@solvimon/solvimon-web 0.1.0-alpha.30 → 0.1.0-alpha.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/README.md +152 -91
  2. package/dist/AddPaymentMethodModal-Cx203VXo.mjs +97 -0
  3. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-BMHhLZnu.mjs +89 -0
  4. package/dist/{Alert.vue.es-ZPG49yR_.mjs → Alert.vue.es-DHJpiSdR.mjs} +1 -1
  5. package/dist/{Amount.vue.es-DPqHB8Xd.mjs → Amount.vue.es-CofcgmXt.mjs} +1 -1
  6. package/dist/AuthProvider.handle-BpFblzFx.mjs +46 -0
  7. package/dist/{Avatar.vue.es-geDQsZwu.mjs → Avatar.vue.es-CJdXXOiG.mjs} +1 -1
  8. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-BD84aBiU.mjs +64 -0
  9. package/dist/BillingInformationForm.lib-ad8B2Y1O.mjs +32 -0
  10. package/dist/BillingInformationForm.vue_vue_type_script_setup_true_lang-F5OVG0kO.mjs +340 -0
  11. package/dist/BillingInformationModal-Do3Fuu8A.mjs +85 -0
  12. package/dist/{Button.vue.es-j7iYlqtJ.mjs → Button.vue.es-CW7XfMBF.mjs} +1 -1
  13. package/dist/{ChargeOnDemandModal-CR01PkP_.mjs → ChargeOnDemandModal-B4ShPKLS.mjs} +46 -45
  14. package/dist/{Chip.vue.es-Dxx_0dte.mjs → Chip.vue.es-CYwWHyAT.mjs} +2 -2
  15. package/dist/CompanyPurchaseToggle.vue_vue_type_script_setup_true_lang-CVXHCSPb.mjs +510 -0
  16. package/dist/{Comparators.vue.es-DQBI3f7m.mjs → Comparators.vue.es-DYrKlE8t.mjs} +1 -1
  17. package/dist/{ContentWithAsideLayout-Bnbsq8_5.mjs → ContentWithAsideLayout-C2kFcft1.mjs} +1 -1
  18. package/dist/{ContextMenu.vue.es-BJO4U47Q.mjs → ContextMenu.vue.es-EXTx0NEt.mjs} +10 -10
  19. package/dist/{CustomerBillingInformation.vue.es-CmNpqcBw.mjs → CustomerBillingInformation.vue.es-CSKG6V3T.mjs} +3 -3
  20. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZZuAHIE.mjs +217 -0
  21. package/dist/CustomerShippingAddresses-Bdy4XWjE.mjs +282 -0
  22. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BEKwWob_.mjs +3124 -0
  23. package/dist/{DividerText.vue.es-BusbyeAI.mjs → DividerText.vue.es-Dq0JzI8C.mjs} +1 -1
  24. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-wPma8Os-.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs} +3 -3
  25. package/dist/{ErrorNotification.vue.es-F068p7PY.mjs → ErrorNotification.vue.es-Cw7fqCg1.mjs} +2 -2
  26. package/dist/{FormMessage.vue.es-CwMQpIAW.mjs → FormMessage.vue.es-MrzQoSae.mjs} +1 -1
  27. package/dist/{IconButton.vue.es-D8DtBW9i.mjs → IconButton.vue.es-CpQbFw0x.mjs} +2 -2
  28. package/dist/{IconTitle.vue.es-6VJtjJX2.mjs → IconTitle.vue.es-CcOIFjbE.mjs} +3 -3
  29. package/dist/{Input.vue.es-BLyHcmu4.mjs → Input.vue.es-Cd55vQri.mjs} +4 -4
  30. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dl1vTzQD.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CqkGCbvg.mjs} +2 -2
  31. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DYskT3r7.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-BUu5M_gx.mjs} +7 -7
  32. package/dist/{InvoicePreview.vue.es-Cpf66_xV.mjs → InvoicePreview.vue.es-DHh5wruk.mjs} +7 -7
  33. package/dist/{InvoicePricingClauseChip.vue.es-CDrAE901.mjs → InvoicePricingClauseChip.vue.es-ZSOBp1se.mjs} +4 -4
  34. package/dist/{Label.vue.es-es7ZUBSP.mjs → Label.vue.es-CB6G8Krh.mjs} +3 -3
  35. package/dist/LoadFailedNotice.vue_vue_type_script_setup_true_lang-BZCtO2Er.mjs +20 -0
  36. package/dist/{Modal.vue.es-eeR9FmvQ.mjs → Modal.vue.es-CJFTVFSZ.mjs} +138 -127
  37. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs +789 -0
  38. package/dist/{PaymentCompletedCard.vue_vue_type_script_setup_true_lang-CrjVPks0.mjs → PaymentCompletedCard.vue_vue_type_script_setup_true_lang-D08Qpgb0.mjs} +2 -2
  39. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DyjzaTK1.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-dl52PYcq.mjs} +4 -4
  40. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BHQrWy6r.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs} +3 -3
  41. package/dist/{PaymentHistoryBlock-CN42ewCn.mjs → PaymentHistoryBlock-BSXlneqM.mjs} +1 -1
  42. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3Y5fHvA.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CXy0XGpn.mjs} +5 -5
  43. package/dist/{PaymentIntegrationForm-D3Ye7LZ5.mjs → PaymentIntegrationForm-Diua0GGJ.mjs} +1 -1
  44. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CLlm_Q2j.mjs +161 -0
  45. package/dist/{PaymentIntegrationFormAdyen-Fm-diCCO.mjs → PaymentIntegrationFormAdyen-D4FP0Vj5.mjs} +302 -282
  46. package/dist/{PaymentIntegrationFormStripe-BANBL6za.mjs → PaymentIntegrationFormStripe-vFzF_sCJ.mjs} +126 -117
  47. package/dist/{PaymentMethod.vue.es-t3-VyoE8.mjs → PaymentMethod.vue.es-vs6SaZOh.mjs} +200 -150
  48. package/dist/{PaymentMethodForm-CqP3GoNj.mjs → PaymentMethodForm-Buhe0aRQ.mjs} +1 -1
  49. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-RPPdBw_e.mjs +165 -0
  50. package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-D5wmRuCf.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DprL5TR8.mjs} +7 -7
  51. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DhkkiJaQ.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BXbevI3r.mjs} +28 -26
  52. package/dist/PaymentMethodsModal-CnJP9UKp.mjs +192 -0
  53. package/dist/PlanCustomizationEditor-KHLSEUbb.mjs +864 -0
  54. package/dist/{PortalLinkUnverified-Cp60_kRJ.mjs → PortalLinkUnverified-DlZAkE93.mjs} +3 -3
  55. package/dist/{PortalNotAvailable-DzSQnfzw.mjs → PortalNotAvailable-CKIomNrm.mjs} +2 -2
  56. package/dist/{PricingGroupRangeInput.vue.es-Srq_3cga.mjs → PricingGroupRangeInput.vue.es-oHD-IT12.mjs} +8 -8
  57. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-oRijnVnZ.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-wCW8YZHM.mjs} +16 -15
  58. package/dist/{RadioGroupExtended.vue.es-BbBMDf6l.mjs → RadioGroupExtended.vue.es-DsShmkKZ.mjs} +5 -5
  59. package/dist/Section.vue.es-DYmEtgBj.mjs +88 -0
  60. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-OM19NPBh.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs} +2 -2
  61. package/dist/ShippingAddressForm.vue_vue_type_script_setup_true_lang-CJp6ddhZ.mjs +144 -0
  62. package/dist/ShippingAddressesModal-Gxv2KxaW.mjs +283 -0
  63. package/dist/{StepInput.vue.es-ieh4EuJ7.mjs → StepInput.vue.es-sqA-VSsn.mjs} +4 -4
  64. package/dist/SubscriptionCancellationModal-DfAZ_uW6.mjs +4 -0
  65. package/dist/SubscriptionCancellationModal.vue_vue_type_script_setup_true_lang-BlbiDNIu.mjs +240 -0
  66. package/dist/SubscriptionCancellationSuccess.vue_vue_type_script_setup_true_lang-C1ko2xvR.mjs +64 -0
  67. package/dist/SubscriptionDetails.entry.ce-CdWV-8WN.mjs +764 -0
  68. package/dist/{SubscriptionSchedules-DMxX3GpK.mjs → SubscriptionSchedules-BfdVn1XA.mjs} +1 -1
  69. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-C8q8Q6h5.mjs +5413 -0
  70. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs +90 -0
  71. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-CHlXP_2x.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DYWjTzPV.mjs} +133 -108
  72. package/dist/Toggle.vue.es-S2g8WGY_.mjs +99 -0
  73. package/dist/{TooltipParagraph.vue.es-BES3zsYN.mjs → TooltipParagraph.vue.es-Bt-7LHr3.mjs} +18 -18
  74. package/dist/{TranslationOverride.vue_vue_type_script_setup_true_lang-BJmlNrXT.mjs → TranslationOverride.vue_vue_type_script_setup_true_lang-Cp_sFa52.mjs} +1 -1
  75. package/dist/TrialChip.vue.es-VZwQX079.mjs +47 -0
  76. package/dist/addonQuantity-D3bGVqjL.mjs +128 -0
  77. package/dist/adyen-CHgq2l6n.mjs +99 -0
  78. package/dist/adyenSdk-DUTO7xkT.mjs +63 -0
  79. package/dist/{api.es-qgvzNMU-.mjs → api.es-QaC926Xu.mjs} +2 -2
  80. package/dist/components/BillingInformation/BillingInformation.mjs +37 -41
  81. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +45 -462
  82. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +33 -42
  83. package/dist/components/Invoice/Invoice.mjs +1087 -1019
  84. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +38 -47
  85. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +29 -34
  86. package/dist/components/InvoicesList/InvoicesList.mjs +33 -42
  87. package/dist/components/PaymentHistory/PaymentHistory.mjs +39 -48
  88. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +56 -64
  89. package/dist/components/ShippingAddressForm/ShippingAddressForm.ce.d.ts +1 -0
  90. package/dist/components/ShippingAddressForm/ShippingAddressForm.mjs +212 -0
  91. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +34 -42
  92. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +41 -50
  93. package/dist/components/WalletBalances/WalletBalances.mjs +46 -55
  94. package/dist/core/events.types.d.ts +1 -0
  95. package/dist/core/index.mjs +51 -34
  96. package/dist/{customElements-DK4GKNJG.mjs → customElements-B8c354Nu.mjs} +802 -768
  97. package/dist/{customer-lf6S5DBR.mjs → customer-CP-Wz7JO.mjs} +1 -1
  98. package/dist/{de-DE-Cyj_NtiI.mjs → de-DE-C9HrzHpE.mjs} +71 -5
  99. package/dist/{de-DE-UJ6X6jXu.mjs → de-DE-DAQmgEy5.mjs} +82 -19
  100. package/dist/{formControl-BZQLHnOO.mjs → formControl-C18sw44K.mjs} +275 -275
  101. package/dist/{formatting.es-RclXHhKo.mjs → formatting.es-DlJEzreG.mjs} +16 -13
  102. package/dist/{fr-FR-CRFoWQ7J.mjs → fr-FR-CHR3VWvd.mjs} +71 -5
  103. package/dist/{fr-FR-Cvvbkwlj.mjs → fr-FR-fz51-Ubw.mjs} +79 -16
  104. package/dist/{countryData.es-BegoD-cZ.mjs → getCountryNameByCode.es-OGxn_zT0.mjs} +7 -2
  105. package/dist/icon-sprite.svg.es-2S3rv8NW.mjs +4 -0
  106. package/dist/index.es-Bv55VtdE.mjs +633 -0
  107. package/dist/{index.es-BrVTOW5D.mjs → index.es-C7J3WGGo.mjs} +4 -4
  108. package/dist/index.mjs +37 -33
  109. package/dist/invoices-I7PghcPV.mjs +143 -0
  110. package/dist/{it-IT-DnJP5URH.mjs → it-IT-BpCkTMZL.mjs} +73 -10
  111. package/dist/{it-IT-DObZEc-U.mjs → it-IT-Dzc7DmmL.mjs} +71 -5
  112. package/dist/{nl-NL-q9xfTZF0.mjs → nl-NL-22C8OcIM.mjs} +79 -16
  113. package/dist/{nl-NL-C02xHilF.mjs → nl-NL-Dut_QwsY.mjs} +71 -5
  114. package/dist/paymentIntegrationFormLoaders-BFMAMpcA.mjs +31 -0
  115. package/dist/{paymentMethods-8w-ccfY_.mjs → paymentMethods-aGKIi7DS.mjs} +22 -21
  116. package/dist/{paymentOutcome-B6sW1eCV.mjs → paymentOutcome-Cv7hTFVu.mjs} +1 -1
  117. package/dist/paymentRedirect-DaS8Kccc.mjs +66 -0
  118. package/dist/payments-BKoKpoLN.mjs +71 -0
  119. package/dist/preloadPaymentIntegrationForms-Buwal_JR.mjs +9 -0
  120. package/dist/pricing-Y-7ELzN-.mjs +42 -0
  121. package/dist/{pricingItem.es-bCPArbTa.mjs → pricingItem.es-BafitMMY.mjs} +1 -1
  122. package/dist/pricingPlanScheduleOverrides-CGm_-jJq.mjs +291 -0
  123. package/dist/randomUuid-BE_IQ-aq.mjs +10 -0
  124. package/dist/screens/Checkout/Checkout.mjs +1098 -3
  125. package/dist/screens/CheckoutSession/CheckoutSession.ce.d.ts +1 -0
  126. package/dist/screens/CheckoutSession/CheckoutSession.mjs +1322 -0
  127. package/dist/screens/CustomerOverview/CustomerOverview.mjs +209 -133
  128. package/dist/screens/PayInvoice/PayInvoice.mjs +283 -275
  129. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +92 -97
  130. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  131. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +915 -404
  132. package/dist/{subscription-BwzkagDI.mjs → subscription-DQ5mRp_e.mjs} +10 -10
  133. package/dist/subscriptions-B7dNqi1C.mjs +99 -0
  134. package/dist/timePeriod.es-R9U0wLlB.mjs +13 -0
  135. package/dist/types/components/customer/BillingInformationForm/BillingInformationForm.types.d.ts +11 -14
  136. package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -9
  137. package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +10 -0
  138. package/dist/types/components/customer/CustomerPaymentMethodsBlock/CustomerPaymentMethodsBlock.types.d.ts +6 -0
  139. package/dist/types/components/payments/AddPaymentMethodModal/AddPaymentMethodModal.types.d.ts +17 -0
  140. package/dist/types/components/payments/ExpressPaymentMethod/ExpressPaymentMethodApplePay.types.d.ts +3 -2
  141. package/dist/types/components/payments/ExpressPaymentMethods/ExpressPaymentMethods.types.d.ts +3 -2
  142. package/dist/types/components/payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts +2 -0
  143. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +12 -1
  144. package/dist/types/components/payments/PaymentMethodsList/PaymentMethodsList.types.d.ts +2 -0
  145. package/dist/types/components/payments/PaymentMethodsModal/PaymentMethodsModal.types.d.ts +22 -0
  146. package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.lib.types.d.ts +1 -1
  147. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -1
  148. package/dist/types/components/providers/EntryProvider/EntryProvider.types.d.ts +2 -2
  149. package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +3 -11
  150. package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +1 -5
  151. package/dist/types/components/providers/HostElementProvider/HostElementProvider.lib.d.ts +11 -0
  152. package/dist/types/components/providers/HostElementProvider/composables/useHostEvent.d.ts +12 -0
  153. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +5 -4
  154. package/dist/types/components/providers/PortalProvider/PortalProvider.lib.d.ts +3 -3
  155. package/dist/types/components/providers/PortalProvider/PortalProvider.types.d.ts +3 -3
  156. package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +6 -1
  157. package/dist/types/components/providers/PortalProvider/composables/usePortal.d.ts +1 -0
  158. package/dist/types/components/providers/Provider/Provider.types.d.ts +10 -3
  159. package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -14
  160. package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +1 -1
  161. package/dist/types/components/subscriptions/OrderSummary.types.d.ts +14 -0
  162. package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +14 -1
  163. package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +9 -0
  164. package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditor.types.d.ts +4 -0
  165. package/dist/types/components/subscriptions/PlanCustomizationForm/SeatsEditorItem.types.d.ts +2 -0
  166. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +4 -0
  167. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +2 -0
  168. package/dist/types/components/subscriptions/SubscriptionCancellationSuccess/SubscriptionCancellationSuccess.types.d.ts +4 -0
  169. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +10 -9
  170. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSuccess.types.d.ts +5 -0
  171. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementSummary.types.d.ts +3 -0
  172. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanChangeSummary.types.d.ts +4 -0
  173. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionPlanSelector.types.d.ts +7 -0
  174. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsList.types.d.ts +1 -0
  175. package/dist/types/components/subscriptions/SubscriptionsList/SubscriptionsListItem.types.d.ts +1 -0
  176. package/dist/types/components/wallets/AutoTopUpModal/AutoTopUpModal.types.d.ts +3 -1
  177. package/dist/types/index.d.ts +5 -1
  178. package/dist/types/public/components/BillingInformation/BillingInformation.types.d.ts +5 -0
  179. package/dist/types/public/components/BillingInformationForm/BillingInformationForm.entry.types.d.ts +1 -2
  180. package/dist/types/public/components/CustomerPaymentMethods/CustomerPaymentMethods.types.d.ts +6 -2
  181. package/dist/types/public/components/Invoice/Invoice.types.d.ts +7 -7
  182. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +2 -2
  183. package/dist/types/public/components/InvoicesList/InvoicesList.types.d.ts +6 -7
  184. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.entry.types.d.ts +1 -1
  185. package/dist/types/public/components/PaymentMethodForm/PaymentMethodForm.types.d.ts +19 -14
  186. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.ce.d.ts +1 -0
  187. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.entry.types.d.ts +6 -0
  188. package/dist/types/public/components/ShippingAddressForm/ShippingAddressForm.types.d.ts +5 -0
  189. package/dist/types/public/components/SubscriptionsList/SubscriptionsList.types.d.ts +10 -1
  190. package/dist/types/public/core/action-request.types.d.ts +18 -24
  191. package/dist/types/public/core/events.types.d.ts +99 -0
  192. package/dist/types/public/core/index.d.ts +3 -1
  193. package/dist/types/public/core/types.d.ts +11 -2
  194. package/dist/types/public/screens/Checkout/Checkout.entry.types.d.ts +1 -7
  195. package/dist/types/public/screens/Checkout/Checkout.source.types.d.ts +151 -0
  196. package/dist/types/public/screens/Checkout/Checkout.types.d.ts +7 -30
  197. package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.ce.d.ts +1 -0
  198. package/dist/types/public/screens/CheckoutSession/CheckoutSession.entry.types.d.ts +3 -0
  199. package/dist/types/public/screens/CustomerOverview/CustomerOverview.types.d.ts +8 -2
  200. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +0 -6
  201. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +2 -19
  202. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +2 -3
  203. package/dist/types/public/screens/SubscriptionManagement/SubscriptionManagement.types.d.ts +2 -1
  204. package/dist/types/services/paymentMethods.types.d.ts +12 -1
  205. package/dist/types/types/EntryBaseProps.d.ts +10 -6
  206. package/dist/types/types/branding.d.ts +15 -0
  207. package/dist/types/types/checkoutSession.d.ts +199 -0
  208. package/dist/types/types/errors.d.ts +2 -0
  209. package/dist/types/types/pricingPlanGroup.d.ts +25 -0
  210. package/dist/{useActionDispatchProvider-ChAHdwR8.mjs → useActionDispatchProvider-BCtk-FGU.mjs} +1 -1
  211. package/dist/useAddressFormats-CtE4QaVU.mjs +1998 -0
  212. package/dist/useCheckoutForm-BhXcmnUi.mjs +3355 -0
  213. package/dist/{useCustomer-CTMhg1nd.mjs → useCustomer-mQysxUwp.mjs} +2 -2
  214. package/dist/useDefaultPaymentMethod-Dliq6_Yw.mjs +39 -0
  215. package/dist/useExperimentalFeature-Bw6bBtay.mjs +6 -0
  216. package/dist/useHostEvent-MtRG6W2B.mjs +12 -0
  217. package/dist/{useIncrementalLoading-CBVutPH8.mjs → useIncrementalLoading-CJSj1945.mjs} +2 -2
  218. package/dist/{useInvoiceData-qUGbBAQK.mjs → useInvoiceData-BEZIvw32.mjs} +2 -2
  219. package/dist/{useInvoicesList-wJvZAJpW.mjs → useInvoicesList-CrXjsmei.mjs} +140 -138
  220. package/dist/{sorting.es-C0pdMgX0.mjs → useIsMounted.es-BNPhTTHE.mjs} +11 -10
  221. package/dist/{useLoadInitialData-UvfYXgbi.mjs → useLoadInitialData-Bomj_1mo.mjs} +1 -1
  222. package/dist/usePaymentFormHold-CYZ4BdOw.mjs +19 -0
  223. package/dist/{usePaymentMethodAvailability-35l4pWdH.mjs → usePaymentMethodAvailability-DR_neLeZ.mjs} +4 -4
  224. package/dist/usePaymentMethodOptions-CuHoQx3K.mjs +67 -0
  225. package/dist/{usePaymentMethods-De7hlLHo.mjs → usePaymentMethods-BDdetXts.mjs} +2 -2
  226. package/dist/{usePayments-hWS7fnOx.mjs → usePayments-B5Z9Kfbv.mjs} +20 -18
  227. package/dist/usePortal-DuLR5Mid.mjs +14 -0
  228. package/dist/{useService-BwzIBIRp.mjs → useService-2aOFBTxU.mjs} +1 -1
  229. package/dist/useShippingAddresses-BvThNpez.mjs +122 -0
  230. package/dist/useSubscription-Dzo-kBpQ.mjs +35 -0
  231. package/dist/useSubscriptionActions-CWaNRoZ7.mjs +44 -0
  232. package/dist/useWatchDebounced-DkXgKe0E.mjs +20 -0
  233. package/dist/{wallets.es-eH2C2ygn.mjs → wallets.es-DRlUVd2R.mjs} +1 -1
  234. package/package.json +41 -11
  235. package/dist/AuthProvider.handle-SRR_04XS.mjs +0 -50
  236. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-nqKbgY7G.mjs +0 -58
  237. package/dist/Checkout.entry.ce-CopWuLJC.mjs +0 -4169
  238. package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-CEnM1uxK.mjs +0 -828
  239. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Jyb5ZN3s.mjs +0 -136
  240. package/dist/CustomerShippingAddresses-BRPukhRI.mjs +0 -397
  241. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DJnr5D56.mjs +0 -2936
  242. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-B_FpibLA.mjs +0 -441
  243. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D07SEP8a.mjs +0 -181
  244. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-CMRMbL3d.mjs +0 -161
  245. package/dist/PlanCustomizationEditor-B76UNEMm.mjs +0 -791
  246. package/dist/Section.vue.es-Oqn1wGPZ.mjs +0 -72
  247. package/dist/ShippingAddressesModal-c7nqf4Ny.mjs +0 -418
  248. package/dist/SubscriptionDetails.entry.ce-uYv45FGH.mjs +0 -1044
  249. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DXro_64f.mjs +0 -5200
  250. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-BZNsqN4G.mjs +0 -203
  251. package/dist/TrialChip.vue.es-C51z1ZiA.mjs +0 -35
  252. package/dist/addonQuantity-CCVaA3e-.mjs +0 -758
  253. package/dist/adyenSdk-B01MB9Ia.mjs +0 -58
  254. package/dist/getCountryNameByCode.es-BDHua7VM.mjs +0 -8
  255. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +0 -4
  256. package/dist/invoices-DdREPDXV.mjs +0 -123
  257. package/dist/paymentMethods-Goa25rTs.mjs +0 -61
  258. package/dist/payments-CKpU1K3t.mjs +0 -68
  259. package/dist/pricing-CEaZGgKe.mjs +0 -29
  260. package/dist/pricingPlanScheduleOverrides-BBp-DmpV.mjs +0 -233
  261. package/dist/pricingPlanSchedules-DSMptcAh.mjs +0 -38
  262. package/dist/subscriptions-B5bH8hsI.mjs +0 -66
  263. package/dist/taxId.es-e6NEvprh.mjs +0 -243
  264. package/dist/types/components/payments/ExpressPaymentMethodButton/ExpressPaymentMethodButton.types.d.ts +0 -3
  265. package/dist/useCustomerFormLabels-D4oDnfxA.mjs +0 -1173
  266. package/dist/usePaymentFormHold-Cwdr-vyc.mjs +0 -181
  267. package/dist/usePortal-DUfD6hrA.mjs +0 -7
  268. package/dist/useTimePeriod.es-BUorDLVK.mjs +0 -93
@@ -0,0 +1,3355 @@
1
+ import { defineComponent as se, openBlock as n, createElementBlock as x, createElementVNode as S, createVNode as b, unref as e, withCtx as g, createTextVNode as D, toDisplayString as N, withModifiers as qe, useId as Oa, ref as ae, useModel as Ra, computed as c, reactive as $a, Fragment as K, renderList as ce, createBlock as w, createCommentVNode as $, mergeModels as Ot, renderSlot as Rt, createSlots as $t, resolveComponent as Va, normalizeClass as ut, onMounted as na, watch as Pe, onBeforeUnmount as Ba, nextTick as Re, mergeProps as ve, withDirectives as Da, withKeys as Vt, vShow as Ua, defineAsyncComponent as Bt, isRef as Dt, toValue as st, getCurrentInstance as Fa, toRaw as qa } from "vue";
2
+ import { u as je, w as za } from "./pricingPlanScheduleOverrides-CGm_-jJq.mjs";
3
+ import { f as ie } from "./formatting.es-DlJEzreG.mjs";
4
+ import { _ as Ie, b as ja, a as Be } from "./Button.vue.es-CW7XfMBF.mjs";
5
+ import { _ as lt } from "./ErrorNotification.vue.es-Cw7fqCg1.mjs";
6
+ import { a as he, d as G, e as sa } from "./customElements-B8c354Nu.mjs";
7
+ import { u as Ya } from "./useHostEvent-MtRG6W2B.mjs";
8
+ import { g as Ut } from "./getCountryNameByCode.es-OGxn_zT0.mjs";
9
+ import { a as Ft, b as Ga, g as Ha, c as qt, d as De, e as zt, _ as Ka, i as Za, s as Wa } from "./OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-D0pwpqIC.mjs";
10
+ import { i as ze, f as Ja, t as Xa, l as jt, _ as Ue, c as Yt, m as la, g as Fe, u as Qa, d as eo, a as Gt, s as to, e as ao, b as Ht, n as oo, r as rt, h as io, o as Kt } from "./useAddressFormats-CtE4QaVU.mjs";
11
+ import { _ as Zt } from "./Expand.vue.es-BleuAfDz.mjs";
12
+ import { _ as Me } from "./Input.vue.es-Cd55vQri.mjs";
13
+ import { _ as Wt, u as no } from "./Label.vue.es-CB6G8Krh.mjs";
14
+ import { _ as fe } from "./Section.vue.es-DYmEtgBj.mjs";
15
+ import { _ as so, a as lo, t as ro, o as uo } from "./CompanyPurchaseToggle.vue_vue_type_script_setup_true_lang-CVXHCSPb.mjs";
16
+ import { f as pe, a as re, d as co, u as po, b as Jt, e as mo, r as go } from "./formControl-C18sw44K.mjs";
17
+ import { a as vo } from "./InvoicePreview.vue.es-DHh5wruk.mjs";
18
+ import { _ as fo, T as ho, a as yo } from "./TooltipParagraph.vue.es-Bt-7LHr3.mjs";
19
+ import { _ as bo, g as _o, a as ko } from "./TrialChip.vue.es-VZwQX079.mjs";
20
+ import { _ as Po } from "./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D0priVnA.mjs";
21
+ import { _ as Xt } from "./Chip.vue.es-CYwWHyAT.mjs";
22
+ import { _ as wo } from "./Toggle.vue.es-S2g8WGY_.mjs";
23
+ import { S as Ao } from "./index.es-Bv55VtdE.mjs";
24
+ import { _ as Co } from "./SubscriptionSummary.vue_vue_type_script_setup_true_lang-qQ9gJOIs.mjs";
25
+ import { u as ra } from "./useViewport-psZejz_H.mjs";
26
+ import { j as ua, e as ct, m as xo, c as Mo, n as Eo } from "./subscription-DQ5mRp_e.mjs";
27
+ import { b as Io, s as Lo } from "./paymentRedirect-DaS8Kccc.mjs";
28
+ import { _ as Se } from "./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-3gf8pvR7.mjs";
29
+ import { _ as Ee } from "./Skeleton.vue_vue_type_script_setup_true_lang-D7MFjvrP.mjs";
30
+ import { _ as To } from "./DividerText.vue.es-Dq0JzI8C.mjs";
31
+ import { d as No, c as So, t as Qt } from "./adyen-CHgq2l6n.mjs";
32
+ import { a as ca } from "./adyenSdk-DUTO7xkT.mjs";
33
+ import { c as Oo } from "./payments-BKoKpoLN.mjs";
34
+ import { c as Ro } from "./paymentFailure-QZdZHBhf.mjs";
35
+ import { a as $o, i as Vo } from "./paymentOutcome-Cv7hTFVu.mjs";
36
+ import { u as Bo } from "./useExperimentalFeature-Bw6bBtay.mjs";
37
+ import { b as Do, c as Uo, g as Fo, d as qo } from "./pricing-Y-7ELzN-.mjs";
38
+ import { g as zo } from "./pricingItem.es-BafitMMY.mjs";
39
+ import { C as jo } from "./ContentWithAsideLayout-C2kFcft1.mjs";
40
+ import { u as Yo } from "./usePaymentFormHold-CYZ4BdOw.mjs";
41
+ import { _ as Go } from "./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CANXYTzu.mjs";
42
+ import { u as Ho } from "./useWatchDebounced-DkXgKe0E.mjs";
43
+ const Ko = { class: "flex min-h-96 w-full items-center justify-center" }, Zo = { class: "max-w-sm" }, Wo = /* @__PURE__ */ se({
44
+ __name: "CheckoutNotAvailable",
45
+ setup(t) {
46
+ const { $t: u } = he(), s = () => {
47
+ window.location.reload();
48
+ };
49
+ return (v, a) => (n(), x("div", Ko, [
50
+ S("div", Zo, [
51
+ b(e(G), { variant: "heading-1" }, {
52
+ default: g(() => [
53
+ D(N(e(u)({
54
+ defaultMessage: "Checkout not available",
55
+ id: "checkout.not_available.title",
56
+ description: "The title of the checkout not available page"
57
+ })), 1)
58
+ ]),
59
+ _: 1
60
+ }),
61
+ b(e(G), {
62
+ variant: "body-sm",
63
+ color: "subtle"
64
+ }, {
65
+ default: g(() => [
66
+ D(N(e(u)({
67
+ defaultMessage: "The checkout is currently not available.",
68
+ id: "checkout.not_available.description",
69
+ description: "The description of the checkout not available page"
70
+ })) + " ", 1),
71
+ S("a", {
72
+ href: "#",
73
+ class: "text-primary-900 hover:underline",
74
+ onClick: qe(s, ["prevent"])
75
+ }, N(e(u)({
76
+ defaultMessage: "Reload",
77
+ id: "checkout.not_available.reload_button",
78
+ description: "The label of the reload button"
79
+ })), 1),
80
+ D(" " + N(e(u)({
81
+ defaultMessage: "this page to try again, or contact customer support.",
82
+ id: "checkout.not_available.contact_support_message",
83
+ description: "The message shown when the user wants to contact customer support"
84
+ })), 1)
85
+ ]),
86
+ _: 1
87
+ })
88
+ ])
89
+ ]));
90
+ }
91
+ }), Jo = ["id"], Xo = { class: "grid grid-cols-1 gap-4" }, Qo = {
92
+ key: 0,
93
+ class: "grid grid-cols-1 gap-2"
94
+ }, ei = {
95
+ key: 1,
96
+ class: "flex flex-col gap-2"
97
+ }, ti = { key: 0 }, ai = { class: "mt-2 flex flex-col gap-2" }, oi = { class: "grid grid-cols-3 gap-2" }, ii = {
98
+ key: 3,
99
+ class: "mt-2"
100
+ }, ni = { class: "flex flex-col gap-2" }, si = { class: "mt-2" }, li = {
101
+ key: 1,
102
+ class: "grid grid-cols-1 gap-2"
103
+ }, ri = {
104
+ key: 2,
105
+ class: "mt-2 grid grid-cols-2 gap-2"
106
+ }, ui = { key: 0 }, ci = {
107
+ key: 0,
108
+ class: "mt-2 flex flex-col gap-2"
109
+ }, ea = /* @__PURE__ */ se({
110
+ __name: "CheckoutForm",
111
+ props: /* @__PURE__ */ Ot({
112
+ validation: { type: null },
113
+ initialState: { type: Object },
114
+ readOnlyEmail: { type: String },
115
+ showCustomerInfoOnTop: { type: Boolean },
116
+ isBillingInformationMandatory: { type: Boolean },
117
+ isShippingAddressRequired: { type: Boolean },
118
+ getIsFieldRequired: { type: Function },
119
+ shippingAddressFormat: { type: Object },
120
+ readOnly: { type: Boolean },
121
+ display: { type: Object },
122
+ isTypeLocked: { type: Boolean },
123
+ title: { type: String }
124
+ }, {
125
+ modelValue: { required: !0 },
126
+ modelModifiers: {}
127
+ }),
128
+ emits: /* @__PURE__ */ Ot(["submit"], ["update:modelValue"]),
129
+ setup(t) {
130
+ const u = t, s = Oa(), v = ae(!1), a = Ra(t, "modelValue"), I = c({
131
+ get: () => a.value.type === "ORGANIZATION",
132
+ set: (m) => {
133
+ a.value.type = m ? "ORGANIZATION" : "INDIVIDUAL";
134
+ }
135
+ }), C = c(() => a.value.type === "ORGANIZATION"), o = $a({
136
+ email: pe(a, "email", re),
137
+ addressLine1: pe(a, "addressLine1", re),
138
+ addressLine2: pe(a, "addressLine2", re),
139
+ postalCode: pe(a, "postalCode", re),
140
+ city: pe(a, "city", re),
141
+ state: pe(a, "state", re),
142
+ firstName: pe(a, "firstName", re),
143
+ lastName: pe(a, "lastName", re),
144
+ companyRegistrationNumber: pe(a, "companyRegistrationNumber", re),
145
+ taxExemptNote: pe(a, "taxExemptNote", re)
146
+ }), L = c({
147
+ get: () => !!a.value.taxExempt,
148
+ set: (m) => {
149
+ a.value.taxExempt = m;
150
+ }
151
+ }), y = (m) => la(u.display, m), O = (m) => y(m) === "EDITABLE", j = (m, l) => C.value && !!u.display && y(m) === l, A = c(
152
+ () => {
153
+ var m;
154
+ return !C.value && !!((m = u.display) != null && m.customer_details) && y("firstName") !== "HIDDEN";
155
+ }
156
+ ), U = c({
157
+ get: () => a.value.country,
158
+ set: (m) => {
159
+ const l = re(m);
160
+ a.value.country = l !== void 0 && ze(l) ? l : void 0;
161
+ }
162
+ }), _ = c({
163
+ get: () => a.value.shippingCountry,
164
+ set: (m) => {
165
+ const l = re(m);
166
+ a.value.shippingCountry = l !== void 0 && ze(l) ? l : void 0;
167
+ }
168
+ }), { $t: k } = he(), M = Ja(), F = (m) => u.getIsFieldRequired(m) ? "" : " " + k({
169
+ defaultMessage: "(optional)",
170
+ id: "checkout.optional_suffix.label",
171
+ description: "The suffix for optional fields in the checkout form"
172
+ }), X = c(
173
+ () => a.value.country ? Ut(a.value.country) : void 0
174
+ ), Z = c(
175
+ () => ["addressLine1", "postalCode", "city", "state"].some(u.getIsFieldRequired)
176
+ ), Q = c(
177
+ () => [
178
+ a.value.addressLine1,
179
+ a.value.addressLine2,
180
+ [a.value.postalCode, a.value.city].filter(Boolean).join(" "),
181
+ a.value.state,
182
+ X.value
183
+ ].filter((m) => !!m)
184
+ ), H = c(
185
+ () => k({
186
+ defaultMessage: "Name",
187
+ id: "checkout.individual_name.label",
188
+ description: "Label of the name of a customer who buys as an individual"
189
+ })
190
+ ), i = c(
191
+ () => k({
192
+ defaultMessage: "Registration number",
193
+ id: "checkout.registration_number.label",
194
+ description: "Label of the company registration number of an organization customer"
195
+ })
196
+ ), T = c(
197
+ () => k({
198
+ defaultMessage: "Tax exempt",
199
+ id: "checkout.tax_exempt.label",
200
+ description: "Label of whether an organization customer is exempt from tax"
201
+ })
202
+ ), R = c(
203
+ () => [
204
+ C.value && y("companyLegalName") === "READ_ONLY" && {
205
+ label: M.legalNameLabel,
206
+ value: a.value.companyLegalName
207
+ },
208
+ C.value && y("companyVatNumber") === "READ_ONLY" && {
209
+ label: M.vatNumberLabel,
210
+ value: a.value.companyVatNumber
211
+ },
212
+ j("companyRegistrationNumber", "READ_ONLY") && {
213
+ label: i.value,
214
+ value: a.value.companyRegistrationNumber
215
+ },
216
+ j("taxExempt", "READ_ONLY") && a.value.taxExempt && {
217
+ label: T.value,
218
+ value: a.value.taxExemptNote || k({
219
+ defaultMessage: "Yes",
220
+ id: "checkout.tax_exempt.yes",
221
+ description: "Shown for an organization customer that is exempt from tax, when no reason is given"
222
+ })
223
+ },
224
+ A.value && y("firstName") === "READ_ONLY" && {
225
+ label: H.value,
226
+ value: [a.value.firstName, a.value.infix, a.value.lastName].filter(Boolean).join(" ")
227
+ }
228
+ ].filter((m) => !!m && !!m.value)
229
+ ), B = c(
230
+ () => !u.isTypeLocked || A.value || C.value && (y("companyLegalName") !== "HIDDEN" || y("companyVatNumber") !== "HIDDEN")
231
+ ), q = c(() => {
232
+ var J, oe;
233
+ const { recipient: m, address: l } = Xa(
234
+ a.value,
235
+ "",
236
+ u.shippingAddressFormat
237
+ ), p = (J = m.individual) == null ? void 0 : J.name;
238
+ return [
239
+ ((oe = m.organization) == null ? void 0 : oe.attention_name) ?? [p == null ? void 0 : p.first_name, p == null ? void 0 : p.last_name].filter(Boolean).join(" "),
240
+ l.line1,
241
+ l.line2,
242
+ [l.postal_code, l.city].filter(Boolean).join(" "),
243
+ l.state,
244
+ l.country && Ut(l.country)
245
+ ].filter((ne) => !!ne);
246
+ }), d = c({
247
+ get: () => a.value.billingAddressSameAsShipping,
248
+ set: (m) => {
249
+ a.value.billingAddressSameAsShipping = m;
250
+ }
251
+ }), z = c(
252
+ () => u.title ?? (u.isShippingAddressRequired ? k({
253
+ defaultMessage: "Shipping information",
254
+ id: "checkout.shipping_information_block.title",
255
+ description: "The title of the shipping information block in the checkout form"
256
+ }) : M.contactInformationTitle)
257
+ ), P = c(
258
+ () => k({
259
+ defaultMessage: "Shipping address",
260
+ id: "checkout.shipping_address.title",
261
+ description: "Label above the address an order is shipped to in the checkout form"
262
+ })
263
+ ), h = c(
264
+ () => k({
265
+ defaultMessage: "Shipping country",
266
+ id: "checkout.shipping_country.label",
267
+ description: "Label of the country an order is shipped to in the checkout form"
268
+ })
269
+ ), E = c(
270
+ () => k({
271
+ defaultMessage: "Shipping country",
272
+ id: "checkout.shipping_country.placeholder",
273
+ description: "Placeholder of the shipping country select while no country is chosen"
274
+ })
275
+ );
276
+ return (m, l) => (n(), x("form", {
277
+ id: e(s),
278
+ onSubmit: l[20] || (l[20] = qe((p) => m.$emit("submit", a.value), ["prevent"]))
279
+ }, [
280
+ S("div", Xo, [
281
+ b(e(fe), { title: z.value }, {
282
+ default: g(() => [
283
+ t.readOnly ? (n(), x("div", Qo, [
284
+ b(e(G), {
285
+ variant: "body",
286
+ tag: "span",
287
+ weight: "semibold",
288
+ "no-spacing": ""
289
+ }, {
290
+ default: g(() => [
291
+ D(N(a.value.email), 1)
292
+ ]),
293
+ _: 1
294
+ }),
295
+ t.isShippingAddressRequired ? (n(!0), x(K, { key: 0 }, ce(q.value, (p, J) => (n(), w(e(G), {
296
+ key: J,
297
+ variant: "body-sm",
298
+ tag: "span",
299
+ color: "subtle",
300
+ "no-spacing": "",
301
+ class: "sv-checkout__shipping-address-summary"
302
+ }, {
303
+ default: g(() => [
304
+ D(N(p), 1)
305
+ ]),
306
+ _: 2
307
+ }, 1024))), 128)) : (n(), w(e(G), {
308
+ key: 1,
309
+ variant: "body-sm",
310
+ tag: "span",
311
+ color: "subtle",
312
+ "no-spacing": ""
313
+ }, {
314
+ default: g(() => [
315
+ D(N(X.value), 1)
316
+ ]),
317
+ _: 1
318
+ }))
319
+ ])) : (n(), x("div", ei, [
320
+ y("email") === "READ_ONLY" ? (n(), w(e(G), {
321
+ key: 0,
322
+ variant: "body",
323
+ tag: "span",
324
+ weight: "semibold",
325
+ "no-spacing": ""
326
+ }, {
327
+ default: g(() => [
328
+ D(N(a.value.email), 1)
329
+ ]),
330
+ _: 1
331
+ })) : O("email") ? (n(), w(e(Me), {
332
+ key: 1,
333
+ modelValue: o.email,
334
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => o.email = p),
335
+ required: "",
336
+ type: "email",
337
+ name: "email",
338
+ autocomplete: "email",
339
+ disabled: !!t.readOnlyEmail,
340
+ label: e(M).emailLabel,
341
+ placeholder: e(M).emailPlaceholder + F("email"),
342
+ error: t.validation.value.email.$errors
343
+ }, null, 8, ["modelValue", "disabled", "label", "placeholder", "error"])) : $("", !0),
344
+ !t.isShippingAddressRequired && y("country") === "READ_ONLY" ? (n(!0), x(K, { key: 2 }, ce(Q.value, (p, J) => (n(), w(e(G), {
345
+ key: J,
346
+ variant: "body-sm",
347
+ tag: "span",
348
+ color: "subtle",
349
+ "no-spacing": ""
350
+ }, {
351
+ default: g(() => [
352
+ D(N(p), 1)
353
+ ]),
354
+ _: 2
355
+ }, 1024))), 128)) : !t.isShippingAddressRequired && O("country") ? (n(), w(e(jt), {
356
+ key: 3,
357
+ "single-model-value": U.value,
358
+ "onUpdate:singleModelValue": l[3] || (l[3] = (p) => U.value = p),
359
+ i18n: { placeholderDefault: e(M).countryPlaceholder },
360
+ required: "",
361
+ name: "country",
362
+ label: e(M).countryLabel + F("country"),
363
+ error: t.validation.value.country.$errors
364
+ }, {
365
+ "label-suffix": g(() => [
366
+ !v.value && !t.isBillingInformationMandatory && !Z.value ? (n(), w(e(Ie), {
367
+ key: 0,
368
+ size: "xs",
369
+ intent: "subtle",
370
+ "icon-prefix": "add",
371
+ class: "py-0.5",
372
+ onClick: l[1] || (l[1] = (p) => v.value = !0)
373
+ }, {
374
+ default: g(() => [
375
+ D(N(e(k)({
376
+ defaultMessage: "More billing details",
377
+ description: "Label of the button in the checkout that lets you fill out all billing details",
378
+ id: "checkout.billing_details.add_billing_details_button.label"
379
+ })), 1)
380
+ ]),
381
+ _: 1
382
+ })) : $("", !0),
383
+ v.value && !t.isBillingInformationMandatory && !Z.value ? (n(), w(e(Ie), {
384
+ key: 1,
385
+ size: "sm",
386
+ intent: "subtle",
387
+ "icon-prefix": "close",
388
+ class: "py-0.5",
389
+ onClick: l[2] || (l[2] = (p) => v.value = !1)
390
+ }, {
391
+ default: g(() => [
392
+ D(N(e(k)({
393
+ defaultMessage: "Remove billing details",
394
+ id: "checkout.billing_details.remove_billing_details_button.label",
395
+ description: "Label of the button in the checkout that lets you remove the billing details"
396
+ })), 1)
397
+ ]),
398
+ _: 1
399
+ })) : $("", !0)
400
+ ]),
401
+ _: 1
402
+ }, 8, ["single-model-value", "i18n", "label", "error"])) : $("", !0)
403
+ ])),
404
+ !t.isShippingAddressRequired && O("country") ? (n(), w(e(Zt), {
405
+ key: 2,
406
+ "is-open": v.value || !!t.isBillingInformationMandatory || Z.value
407
+ }, {
408
+ default: g(() => [
409
+ v.value || t.isBillingInformationMandatory || Z.value ? (n(), x("div", ti, [
410
+ S("div", ai, [
411
+ b(e(Me), {
412
+ modelValue: o.addressLine1,
413
+ "onUpdate:modelValue": l[4] || (l[4] = (p) => o.addressLine1 = p),
414
+ name: "address_line_1",
415
+ autocomplete: "billing address-line1",
416
+ label: e(k)({
417
+ defaultMessage: "Billing address",
418
+ id: "checkout.address.title",
419
+ description: "Label of the billing address, above its first line, in the checkout and billing information forms"
420
+ }),
421
+ placeholder: e(k)({
422
+ defaultMessage: "Address line 1",
423
+ id: "checkout.address.line1.placeholder",
424
+ description: "Address line 1 of the customer address in the checkout form"
425
+ }) + F("addressLine1"),
426
+ required: "",
427
+ error: t.validation.value.addressLine1.$errors
428
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
429
+ b(Ue, {
430
+ modelValue: o.addressLine2,
431
+ "onUpdate:modelValue": l[5] || (l[5] = (p) => o.addressLine2 = p),
432
+ name: "address_line_2",
433
+ autocomplete: "billing address-line2",
434
+ label: e(M).addressLine2Label,
435
+ placeholder: e(k)({
436
+ defaultMessage: "Address line 2",
437
+ id: "checkout.address.line2.placeholder",
438
+ description: "Address line 2 of the customer address in the checkout form"
439
+ }) + F("addressLine2")
440
+ }, null, 8, ["modelValue", "label", "placeholder"]),
441
+ S("div", oi, [
442
+ b(Ue, {
443
+ modelValue: o.postalCode,
444
+ "onUpdate:modelValue": l[6] || (l[6] = (p) => o.postalCode = p),
445
+ name: "postal_code",
446
+ autocomplete: "billing postal-code",
447
+ label: e(M).postalCodeLabel,
448
+ placeholder: e(M).postalCodePlaceholder + F("postalCode"),
449
+ error: t.validation.value.postalCode.$errors
450
+ }, null, 8, ["modelValue", "label", "placeholder", "error"]),
451
+ b(Ue, {
452
+ modelValue: o.city,
453
+ "onUpdate:modelValue": l[7] || (l[7] = (p) => o.city = p),
454
+ name: "city",
455
+ autocomplete: "billing address-level2",
456
+ label: e(M).cityLabel,
457
+ placeholder: e(M).cityPlaceholder + F("city")
458
+ }, null, 8, ["modelValue", "label", "placeholder"]),
459
+ b(Ue, {
460
+ modelValue: o.state,
461
+ "onUpdate:modelValue": l[8] || (l[8] = (p) => o.state = p),
462
+ name: "state",
463
+ autocomplete: "billing address-level1",
464
+ label: e(M).stateLabel,
465
+ placeholder: e(M).statePlaceholder + F("state"),
466
+ error: t.validation.value.state.$errors
467
+ }, null, 8, ["modelValue", "label", "placeholder", "error"])
468
+ ])
469
+ ])
470
+ ])) : $("", !0)
471
+ ]),
472
+ _: 1
473
+ }, 8, ["is-open"])) : $("", !0),
474
+ t.isShippingAddressRequired && !t.readOnly ? (n(), x("fieldset", ii, [
475
+ S("legend", null, [
476
+ b(e(Wt), {
477
+ tag: "span",
478
+ required: ""
479
+ }, {
480
+ default: g(() => [
481
+ D(N(P.value), 1)
482
+ ]),
483
+ _: 1
484
+ })
485
+ ]),
486
+ S("div", ni, [
487
+ b(e(jt), {
488
+ "single-model-value": _.value,
489
+ "onUpdate:singleModelValue": l[9] || (l[9] = (p) => _.value = p),
490
+ i18n: { placeholderDefault: E.value },
491
+ required: "",
492
+ "label-screen-reader-only": "",
493
+ name: "shipping_country",
494
+ label: h.value,
495
+ error: t.validation.value.shippingCountry.$errors
496
+ }, null, 8, ["single-model-value", "i18n", "label", "error"]),
497
+ b(Yt, {
498
+ modelValue: a.value,
499
+ "onUpdate:modelValue": l[10] || (l[10] = (p) => a.value = p),
500
+ variant: "SHIPPING",
501
+ class: "sv-checkout__shipping-address",
502
+ "get-optional-suffix": F,
503
+ format: t.shippingAddressFormat,
504
+ errors: {
505
+ addressLine1: t.validation.value.shippingAddressLine1.$errors,
506
+ postalCode: t.validation.value.shippingPostalCode.$errors,
507
+ city: t.validation.value.shippingCity.$errors,
508
+ state: t.validation.value.shippingState.$errors,
509
+ phoneNumber: t.validation.value.shippingPhoneNumber.$errors,
510
+ lastName: t.validation.value.shippingLastName.$errors
511
+ }
512
+ }, null, 8, ["modelValue", "format", "errors"])
513
+ ]),
514
+ S("div", si, [
515
+ b(e(Ft), {
516
+ modelValue: d.value,
517
+ "onUpdate:modelValue": l[11] || (l[11] = (p) => d.value = p),
518
+ name: "billing_address_same_as_shipping",
519
+ class: "sv-checkout__billing-same-as-shipping",
520
+ label: e(k)({
521
+ defaultMessage: "Billing address is the same as shipping address",
522
+ id: "checkout.billing_address_same_as_shipping.label",
523
+ description: "Label of the checkbox that bills the order to the address it ships to"
524
+ })
525
+ }, null, 8, ["modelValue", "label"])
526
+ ])
527
+ ])) : $("", !0)
528
+ ]),
529
+ _: 1
530
+ }, 8, ["title"]),
531
+ t.isShippingAddressRequired && !t.readOnly ? (n(), x(K, { key: 0 }, [
532
+ d.value ? $("", !0) : (n(), w(e(fe), {
533
+ key: 0,
534
+ class: "sv-checkout__billing-section"
535
+ }, {
536
+ default: g(() => [
537
+ S("fieldset", null, [
538
+ S("legend", null, [
539
+ b(e(Wt), {
540
+ tag: "span",
541
+ required: ""
542
+ }, {
543
+ default: g(() => [
544
+ D(N(e(M).addressTitle), 1)
545
+ ]),
546
+ _: 1
547
+ })
548
+ ]),
549
+ b(Yt, {
550
+ modelValue: a.value,
551
+ "onUpdate:modelValue": l[12] || (l[12] = (p) => a.value = p),
552
+ variant: "BILLING",
553
+ class: "sv-checkout__billing-address",
554
+ "with-country": "",
555
+ "country-label": e(M).countryLabel,
556
+ "get-optional-suffix": F,
557
+ errors: {
558
+ addressLine1: t.validation.value.addressLine1.$errors,
559
+ postalCode: t.validation.value.postalCode.$errors,
560
+ city: t.validation.value.city.$errors,
561
+ state: t.validation.value.state.$errors,
562
+ country: t.validation.value.country.$errors
563
+ }
564
+ }, null, 8, ["modelValue", "country-label", "errors"])
565
+ ])
566
+ ]),
567
+ _: 1
568
+ }))
569
+ ], 64)) : $("", !0),
570
+ !t.readOnly && B.value ? (n(), w(e(fe), { key: 1 }, {
571
+ default: g(() => [
572
+ t.isTypeLocked ? $("", !0) : (n(), w(so, {
573
+ key: 0,
574
+ modelValue: I.value,
575
+ "onUpdate:modelValue": l[13] || (l[13] = (p) => I.value = p),
576
+ "no-spacing": "",
577
+ class: "!flex"
578
+ }, null, 8, ["modelValue"])),
579
+ R.value.length ? (n(), x("div", li, [
580
+ (n(!0), x(K, null, ce(R.value, (p) => (n(), x("div", {
581
+ key: p.label,
582
+ class: "flex flex-col"
583
+ }, [
584
+ b(e(G), {
585
+ variant: "body-sm",
586
+ tag: "span",
587
+ color: "subtle",
588
+ "no-spacing": ""
589
+ }, {
590
+ default: g(() => [
591
+ D(N(p.label), 1)
592
+ ]),
593
+ _: 2
594
+ }, 1024),
595
+ b(e(G), {
596
+ variant: "body",
597
+ tag: "span",
598
+ "no-spacing": ""
599
+ }, {
600
+ default: g(() => [
601
+ D(N(p.value), 1)
602
+ ]),
603
+ _: 2
604
+ }, 1024)
605
+ ]))), 128))
606
+ ])) : $("", !0),
607
+ A.value && O("firstName") ? (n(), x("div", ri, [
608
+ b(e(Me), {
609
+ modelValue: o.firstName,
610
+ "onUpdate:modelValue": l[14] || (l[14] = (p) => o.firstName = p),
611
+ name: "first_name",
612
+ required: t.getIsFieldRequired("firstName"),
613
+ autocomplete: "given-name",
614
+ label: e(k)({
615
+ defaultMessage: "First name",
616
+ id: "checkout.first_name.label",
617
+ description: "Label of the first name of a customer who buys as an individual"
618
+ }),
619
+ error: t.validation.value.firstName.$errors
620
+ }, null, 8, ["modelValue", "required", "label", "error"]),
621
+ b(e(Me), {
622
+ modelValue: o.lastName,
623
+ "onUpdate:modelValue": l[15] || (l[15] = (p) => o.lastName = p),
624
+ name: "last_name",
625
+ required: t.getIsFieldRequired("lastName"),
626
+ autocomplete: "family-name",
627
+ label: e(k)({
628
+ defaultMessage: "Last name",
629
+ id: "checkout.last_name.label",
630
+ description: "Label of the last name of a customer who buys as an individual"
631
+ }),
632
+ error: t.validation.value.lastName.$errors
633
+ }, null, 8, ["modelValue", "required", "label", "error"])
634
+ ])) : $("", !0),
635
+ b(e(Zt), { "is-open": C.value }, {
636
+ default: g(() => [
637
+ C.value ? (n(), x("div", ui, [
638
+ b(lo, {
639
+ modelValue: a.value,
640
+ "onUpdate:modelValue": l[16] || (l[16] = (p) => a.value = p),
641
+ class: "mt-2",
642
+ errors: {
643
+ companyLegalName: t.validation.value.companyLegalName.$errors,
644
+ companyVatNumber: t.validation.value.companyVatNumber.$errors
645
+ },
646
+ "is-vat-number-invalid": t.validation.value.companyVatNumber.$invalid,
647
+ "hides-legal-name": !O("companyLegalName"),
648
+ "hides-vat-number": !O("companyVatNumber")
649
+ }, null, 8, ["modelValue", "errors", "is-vat-number-invalid", "hides-legal-name", "hides-vat-number"]),
650
+ j("companyRegistrationNumber", "EDITABLE") || j("taxExempt", "EDITABLE") ? (n(), x("div", ci, [
651
+ j("companyRegistrationNumber", "EDITABLE") ? (n(), w(e(Me), {
652
+ key: 0,
653
+ modelValue: o.companyRegistrationNumber,
654
+ "onUpdate:modelValue": l[17] || (l[17] = (p) => o.companyRegistrationNumber = p),
655
+ name: "registration_number",
656
+ autocomplete: "off",
657
+ required: t.getIsFieldRequired("companyRegistrationNumber"),
658
+ label: i.value,
659
+ error: t.validation.value.companyRegistrationNumber.$errors
660
+ }, null, 8, ["modelValue", "required", "label", "error"])) : $("", !0),
661
+ j("taxExempt", "EDITABLE") ? (n(), x(K, { key: 1 }, [
662
+ b(e(Ft), {
663
+ modelValue: L.value,
664
+ "onUpdate:modelValue": l[18] || (l[18] = (p) => L.value = p),
665
+ name: "tax_exempt",
666
+ label: T.value
667
+ }, null, 8, ["modelValue", "label"]),
668
+ L.value ? (n(), w(e(Me), {
669
+ key: 0,
670
+ modelValue: o.taxExemptNote,
671
+ "onUpdate:modelValue": l[19] || (l[19] = (p) => o.taxExemptNote = p),
672
+ name: "tax_exempt_note",
673
+ autocomplete: "off",
674
+ label: e(k)({
675
+ defaultMessage: "Reason for tax exemption",
676
+ id: "checkout.tax_exempt_note.label",
677
+ description: "Label of the reason an organization customer is exempt from tax"
678
+ })
679
+ }, null, 8, ["modelValue", "label"])) : $("", !0)
680
+ ], 64)) : $("", !0)
681
+ ])) : $("", !0)
682
+ ])) : $("", !0)
683
+ ]),
684
+ _: 1
685
+ }, 8, ["is-open"])
686
+ ]),
687
+ _: 1
688
+ })) : $("", !0)
689
+ ])
690
+ ], 40, Jo));
691
+ }
692
+ }), di = (t) => typeof t == "object" && t !== null && typeof Reflect.get(t, "strong") == "string", Te = (t) => ({
693
+ strong: t.filter((u) => typeof u == "string").join("")
694
+ });
695
+ function pi(t) {
696
+ return (Array.isArray(t) ? t : [t]).flatMap((s) => typeof s == "string" ? s ? [{ text: s, strong: !1 }] : [] : di(s) ? [{ text: s.strong, strong: !0 }] : []);
697
+ }
698
+ const mi = {
699
+ key: 0,
700
+ class: "flex items-center"
701
+ }, gi = { key: 1 }, vi = { key: 0 }, fi = /* @__PURE__ */ se({
702
+ __name: "CheckoutTitle",
703
+ props: {
704
+ trialPeriod: { type: Object },
705
+ subscriptionName: { type: String },
706
+ amount: { type: Object },
707
+ dueTodayAmount: { type: Object },
708
+ recurringAmount: { type: Object },
709
+ hasOneOffCharges: { type: Boolean },
710
+ hasRecurringCharge: { type: Boolean },
711
+ hasUsageCharges: { type: Boolean },
712
+ billingPeriod: { type: Object },
713
+ countryCode: { type: null },
714
+ trialStartDate: { type: Date },
715
+ subscriptionStartDate: { type: Date }
716
+ },
717
+ setup(t) {
718
+ const u = t, { $t: s } = he(), { formatTimePeriod: v } = je(), a = c(
719
+ () => v(u.billingPeriod, { short: !0, hideValueForExactPeriods: !0 })
720
+ ), I = c(() => {
721
+ const L = ie(u.dueTodayAmount), y = () => s(
722
+ {
723
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today.",
724
+ id: "checkout.one_off_description",
725
+ description: "The description of an order that is charged once and does not renew"
726
+ },
727
+ // @ts-expect-error formatjs does not support this type yet
728
+ { due_today: L, strong: Te }
729
+ );
730
+ if (u.recurringAmount) {
731
+ if (Number(u.recurringAmount.quantity) === 0) {
732
+ if (u.hasUsageCharges)
733
+ return s(
734
+ {
735
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today. Usage is billed every {period_name}.",
736
+ id: "checkout.usage_with_one_off_description",
737
+ description: "The description of a usage-based subscription whose first invoice also charges something only once"
738
+ },
739
+ // @ts-expect-error formatjs does not support this type yet
740
+ { due_today: L, period_name: a.value, strong: Te }
741
+ );
742
+ if (!u.hasRecurringCharge)
743
+ return y();
744
+ }
745
+ const j = ie(u.recurringAmount);
746
+ return u.trialStartDate ? s(
747
+ {
748
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today, then <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",
749
+ id: "checkout.trial_period_description_with_one_off",
750
+ description: "The description of a trial whose first invoice also charges something only once"
751
+ },
752
+ {
753
+ due_today: L,
754
+ price: j,
755
+ period_name: a.value,
756
+ // @ts-expect-error formatjs does not support this type yet
757
+ startDate: u.subscriptionStartDate,
758
+ // @ts-expect-error formatjs does not support this type yet
759
+ strong: Te
760
+ }
761
+ ) : s(
762
+ {
763
+ defaultMessage: "You will be billed <strong>{due_today}</strong> today, then <strong>{price}</strong> per {period_name}.",
764
+ id: "checkout.subscription_description_with_one_off",
765
+ description: "The description of a subscription whose first invoice also charges something only once"
766
+ },
767
+ // @ts-expect-error formatjs does not support this type yet
768
+ { due_today: L, price: j, period_name: a.value, strong: Te }
769
+ );
770
+ }
771
+ if (u.hasOneOffCharges)
772
+ return y();
773
+ const O = ie(u.amount);
774
+ return u.trialStartDate ? s(
775
+ {
776
+ defaultMessage: "You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",
777
+ id: "checkout.trial_period_description",
778
+ description: "The description of the trial period"
779
+ },
780
+ {
781
+ price: O,
782
+ // @ts-expect-error formatjs does not support this type yet
783
+ startDate: u.subscriptionStartDate,
784
+ period_name: a.value,
785
+ // @ts-expect-error formatjs does not support this type yet
786
+ strong: Te
787
+ }
788
+ ) : s(
789
+ {
790
+ defaultMessage: "You will be billed <strong>{price}</strong> per {period_name}, starting today.",
791
+ id: "checkout.subscription_description",
792
+ description: "The description of the subscription"
793
+ },
794
+ // @ts-expect-error formatjs does not support this type yet
795
+ { price: O, period_name: a.value, strong: Te }
796
+ );
797
+ }), C = c(() => pi(I.value)), o = c(
798
+ () => u.trialStartDate ? s(
799
+ {
800
+ defaultMessage: "per {period_name} starting, {startDate, date, long}",
801
+ id: "checkout.trial_period_description_without_price",
802
+ description: "The description of the trial period, while the price is still being determined"
803
+ },
804
+ {
805
+ // @ts-expect-error formatjs does not support this type yet
806
+ startDate: u.subscriptionStartDate,
807
+ period_name: a.value
808
+ }
809
+ ) : s(
810
+ {
811
+ defaultMessage: "per {period_name}, starting today",
812
+ id: "checkout.subscription_description_without_price",
813
+ description: "The description of the subscription, while the price is still being determined"
814
+ },
815
+ { period_name: a.value }
816
+ )
817
+ );
818
+ return (L, y) => (n(), x("div", null, [
819
+ S("div", null, [
820
+ b(e(G), {
821
+ variant: "heading-1",
822
+ class: "inline-block"
823
+ }, {
824
+ default: g(() => [
825
+ D(N(t.trialStartDate ? t.subscriptionName : e(s)({
826
+ defaultMessage: "Pay and subscribe",
827
+ id: "checkout.page_title",
828
+ description: "The title of the checkout page"
829
+ })) + N(" "), 1),
830
+ t.trialPeriod ? (n(), w(e(bo), {
831
+ key: 0,
832
+ "trial-period": t.trialPeriod,
833
+ size: "lg",
834
+ class: "-translate-y-0.5"
835
+ }, null, 8, ["trial-period"])) : $("", !0)
836
+ ]),
837
+ _: 1
838
+ })
839
+ ]),
840
+ b(e(G), {
841
+ variant: "body-sm",
842
+ color: "subtle",
843
+ "no-spacing": ""
844
+ }, {
845
+ default: g(() => [
846
+ t.countryCode ? (n(), x("span", gi, [
847
+ (n(!0), x(K, null, ce(C.value, (O, j) => (n(), x(K, { key: j }, [
848
+ O.strong ? (n(), x("strong", vi, N(O.text), 1)) : (n(), x(K, { key: 1 }, [
849
+ D(N(O.text), 1)
850
+ ], 64))
851
+ ], 64))), 128))
852
+ ])) : (n(), x("span", mi, [
853
+ b(e(fo), { "is-dark-mode": "" }, {
854
+ tooltip: g(() => [
855
+ b(e(ho), null, {
856
+ default: g(() => [
857
+ b(e(yo), null, {
858
+ default: g(() => [
859
+ D(N(e(s)({
860
+ defaultMessage: "Will be determined by billing information",
861
+ description: "Tooltip content for the invoice preview when taxes are not determined by billing information",
862
+ id: "invoice_preview.taxes_not_determined_by_billing_information_tooltip"
863
+ })), 1)
864
+ ]),
865
+ _: 1
866
+ })
867
+ ]),
868
+ _: 1
869
+ })
870
+ ]),
871
+ default: g(() => [
872
+ b(e(vo), {
873
+ "width-class": "w-10",
874
+ "height-class": "h-4",
875
+ shade: "darker",
876
+ class: "mr-1.5 inline-block"
877
+ })
878
+ ]),
879
+ _: 1
880
+ }),
881
+ S("span", null, N(o.value), 1)
882
+ ]))
883
+ ]),
884
+ _: 1
885
+ })
886
+ ]));
887
+ }
888
+ }), hi = /* @__PURE__ */ se({
889
+ __name: "SubscriptionPaymentCompletedCard",
890
+ setup(t) {
891
+ const { $t: u } = he();
892
+ return (s, v) => (n(), w(Po, {
893
+ status: "success",
894
+ title: e(u)({
895
+ defaultMessage: "Payment successful",
896
+ id: "subscription_payment_completed_card.title",
897
+ description: "The title for when a payment has been successful"
898
+ })
899
+ }, {
900
+ default: g(() => [
901
+ b(e(G), {
902
+ variant: "body-xs",
903
+ color: "subtle",
904
+ tag: "span"
905
+ }, {
906
+ default: g(() => [
907
+ D(N(e(u)({
908
+ defaultMessage: "Thank you for subscribing.",
909
+ id: "subscription_payment_completed_card.thank_you_for_subscribing",
910
+ description: "The text shown after a successful message before a redirect"
911
+ })), 1)
912
+ ]),
913
+ _: 1
914
+ })
915
+ ]),
916
+ _: 1
917
+ }, 8, ["title"]));
918
+ }
919
+ }), yi = { class: "flex flex-col gap-3" }, bi = { class: "sv-order-summary__usage-price flex justify-between gap-2" }, _i = /* @__PURE__ */ se({
920
+ __name: "OrderSummaryUsage",
921
+ props: {
922
+ groups: { type: Array }
923
+ },
924
+ setup(t) {
925
+ const u = t, { $t: s } = he(), { map: v } = je(), a = c(
926
+ () => s({
927
+ defaultMessage: "+ Usage",
928
+ id: "checkout.invoice_preview.usage_based_message",
929
+ description: "The message shown for the usage based invoice preview"
930
+ })
931
+ ), I = c(() => {
932
+ const C = u.groups.flatMap(
933
+ (y) => y.prices.map((O) => O.billingPeriod)
934
+ ), [o] = C;
935
+ return !!o && (o.value ?? 1) === 1 && C.every((y) => (y == null ? void 0 : y.type) === o.type && (y.value ?? 1) === 1) ? s(
936
+ {
937
+ defaultMessage: "Billed {period}",
938
+ id: "checkout.order_summary_block.usage.billed_period",
939
+ description: 'Next to the usage line of the order summary, how often usage is billed, e.g. "Billed monthly"'
940
+ },
941
+ { period: v.value[o.type].full }
942
+ ) : void 0;
943
+ });
944
+ return (C, o) => (n(), w(Ga, {
945
+ class: "sv-order-summary__usage",
946
+ title: a.value,
947
+ subtitle: I.value,
948
+ expandable: t.groups.length > 0
949
+ }, {
950
+ default: g(() => [
951
+ S("div", yi, [
952
+ (n(!0), x(K, null, ce(t.groups, (L, y) => (n(), x("div", {
953
+ key: y,
954
+ class: "flex flex-col gap-1.5"
955
+ }, [
956
+ L.name ? (n(), w(e(G), {
957
+ key: 0,
958
+ variant: "caps-heading"
959
+ }, {
960
+ default: g(() => [
961
+ D(N(L.name), 1)
962
+ ]),
963
+ _: 2
964
+ }, 1024)) : $("", !0),
965
+ (n(!0), x(K, null, ce(L.prices, (O, j) => (n(), x(K, { key: j }, [
966
+ S("div", bi, [
967
+ b(e(G), {
968
+ variant: "body-xs",
969
+ weight: "semibold",
970
+ tag: "div",
971
+ class: "min-w-0 flex-1 break-words"
972
+ }, {
973
+ default: g(() => [
974
+ D(N(O.name), 1)
975
+ ]),
976
+ _: 2
977
+ }, 1024),
978
+ b(e(G), {
979
+ variant: "body-xs",
980
+ color: "subtle",
981
+ tag: "div",
982
+ class: "min-w-0 max-w-[50%] break-words text-right"
983
+ }, {
984
+ default: g(() => [
985
+ D(N(O.rate), 1)
986
+ ]),
987
+ _: 2
988
+ }, 1024)
989
+ ]),
990
+ (n(!0), x(K, null, ce(O.rows, (A, U) => (n(), x("div", {
991
+ key: `${j}-${U}`,
992
+ class: "sv-order-summary__usage-price flex justify-between gap-2"
993
+ }, [
994
+ b(e(G), {
995
+ variant: "body-xs",
996
+ color: "subtle",
997
+ tag: "div",
998
+ class: "min-w-0 flex-1 break-words"
999
+ }, {
1000
+ default: g(() => [
1001
+ D(N(A.label), 1)
1002
+ ]),
1003
+ _: 2
1004
+ }, 1024),
1005
+ b(e(G), {
1006
+ variant: "body-xs",
1007
+ color: "subtle",
1008
+ tag: "div",
1009
+ class: "min-w-0 max-w-[50%] break-words text-right"
1010
+ }, {
1011
+ default: g(() => [
1012
+ D(N(A.rate), 1)
1013
+ ]),
1014
+ _: 2
1015
+ }, 1024)
1016
+ ]))), 128))
1017
+ ], 64))), 128))
1018
+ ]))), 128))
1019
+ ])
1020
+ ]),
1021
+ _: 1
1022
+ }, 8, ["title", "subtitle", "expandable"]));
1023
+ }
1024
+ }), ki = { class: "flex items-start" }, Pi = { class: "flex grow flex-col" }, wi = { class: "flex items-center gap-1" }, Ai = { class: "ml-4 flex items-center self-center" }, Ci = /* @__PURE__ */ se({
1025
+ __name: "PricingGroupContent",
1026
+ props: {
1027
+ name: { type: String },
1028
+ description: { type: String }
1029
+ },
1030
+ setup(t) {
1031
+ return (u, s) => (n(), x("div", ki, [
1032
+ S("div", Pi, [
1033
+ S("div", wi, [
1034
+ b(e(G), {
1035
+ tag: "span",
1036
+ variant: "body-sm",
1037
+ weight: "semibold"
1038
+ }, {
1039
+ default: g(() => [
1040
+ D(N(t.name), 1)
1041
+ ]),
1042
+ _: 1
1043
+ }),
1044
+ Rt(u.$slots, "badge")
1045
+ ]),
1046
+ b(e(G), {
1047
+ tag: "span",
1048
+ variant: "body-xs",
1049
+ color: "subtle"
1050
+ }, {
1051
+ default: g(() => [
1052
+ D(N(t.description), 1)
1053
+ ]),
1054
+ _: 1
1055
+ })
1056
+ ]),
1057
+ S("div", Ai, [
1058
+ Rt(u.$slots, "default")
1059
+ ])
1060
+ ]));
1061
+ }
1062
+ }), xi = {
1063
+ class: "sv-order-summary__updating",
1064
+ role: "status"
1065
+ }, Mi = { class: "sr-only" }, Ei = { class: "sv-order-summary__body grid grid-cols-1 gap-1" }, Ii = { class: "px-3 py-2" }, Li = { class: "sv-order-summary__billing-period flex flex-col gap-3" }, Ti = {
1066
+ key: 0,
1067
+ class: "sv-order-summary__renewal flex flex-row gap-2 pt-1.5"
1068
+ }, ta = /* @__PURE__ */ se({
1069
+ __name: "OrderSummary",
1070
+ props: {
1071
+ subscription: { type: Object },
1072
+ subscriptions: { type: Array },
1073
+ invoice: { type: Object },
1074
+ invoiceSections: { type: Array },
1075
+ invoicePreviewByBillingPeriod: { type: Object },
1076
+ trialInvoice: { type: Object },
1077
+ enabledPricingIds: { type: Array },
1078
+ avatar: { type: String },
1079
+ isPaid: { type: Boolean },
1080
+ isUsageBased: { type: Boolean },
1081
+ usagePriceGroups: { type: Array },
1082
+ collapsible: { type: String },
1083
+ noTitle: { type: Boolean },
1084
+ countryCode: { type: null },
1085
+ variant: { type: String },
1086
+ isUpdating: { type: Boolean }
1087
+ },
1088
+ emits: ["billing-period-change"],
1089
+ setup(t, { emit: u }) {
1090
+ const s = t, v = u, { $t: a } = he(), { map: I, formatTimePeriod: C } = je(), { isMobileViewport: o } = ra(), L = c(() => o.value ? "sm" : "xs"), y = (h) => `${h.type}:${h.value}`, O = ["DAY", "WEEK", "MONTH", "YEAR"], j = (h) => O.includes(h), A = (h) => {
1091
+ if (!h)
1092
+ return;
1093
+ const [E, m] = h.split(":"), l = Number(m);
1094
+ if (!(!l || !j(E)))
1095
+ return { type: E, value: l };
1096
+ }, U = c({
1097
+ get: () => {
1098
+ const h = s.subscription.billing_period;
1099
+ return h ? y(h) : void 0;
1100
+ },
1101
+ set: (h) => {
1102
+ const E = A(h);
1103
+ E && v("billing-period-change", E);
1104
+ }
1105
+ }), _ = c({
1106
+ get: () => U.value,
1107
+ set: (h) => {
1108
+ U.value = re(h);
1109
+ }
1110
+ }), k = (h) => {
1111
+ var E;
1112
+ return qt((E = s.invoicePreviewByBillingPeriod) == null ? void 0 : E[h]);
1113
+ }, M = (h) => {
1114
+ const E = k(y(h));
1115
+ if (!E)
1116
+ return;
1117
+ const m = h.type === "MONTH" && h.value === 3 ? a({
1118
+ defaultMessage: "/quarter",
1119
+ id: "checkout.order_summary_block.billing_period.per_quarter",
1120
+ description: "Period label for quarterly billing"
1121
+ }) : a(
1122
+ {
1123
+ defaultMessage: "/{period}",
1124
+ id: "checkout.order_summary_block.billing_period.per_label",
1125
+ description: "Period label for billing cycles"
1126
+ },
1127
+ {
1128
+ period: C(h, {
1129
+ prefix: !1,
1130
+ hideValueForExactPeriods: !0
1131
+ })
1132
+ }
1133
+ );
1134
+ return a(
1135
+ {
1136
+ defaultMessage: "{amount}{period}",
1137
+ id: "checkout.order_summary_block.billing_period.sub_label",
1138
+ description: "Billing period option sublabel showing price per period"
1139
+ },
1140
+ {
1141
+ amount: ie(E),
1142
+ period: m
1143
+ }
1144
+ );
1145
+ }, F = (h) => {
1146
+ if (!h)
1147
+ return;
1148
+ const E = a(
1149
+ {
1150
+ defaultMessage: "Save {amount}",
1151
+ id: "checkout.order_summary_block.billing_period.save_badge.prefix",
1152
+ description: "First line for the savings badge label"
1153
+ },
1154
+ { amount: ie(h) }
1155
+ ), m = a({
1156
+ defaultMessage: "/year",
1157
+ id: "checkout.order_summary_block.billing_period.save_badge.suffix",
1158
+ description: "Second line for the savings badge label"
1159
+ });
1160
+ return `${E}${m}`;
1161
+ }, X = c(
1162
+ () => s.invoice ? Ha(s.invoice) : { recurring: [], oneOff: [], other: [] }
1163
+ ), Z = c(
1164
+ () => X.value.recurring.length > 0 && X.value.oneOff.length > 0
1165
+ ), Q = c(
1166
+ () => Z.value ? qt(s.invoice) : void 0
1167
+ ), H = c(
1168
+ () => Q.value && Number(Q.value.quantity) !== 0 ? Q.value : void 0
1169
+ ), i = c(() => {
1170
+ var me, ye, $e;
1171
+ const h = ua({
1172
+ pricingPlanScheduleInfos: s.subscription.pricing_plan_schedule_infos ?? [],
1173
+ type: "DEFAULT"
1174
+ }), E = ((ye = (me = h == null ? void 0 : h.pricing_plan_version) == null ? void 0 : me.billing_period_settings) == null ? void 0 : ye.billing_periods) ?? [], m = /* @__PURE__ */ new Map(), l = (te) => {
1175
+ te && m.set(y(te), te);
1176
+ }, p = (te) => {
1177
+ var we;
1178
+ (we = te == null ? void 0 : te.items) == null || we.forEach((be) => {
1179
+ var le, _e;
1180
+ (le = be.billing_period_configs) == null || le.forEach(
1181
+ (ke) => l(ke.billing_period)
1182
+ ), (_e = be.pricing_currency_configs) == null || _e.forEach((ke) => {
1183
+ var Le;
1184
+ (Le = ke.billing_period_configs) == null || Le.forEach(
1185
+ (Ye) => l(Ye.billing_period)
1186
+ );
1187
+ });
1188
+ });
1189
+ };
1190
+ if (((($e = h == null ? void 0 : h.pricing_plan_version) == null ? void 0 : $e.pricing_categories) ?? []).forEach((te) => {
1191
+ var we, be;
1192
+ (we = te.pricings) == null || we.forEach((le) => p(le)), (be = te.pricing_groups) == null || be.forEach(
1193
+ (le) => {
1194
+ var _e;
1195
+ return (_e = le.pricings) == null ? void 0 : _e.forEach((ke) => p(ke));
1196
+ }
1197
+ );
1198
+ }), !m.size)
1199
+ return [];
1200
+ const oe = E.map((te) => m.get(y(te.period))).filter((te) => !!te), ne = new Set(oe.map(y)), ee = [...m.values()].filter(
1201
+ (te) => !ne.has(y(te))
1202
+ );
1203
+ return [...oe, ...ee];
1204
+ }), T = c(() => {
1205
+ const h = i.value[i.value.length - 1], E = h ? De(
1206
+ h,
1207
+ k(y(h))
1208
+ ) : void 0;
1209
+ return i.value.map((l) => {
1210
+ const p = l.type === "MONTH" && l.value === 3 ? a({
1211
+ defaultMessage: "Billed quarterly",
1212
+ id: "checkout.order_summary_block.billing_period.quarterly",
1213
+ description: "Billing period option label for quarterly billing"
1214
+ }) : a(
1215
+ {
1216
+ defaultMessage: "Billed {period}",
1217
+ id: "checkout.order_summary_block.billing_period.label",
1218
+ description: "Billing period option label for the selected period"
1219
+ },
1220
+ { period: I.value[l.type].full }
1221
+ ), J = k(y(l)), oe = De(l, J), ne = h && l.type === h.type && l.value === h.value ? void 0 : zt(oe, E), ee = F(ne);
1222
+ return {
1223
+ label: p,
1224
+ subLabel: M(l),
1225
+ labelSuffixComponent: ee ? {
1226
+ component: Xt,
1227
+ props: {
1228
+ color: "primary",
1229
+ content: ee,
1230
+ size: L.value,
1231
+ class: "whitespace-nowrap text-left leading-tight"
1232
+ }
1233
+ } : void 0,
1234
+ hidden: U.value === y(l),
1235
+ value: y(l)
1236
+ };
1237
+ });
1238
+ }), R = c(() => {
1239
+ const h = T.value, E = h[0], m = h[h.length - 1];
1240
+ return {
1241
+ smallestPeriod: E == null ? void 0 : E.value,
1242
+ biggestPeriod: m == null ? void 0 : m.value
1243
+ };
1244
+ }), B = c(
1245
+ () => T.value.find((h) => h.value === R.value.biggestPeriod)
1246
+ ), q = c(
1247
+ () => T.value.find((h) => h.value === U.value)
1248
+ ), d = c(() => {
1249
+ const h = T.value, E = h[h.length - 1], m = U.value;
1250
+ if (!E || !m || m === E.value)
1251
+ return "";
1252
+ const l = A(E.value);
1253
+ if (!l)
1254
+ return "";
1255
+ const p = k(E.value), J = A(m), oe = k(m);
1256
+ if (!J || !oe)
1257
+ return "";
1258
+ const ne = De(J, oe), ee = De(l, p);
1259
+ return F(zt(ne, ee)) ?? "";
1260
+ }), z = c(
1261
+ () => {
1262
+ var h;
1263
+ return !!((h = s.invoiceSections) != null && h.length) && s.variant !== "products-inline";
1264
+ }
1265
+ ), P = (h) => {
1266
+ const { smallestPeriod: E, biggestPeriod: m } = R.value;
1267
+ U.value = h ? m : E;
1268
+ };
1269
+ return (h, E) => (n(), w(e(fe), {
1270
+ class: "sv-order-summary",
1271
+ "no-border": "",
1272
+ "no-spacing": "",
1273
+ "content-background": "none",
1274
+ title: t.noTitle ? void 0 : e(a)({
1275
+ defaultMessage: "Order summary",
1276
+ id: "checkout.order_summary_block.title",
1277
+ description: "The title of the order summary block that lists the subscription cost in the checkout"
1278
+ })
1279
+ }, $t({
1280
+ default: g(() => [
1281
+ S("div", Ei, [
1282
+ (n(!0), x(K, null, ce(z.value ? [] : t.subscriptions ?? [t.subscription], (m, l) => (n(), w(e(fe), {
1283
+ key: l,
1284
+ "no-spacing": "",
1285
+ class: "sv-order-summary__subscription"
1286
+ }, {
1287
+ default: g(() => [
1288
+ m ? (n(), w(Co, {
1289
+ key: 0,
1290
+ avatar: t.avatar,
1291
+ subscription: m,
1292
+ "enabled-pricing-ids": t.enabledPricingIds
1293
+ }, null, 8, ["avatar", "subscription", "enabled-pricing-ids"])) : $("", !0)
1294
+ ]),
1295
+ _: 2
1296
+ }, 1024))), 128)),
1297
+ T.value.length === 2 ? (n(), w(e(fe), {
1298
+ key: 0,
1299
+ "no-spacing": "",
1300
+ "content-classes": U.value === R.value.biggestPeriod ? "border-primary-500" : void 0
1301
+ }, {
1302
+ default: g(() => {
1303
+ var m;
1304
+ return [
1305
+ S("div", Ii, [
1306
+ S("div", Li, [
1307
+ B.value ? (n(), w(Ci, {
1308
+ key: 0,
1309
+ name: B.value.label,
1310
+ description: ((m = q.value) == null ? void 0 : m.subLabel) ?? ""
1311
+ }, $t({
1312
+ default: g(() => [
1313
+ b(e(wo), {
1314
+ "model-value": U.value === R.value.biggestPeriod,
1315
+ size: "sm",
1316
+ "onUpdate:modelValue": P
1317
+ }, null, 8, ["model-value"])
1318
+ ]),
1319
+ _: 2
1320
+ }, [
1321
+ d.value ? {
1322
+ name: "badge",
1323
+ fn: g(() => [
1324
+ b(e(Xt), {
1325
+ intent: "brand",
1326
+ content: d.value,
1327
+ size: L.value,
1328
+ class: "whitespace-nowrap text-left leading-tight"
1329
+ }, null, 8, ["content", "size"])
1330
+ ]),
1331
+ key: "0"
1332
+ } : void 0
1333
+ ]), 1032, ["name", "description"])) : $("", !0)
1334
+ ])
1335
+ ])
1336
+ ];
1337
+ }),
1338
+ _: 1
1339
+ }, 8, ["content-classes"])) : T.value.length > 2 ? (n(), w(e(Ao), {
1340
+ key: 1,
1341
+ "single-model-value": _.value,
1342
+ "onUpdate:singleModelValue": E[0] || (E[0] = (m) => _.value = m),
1343
+ class: "sv-order-summary__billing-period",
1344
+ options: T.value,
1345
+ size: "xl",
1346
+ "has-large-dropdown": "",
1347
+ "show-sub-label-in-input": "",
1348
+ "show-suffix-in-closed-input": ""
1349
+ }, null, 8, ["single-model-value", "options"])) : $("", !0),
1350
+ t.invoice ? (n(), w(Ka, {
1351
+ key: 2,
1352
+ "is-updating": t.isUpdating,
1353
+ invoice: t.invoice,
1354
+ sections: t.invoiceSections,
1355
+ "trial-invoice": t.trialInvoice,
1356
+ "is-paid": t.isPaid,
1357
+ collapsible: t.collapsible,
1358
+ "is-preview-without-taxes": !t.countryCode,
1359
+ variant: t.variant
1360
+ }, {
1361
+ "before-totals": g(() => [
1362
+ t.isUsageBased ? (n(), w(_i, {
1363
+ key: 0,
1364
+ groups: t.usagePriceGroups ?? []
1365
+ }, null, 8, ["groups"])) : $("", !0)
1366
+ ]),
1367
+ default: g(() => [
1368
+ H.value ? (n(), x("div", Ti, [
1369
+ b(e(G), {
1370
+ tag: "span",
1371
+ variant: "body-xs",
1372
+ color: "subtle",
1373
+ class: "grow"
1374
+ }, {
1375
+ default: g(() => [
1376
+ D(N(e(a)(
1377
+ {
1378
+ defaultMessage: "Then {amount} per {period}",
1379
+ id: "checkout.order_summary_block.renews_at",
1380
+ description: "The amount the subscription is charged every period after the first invoice"
1381
+ },
1382
+ {
1383
+ amount: e(ie)(H.value),
1384
+ period: e(C)(t.subscription.billing_period, {
1385
+ prefix: !1,
1386
+ singular: !0,
1387
+ hideValueForExactPeriods: !0
1388
+ })
1389
+ }
1390
+ )), 1)
1391
+ ]),
1392
+ _: 1
1393
+ })
1394
+ ])) : $("", !0)
1395
+ ]),
1396
+ _: 1
1397
+ }, 8, ["is-updating", "invoice", "sections", "trial-invoice", "is-paid", "collapsible", "is-preview-without-taxes", "variant"])) : (n(), w(e(fe), {
1398
+ key: 3,
1399
+ class: "sv-order-summary__totals"
1400
+ }, {
1401
+ default: g(() => [
1402
+ b(e(G), {
1403
+ variant: "body-sm",
1404
+ color: "subtle",
1405
+ class: "sv-order-summary__empty"
1406
+ }, {
1407
+ default: g(() => [
1408
+ D(N(e(a)({
1409
+ defaultMessage: "Please select a country first",
1410
+ description: "The message shown for the invoice preview when no country is set",
1411
+ id: "checkout.invoice_preview.no_country_selected_message"
1412
+ })), 1)
1413
+ ]),
1414
+ _: 1
1415
+ })
1416
+ ]),
1417
+ _: 1
1418
+ }))
1419
+ ])
1420
+ ]),
1421
+ _: 2
1422
+ }, [
1423
+ t.isUpdating ? {
1424
+ name: "right",
1425
+ fn: g(() => [
1426
+ S("span", xi, [
1427
+ b(e(ja), {
1428
+ size: "4",
1429
+ color: "gray"
1430
+ }),
1431
+ S("span", Mi, N(e(a)({
1432
+ defaultMessage: "Updating the price",
1433
+ id: "checkout.order_summary_block.updating",
1434
+ description: "Read out while the order summary is priced again after the customer changed the order"
1435
+ })), 1)
1436
+ ])
1437
+ ]),
1438
+ key: "0"
1439
+ } : void 0
1440
+ ]), 1032, ["title"]));
1441
+ }
1442
+ }), Ni = { key: 1 }, Si = { key: 2 }, Oi = { key: 3 }, Ri = { key: 4 }, $i = ["href"], Vi = /* @__PURE__ */ se({
1443
+ __name: "MarkdownInline",
1444
+ props: {
1445
+ nodes: { type: Array }
1446
+ },
1447
+ setup(t) {
1448
+ return (u, s) => {
1449
+ const v = Va("MarkdownInline", !0);
1450
+ return n(!0), x(K, null, ce(t.nodes, (a, I) => (n(), x(K, { key: I }, [
1451
+ a.type === "text" ? (n(), x(K, { key: 0 }, [
1452
+ D(N(a.value), 1)
1453
+ ], 64)) : a.type === "break" ? (n(), x("br", Ni)) : a.type === "bold" ? (n(), x("strong", Si, [
1454
+ b(v, {
1455
+ nodes: a.children
1456
+ }, null, 8, ["nodes"])
1457
+ ])) : a.type === "italic" ? (n(), x("em", Oi, [
1458
+ b(v, {
1459
+ nodes: a.children
1460
+ }, null, 8, ["nodes"])
1461
+ ])) : a.type === "underline" ? (n(), x("u", Ri, [
1462
+ b(v, {
1463
+ nodes: a.children
1464
+ }, null, 8, ["nodes"])
1465
+ ])) : a.type === "link" ? (n(), x("a", {
1466
+ key: 5,
1467
+ href: a.href,
1468
+ target: "_blank",
1469
+ rel: "noopener noreferrer",
1470
+ class: "underline"
1471
+ }, [
1472
+ b(v, {
1473
+ nodes: a.children
1474
+ }, null, 8, ["nodes"])
1475
+ ], 8, $i)) : $("", !0)
1476
+ ], 64))), 128);
1477
+ };
1478
+ }
1479
+ }), Bi = /^<u>([\s\S]*?)<\/u>/i, Di = /^\*\*([\s\S]+?)\*\*/, Ui = /^\*([\s\S]+?)\*/, Fi = /^_([\s\S]+?)_(?![\p{L}\p{N}])/u, qi = /[\p{L}\p{N}]/u, zi = /^\[([^\]]*)\]\(\s*([^)\s]*)\s*\)/, ji = /^<([a-z][a-z0-9+.-]*:[^>\s]+)>/i, Yi = /\n[ \t]*\n/;
1480
+ function Oe(t) {
1481
+ const u = [];
1482
+ let s = "";
1483
+ const v = () => {
1484
+ s && (u.push({ type: "text", value: s }), s = "");
1485
+ };
1486
+ let a = 0;
1487
+ for (; a < t.length; ) {
1488
+ const I = t.slice(a), C = Di.exec(I);
1489
+ if (C) {
1490
+ v(), u.push({ type: "bold", children: Oe(C[1]) }), a += C[0].length;
1491
+ continue;
1492
+ }
1493
+ const o = Ui.exec(I) ?? (Gi(t, a) ? Fi.exec(I) : null);
1494
+ if (o) {
1495
+ v(), u.push({ type: "italic", children: Oe(o[1]) }), a += o[0].length;
1496
+ continue;
1497
+ }
1498
+ const L = Bi.exec(I);
1499
+ if (L) {
1500
+ v(), u.push({ type: "underline", children: Oe(L[1]) }), a += L[0].length;
1501
+ continue;
1502
+ }
1503
+ const y = zi.exec(I);
1504
+ if (y) {
1505
+ v(), u.push(aa(y[2], Oe(y[1]))), a += y[0].length;
1506
+ continue;
1507
+ }
1508
+ const O = ji.exec(I);
1509
+ if (O) {
1510
+ v(), u.push(aa(O[1], [{ type: "text", value: O[1] }])), a += O[0].length;
1511
+ continue;
1512
+ }
1513
+ if (t[a] === `
1514
+ `) {
1515
+ v(), u.push({ type: "break" }), a += 1;
1516
+ continue;
1517
+ }
1518
+ s += t[a], a += 1;
1519
+ }
1520
+ return v(), u;
1521
+ }
1522
+ function Gi(t, u) {
1523
+ return u === 0 || !qi.test(t[u - 1]);
1524
+ }
1525
+ function aa(t, u) {
1526
+ const s = Io(t);
1527
+ return s ? { type: "link", href: s, children: u } : { type: "text", value: da(u) };
1528
+ }
1529
+ function da(t) {
1530
+ return t.map((u) => u.type === "text" ? u.value : u.type === "break" ? " " : da(u.children)).join("");
1531
+ }
1532
+ function Hi(t) {
1533
+ return t != null && t.trim() ? t.split(Yi).map((u) => u.trim()).filter(Boolean).map((u) => ({ type: "paragraph", children: Oe(u) })) : [];
1534
+ }
1535
+ const Ki = { key: 0 }, Zi = /* @__PURE__ */ se({
1536
+ __name: "MarkdownText",
1537
+ props: {
1538
+ source: { type: [String, null] }
1539
+ },
1540
+ setup(t) {
1541
+ const u = t, s = c(() => Hi(u.source));
1542
+ return (v, a) => s.value.length ? (n(), x("div", Ki, [
1543
+ (n(!0), x(K, null, ce(s.value, (I, C) => (n(), x("p", {
1544
+ key: C,
1545
+ class: ut({ "mt-2": C > 0 })
1546
+ }, [
1547
+ b(Vi, {
1548
+ nodes: I.children
1549
+ }, null, 8, ["nodes"])
1550
+ ], 2))), 128))
1551
+ ])) : $("", !0);
1552
+ }
1553
+ });
1554
+ async function Wi(t, u, { onSubmit: s } = {}) {
1555
+ const { AdyenCheckout: v } = await ca();
1556
+ return v(
1557
+ No({
1558
+ locale: t.locale,
1559
+ amount: t.amount,
1560
+ countryCode: t.countryCode,
1561
+ paymentMethodOptionResponse: t.paymentMethodOptionsResponse,
1562
+ logger: u,
1563
+ onSubmit: s
1564
+ })
1565
+ );
1566
+ }
1567
+ const Ji = /* @__PURE__ */ se({
1568
+ __name: "ExpressPaymentMethodButton",
1569
+ emits: ["click"],
1570
+ setup(t, { emit: u }) {
1571
+ const s = u;
1572
+ function v() {
1573
+ s("click");
1574
+ }
1575
+ return (a, I) => (n(), w(e(Ie), {
1576
+ size: "lg",
1577
+ "aria-label": "Apple Pay",
1578
+ class: "!block h-11 w-full !bg-black !py-0",
1579
+ onClick: v
1580
+ }, {
1581
+ default: g(() => [...I[0] || (I[0] = [
1582
+ S("svg", {
1583
+ viewBox: "0 0 35 15",
1584
+ class: "h-[44px]"
1585
+ }, [
1586
+ S("svg", {
1587
+ x: "0",
1588
+ y: "3.85",
1589
+ height: "7.3",
1590
+ width: "35",
1591
+ class: "logo",
1592
+ viewBox: "0 0 105 43",
1593
+ version: "1.1",
1594
+ xmlns: "http://www.w3.org/2000/svg"
1595
+ }, [
1596
+ S("title", null, "Apple Logo"),
1597
+ S("g", {
1598
+ stroke: "none",
1599
+ "stroke-width": "1",
1600
+ fill: "none",
1601
+ "fill-rule": "evenodd"
1602
+ }, [
1603
+ S("g", { fill: "#FFF" }, [
1604
+ S("path", { d: "M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674" }),
1605
+ S("path", { d: "M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926" }),
1606
+ S("path", { d: "M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381" }),
1607
+ S("path", { d: "M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z" }),
1608
+ S("path", { d: "M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345" })
1609
+ ])
1610
+ ])
1611
+ ])
1612
+ ], -1)
1613
+ ])]),
1614
+ _: 1
1615
+ }));
1616
+ }
1617
+ }), Xi = { class: "absolute h-[1px] w-[1px] overflow-hidden opacity-0" }, Qi = "ADYEN", en = /* @__PURE__ */ se({
1618
+ __name: "ExpressPaymentMethodApplePay",
1619
+ props: {
1620
+ onBillingInformationChange: { type: Function },
1621
+ context: { type: Object },
1622
+ validateOnSubmit: { type: Function },
1623
+ amount: { type: Object },
1624
+ countryCode: { type: String },
1625
+ locale: { type: String },
1626
+ isVisible: { type: Boolean },
1627
+ paymentMethodOptionsResponse: { type: Object },
1628
+ billingInformation: { type: Object }
1629
+ },
1630
+ emits: ["ready", "unavailable", "update-billing-information", "payment-success", "payment-failed"],
1631
+ setup(t, { emit: u }) {
1632
+ const s = t, v = u, a = ae();
1633
+ let I, C = 0;
1634
+ const o = sa(), { authorizePayment: L } = Oo(), y = s.paymentMethodOptionsResponse.payment_acceptor.id;
1635
+ function O(i) {
1636
+ return Ro({
1637
+ gateway: "ADYEN",
1638
+ paymentAcceptorId: y,
1639
+ paymentMethodType: "applepay",
1640
+ ...i
1641
+ });
1642
+ }
1643
+ const j = (i) => {
1644
+ var T;
1645
+ return i.status === "SUCCESS" && ((T = i.payment) == null ? void 0 : T.result) === "AUTHORIZED";
1646
+ }, A = () => Object.assign(new Error("Apple Pay payment could not be confirmed"), {
1647
+ code: "PAYMENT_OUTCOME_UNCONFIRMED"
1648
+ }), U = async (i, T) => {
1649
+ var B;
1650
+ const R = (q) => {
1651
+ T.reject(), v("payment-failed", q);
1652
+ };
1653
+ try {
1654
+ const q = await L({
1655
+ payment_acceptor_id: y,
1656
+ payment_gateway_variant: Qi,
1657
+ adyen: {
1658
+ payment_method: Qt(i.data.paymentMethod),
1659
+ ...i.data.riskData && {
1660
+ risk_data: Qt(i.data.riskData)
1661
+ },
1662
+ store_payment_method: !0
1663
+ // Required for recurring payments
1664
+ },
1665
+ amount: s.amount,
1666
+ ...s.context ? { context: s.context } : {},
1667
+ return_url: So({ paymentAcceptorId: y, redirectUrl: window.location.href })
1668
+ });
1669
+ if (j(q)) {
1670
+ T.resolve({ resultCode: "Authorised" }), v("payment-success");
1671
+ return;
1672
+ }
1673
+ if ($o(q) === "UNCONFIRMED") {
1674
+ o.warn(
1675
+ "PAYMENT_OUTCOME_UNCONFIRMED",
1676
+ "The payment outcome could not be confirmed yet",
1677
+ O({
1678
+ reason: "PAYMENT_PENDING",
1679
+ extra: {
1680
+ paymentStatus: q.status,
1681
+ paymentResult: (B = q.payment) == null ? void 0 : B.result
1682
+ }
1683
+ })
1684
+ ), R(A());
1685
+ return;
1686
+ }
1687
+ o.error(
1688
+ "APPLE_PAY_AUTHORIZATION_FAILED",
1689
+ "Payment authorization failed",
1690
+ O({
1691
+ reason: "APPLE_PAY_AUTHORIZATION_REJECTED",
1692
+ extra: { paymentStatus: q.status }
1693
+ })
1694
+ ), R(new Error(`Apple Pay payment was not authorized (${q.status})`));
1695
+ } catch (q) {
1696
+ if (o.error(
1697
+ "APPLE_PAY_AUTHORIZATION_FAILED",
1698
+ "Apple Pay authorization failed",
1699
+ O({ reason: "APPLE_PAY_AUTHORIZATION_FAILED", cause: q }),
1700
+ q
1701
+ ), Vo(q)) {
1702
+ R(A());
1703
+ return;
1704
+ }
1705
+ R(q instanceof Error ? q : new Error("Apple Pay authorization failed"));
1706
+ }
1707
+ }, _ = async () => {
1708
+ const i = C, { ApplePay: T } = await ca(), R = await Wi(s, o, {
1709
+ onSubmit: (d, z, P) => void U(d, P)
1710
+ }), B = s.billingInformation.regular ? {
1711
+ paymentDescription: s.billingInformation.description,
1712
+ billingAgreement: s.billingInformation.agreement,
1713
+ managementURL: s.billingInformation.managementURL,
1714
+ ...s.billingInformation.trial && {
1715
+ trialBilling: {
1716
+ label: s.billingInformation.trial.label,
1717
+ amount: s.billingInformation.trial.amount.quantity.toString(),
1718
+ type: "final",
1719
+ paymentTiming: "recurring",
1720
+ recurringPaymentStartDate: s.billingInformation.trial.startDate,
1721
+ recurringPaymentEndDate: s.billingInformation.trial.endDate
1722
+ }
1723
+ },
1724
+ regularBilling: {
1725
+ label: s.billingInformation.regular.label,
1726
+ amount: s.billingInformation.regular.amount.quantity.toString(),
1727
+ type: "final",
1728
+ paymentTiming: "recurring",
1729
+ recurringPaymentStartDate: s.billingInformation.regular.startDate,
1730
+ ...M(
1731
+ s.billingInformation.regular.interval ?? { type: "MONTH", value: 1 }
1732
+ )
1733
+ }
1734
+ } : void 0, q = new T(R, {
1735
+ isExpress: !0,
1736
+ ...B && { recurringPaymentRequest: B },
1737
+ requiredBillingContactFields: ["postalAddress"],
1738
+ requiredShippingContactFields: ["email"],
1739
+ onPaymentMethodSelected: async (d, z, P) => {
1740
+ var l, p, J, oe, ne, ee, me, ye;
1741
+ const { invoicePreview: h, trialInvoicePreview: E } = await s.onBillingInformationChange({
1742
+ ...((l = P.paymentMethod.billingContact) == null ? void 0 : l.postalCode) && {
1743
+ postalCode: P.paymentMethod.billingContact.postalCode
1744
+ },
1745
+ ...((p = P.paymentMethod.billingContact) == null ? void 0 : p.locality) && {
1746
+ city: P.paymentMethod.billingContact.locality
1747
+ },
1748
+ ...Z((J = P.paymentMethod.billingContact) == null ? void 0 : J.countryCode) && {
1749
+ country: Z((oe = P.paymentMethod.billingContact) == null ? void 0 : oe.countryCode)
1750
+ }
1751
+ }), m = E ? E.invoice_amount_including_tax.quantity.toString() : h.invoice_amount_including_tax.quantity.toString();
1752
+ v("update-billing-information", {
1753
+ postal_code: (ne = P.paymentMethod.billingContact) == null ? void 0 : ne.postalCode,
1754
+ city: (ee = P.paymentMethod.billingContact) == null ? void 0 : ee.locality,
1755
+ country: (me = P.paymentMethod.billingContact) == null ? void 0 : me.countryCode
1756
+ }), d({
1757
+ newTotal: {
1758
+ label: ((ye = s.billingInformation.regular) == null ? void 0 : ye.label) ?? s.billingInformation.description,
1759
+ amount: m,
1760
+ type: "final"
1761
+ }
1762
+ });
1763
+ },
1764
+ onError: (d) => {
1765
+ o.error(
1766
+ "APPLE_PAY_ERROR",
1767
+ "Apple Pay error",
1768
+ O({ reason: "APPLE_PAY_ERROR", cause: d }),
1769
+ d
1770
+ );
1771
+ },
1772
+ /**
1773
+ * Resolving here is what starts Adyen's payment flow, which calls `onSubmit` above. The
1774
+ * charge is not made from this callback — the form is checked here instead, because a
1775
+ * rejection shows the customer an error in the sheet rather than taking their money for a
1776
+ * subscription the checkout cannot create.
1777
+ */
1778
+ onAuthorized: async (d, z) => {
1779
+ var P, h, E, m;
1780
+ try {
1781
+ const l = (P = d.authorizedEvent.payment) == null ? void 0 : P.billingContact, p = l ? F(l) : d.billingAddress ? X(d.billingAddress) : void 0, J = (E = (h = d.authorizedEvent.payment) == null ? void 0 : h.shippingContact) == null ? void 0 : E.emailAddress;
1782
+ if ((p || J) && (v("update-billing-information", { ...p, ...J && { email: J } }), await Re()), !(await ((m = s.validateOnSubmit) == null ? void 0 : m.call(s)) ?? !0)) {
1783
+ o.warn(
1784
+ "APPLE_PAY_FORM_INCOMPLETE",
1785
+ "Apple Pay authorization stopped: the checkout form is incomplete",
1786
+ O({ reason: "APPLE_PAY_FORM_INVALID" })
1787
+ ), z.reject(), v("payment-failed", new Error("The checkout form is incomplete"));
1788
+ return;
1789
+ }
1790
+ z.resolve();
1791
+ } catch (l) {
1792
+ o.error(
1793
+ "APPLE_PAY_AUTHORIZATION_FAILED",
1794
+ "Apple Pay authorization failed",
1795
+ O({ reason: "APPLE_PAY_AUTHORIZATION_FAILED", cause: l }),
1796
+ l
1797
+ ), z.reject(), v(
1798
+ "payment-failed",
1799
+ l instanceof Error ? l : new Error("Apple Pay authorization failed")
1800
+ );
1801
+ }
1802
+ }
1803
+ });
1804
+ if (!a.value) {
1805
+ o.error("APPLE_PAY_ERROR", "Apple Pay button ref not found");
1806
+ return;
1807
+ }
1808
+ try {
1809
+ if (await q.isAvailable(), i !== C)
1810
+ return;
1811
+ q.mount(a.value), I = q, v("ready");
1812
+ } catch (d) {
1813
+ o.error("APPLE_PAY_ERROR", "Apple Pay not available on this device", {}, d), i === C && v("unavailable");
1814
+ }
1815
+ }, k = () => {
1816
+ C += 1, I == null || I.unmount(), I = void 0;
1817
+ }, M = (i) => {
1818
+ if (!i.value)
1819
+ return;
1820
+ let T = i.value ?? 1, R = i.type.toLowerCase();
1821
+ if (i.type === "WEEK" && (R = "day", T = i.value * 7), R === "day" || R === "month" || R === "year" || R === "hour" || R === "minute")
1822
+ return {
1823
+ recurringPaymentIntervalUnit: R,
1824
+ recurringPaymentIntervalCount: T
1825
+ };
1826
+ }, F = (i) => {
1827
+ var T, R;
1828
+ return {
1829
+ ...((T = i.addressLines) == null ? void 0 : T[0]) && { line1: i.addressLines[0] },
1830
+ ...((R = i.addressLines) == null ? void 0 : R[1]) && { line2: i.addressLines[1] },
1831
+ ...i.administrativeArea && { state: i.administrativeArea },
1832
+ postal_code: i.postalCode,
1833
+ city: i.locality,
1834
+ country: i.countryCode
1835
+ };
1836
+ }, X = (i) => ({
1837
+ ...i.street && { line1: i.street },
1838
+ ...i.houseNumberOrName && { line2: i.houseNumberOrName },
1839
+ ...i.stateOrProvince && { state: i.stateOrProvince },
1840
+ postal_code: i.postalCode,
1841
+ city: i.city,
1842
+ country: i.country
1843
+ }), Z = (i) => i && ze(i) ? i : void 0, Q = () => {
1844
+ var T;
1845
+ const i = (T = a.value) == null ? void 0 : T.querySelector("apple-pay-button");
1846
+ if (i) {
1847
+ const R = new MouseEvent("click", {
1848
+ bubbles: !0,
1849
+ cancelable: !0,
1850
+ view: window
1851
+ });
1852
+ i.dispatchEvent(R);
1853
+ }
1854
+ }, H = async () => {
1855
+ try {
1856
+ await _();
1857
+ } catch (i) {
1858
+ o.error(
1859
+ "APPLE_PAY_ERROR",
1860
+ "Apple Pay could not be set up",
1861
+ O({ reason: "APPLE_PAY_SETUP_FAILED", cause: i }),
1862
+ i
1863
+ );
1864
+ }
1865
+ };
1866
+ return na(() => {
1867
+ H();
1868
+ }), Pe(
1869
+ // By value: `amount` is rebuilt by every invoice preview, and `onPaymentMethodSelected` asks
1870
+ // for one as the sheet opens — comparing objects would tear down the live session.
1871
+ () => [s.amount.quantity, s.amount.currency, s.billingInformation.agreement].join(
1872
+ "|"
1873
+ ),
1874
+ () => {
1875
+ k(), H();
1876
+ }
1877
+ ), Ba(k), (i, T) => (n(), x(K, null, [
1878
+ t.isVisible ? (n(), w(Ji, {
1879
+ key: 0,
1880
+ onClick: Q
1881
+ })) : $("", !0),
1882
+ S("div", Xi, [
1883
+ S("div", {
1884
+ ref_key: "applePayButtonRef",
1885
+ ref: a
1886
+ }, null, 512)
1887
+ ])
1888
+ ], 64));
1889
+ }
1890
+ }), tn = {
1891
+ key: 0,
1892
+ class: "mt-4n"
1893
+ }, an = { class: "mb-2" }, on = { class: "mt-4 h-4" }, nn = /* @__PURE__ */ se({
1894
+ __name: "ExpressPaymentMethods",
1895
+ props: {
1896
+ amount: { type: Object },
1897
+ countryCode: { type: String },
1898
+ locale: { type: String },
1899
+ paymentMethodsOptionsResponse: { type: null },
1900
+ billingInformation: { type: Object },
1901
+ onBillingInformationChange: { type: Function },
1902
+ context: { type: Object },
1903
+ validateOnSubmit: { type: Function }
1904
+ },
1905
+ emits: ["update-billing-information", "payment-success", "payment-failed"],
1906
+ setup(t) {
1907
+ const u = t, { $t: s } = he(), v = ae(!1), a = ae(!1), I = c(
1908
+ () => {
1909
+ var o;
1910
+ return (o = u.paymentMethodsOptionsResponse) == null ? void 0 : o.find(
1911
+ (L) => {
1912
+ var y;
1913
+ return (y = L.options) == null ? void 0 : y.some(
1914
+ (O) => O.name.toLowerCase() === "apple pay" && O.payment_gateway_variant === "ADYEN"
1915
+ );
1916
+ }
1917
+ );
1918
+ }
1919
+ ), C = c(() => a.value ? void 0 : I.value);
1920
+ return (o, L) => C.value ? (n(), x("div", tn, [
1921
+ S("div", an, [
1922
+ v.value ? (n(), w(e(G), {
1923
+ key: 1,
1924
+ variant: "heading-3",
1925
+ tag: "h2"
1926
+ }, {
1927
+ default: g(() => [
1928
+ D(N(e(s)({
1929
+ defaultMessage: "Subscribe instantly with",
1930
+ id: "checkout.express_payment_methods.title",
1931
+ description: "The title of the express payment methods block in the checkout form"
1932
+ })), 1)
1933
+ ]),
1934
+ _: 1
1935
+ })) : (n(), w(Ee, {
1936
+ key: 0,
1937
+ variant: "title"
1938
+ }))
1939
+ ]),
1940
+ S("div", null, [
1941
+ v.value ? $("", !0) : (n(), w(Ee, {
1942
+ key: 0,
1943
+ class: "h-11"
1944
+ })),
1945
+ b(en, {
1946
+ amount: t.amount,
1947
+ "billing-information": t.billingInformation,
1948
+ "country-code": t.countryCode,
1949
+ locale: t.locale,
1950
+ "is-visible": v.value,
1951
+ "payment-method-options-response": C.value,
1952
+ "on-billing-information-change": t.onBillingInformationChange,
1953
+ context: t.context,
1954
+ "validate-on-submit": t.validateOnSubmit,
1955
+ onReady: L[0] || (L[0] = (y) => v.value = !0),
1956
+ onUnavailable: L[1] || (L[1] = (y) => a.value = !0),
1957
+ onUpdateBillingInformation: L[2] || (L[2] = (y) => o.$emit("update-billing-information", y)),
1958
+ onPaymentSuccess: L[3] || (L[3] = (y) => o.$emit("payment-success")),
1959
+ onPaymentFailed: L[4] || (L[4] = (y) => o.$emit("payment-failed", y))
1960
+ }, null, 8, ["amount", "billing-information", "country-code", "locale", "is-visible", "payment-method-options-response", "on-billing-information-change", "context", "validate-on-submit"])
1961
+ ]),
1962
+ S("div", on, [
1963
+ v.value ? (n(), w(e(To), {
1964
+ key: 1,
1965
+ text: e(s)({
1966
+ defaultMessage: "Or",
1967
+ id: "checkout.express_payment_methods.divider_text",
1968
+ description: "The text of the divider text in the express payment methods block in the checkout form"
1969
+ }),
1970
+ "text-position": "center"
1971
+ }, null, 8, ["text"])) : (n(), w(Ee, {
1972
+ key: 0,
1973
+ variant: "divider-text"
1974
+ }))
1975
+ ])
1976
+ ])) : $("", !0);
1977
+ }
1978
+ });
1979
+ function gs(t, u = void 0) {
1980
+ const s = u ?? [], v = ct(t);
1981
+ for (const a of v)
1982
+ if (["EXACTLY_ONE", "AT_LEAST_ONE"].includes(a.selection_constraint)) {
1983
+ const I = a.pricings.map((C) => C.id);
1984
+ if (u != null && u.some((C) => I.includes(C)))
1985
+ continue;
1986
+ s.push(a.pricings[0].id);
1987
+ }
1988
+ return s;
1989
+ }
1990
+ function sn(t) {
1991
+ return ct(t).some(
1992
+ (s) => s.selection_constraint === "EXACTLY_ONE" || s.selection_constraint === "AT_LEAST_ONE"
1993
+ );
1994
+ }
1995
+ function ln(t) {
1996
+ const u = Do(t.pricing_plan_schedule_infos), s = ct(t);
1997
+ return u.some((v) => v.product_type === "ADDON") || s.some((v) => v.object_type === "ADDON");
1998
+ }
1999
+ const rn = ["TIERED", "TOP_TIERED", "STAIR_STEP"];
2000
+ function un({
2001
+ scheduleInfo: t,
2002
+ enabledPricingIds: u,
2003
+ currency: s,
2004
+ billingPeriod: v,
2005
+ intl: { $t: a, formatNumber: I }
2006
+ }) {
2007
+ if (!t) return [];
2008
+ const C = (A, U) => {
2009
+ const _ = Number(A.percentage) !== 0 && A.percentage && I(Number(A.percentage) / 100, {
2010
+ style: "percent",
2011
+ maximumFractionDigits: 4
2012
+ }), k = A.amount && !(_ && Number(A.amount.quantity) === 0) && ie(A.amount), M = U ?? a({
2013
+ defaultMessage: "unit",
2014
+ id: "checkout.order_summary_block.usage.unit_fallback",
2015
+ description: "The unit a usage price is charged per when its product names none"
2016
+ });
2017
+ return _ && k ? a(
2018
+ {
2019
+ defaultMessage: "{percentage} + {amount} / {unit}",
2020
+ id: "checkout.order_summary_block.usage.rate_percentage_amount",
2021
+ description: 'A usage price of a percentage plus an amount per unit, e.g. "1.4% + €0.25 / transaction"'
2022
+ },
2023
+ { percentage: _, amount: k, unit: M }
2024
+ ) : k ? a(
2025
+ {
2026
+ defaultMessage: "{amount} / {unit}",
2027
+ id: "checkout.order_summary_block.usage.rate_per_unit",
2028
+ description: 'A usage price per unit, e.g. "€0.05 / transaction"'
2029
+ },
2030
+ { amount: k, unit: M }
2031
+ ) : _ && U ? a(
2032
+ {
2033
+ defaultMessage: "{percentage} of {unit} value",
2034
+ id: "checkout.order_summary_block.usage.rate_percentage",
2035
+ description: 'A usage price as a percentage of what is used, e.g. "1.19% of transaction value"'
2036
+ },
2037
+ { percentage: _, unit: U }
2038
+ ) : _ || void 0;
2039
+ }, o = (A, U, _) => {
2040
+ if (!(!A.amount || Number(A.percentage) || A.fixed_amount))
2041
+ return a(
2042
+ {
2043
+ defaultMessage: "{amount} / {blockSize} {unit}",
2044
+ id: "checkout.order_summary_block.usage.rate_per_block",
2045
+ description: 'A usage price per block of units, e.g. "$0.02 / 1M tokens"'
2046
+ },
2047
+ {
2048
+ amount: ie(A.amount),
2049
+ // Compact notation rounds: 1,234,567 must not read as "1.2M".
2050
+ blockSize: I(
2051
+ U,
2052
+ Number(U.toPrecision(3)) === U ? { notation: "compact", maximumSignificantDigits: 3 } : void 0
2053
+ ),
2054
+ unit: _ ?? a({
2055
+ defaultMessage: "units",
2056
+ id: "checkout.order_summary_block.usage.units_fallback",
2057
+ description: "The units a usage price is charged per block of when its product names none"
2058
+ })
2059
+ }
2060
+ );
2061
+ }, L = (A, U, _, k) => {
2062
+ if (!(A.minimum_amount || A.maximum_amount || A.minimum_number || A.maximum_number)) {
2063
+ if (A.block_size) {
2064
+ const M = "number" in A.block_size ? Number(A.block_size.number) : 0;
2065
+ if (M !== 1)
2066
+ return _ || !(M > 1) ? void 0 : o(A, M, k ?? U);
2067
+ }
2068
+ return A.fixed_amount ? _ && !A.amount && !A.percentage ? ie(A.fixed_amount) : void 0 : _ ? void 0 : C(A, U);
2069
+ }
2070
+ }, y = (A, U, _, k) => {
2071
+ const M = {
2072
+ infinite: "",
2073
+ formatNumber: (F) => I(F),
2074
+ formatAmount: ie
2075
+ };
2076
+ return A.map((F, X) => {
2077
+ const Z = String(_o(M)(A[X - 1]) ?? "");
2078
+ return {
2079
+ label: X === A.length - 1 ? a(
2080
+ {
2081
+ defaultMessage: "{from}+",
2082
+ id: "checkout.order_summary_block.usage.tier_open",
2083
+ description: 'The last band of a tiered usage price, which has no upper bound, e.g. "20,000+"'
2084
+ },
2085
+ { from: Z }
2086
+ ) : a(
2087
+ {
2088
+ defaultMessage: "{from} - {to}",
2089
+ id: "checkout.order_summary_block.usage.tier_range",
2090
+ description: 'The range of a band of a tiered usage price, e.g. "0 - 20,000"'
2091
+ },
2092
+ { from: Z, to: ko(M)(F, A, X) ?? "" }
2093
+ ),
2094
+ rate: L(F, U, _, k)
2095
+ };
2096
+ });
2097
+ }, O = (A, U, _) => {
2098
+ var Q, H;
2099
+ const k = [...A].sort((i, T) => i.order - T.order), M = k.filter(({ conditions: i }) => !(i != null && i.name)), F = new Set(
2100
+ M.flatMap(({ conditions: i }) => (i == null ? void 0 : i.meter_properties) ?? []).map(({ id: i }) => i)
2101
+ ), X = M.filter(({ conditions: i }) => {
2102
+ var T;
2103
+ return !((T = i == null ? void 0 : i.meter_properties) != null && T.length);
2104
+ });
2105
+ if (F.size > 1 || X.length > 1) return;
2106
+ const Z = [];
2107
+ for (const { conditions: i, details: T } of k) {
2108
+ const [R, ...B] = (i == null ? void 0 : i.meter_properties) ?? [], q = ((Q = T.bands) == null ? void 0 : Q.length) === 1 ? T.bands[0] : void 0, d = (i == null ? void 0 : i.name) || (R ? !B.length && R.comparator === "EQUALS" ? R.value : void 0 : a({
2109
+ defaultMessage: "Other",
2110
+ id: "checkout.order_summary_block.usage.condition_other",
2111
+ description: 'The row of a usage price set per condition that applies when no condition matches, e.g. below "spot €6.39 / GPU-hour"'
2112
+ })), z = T.pricing_type === "FLAT" && q ? L(q, U, !1, _) : void 0;
2113
+ if (!d || !z || (H = i == null ? void 0 : i.configs) != null && H.length) return;
2114
+ Z.push({ label: d, rate: z });
2115
+ }
2116
+ return Z;
2117
+ }, j = /* @__PURE__ */ new Map();
2118
+ return Uo(za(t).pricing_categories, {
2119
+ enabledPricingIds: u
2120
+ }).forEach(({ category: A, pricing: U }) => {
2121
+ (U.items ?? []).forEach((_) => {
2122
+ var z, P, h, E, m, l;
2123
+ const k = (z = _.product_items) == null ? void 0 : z[0];
2124
+ if ((k == null ? void 0 : k.model_type) !== "USAGE_BASED") return;
2125
+ const M = zo({ pricingItem: _, currency: s, billingPeriod: v }), F = M == null ? void 0 : M.details;
2126
+ if ((F == null ? void 0 : F.pricing_type) === "NONE") return;
2127
+ const Z = [
2128
+ _.configs,
2129
+ ...(_.billing_period_configs ?? []).map((p) => p.configs),
2130
+ ...(_.pricing_currency_configs ?? []).flatMap((p) => [
2131
+ p.configs,
2132
+ ...(p.billing_period_configs ?? []).map((J) => J.configs)
2133
+ ])
2134
+ ].find((p) => M && (p == null ? void 0 : p.includes(M))) ?? [], Q = !!((h = (P = M == null ? void 0 : M.conditions) == null ? void 0 : P.configs) != null && h.length) || Z.length > 1, H = ((E = k.unit_name) == null ? void 0 : E.singular) || void 0, i = ((m = k.unit_name) == null ? void 0 : m.plural) || void 0, T = (F == null ? void 0 : F.bands) ?? [], R = T[0], B = {
2135
+ name: k.name || Fo(U) || "",
2136
+ billingPeriod: (F == null ? void 0 : F.billing_period) ?? v
2137
+ }, q = Q || F == null ? void 0 : F.pricing_type;
2138
+ Q ? B.rows = O(Z, H, i) : q && rn.includes(q) ? B.rows = y(T, H, q === "STAIR_STEP", i) : q === "FLAT" && R && (B.rate = L(R, H, !1, i));
2139
+ const d = j.get(A.product_category_id) ?? {
2140
+ name: ((l = A.product_category) == null ? void 0 : l.name) ?? "",
2141
+ prices: []
2142
+ };
2143
+ d.prices.push(B), j.set(A.product_category_id, d);
2144
+ });
2145
+ }), [...j.values()];
2146
+ }
2147
+ const cn = ["aria-expanded", "aria-label"], dn = { class: "flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2" }, pn = { class: "flex flex-row items-center gap-2" }, mn = ["onKeydown"], gn = ["aria-label"], vn = { class: "flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2" }, fn = { class: "flex flex-row items-center gap-2" }, hn = {
2148
+ class: "sr-only",
2149
+ "aria-live": "polite"
2150
+ }, oa = /* @__PURE__ */ se({
2151
+ inheritAttrs: !1,
2152
+ __name: "PromotionCodeSection",
2153
+ props: {
2154
+ promotionCode: { default: null, type: [String, null] },
2155
+ isPending: { type: Boolean, default: !1 }
2156
+ },
2157
+ emits: ["update:appliedCode", "apply", "remove"],
2158
+ setup(t, { emit: u }) {
2159
+ const { $t: s } = he(), v = t, a = u, I = ae(!1), C = ae(""), o = ae(""), L = ae(!1), y = ae(null), O = ae(null), j = no("promotion-code-"), A = `${j}-label`, U = `${j}-panel`, _ = c({
2160
+ get: () => C.value,
2161
+ set: (d) => C.value = co(d)
2162
+ }), k = c(() => v.promotionCode !== null && v.promotionCode !== ""), M = c(() => C.value.trim().length > 0), F = c(
2163
+ () => v.promotionCode ?? s({
2164
+ defaultMessage: "Promotion applied",
2165
+ id: "checkout.promotion_code.applied_label",
2166
+ description: "Fallback label for an applied promotion code in checkout"
2167
+ })
2168
+ ), X = c(
2169
+ () => I.value ? s({
2170
+ defaultMessage: "Collapse promotion code input",
2171
+ id: "checkout.promotion_code.collapse_aria_label",
2172
+ description: "Aria label for the promotion code toggle button in checkout, while the input is open"
2173
+ }) : s({
2174
+ defaultMessage: "Expand promotion code input",
2175
+ id: "checkout.promotion_code.expand_aria_label",
2176
+ description: "Aria label for the promotion code toggle button in checkout, while the input is closed"
2177
+ })
2178
+ ), Z = c(
2179
+ () => s({
2180
+ defaultMessage: "Apply promotion code",
2181
+ id: "checkout.promotion_code.apply_aria_label",
2182
+ description: "Aria label for the promotion code apply button in checkout"
2183
+ })
2184
+ ), Q = c(
2185
+ () => s({
2186
+ defaultMessage: "Remove promotion code",
2187
+ id: "checkout.promotion_code.remove_aria_label",
2188
+ description: "Aria label for the promotion code remove button in checkout"
2189
+ })
2190
+ ), H = () => {
2191
+ C.value = "";
2192
+ }, i = () => {
2193
+ var z;
2194
+ const d = (z = O.value) == null ? void 0 : z.querySelector("input");
2195
+ d instanceof HTMLInputElement && d.focus();
2196
+ }, T = () => {
2197
+ I.value && (I.value = !1);
2198
+ }, R = () => {
2199
+ k.value || (I.value = !I.value);
2200
+ }, B = () => {
2201
+ if (!M.value)
2202
+ return;
2203
+ const d = C.value.trim();
2204
+ o.value = "", L.value = !0, a("update:appliedCode", d), a("apply", d), I.value = !1;
2205
+ }, q = () => {
2206
+ L.value = !1, a("update:appliedCode", null), a("remove"), o.value = s({
2207
+ defaultMessage: "Promotion code removed",
2208
+ id: "checkout.promotion_code.removed_status",
2209
+ description: "Aria live message when a promotion code is removed in checkout"
2210
+ }), H(), Re(() => {
2211
+ var d;
2212
+ (d = y.value) == null || d.focus();
2213
+ });
2214
+ };
2215
+ return Pe(I, (d) => {
2216
+ if (!d) {
2217
+ H(), Re(() => {
2218
+ var z;
2219
+ (z = y.value) == null || z.focus();
2220
+ });
2221
+ return;
2222
+ }
2223
+ Re(() => {
2224
+ i();
2225
+ });
2226
+ }), Pe(
2227
+ () => v.promotionCode,
2228
+ (d) => {
2229
+ d || H();
2230
+ }
2231
+ ), Pe(
2232
+ () => v.isPending,
2233
+ (d) => {
2234
+ d || !L.value || (L.value = !1, k.value && (o.value = s({
2235
+ defaultMessage: "Promotion code applied",
2236
+ id: "checkout.promotion_code.applied_status",
2237
+ description: "Aria live message when a promotion code is applied in checkout"
2238
+ })));
2239
+ }
2240
+ ), (d, z) => (n(), x(K, null, [
2241
+ k.value ? (n(), w(e(fe), ve({ key: 1 }, d.$attrs, {
2242
+ "no-border": "",
2243
+ "no-spacing": "",
2244
+ "content-background": "none",
2245
+ class: "relative w-full"
2246
+ }), {
2247
+ default: g(() => [
2248
+ S("button", {
2249
+ type: "button",
2250
+ class: "w-full rounded border border-primary-900 bg-white",
2251
+ "aria-label": Q.value,
2252
+ onClick: q
2253
+ }, [
2254
+ S("div", vn, [
2255
+ S("div", fn, [
2256
+ b(e(Be), { icon: "local_activity" }),
2257
+ b(e(G), {
2258
+ variant: "body-sm",
2259
+ class: "font-semibold"
2260
+ }, {
2261
+ default: g(() => [
2262
+ D(N(F.value), 1)
2263
+ ]),
2264
+ _: 1
2265
+ })
2266
+ ]),
2267
+ b(e(Be), { icon: "close" })
2268
+ ])
2269
+ ], 8, gn)
2270
+ ]),
2271
+ _: 1
2272
+ }, 16)) : (n(), w(e(fe), ve({ key: 0 }, d.$attrs, {
2273
+ "no-spacing": "",
2274
+ class: "relative w-full"
2275
+ }), {
2276
+ default: g(() => [
2277
+ S("button", {
2278
+ ref_key: "toggleRef",
2279
+ ref: y,
2280
+ type: "button",
2281
+ class: "w-full",
2282
+ "aria-expanded": I.value,
2283
+ "aria-controls": U,
2284
+ "aria-label": X.value,
2285
+ onClick: R
2286
+ }, [
2287
+ S("div", dn, [
2288
+ S("div", pn, [
2289
+ b(e(Be), { icon: "local_activity" }),
2290
+ b(e(G), {
2291
+ id: A,
2292
+ variant: "body-sm"
2293
+ }, {
2294
+ default: g(() => [
2295
+ D(N(e(s)({
2296
+ defaultMessage: "Add promotion code",
2297
+ id: "checkout.promotion_code.add_label",
2298
+ description: "Label for adding a promotion code in checkout"
2299
+ })), 1)
2300
+ ]),
2301
+ _: 1
2302
+ })
2303
+ ]),
2304
+ b(e(Be), {
2305
+ icon: I.value ? "remove" : "add"
2306
+ }, null, 8, ["icon"])
2307
+ ])
2308
+ ], 8, cn),
2309
+ Da(S("div", {
2310
+ id: U,
2311
+ ref_key: "panelRef",
2312
+ ref: O,
2313
+ role: "region",
2314
+ "aria-labelledby": A,
2315
+ class: "flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",
2316
+ onKeydown: Vt(qe(T, ["prevent"]), ["esc"])
2317
+ }, [
2318
+ b(e(Me), {
2319
+ modelValue: _.value,
2320
+ "onUpdate:modelValue": z[0] || (z[0] = (P) => _.value = P),
2321
+ placeholder: e(s)({
2322
+ defaultMessage: "Promotion code",
2323
+ id: "checkout.promotion_code.placeholder",
2324
+ description: "Placeholder for promotion code input in checkout"
2325
+ }),
2326
+ "aria-label": e(s)({
2327
+ defaultMessage: "Promotion code",
2328
+ id: "checkout.promotion_code.input_aria_label",
2329
+ description: "Aria label for promotion code input in checkout"
2330
+ }),
2331
+ class: "w-full",
2332
+ onKeydown: Vt(qe(B, ["self", "prevent"]), ["enter"])
2333
+ }, null, 8, ["modelValue", "placeholder", "aria-label", "onKeydown"]),
2334
+ b(e(Ie), {
2335
+ type: "button",
2336
+ disabled: !M.value,
2337
+ "aria-label": Z.value,
2338
+ "aria-disabled": !M.value,
2339
+ onClick: B
2340
+ }, {
2341
+ default: g(() => [
2342
+ D(N(e(s)({
2343
+ defaultMessage: "Apply",
2344
+ id: "checkout.promotion_code.apply_button",
2345
+ description: "Button label for applying a promotion code in checkout"
2346
+ })), 1)
2347
+ ]),
2348
+ _: 1
2349
+ }, 8, ["disabled", "aria-label", "aria-disabled"])
2350
+ ], 40, mn), [
2351
+ [Ua, I.value]
2352
+ ])
2353
+ ]),
2354
+ _: 1
2355
+ }, 16)),
2356
+ S("span", hn, N(o.value), 1)
2357
+ ], 64));
2358
+ }
2359
+ }), yn = { class: "sv-checkout__header" }, bn = { class: "sv-checkout__payment-methods" }, _n = {
2360
+ key: 0,
2361
+ class: "sv-checkout__payment-methods-body"
2362
+ }, kn = {
2363
+ key: 4,
2364
+ class: "sv-checkout__payment-form"
2365
+ }, Pn = { class: "sv-checkout__order-summary" }, wn = { class: "flex flex-col gap-4" }, An = ["href"], vs = /* @__PURE__ */ se({
2366
+ __name: "Checkout",
2367
+ props: {
2368
+ configuration: { type: Object },
2369
+ source: { type: Object },
2370
+ avatar: { type: String }
2371
+ },
2372
+ setup(t) {
2373
+ const u = Bt(
2374
+ () => import("./PaymentIntegrationForm-Diua0GGJ.mjs")
2375
+ ), s = Bt(
2376
+ () => import("./PlanCustomizationEditor-KHLSEUbb.mjs")
2377
+ ), v = t, a = ae(), I = sa(), C = he(), { $t: o, locale: L } = C, { formatTimePeriod: y } = je(), { isMobileViewport: O } = ra(), j = c(() => {
2378
+ var r;
2379
+ return ((r = v.source.note.value) == null ? void 0 : r.trim()) || void 0;
2380
+ }), {
2381
+ validatedEmail: A,
2382
+ validatedCountry: U,
2383
+ subscription: _,
2384
+ orderMeterValues: k,
2385
+ quantityAddonConfigIds: M,
2386
+ isInvoicePreviewPending: F,
2387
+ isInvoicePreviewStale: X,
2388
+ isInvoicePreviewFailed: Z,
2389
+ hasSubscriptionLoadFailed: Q,
2390
+ settleInvoicePreview: H,
2391
+ checkoutForm: i,
2392
+ customerForms: T,
2393
+ planCustomizations: R,
2394
+ invoicePreview: B,
2395
+ invoicePreviewByBillingPeriod: q,
2396
+ trialInvoicePreview: d,
2397
+ trialPeriod: z,
2398
+ payment: P,
2399
+ pricingCurrency: h,
2400
+ isPaid: E,
2401
+ amount: m,
2402
+ recurringAmount: l,
2403
+ hasOneOffCharges: p,
2404
+ loadInvoicePreview: J,
2405
+ changeBillingPeriod: oe,
2406
+ saveFormStateForRedirect: ne,
2407
+ clearSavedFormState: ee,
2408
+ successUrl: me,
2409
+ cancelUrl: ye,
2410
+ isShippingAddressRequired: $e
2411
+ } = v.source, { dispatch: te, componentName: we } = Ya();
2412
+ let be = !1;
2413
+ Pe(
2414
+ () => !!(_.value && B.value),
2415
+ (r) => {
2416
+ !r || be || (be = !0, te("solvimon-ready", void 0));
2417
+ },
2418
+ { immediate: !0 }
2419
+ );
2420
+ const le = c(() => (P == null ? void 0 : P.paymentMethodOptions.value) ?? []), _e = c(() => (P == null ? void 0 : P.isPaymentMethodsPending.value) ?? !1), ke = c(
2421
+ () => (P == null ? void 0 : P.hasPaymentMethodOptionsError.value) ?? !1
2422
+ ), Le = c(() => P == null ? void 0 : P.authorizationContext.value), Ye = () => P == null ? void 0 : P.retryPaymentMethodOptions(), dt = P == null ? void 0 : P.updateInvoicePreviewOnBillingInformationChange, Ge = c(
2423
+ () => P != null && P.countryCode ? P.countryCode.value : i.form.value.country
2424
+ ), pt = c(() => {
2425
+ var r;
2426
+ return !!P && (((r = v.source.canPay) == null ? void 0 : r.value) ?? !0);
2427
+ }), He = Bo(), pa = c(
2428
+ () => {
2429
+ var r;
2430
+ return !!((r = He == null ? void 0 : He.value) != null && r["express-checkout"]);
2431
+ }
2432
+ ), Ae = ae(!1), { isFormHeld: ma, handleActionRequired: ga } = Yo(Ae), mt = c(
2433
+ () => (T == null ? void 0 : T.value.map(({ form: r }) => r)) ?? [i]
2434
+ ), gt = async () => (await Promise.all(mt.value.map((r) => r.validation.value.$validate())), mt.value.every((r) => !r.validation.value.$invalid)), va = async () => {
2435
+ !await gt() || !a.value || (vt(), a.value.submit());
2436
+ }, vt = () => {
2437
+ Ae.value = !0, de.value = null, ne == null || ne();
2438
+ }, de = ae(null), ft = () => o({
2439
+ defaultMessage: "The price changed with your last edit. Check it and pay again.",
2440
+ id: "checkout.price_changed",
2441
+ description: "Shown when a payment is held back because the customer changed the order while it waited for the price"
2442
+ }), fa = () => {
2443
+ Ae.value = !1, ge.value = void 0, ee == null || ee();
2444
+ }, Ke = ae(!1), ht = (r) => {
2445
+ var f;
2446
+ const V = (f = P == null ? void 0 : P.recoverPaymentFailure) == null ? void 0 : f.call(P, r);
2447
+ if (Ae.value = !1, ge.value = void 0, ee == null || ee(), (r == null ? void 0 : r.code) === "PAYMENT_OUTCOME_UNCONFIRMED") {
2448
+ Ke.value = !0;
2449
+ return;
2450
+ }
2451
+ if (V === "PRICE_CHANGED") {
2452
+ de.value = ft();
2453
+ return;
2454
+ }
2455
+ de.value = (r == null ? void 0 : r.message) ?? o({
2456
+ defaultMessage: "The payment did not go through. Please try again.",
2457
+ id: "checkout.payment_failed",
2458
+ description: "Error shown when a payment the customer started did not complete"
2459
+ });
2460
+ }, ha = (r) => {
2461
+ ht(r), (r == null ? void 0 : r.code) === "PAYMENT_OUTCOME_UNCONFIRMED" && (de.value = o({
2462
+ defaultMessage: "Your payment could not be confirmed yet and may still go through, so please do not pay again.",
2463
+ id: "checkout.payment_unconfirmed",
2464
+ description: "Shown when it is not yet known whether an express payment the customer made went through"
2465
+ }));
2466
+ }, ge = ae(), Ne = c(() => ge.value ? { inert: !0 } : {}), yt = async () => {
2467
+ if (!await gt()) return !1;
2468
+ const r = await H();
2469
+ return r === "CHANGED" ? (de.value = ft(), !1) : r === "FAILED" ? (de.value = o({
2470
+ defaultMessage: "The price could not be brought up to date. Please try again.",
2471
+ id: "checkout.price_not_settled",
2472
+ description: "Error shown when a payment is held back because the price of the latest changes could not be loaded"
2473
+ }), !1) : pt.value ? (m.value && (ge.value = { amount: m.value, context: Le.value }, await Re()), !0) : !1;
2474
+ }, ya = c(() => !!d.value), bt = c(
2475
+ () => {
2476
+ var r, V;
2477
+ return ((r = v.source.chargedSchedules) == null ? void 0 : r.value) ?? [
2478
+ {
2479
+ scheduleInfo: Xe.value,
2480
+ enabledPricingIds: i.form.value.enabledPricingIds,
2481
+ billingPeriod: (V = _.value) == null ? void 0 : V.billing_period
2482
+ }
2483
+ ];
2484
+ }
2485
+ ), _t = c(
2486
+ () => new Set(
2487
+ bt.value.flatMap((r) => [
2488
+ ...qo(r.scheduleInfo, {
2489
+ enabledPricingIds: r.enabledPricingIds
2490
+ })
2491
+ ])
2492
+ )
2493
+ ), kt = c(
2494
+ () => bt.value.flatMap(
2495
+ (r) => un({
2496
+ ...r,
2497
+ currency: h.value,
2498
+ intl: C
2499
+ })
2500
+ )
2501
+ ), ba = c(
2502
+ () => [..._t.value].some((r) => r !== "ONE_OFF")
2503
+ ), Ze = c(() => _t.value.has("USAGE_BASED")), _a = c(
2504
+ () => Ze.value || kt.value.length > 0 || (B.value ? Za(B.value) : !1)
2505
+ ), Ce = c(
2506
+ () => {
2507
+ var r;
2508
+ return l.value ?? ((r = B.value) == null ? void 0 : r.tax_summary.total_amount);
2509
+ }
2510
+ );
2511
+ Pe(
2512
+ () => p.value && !l.value && !!B.value,
2513
+ (r) => {
2514
+ r && I.warn(
2515
+ "RECURRING_AMOUNT_UNRESOLVED",
2516
+ "Could not tell the recurring part of the invoice from the one-off part; the mandate states the invoice total",
2517
+ {
2518
+ flow: "CHECKOUT",
2519
+ unattributedGroupTypes: B.value ? Wa(B.value).unattributedGroupTypes : []
2520
+ }
2521
+ );
2522
+ }
2523
+ );
2524
+ const We = c(
2525
+ () => ba.value || !!Ce.value && Number(Ce.value.quantity) !== 0
2526
+ ), ka = c(
2527
+ () => p.value ? l.value : void 0
2528
+ ), Pt = (r) => !!r && ["US", "CA"].includes(r), Pa = c(
2529
+ () => Pt(i.form.value.country)
2530
+ ), Je = c({
2531
+ get: () => i.form.value.enabledPricingIds ?? [],
2532
+ set: (r) => {
2533
+ i.form.value.enabledPricingIds = r;
2534
+ }
2535
+ }), Xe = c(
2536
+ () => _.value ? ua({
2537
+ pricingPlanScheduleInfos: _.value.pricing_plan_schedule_infos,
2538
+ type: "DEFAULT"
2539
+ }) : void 0
2540
+ ), wt = c(() => {
2541
+ if (!Xe.value || !_.value)
2542
+ return /* @__PURE__ */ new Set();
2543
+ const r = xo({
2544
+ pricingPlanScheduleInfo: Xe.value
2545
+ }), V = h.value, f = _.value.billing_period, Y = /* @__PURE__ */ new Set();
2546
+ return r.forEach((W, ue) => {
2547
+ V && W.currency !== V || f && W.billingPeriod && (W.billingPeriod.type !== f.type || W.billingPeriod.value !== f.value) || Y.add(ue);
2548
+ }), Y;
2549
+ }), At = (r) => c({
2550
+ get: () => {
2551
+ const V = i.form.value[r] ?? [], f = wt.value;
2552
+ return f.size ? V.filter(({ pricing_item_config_id: Y }) => f.has(Y)) : V;
2553
+ },
2554
+ set: (V) => {
2555
+ const f = i.form.value[r] ?? [], Y = wt.value;
2556
+ if (!Y.size) {
2557
+ i.form.value[r] = V;
2558
+ return;
2559
+ }
2560
+ const W = f.filter(
2561
+ ({ pricing_item_config_id: ue }) => !Y.has(ue) && !(M != null && M.value.has(ue))
2562
+ );
2563
+ i.form.value[r] = W.concat(V);
2564
+ }
2565
+ }), Qe = At("seatsValues"), et = At("unitsValues"), Ve = c(
2566
+ () => {
2567
+ var r;
2568
+ return y(((r = B.value) == null ? void 0 : r.billing_period) ?? { type: "MONTH", value: 1 }, {
2569
+ short: !0,
2570
+ singular: !0,
2571
+ hideValueForExactPeriods: !0
2572
+ });
2573
+ }
2574
+ ), wa = c(() => {
2575
+ var r;
2576
+ if (d.value)
2577
+ return o(
2578
+ {
2579
+ defaultMessage: "{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",
2580
+ id: "checkout.agreement.trial",
2581
+ description: "The agreement for the trial period"
2582
+ },
2583
+ {
2584
+ discounted_amount: Number(d.value.tax_summary.total_amount.quantity) === 0 ? o({
2585
+ defaultMessage: "Free",
2586
+ id: "checkout.agreement.trial.free",
2587
+ description: "The free amount for the trial period"
2588
+ }) : ie(d.value.tax_summary.total_amount),
2589
+ trial_period: y(z.value, { short: !0 }),
2590
+ subscription_amount: ie(
2591
+ Ce.value ?? {
2592
+ quantity: "0.00",
2593
+ currency: d.value.tax_summary.total_amount.currency
2594
+ }
2595
+ ),
2596
+ billing_period: Ve.value,
2597
+ // @ts-expect-error formatjs does not support this type yet
2598
+ start_date: new Date(xe.value)
2599
+ }
2600
+ );
2601
+ if (p.value && l.value) {
2602
+ const V = ie(
2603
+ ((r = B.value) == null ? void 0 : r.tax_summary.total_amount) ?? {
2604
+ quantity: "0.00",
2605
+ currency: l.value.currency
2606
+ }
2607
+ );
2608
+ return We.value ? Ze.value && Number(l.value.quantity) === 0 ? o(
2609
+ {
2610
+ defaultMessage: "{due_today} today, then usage billed every {billing_period} until canceled.",
2611
+ id: "checkout.agreement.usage_with_one_off",
2612
+ description: "The agreement for a usage-based subscription whose first invoice also charges something only once"
2613
+ },
2614
+ {
2615
+ due_today: V,
2616
+ billing_period: Ve.value
2617
+ }
2618
+ ) : o(
2619
+ {
2620
+ defaultMessage: "{due_today} today, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",
2621
+ id: "checkout.agreement.subscription_with_one_off",
2622
+ description: "The agreement for a subscription whose first invoice also charges something only once"
2623
+ },
2624
+ {
2625
+ due_today: V,
2626
+ subscription_amount: ie(l.value),
2627
+ billing_period: Ve.value,
2628
+ // @ts-expect-error formatjs does not support this type yet
2629
+ start_date: new Date(xe.value)
2630
+ }
2631
+ ) : o(
2632
+ {
2633
+ defaultMessage: "{due_today} today. One-time purchase.",
2634
+ id: "checkout.agreement.one_off",
2635
+ description: "The agreement for an order that is charged once and does not renew"
2636
+ },
2637
+ { due_today: V }
2638
+ );
2639
+ }
2640
+ return o(
2641
+ {
2642
+ defaultMessage: "{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",
2643
+ id: "checkout.agreement.subscription",
2644
+ description: "The agreement for the subscription"
2645
+ },
2646
+ {
2647
+ subscription_amount: Ce.value ? ie(Ce.value) : "",
2648
+ billing_period: Ve.value,
2649
+ // @ts-expect-error formatjs does not support this type yet
2650
+ start_date: new Date(xe.value)
2651
+ }
2652
+ );
2653
+ }), tt = c(
2654
+ () => {
2655
+ var r, V, f, Y;
2656
+ return ((V = (r = B.value) == null ? void 0 : r.billing_entity) == null ? void 0 : V.legal_name) || ((Y = (f = _.value) == null ? void 0 : f.billing_entity) == null ? void 0 : Y.legal_name) || void 0;
2657
+ }
2658
+ ), Ct = c(() => {
2659
+ var r;
2660
+ return {
2661
+ subscriptions: R == null ? void 0 : R.value.map((V) => V.subscription),
2662
+ invoicePreviewByBillingPeriod: q.value,
2663
+ trialInvoice: d.value,
2664
+ enabledPricingIds: Je.value,
2665
+ countryCode: i.form.value.country,
2666
+ avatar: v.avatar,
2667
+ isPaid: E.value,
2668
+ isUsageBased: _a.value,
2669
+ usagePriceGroups: kt.value,
2670
+ isUpdating: F.value || X.value,
2671
+ invoiceSections: (r = v.source.invoiceSections) == null ? void 0 : r.value
2672
+ };
2673
+ }), xt = c(() => {
2674
+ var V;
2675
+ if (!B.value)
2676
+ return;
2677
+ const r = Mo({
2678
+ subscription: _.value,
2679
+ fallback: o({
2680
+ defaultMessage: "Subscription",
2681
+ description: "The fallback name for when no subscription name can be determined",
2682
+ id: "customer_overview.subscriptions_block.fallback_subscription_name"
2683
+ })
2684
+ });
2685
+ return {
2686
+ description: r,
2687
+ managementURL: "https://www.solvimon.com/account/billing",
2688
+ agreement: wa.value,
2689
+ ...d.value && z.value && {
2690
+ trial: {
2691
+ label: o({
2692
+ defaultMessage: "Trial",
2693
+ id: "checkout.trial.label",
2694
+ description: "The label of the trial"
2695
+ }),
2696
+ amount: d.value.tax_summary.total_amount,
2697
+ startDate: at.value ? new Date(at.value) : void 0,
2698
+ endDate: Et.value ? new Date(Et.value) : void 0
2699
+ }
2700
+ },
2701
+ // Left off entirely, so the sheet mandates no charge that is never going to be made.
2702
+ ...We.value && Ce.value && {
2703
+ regular: {
2704
+ label: r,
2705
+ amount: Ce.value,
2706
+ startDate: xe.value ? new Date(xe.value) : void 0,
2707
+ interval: ((V = _.value) == null ? void 0 : V.billing_period) ?? { type: "MONTH", value: 1 }
2708
+ }
2709
+ }
2710
+ };
2711
+ }), Aa = (r) => {
2712
+ const { line1: V, line2: f, postal_code: Y, city: W, state: ue, country: nt, email: St } = r;
2713
+ i.updateInitialState({
2714
+ ...V && { addressLine1: V },
2715
+ ...f && { addressLine2: f },
2716
+ ...Y && { postalCode: Y },
2717
+ ...W && { city: W },
2718
+ ...ue && { state: ue },
2719
+ ...St && { email: St },
2720
+ ...nt && ze(nt) ? { country: nt } : {}
2721
+ });
2722
+ }, Mt = c(() => !(A && U)), at = c(() => {
2723
+ var f, Y, W;
2724
+ const r = (Y = (f = d.value) == null ? void 0 : f.periods) == null ? void 0 : Y[0], V = (W = ot.value) == null ? void 0 : W.trialStartDate;
2725
+ return r != null && r.start_at ? new Date(r.start_at) : V;
2726
+ }), ot = c(() => Eo(_.value)), Et = c(() => {
2727
+ var f, Y, W;
2728
+ const r = (Y = (f = d.value) == null ? void 0 : f.periods) == null ? void 0 : Y[0], V = (W = ot.value) == null ? void 0 : W.trialEndDate;
2729
+ return r != null && r.end_at ? new Date(r.end_at) : V;
2730
+ }), xe = c(() => {
2731
+ var f, Y, W;
2732
+ const r = (Y = (f = B.value) == null ? void 0 : f.periods) == null ? void 0 : Y[0], V = (W = ot.value) == null ? void 0 : W.subscriptionStartDate;
2733
+ return r != null && r.start_at ? new Date(r.start_at) : V;
2734
+ }), Ca = c(() => !!(i.form.value.seatsValues && i.form.value.seatsValues.length > 0 || i.form.value.unitsValues && i.form.value.unitsValues.length > 0 || _.value && sn(_.value) || _.value && ln(_.value))), {
2735
+ code: It,
2736
+ isPending: Lt,
2737
+ errorMessage: it,
2738
+ apply: xa,
2739
+ remove: Ma
2740
+ } = v.source.promotionCode, Ea = c(() => {
2741
+ var r;
2742
+ return ((r = v.source.promotionCode.isAllowed) == null ? void 0 : r.value) ?? !0;
2743
+ }), Ia = (r) => {
2744
+ It.value = r;
2745
+ }, La = (r, V) => {
2746
+ r && (r.code.value = V);
2747
+ }, Ta = () => {
2748
+ me.value && Lo(me.value);
2749
+ }, Tt = ae(!1), Na = c(
2750
+ () => !Tt.value && !!me.value
2751
+ ), Nt = () => {
2752
+ var r;
2753
+ if (P != null && P.awaitCompletion) {
2754
+ Ae.value = !0, de.value = null, P.awaitCompletion();
2755
+ return;
2756
+ }
2757
+ if (E.value = !0, ge.value = void 0, ee == null || ee(), it.value = null, de.value = null, !te("solvimon-payment-succeeded", {
2758
+ componentName: we,
2759
+ subscriptionId: (r = _.value) == null ? void 0 : r.id
2760
+ })) {
2761
+ Tt.value = !0;
2762
+ return;
2763
+ }
2764
+ Ta();
2765
+ }, Sa = () => J().catch(() => {
2766
+ });
2767
+ return (r, V) => e(Q) ? (n(), w(Wo, {
2768
+ key: 0,
2769
+ class: "sv-checkout sv-root sv-screen sv-checkout--error"
2770
+ })) : (n(), w(e(jo), {
2771
+ key: 1,
2772
+ class: ut(["sv-checkout sv-root sv-screen", { "sv-checkout--paid": e(E) }])
2773
+ }, {
2774
+ header: g(() => [
2775
+ S("div", yn, [
2776
+ b(Ee, { class: "min-h-[52px] w-96" }, {
2777
+ default: g(() => {
2778
+ var f, Y, W, ue;
2779
+ return [
2780
+ e(B) && e(_) && xe.value ? (n(), w(fi, {
2781
+ key: 0,
2782
+ class: "sv-checkout__title",
2783
+ "trial-start-date": at.value,
2784
+ "trial-period": e(z),
2785
+ "subscription-start-date": xe.value,
2786
+ "subscription-name": ((f = e(_)) == null ? void 0 : f.name) ?? "",
2787
+ amount: (Y = e(B)) == null ? void 0 : Y.invoice_amount_including_tax,
2788
+ "due-today-amount": e(m) ?? ((W = e(B)) == null ? void 0 : W.invoice_amount_including_tax),
2789
+ "recurring-amount": ka.value,
2790
+ "has-one-off-charges": e(p),
2791
+ "has-recurring-charge": We.value,
2792
+ "has-usage-charges": Ze.value,
2793
+ "billing-period": (ue = e(_)) == null ? void 0 : ue.billing_period,
2794
+ "country-code": e(i).form.value.country
2795
+ }, null, 8, ["trial-start-date", "trial-period", "subscription-start-date", "subscription-name", "amount", "due-today-amount", "recurring-amount", "has-one-off-charges", "has-recurring-charge", "has-usage-charges", "billing-period", "country-code"])) : $("", !0)
2796
+ ];
2797
+ }),
2798
+ _: 1
2799
+ })
2800
+ ])
2801
+ ]),
2802
+ content: g(() => [
2803
+ e(E) ? (n(), w(hi, {
2804
+ key: 0,
2805
+ class: "sv-checkout__completed-payment"
2806
+ })) : (n(), x(K, { key: 1 }, [
2807
+ e(_) && e(O) ? (n(), w(ta, ve({
2808
+ key: 0,
2809
+ class: "sv-checkout__mobile-order-summary"
2810
+ }, Ct.value, {
2811
+ subscription: e(_),
2812
+ invoice: e(B),
2813
+ collapsible: "collapsed",
2814
+ variant: "products-inline",
2815
+ onBillingPeriodChange: e(oe)
2816
+ }), null, 16, ["subscription", "invoice", "onBillingPeriodChange"])) : $("", !0),
2817
+ e(R) ? (n(!0), x(K, { key: 1 }, ce(e(R), (f) => (n(), x(K, {
2818
+ key: f.key
2819
+ }, [
2820
+ f.seatsValues.value.length || f.unitsValues.value.length || f.promotionCode ? (n(), w(e(s), ve({
2821
+ key: 0,
2822
+ ref_for: !0
2823
+ }, Ne.value, {
2824
+ "seats-values": f.seatsValues.value,
2825
+ "onUpdate:seatsValues": (Y) => f.seatsValues.value = Y,
2826
+ "units-values": f.unitsValues.value,
2827
+ "onUpdate:unitsValues": (Y) => f.unitsValues.value = Y,
2828
+ class: "sv-checkout__plan-customization",
2829
+ title: f.title,
2830
+ subscription: f.subscription,
2831
+ "enabled-pricing-ids": [],
2832
+ "hide-pricing-choices": "",
2833
+ "initial-seats-values": f.minimums.seatsValues,
2834
+ "initial-units-values": f.minimums.unitsValues,
2835
+ "max-seats-values": f.maximums.seatsValues,
2836
+ "max-units-values": f.maximums.unitsValues,
2837
+ "editable-config-ids": f.editableConfigIds,
2838
+ "billing-period": f.subscription.billing_period
2839
+ }), {
2840
+ default: g(() => {
2841
+ var Y, W;
2842
+ return [
2843
+ (W = (Y = f.promotionCode) == null ? void 0 : Y.isAllowed) != null && W.value ? (n(), x(K, { key: 0 }, [
2844
+ b(oa, {
2845
+ class: "sv-checkout__promotion-code",
2846
+ "promotion-code": f.promotionCode.code.value,
2847
+ "is-pending": f.promotionCode.isPending.value,
2848
+ "onUpdate:appliedCode": (ue) => La(f.promotionCode, ue),
2849
+ onRemove: f.promotionCode.remove,
2850
+ onApply: f.promotionCode.apply
2851
+ }, null, 8, ["promotion-code", "is-pending", "onUpdate:appliedCode", "onRemove", "onApply"]),
2852
+ f.promotionCode.errorMessage.value ? (n(), w(e(lt), {
2853
+ key: 0,
2854
+ class: "sv-checkout__promotion-error",
2855
+ title: f.promotionCode.errorMessage.value
2856
+ }, null, 8, ["title"])) : $("", !0)
2857
+ ], 64)) : $("", !0)
2858
+ ];
2859
+ }),
2860
+ _: 2
2861
+ }, 1040, ["seats-values", "onUpdate:seatsValues", "units-values", "onUpdate:unitsValues", "title", "subscription", "initial-seats-values", "initial-units-values", "max-seats-values", "max-units-values", "editable-config-ids", "billing-period"])) : $("", !0)
2862
+ ], 64))), 128)) : Ca.value && e(_) ? (n(), w(e(s), ve({ key: 2 }, Ne.value, {
2863
+ "seats-values": e(Qe),
2864
+ "onUpdate:seatsValues": V[0] || (V[0] = (f) => Dt(Qe) ? Qe.value = f : null),
2865
+ "units-values": e(et),
2866
+ "onUpdate:unitsValues": V[1] || (V[1] = (f) => Dt(et) ? et.value = f : null),
2867
+ "enabled-pricing-ids": Je.value,
2868
+ "onUpdate:enabledPricingIds": V[2] || (V[2] = (f) => Je.value = f),
2869
+ class: "sv-checkout__plan-customization",
2870
+ subscription: e(_),
2871
+ "initial-seats-values": e(k).seatsValues,
2872
+ "initial-units-values": e(k).unitsValues,
2873
+ "billing-period": e(_).billing_period,
2874
+ currency: e(h)
2875
+ }), null, 16, ["seats-values", "units-values", "enabled-pricing-ids", "subscription", "initial-seats-values", "initial-units-values", "billing-period", "currency"])) : $("", !0),
2876
+ e(dt) && pa.value && !Ke.value && e(i).form.value.country && e(m) && xt.value ? (n(), w(nn, {
2877
+ key: 3,
2878
+ class: "sv-checkout__express-payment-methods",
2879
+ amount: e(m),
2880
+ "country-code": e(i).form.value.country,
2881
+ locale: e(L),
2882
+ "payment-methods-options-response": le.value ?? [],
2883
+ "billing-information": xt.value,
2884
+ "on-billing-information-change": e(dt),
2885
+ context: Le.value,
2886
+ "validate-on-submit": yt,
2887
+ onUpdateBillingInformation: Aa,
2888
+ onPaymentSuccess: Nt,
2889
+ onPaymentFailed: ha
2890
+ }, null, 8, ["amount", "country-code", "locale", "payment-methods-options-response", "billing-information", "on-billing-information-change", "context"])) : $("", !0),
2891
+ e(T) ? (n(!0), x(K, { key: 4 }, ce(e(T), (f) => (n(), w(ea, ve({
2892
+ key: f.key,
2893
+ modelValue: f.form.form.value,
2894
+ "onUpdate:modelValue": (Y) => f.form.form.value = Y,
2895
+ class: "sv-checkout__customer-form",
2896
+ validation: f.form.validation,
2897
+ display: f.display,
2898
+ "is-type-locked": f.isTypeLocked,
2899
+ title: f.title,
2900
+ "show-customer-info-on-top": Mt.value || e(E),
2901
+ "is-billing-information-mandatory": Pt(f.form.form.value.country),
2902
+ "get-is-field-required": f.form.getIsFieldRequired,
2903
+ "shipping-address-format": f.form.shippingAddressFormat.value,
2904
+ "read-only": e(E)
2905
+ }, { ref_for: !0 }, Ne.value), null, 16, ["modelValue", "onUpdate:modelValue", "validation", "display", "is-type-locked", "title", "show-customer-info-on-top", "is-billing-information-mandatory", "get-is-field-required", "shipping-address-format", "read-only"]))), 128)) : (n(), w(ea, ve({
2906
+ key: 5,
2907
+ modelValue: e(i).form.value,
2908
+ "onUpdate:modelValue": V[3] || (V[3] = (f) => e(i).form.value = f),
2909
+ class: "sv-checkout__customer-form",
2910
+ validation: e(i).validation,
2911
+ "read-only-email": e(A),
2912
+ "show-customer-info-on-top": Mt.value || e(E),
2913
+ "is-billing-information-mandatory": Pa.value,
2914
+ "is-shipping-address-required": e($e),
2915
+ "get-is-field-required": e(i).getIsFieldRequired,
2916
+ "shipping-address-format": e(i).shippingAddressFormat.value,
2917
+ "read-only": e(E)
2918
+ }, Ne.value), null, 16, ["modelValue", "validation", "read-only-email", "show-customer-info-on-top", "is-billing-information-mandatory", "is-shipping-address-required", "get-is-field-required", "shipping-address-format", "read-only"])),
2919
+ S("div", bn, [
2920
+ b(Ee, {
2921
+ variant: "section",
2922
+ class: "min-h-[130px]"
2923
+ }, {
2924
+ default: g(() => [
2925
+ !_e.value || _e.value && le.value.length > 0 ? (n(), x("div", _n, [
2926
+ b(e(G), {
2927
+ variant: "heading-3",
2928
+ tag: "h2",
2929
+ class: "sv-checkout__payment-methods-title mb-2"
2930
+ }, {
2931
+ default: g(() => [
2932
+ D(N(e(o)({
2933
+ defaultMessage: "Payment method",
2934
+ id: "checkout.payment_method_block.title",
2935
+ description: "The title of the payment method block in the checkout form"
2936
+ })), 1)
2937
+ ]),
2938
+ _: 1
2939
+ }),
2940
+ e(P) ? Ge.value ? ke.value ? (n(), w(Se, {
2941
+ key: 2,
2942
+ class: "sv-checkout__payment-methods-error",
2943
+ icon: "error"
2944
+ }, {
2945
+ title: g(() => [
2946
+ D(N(e(o)({
2947
+ defaultMessage: "Could not load payment methods",
2948
+ id: "checkout.payment_method_block.load_failed_title",
2949
+ description: "The title shown when the payment methods failed to load"
2950
+ })), 1)
2951
+ ]),
2952
+ message: g(() => [
2953
+ D(N(e(o)({
2954
+ defaultMessage: "Check your connection and try again.",
2955
+ id: "checkout.payment_method_block.load_failed_message",
2956
+ description: "The message shown when the payment methods failed to load"
2957
+ })), 1)
2958
+ ]),
2959
+ action: g(() => [
2960
+ b(e(Ie), {
2961
+ type: "button",
2962
+ intent: "secondary",
2963
+ size: "sm",
2964
+ class: "sv-action sv-action--secondary sv-checkout__payment-methods-retry",
2965
+ onClick: Ye
2966
+ }, {
2967
+ default: g(() => [
2968
+ D(N(e(o)({
2969
+ defaultMessage: "Try again",
2970
+ id: "checkout.payment_method_block.load_failed_retry_button.label",
2971
+ description: "The label of the button that loads the payment methods again"
2972
+ })), 1)
2973
+ ]),
2974
+ _: 1
2975
+ })
2976
+ ]),
2977
+ _: 1
2978
+ })) : le.value.length === 0 ? (n(), w(Se, {
2979
+ key: 3,
2980
+ class: "sv-checkout__payment-methods-empty",
2981
+ icon: "credit_card_off"
2982
+ }, {
2983
+ title: g(() => [
2984
+ D(N(e(o)({
2985
+ defaultMessage: "No payment methods available",
2986
+ id: "checkout.payment_method_block.no_payment_methods_available_title",
2987
+ description: "The title shown when there are no available payment methods"
2988
+ })), 1)
2989
+ ]),
2990
+ _: 1
2991
+ })) : e(m) && Ge.value ? (n(), x("div", kn, [
2992
+ S("div", {
2993
+ class: ut({ "pointer-events-none opacity-60": e(ma) })
2994
+ }, [
2995
+ b(e(u), {
2996
+ ref_key: "paymentIntegrationFormRef",
2997
+ ref: a,
2998
+ "country-code": Ge.value,
2999
+ context: ge.value ? ge.value.context : Le.value,
3000
+ amount: ge.value ? ge.value.amount : e(m),
3001
+ email: e(i).form.value.email,
3002
+ variant: "AUTHORIZE",
3003
+ "payment-method-options": le.value ?? [],
3004
+ "validate-on-submit": yt,
3005
+ "redirects-on-success": Na.value,
3006
+ "force-store-payment-method": "",
3007
+ "billing-entity-name": tt.value,
3008
+ onPaymentSuccess: Nt,
3009
+ onPaymentFailed: ht,
3010
+ onInvalid: fa,
3011
+ onSubmitting: vt,
3012
+ onActionRequired: e(ga)
3013
+ }, null, 8, ["country-code", "context", "amount", "email", "payment-method-options", "redirects-on-success", "billing-entity-name", "onActionRequired"])
3014
+ ], 2)
3015
+ ])) : $("", !0) : (n(), w(Se, {
3016
+ key: 1,
3017
+ class: "sv-checkout__payment-methods-empty",
3018
+ icon: "captive_portal"
3019
+ }, {
3020
+ title: g(() => [
3021
+ D(N(e(o)({
3022
+ defaultMessage: "Select your billing country",
3023
+ id: "checkout.payment_method_block.no_country_selected_title",
3024
+ description: "The title shown when no country is selected"
3025
+ })), 1)
3026
+ ]),
3027
+ message: g(() => [
3028
+ D(N(e(o)({
3029
+ defaultMessage: "Payment methods will be shown after you select the billing country.",
3030
+ id: "checkout.payment_method_block.no_country_selected_message",
3031
+ description: "The message shown when no country is selected"
3032
+ })), 1)
3033
+ ]),
3034
+ _: 1
3035
+ })) : (n(), w(Se, {
3036
+ key: 0,
3037
+ class: "sv-checkout__payment-unavailable",
3038
+ icon: "credit_card_off"
3039
+ }, {
3040
+ title: g(() => [
3041
+ D(N(e(o)({
3042
+ defaultMessage: "Payment is not available yet",
3043
+ id: "checkout.payment_method_block.payment_unavailable_title",
3044
+ description: "The title shown where the payment methods go when this checkout cannot take a payment yet"
3045
+ })), 1)
3046
+ ]),
3047
+ _: 1
3048
+ }))
3049
+ ])) : $("", !0)
3050
+ ]),
3051
+ _: 1
3052
+ })
3053
+ ])
3054
+ ], 64))
3055
+ ]),
3056
+ aside: g(() => [
3057
+ S("div", Pn, [
3058
+ e(Z) && !e(B) ? (n(), w(Se, {
3059
+ key: 0,
3060
+ class: "sv-checkout__order-summary-error",
3061
+ icon: "error"
3062
+ }, {
3063
+ title: g(() => [
3064
+ D(N(e(o)({
3065
+ defaultMessage: "Could not load the price",
3066
+ id: "checkout.order_summary.load_failed_title",
3067
+ description: "The title shown in the order summary when the price of the order failed to load"
3068
+ })), 1)
3069
+ ]),
3070
+ message: g(() => [
3071
+ D(N(e(o)({
3072
+ defaultMessage: "Check your connection and try again.",
3073
+ id: "checkout.order_summary.load_failed_message",
3074
+ description: "The message shown in the order summary when the price of the order failed to load"
3075
+ })), 1)
3076
+ ]),
3077
+ action: g(() => [
3078
+ b(e(Ie), {
3079
+ type: "button",
3080
+ intent: "secondary",
3081
+ size: "sm",
3082
+ class: "sv-action sv-action--secondary sv-checkout__order-summary-retry",
3083
+ onClick: Sa
3084
+ }, {
3085
+ default: g(() => [
3086
+ D(N(e(o)({
3087
+ defaultMessage: "Try again",
3088
+ id: "checkout.order_summary.load_failed_retry_button.label",
3089
+ description: "The label of the button that loads the price of the order again"
3090
+ })), 1)
3091
+ ]),
3092
+ _: 1
3093
+ })
3094
+ ]),
3095
+ _: 1
3096
+ })) : (n(), w(Ee, {
3097
+ key: 1,
3098
+ variant: "section",
3099
+ class: "min-h-[220px]"
3100
+ }, {
3101
+ default: g(() => [
3102
+ e(_) && e(B) ? (n(), w(ta, ve({ key: 0 }, Ct.value, {
3103
+ subscription: e(_),
3104
+ invoice: e(B),
3105
+ onBillingPeriodChange: e(oe)
3106
+ }), null, 16, ["subscription", "invoice", "onBillingPeriodChange"])) : $("", !0)
3107
+ ]),
3108
+ _: 1
3109
+ }))
3110
+ ]),
3111
+ e(E) ? $("", !0) : (n(), x(K, { key: 0 }, [
3112
+ Ea.value ? (n(), w(oa, ve({
3113
+ key: 0,
3114
+ class: "sv-checkout__promotion-code"
3115
+ }, Ne.value, {
3116
+ "promotion-code": e(It),
3117
+ "is-pending": e(Lt),
3118
+ "onUpdate:appliedCode": Ia,
3119
+ onRemove: e(Ma),
3120
+ onApply: e(xa)
3121
+ }), null, 16, ["promotion-code", "is-pending", "onRemove", "onApply"])) : $("", !0),
3122
+ e(it) ? (n(), w(e(lt), {
3123
+ key: 1,
3124
+ class: "sv-checkout__promotion-error mt-2",
3125
+ title: e(it)
3126
+ }, null, 8, ["title"])) : $("", !0),
3127
+ de.value ? (n(), w(e(lt), {
3128
+ key: 2,
3129
+ class: "sv-checkout__payment-error mt-2",
3130
+ title: de.value
3131
+ }, null, 8, ["title"])) : $("", !0),
3132
+ S("div", wn, [
3133
+ b(Ee, { class: "sv-checkout__submit-skeleton min-h-10" }, {
3134
+ default: g(() => [
3135
+ e(B) ? (n(), w(e(Ie), {
3136
+ key: 0,
3137
+ type: "button",
3138
+ size: "md",
3139
+ class: "sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",
3140
+ disabled: !pt.value || e(Lt) || e(F) || e(X) || ke.value || le.value.length === 0 || Ae.value || Ke.value,
3141
+ loading: Ae.value,
3142
+ onClick: va
3143
+ }, {
3144
+ default: g(() => [
3145
+ D(N(ya.value ? e(o)({
3146
+ defaultMessage: "Start trial",
3147
+ id: "checkout.pay_and_subscribe_button_trial.label",
3148
+ description: "The label of the start trial button in the checkout form"
3149
+ }) : e(o)({
3150
+ defaultMessage: "Pay and subscribe",
3151
+ id: "checkout.pay_and_subscribe_button.label",
3152
+ description: "The label of the pay and subscribe button in the checkout form"
3153
+ })), 1)
3154
+ ]),
3155
+ _: 1
3156
+ }, 8, ["disabled", "loading"])) : $("", !0)
3157
+ ]),
3158
+ _: 1
3159
+ }),
3160
+ e(ye) ? (n(), w(e(G), {
3161
+ key: 0,
3162
+ tag: "div",
3163
+ variant: "body-xs",
3164
+ class: "sv-checkout__cancel text-center"
3165
+ }, {
3166
+ default: g(() => [
3167
+ S("a", {
3168
+ href: e(ye),
3169
+ class: "text-primary-900 hover:underline"
3170
+ }, N(tt.value ? e(o)(
3171
+ {
3172
+ defaultMessage: "Cancel and return to {name}",
3173
+ id: "checkout.cancel_link_to",
3174
+ description: "The link under the pay button that leaves the checkout without paying and goes back to the shop named by the seller"
3175
+ },
3176
+ { name: tt.value }
3177
+ ) : e(o)({
3178
+ defaultMessage: "Cancel and return",
3179
+ id: "checkout.cancel_link",
3180
+ description: "The link under the pay button that leaves the checkout without paying and goes back to the shop"
3181
+ })), 9, An)
3182
+ ]),
3183
+ _: 1
3184
+ })) : $("", !0),
3185
+ b(Go, { "payment-method-options": le.value }, null, 8, ["payment-method-options"]),
3186
+ j.value ? (n(), w(e(G), {
3187
+ key: 1,
3188
+ tag: "div",
3189
+ variant: "body-xs",
3190
+ color: "subtle",
3191
+ class: "sv-checkout__terms px-4 text-center"
3192
+ }, {
3193
+ default: g(() => [
3194
+ b(Zi, { source: j.value }, null, 8, ["source"])
3195
+ ]),
3196
+ _: 1
3197
+ })) : $("", !0)
3198
+ ])
3199
+ ], 64))
3200
+ ]),
3201
+ _: 1
3202
+ }, 8, ["class"]));
3203
+ }
3204
+ });
3205
+ function Cn() {
3206
+ return {
3207
+ /**
3208
+ * Get geolocation information from the user
3209
+ */
3210
+ getGeoLocation() {
3211
+ return fetch("https://api.country.is/").then((t) => t.json());
3212
+ }
3213
+ };
3214
+ }
3215
+ function fs({
3216
+ initialState: t,
3217
+ onRequiredFieldChange: u,
3218
+ isShippingAddressRequired: s,
3219
+ display: v,
3220
+ alsoRequired: a,
3221
+ guessCountry: I = !0
3222
+ }) {
3223
+ const C = c(() => st(s) ?? !1), o = ae(Fe(t)), L = ae(Fe(t));
3224
+ C.value && !o.value.shippingCountry && (o.value.shippingCountry = o.value.country, L.value.shippingCountry = o.value.country);
3225
+ const y = (d) => {
3226
+ const z = Fe({ ...qa(o.value), ...d });
3227
+ o.value = z, L.value = structuredClone(z);
3228
+ }, { formatOf: O } = Qa({
3229
+ isNeeded: () => C.value,
3230
+ countries: [() => o.value.shippingCountry, () => o.value.country]
3231
+ }), j = c(() => O(o.value.shippingCountry)), A = c(
3232
+ () => C.value && !o.value.billingAddressSameAsShipping
3233
+ ), U = c(
3234
+ () => A.value ? O(o.value.country) : void 0
3235
+ ), _ = c(() => {
3236
+ const d = o.value.type === "ORGANIZATION" ? [] : ["shippingLastName"];
3237
+ return [
3238
+ ...eo(o.value.country),
3239
+ ...C.value ? [
3240
+ ...Gt(
3241
+ "SHIPPING",
3242
+ o.value.shippingCountry,
3243
+ j.value
3244
+ ),
3245
+ "shippingPhoneNumber",
3246
+ ...d
3247
+ ] : [],
3248
+ ...A.value ? Gt(
3249
+ "BILLING",
3250
+ o.value.country,
3251
+ U.value
3252
+ ) : [],
3253
+ ...st(a) ?? []
3254
+ ];
3255
+ }), k = (d) => _.value.includes(d), M = po(
3256
+ c(() => {
3257
+ const d = {
3258
+ ...Ht("BILLING", () => U.value, k),
3259
+ ...Ht("SHIPPING", () => j.value, k),
3260
+ email: { required: Jt, email: mo },
3261
+ country: { required: Jt },
3262
+ companyLegalName: {
3263
+ required: go(() => o.value.type === "ORGANIZATION")
3264
+ },
3265
+ companyRegistrationNumber: rt(
3266
+ k,
3267
+ "companyRegistrationNumber"
3268
+ ),
3269
+ firstName: rt(k, "firstName"),
3270
+ lastName: rt(k, "lastName"),
3271
+ companyVatNumber: ao(o.value) ? { taxId: ro } : {},
3272
+ ...to(k)
3273
+ }, z = st(v);
3274
+ return z ? Object.fromEntries(
3275
+ Object.entries(d).map(([P, h]) => [
3276
+ P,
3277
+ ia(P) && la(z, P) !== "EDITABLE" ? {} : h
3278
+ ])
3279
+ ) : d;
3280
+ }),
3281
+ o
3282
+ ), F = Cn(), X = async () => {
3283
+ try {
3284
+ const { country: d } = await F.getGeoLocation();
3285
+ if (typeof d != "string" || !io(d))
3286
+ return;
3287
+ o.value.country || (o.value.country = d), C.value && !o.value.shippingCountry && (o.value.shippingCountry = d);
3288
+ } catch {
3289
+ }
3290
+ }, Z = [
3291
+ "type",
3292
+ "companyVatNumber",
3293
+ "seatsValues",
3294
+ "unitsValues",
3295
+ "enabledPricingIds"
3296
+ ], Q = (d) => Z.includes(d) || (C.value ? Kt("SHIPPING", o.value.shippingCountry) : Kt("BILLING", o.value.country)).includes(d), H = () => JSON.parse(JSON.stringify(o.value));
3297
+ let i = H();
3298
+ const T = (d) => Object.keys(uo({ from: i, to: d })).filter(ia).some(Q);
3299
+ Pe(
3300
+ () => [
3301
+ C.value,
3302
+ o.value.billingAddressSameAsShipping,
3303
+ o.value.shippingAddressLine1,
3304
+ o.value.shippingAddressLine2,
3305
+ o.value.shippingPostalCode,
3306
+ o.value.shippingCity,
3307
+ o.value.shippingState,
3308
+ o.value.shippingCountry,
3309
+ j.value
3310
+ ],
3311
+ () => {
3312
+ !C.value || !o.value.billingAddressSameAsShipping || Object.assign(
3313
+ o.value,
3314
+ oo(o.value, j.value)
3315
+ );
3316
+ },
3317
+ { immediate: !0 }
3318
+ );
3319
+ const R = ae(!1), B = (d) => {
3320
+ const z = T(d);
3321
+ i = d, R.value = !1, z && u(d);
3322
+ };
3323
+ Pe(
3324
+ H,
3325
+ (d) => {
3326
+ R.value = T(d);
3327
+ },
3328
+ { flush: "sync" }
3329
+ );
3330
+ const q = () => {
3331
+ R.value && B(H());
3332
+ };
3333
+ return I && Fa() && na(() => {
3334
+ t != null && t.country || X();
3335
+ }), Ho(H, B, { debounce: 200 }), {
3336
+ form: o,
3337
+ validation: M,
3338
+ getIsFieldRequired: k,
3339
+ shippingAddressFormat: j,
3340
+ updateInitialState: y,
3341
+ initialState: L,
3342
+ isPreviewStale: R,
3343
+ flushPreviewChange: q
3344
+ };
3345
+ }
3346
+ function ia(t) {
3347
+ return t in Fe();
3348
+ }
3349
+ export {
3350
+ Wo as _,
3351
+ vs as a,
3352
+ Ci as b,
3353
+ fs as u,
3354
+ gs as w
3355
+ };