@solvimon/solvimon-web 0.1.0-alpha.24 → 0.1.0-alpha.26

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 (286) hide show
  1. package/README.md +14 -11
  2. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DW10rozs.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DcrLNA_x.mjs} +6 -6
  3. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jWthTJk-.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DwbIiJBY.js} +1 -1
  4. package/dist/{Avatar.vue.es-nr8srGuK.js → Avatar.vue.es-Bm6MCMAL.js} +1 -1
  5. package/dist/{Avatar.vue.es-DzjFvLuK.mjs → Avatar.vue.es-BqQHvLGA.mjs} +1 -1
  6. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-C1prOJay.js → BillingInformation.vue_vue_type_script_setup_true_lang-0JHnqIpC.js} +1 -1
  7. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BptcwJMr.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BFza7Nf9.mjs} +8 -8
  8. package/dist/{Button.vue.es-PbJFK8z7.mjs → Button.vue.es-C32_baQN.mjs} +1 -1
  9. package/dist/{Button.vue.es-TCF-bvDF.js → Button.vue.es-qGvnOKnK.js} +1 -1
  10. package/dist/ChargeOnDemandModal-CIiI74ls.mjs +983 -0
  11. package/dist/ChargeOnDemandModal-DIQaGnRs.js +1 -0
  12. package/dist/Checkout.entry.ce-8EcavNgT.js +2 -0
  13. package/dist/{Checkout.entry.ce-DHFx5Vnb.mjs → Checkout.entry.ce-BA5ljKj8.mjs} +1562 -1538
  14. package/dist/{Chip.vue.es-DpcOM3Ai.mjs → Chip.vue.es-CKCOY5T6.mjs} +2 -2
  15. package/dist/{Chip.vue.es-CAoisngJ.js → Chip.vue.es-D60gTbfe.js} +1 -1
  16. package/dist/{ContextMenu.vue.es-kzZ3JJHG.js → ContextMenu.vue.es-C7KI8Gz6.js} +1 -1
  17. package/dist/{ContextMenu.vue.es-tAuFp-6i.mjs → ContextMenu.vue.es-Da-lAmTl.mjs} +10 -10
  18. package/dist/{CustomerBillingInformation.vue.es-BQSl9q6W.mjs → CustomerBillingInformation.vue.es-BxBQt4Q0.mjs} +2 -2
  19. package/dist/{CustomerBillingInformation.vue.es-Nac6HgLo.js → CustomerBillingInformation.vue.es-bFUx81Ig.js} +1 -1
  20. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-R47ln7Wb.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BcTZgshS.mjs} +6 -6
  21. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BOLf-U0A.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C0lJ_ESU.js} +1 -1
  22. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CaNXS48v.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DkbQ2MiR.mjs} +908 -891
  23. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-hBo2Y2mJ.js +1 -0
  24. package/dist/{DividerText.vue.es-LJ2kZakb.js → DividerText.vue.es-BF3gnr4e.js} +1 -1
  25. package/dist/{DividerText.vue.es-CSE7a-T0.mjs → DividerText.vue.es-DKl3FnDJ.mjs} +1 -1
  26. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DeotDsFP.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3QYra1x.mjs} +4 -4
  27. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-cSQeqr0A.js} +1 -1
  28. package/dist/{ErrorNotification.vue.es-BF6swP7o.js → ErrorNotification.vue.es-BX9dHEc-.js} +1 -1
  29. package/dist/{ErrorNotification.vue.es-CVUuIt8Z.mjs → ErrorNotification.vue.es-rRKgmkzV.mjs} +1 -1
  30. package/dist/{IconButton.vue.es-CB1lIPao.js → IconButton.vue.es-Bwdfu-jm.js} +1 -1
  31. package/dist/{IconButton.vue.es-DGflbWFk.mjs → IconButton.vue.es-UlqwNPAX.mjs} +2 -2
  32. package/dist/{IconTitle.vue.es-BsdjyGlQ.mjs → IconTitle.vue.es-CK9k69tV.mjs} +3 -3
  33. package/dist/{IconTitle.vue.es-CMO8EyQl.js → IconTitle.vue.es-Cei98MBw.js} +1 -1
  34. package/dist/{Input.vue.es-CREdT4nB.js → Input.vue.es-B47l_feL.js} +1 -1
  35. package/dist/{Input.vue.es-BFbiFXsU.mjs → Input.vue.es-D9IjIWc-.mjs} +2 -2
  36. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BZ4D_-7E.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DKlPrxQS.js} +1 -1
  37. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Btv0rRk4.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DUfJl07Y.mjs} +2 -2
  38. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-CrZq0d1M.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-D9Rtgapa.mjs} +2 -2
  39. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-j-cNIRD_.js → InvoiceEntryView.vue_vue_type_script_setup_true_lang-DlJ6lELc.js} +1 -1
  40. package/dist/InvoiceSummary.vue.es-DBnR9Hs7.js +1 -0
  41. package/dist/{InvoiceSummary.vue.es-JtOIQ6SJ.mjs → InvoiceSummary.vue.es-DQ4KvTaw.mjs} +576 -565
  42. package/dist/{Modal.vue.es-BbdtdxsO.js → Modal.vue.es-8LN4gBh0.js} +1 -1
  43. package/dist/{Modal.vue.es-jT61xK_A.mjs → Modal.vue.es-B9xMiyn3.mjs} +5 -5
  44. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-BBoZVnsK.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-B1yGKkWN.js} +1 -1
  45. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-Dan29qmH.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BVzL2PGe.mjs} +4 -4
  46. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D34fD3Io.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DSGf6uFP.js} +1 -1
  47. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BJZHkTqA.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-nLTPnH4j.mjs} +3 -3
  48. package/dist/{PaymentHistoryBlock-quvnCSFV.mjs → PaymentHistoryBlock-DYa99P1M.mjs} +1 -1
  49. package/dist/{PaymentHistoryBlock-Dw2wOiAI.js → PaymentHistoryBlock-Ds93gNvh.js} +1 -1
  50. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C0XIdBbx.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CBZhXQfC.js} +1 -1
  51. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-5ckQd9eQ.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D0KnSy0y.mjs} +4 -4
  52. package/dist/{PaymentIntegrationForm-D1oJREmH.js → PaymentIntegrationForm-B_Db4DG1.js} +1 -1
  53. package/dist/{PaymentIntegrationForm-CQjUZi22.mjs → PaymentIntegrationForm-UWoyZgsR.mjs} +1 -1
  54. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C0J37ZVe.js +1 -0
  55. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-J15IDbMc.mjs +154 -0
  56. package/dist/{PaymentIntegrationFormAdyen-CyZk9ofV.mjs → PaymentIntegrationFormAdyen-D4qfNtZ_.mjs} +217 -197
  57. package/dist/PaymentIntegrationFormAdyen-HeA9XIj-.js +98 -0
  58. package/dist/{PaymentIntegrationFormStripe-D-GaLHwc.mjs → PaymentIntegrationFormStripe-BIiMCWlV.mjs} +247 -220
  59. package/dist/PaymentIntegrationFormStripe-DUCJTIAq.js +102 -0
  60. package/dist/PaymentMethod.vue.es-CJcSZ9lN.js +1 -0
  61. package/dist/{PaymentMethod.vue.es-C0j580g7.mjs → PaymentMethod.vue.es-CKu5nApX.mjs} +168 -148
  62. package/dist/{PaymentMethodForm-CDV5LR8i.js → PaymentMethodForm-1d0YIGOu.js} +1 -1
  63. package/dist/{PaymentMethodForm-Bf2Ps6eV.mjs → PaymentMethodForm-B05sHWcW.mjs} +1 -1
  64. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BDm8l_6N.js +1 -0
  65. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-BqPu7CYA.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-D1yIYsb_.mjs} +45 -41
  66. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-BIX0k7-q.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-BE4S26JX.js} +1 -1
  67. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-9MUPbgWM.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-DGpXRtp4.mjs} +6 -6
  68. package/dist/PlanCustomizationEditor-CEMP_Dhz.js +1 -0
  69. package/dist/PlanCustomizationEditor-CpZeilm5.mjs +694 -0
  70. package/dist/{PricingGroupRangeInput.vue.es-CP7-dmxS.mjs → PricingGroupRangeInput.vue.es-CJpvUP3-.mjs} +4 -4
  71. package/dist/{PricingGroupRangeInput.vue.es-BchXhunH.js → PricingGroupRangeInput.vue.es-DZSJ5Mz0.js} +1 -1
  72. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DJ81eUJX.mjs +141 -0
  73. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-jrkraJMu.js +1 -0
  74. package/dist/{RadioGroupExtended.vue.es-_QMReyZ8.mjs → RadioGroupExtended.vue.es-BalV7gwp.mjs} +2 -2
  75. package/dist/{RadioGroupExtended.vue.es-Cf5R1P9a.js → RadioGroupExtended.vue.es-Dt6LH9Yh.js} +1 -1
  76. package/dist/{Section.vue.es-KRsHeFoT.mjs → Section.vue.es-D7eiXUbk.mjs} +1 -1
  77. package/dist/{Section.vue.es-CBZx5x53.js → Section.vue.es-zVXBHAL6.js} +1 -1
  78. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-UdGQMJGY.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BdjYFrVC.js} +1 -1
  79. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVELHoUj.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DudMRVka.mjs} +6 -6
  80. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D4sbq9nA.js +1 -0
  81. package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs → Skeleton.vue_vue_type_script_setup_true_lang-D60YtA9z.mjs} +5 -5
  82. package/dist/StepInput.vue.es-C3Zm6Wc9.mjs +199 -0
  83. package/dist/StepInput.vue.es-mAnuCuDQ.js +1 -0
  84. package/dist/SubscriptionDetails.entry.ce-D4CsSoR9.js +1 -0
  85. package/dist/SubscriptionDetails.entry.ce-WEimiOex.mjs +1057 -0
  86. package/dist/{SubscriptionSchedules-1ikoGncQ.js → SubscriptionSchedules-Cm5Dt-1H.js} +1 -1
  87. package/dist/{SubscriptionSchedules-B6b6xf-E.mjs → SubscriptionSchedules-DrrEAPlx.mjs} +1 -1
  88. package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Dv2bP9vv.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DHp_KtbF.mjs} +2284 -2341
  89. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-t2Awijf5.js +1 -0
  90. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DvYZvTV9.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-3VYfm6Hm.mjs} +3 -3
  91. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-B41qZmcL.js} +1 -1
  92. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DTjZcOhj.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-Bu-_clEa.js} +1 -1
  93. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DmeIKMYI.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DFU0IULg.mjs} +8 -8
  94. package/dist/{TooltipParagraph.vue.es-nGFfHF1A.mjs → TooltipParagraph.vue.es-BXbOJmjr.mjs} +3 -3
  95. package/dist/TooltipParagraph.vue.es-Cph6zT31.js +1 -0
  96. package/dist/{TrialChip.vue.es-DhC5Bpmy.js → TrialChip.vue.es-C_wgHGuN.js} +1 -1
  97. package/dist/{TrialChip.vue.es-eKgO6an3.mjs → TrialChip.vue.es-C_yRujip.mjs} +2 -2
  98. package/dist/{cn.es-BD7Afj5Q.mjs → cn.es-CGa6b2Lt.mjs} +2 -2
  99. package/dist/{cn.es-BLE3T5Rx.js → cn.es-D9YMDvG2.js} +1 -1
  100. package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
  101. package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
  102. package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
  103. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +246 -230
  104. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
  105. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
  106. package/dist/components/Invoice/Invoice.cjs +1 -1
  107. package/dist/components/Invoice/Invoice.mjs +201 -212
  108. package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
  109. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +4 -4
  110. package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
  111. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
  112. package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
  113. package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
  114. package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
  115. package/dist/components/PaymentHistory/PaymentHistory.mjs +4 -4
  116. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
  117. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
  118. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
  119. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
  120. package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
  121. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
  122. package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
  123. package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
  124. package/dist/{customElements-CSzbVZIH.js → customElements-C963-LtW.js} +36 -32
  125. package/dist/{customElements-DT1YyL4O.mjs → customElements-D5DAoHRI.mjs} +231 -196
  126. package/dist/{customer-Cq4fF__H.mjs → customer-DKa1B2vp.mjs} +4 -4
  127. package/dist/{customer-CJonIvSm.js → customer-TE1FnGT0.js} +1 -1
  128. package/dist/{de-DE-BSlbAnPE.js → de-DE-B4TUdnUf.js} +1 -1
  129. package/dist/{de-DE-CyvjSD9b.mjs → de-DE-CLfzTbbX.mjs} +39 -6
  130. package/dist/de-DE-DaBBl-Ak.js +1 -0
  131. package/dist/{de-DE-DXsG-vXA.mjs → de-DE-jkW2dJrX.mjs} +28 -14
  132. package/dist/en-US-BNevqm0M.js +1 -0
  133. package/dist/{en-US-xQrWj8qI.mjs → en-US-D6SGRAch.mjs} +39 -6
  134. package/dist/en-US-J85TQRI8.js +1 -0
  135. package/dist/{en-US-C939IZ5i.mjs → en-US-SDhjlY_v.mjs} +20 -5
  136. package/dist/formControl-ODrpUvcA.js +1 -0
  137. package/dist/{index-BPU8tIml.mjs → formControl-dX7l8o3c.mjs} +160 -143
  138. package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +4 -0
  139. package/dist/icon-sprite.svg.es-Ds6lDf5p.js +1 -0
  140. package/dist/index.cjs +1 -1
  141. package/dist/index.mjs +4 -4
  142. package/dist/{invoices-EamWI_jz.js → invoices-ClqTWYF9.js} +1 -1
  143. package/dist/{invoices-CVZOfEOY.mjs → invoices-DJTwftJv.mjs} +1 -1
  144. package/dist/it-IT-BkPbTueL.js +1 -0
  145. package/dist/{it-IT-DT3rfjOY.js → it-IT-CSYvGmpT.js} +1 -1
  146. package/dist/{it-IT-BxpwB3oJ.mjs → it-IT-CaaFToGB.mjs} +20 -6
  147. package/dist/{it-IT-C09oObBM.mjs → it-IT-Cym1UvvK.mjs} +39 -6
  148. package/dist/{nl-NL-DfkhOJKc.js → nl-NL-CpE4IgwO.js} +1 -1
  149. package/dist/{nl-NL-na2I4aiP.mjs → nl-NL-D0MQKaql.mjs} +34 -20
  150. package/dist/{nl-NL-BhNND_yi.mjs → nl-NL-D0c4x5C0.mjs} +39 -6
  151. package/dist/nl-NL-jIfAVGv0.js +1 -0
  152. package/dist/paymentMethods-AL2U_byg.js +1 -0
  153. package/dist/{paymentMethods-By1SebnO.mjs → paymentMethods-CWzJhcWK.mjs} +16 -14
  154. package/dist/{payments-Dnjg9Se4.js → payments-BmiHMlQt.js} +1 -1
  155. package/dist/{payments-BYZLQTJ-.mjs → payments-aXyfylwk.mjs} +6 -6
  156. package/dist/pricing.es-C07bgEZx.js +1 -0
  157. package/dist/pricing.es-QYWrKMUJ.mjs +30 -0
  158. package/dist/pricingPlanSchedules-BD4GIP_F.mjs +32 -0
  159. package/dist/pricingPlanSchedules-BfsMSvN0.js +1 -0
  160. package/dist/screens/Checkout/Checkout.cjs +1 -1
  161. package/dist/screens/Checkout/Checkout.mjs +2 -2
  162. package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
  163. package/dist/screens/CustomerOverview/CustomerOverview.mjs +10 -10
  164. package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
  165. package/dist/screens/PayInvoice/PayInvoice.mjs +57 -55
  166. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
  167. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
  168. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
  169. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +3 -769
  170. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
  171. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +243 -270
  172. package/dist/{subscription-CrVOr5MF.mjs → subscription-D1yHKUNc.mjs} +2 -2
  173. package/dist/{subscriptions-BKER9RUc.js → subscriptions-Cm83ckfl.js} +1 -1
  174. package/dist/{subscriptions-Gj3KgCZz.mjs → subscriptions-cnR5fnf7.mjs} +1 -1
  175. package/dist/types/components/{wallets/WalletModalShell.types.d.ts → payments/OnDemandPaymentModalShell/OnDemandPaymentModalShell.types.d.ts} +3 -3
  176. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +5 -0
  177. package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +5 -9
  178. package/dist/types/components/providers/ActionDispatchProvider/ActionDispatchProvider.vue.d.ts +7 -11
  179. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +7 -11
  180. package/dist/types/components/providers/ConfigProvider/ConfigProvider.vue.d.ts +7 -11
  181. package/dist/types/components/providers/CssOverridesProvider/CssOverridesProvider.vue.d.ts +7 -11
  182. package/dist/types/components/providers/EntryProvider/EntryProvider.vue.d.ts +7 -11
  183. package/dist/types/components/providers/ErrorBoundary/ErrorBoundary.vue.d.ts +7 -11
  184. package/dist/types/components/providers/ExperimentalFeatureProvider/ExperimentalFeatureProvider.vue.d.ts +7 -11
  185. package/dist/types/components/providers/HostElementProvider/HostElementProvider.vue.d.ts +7 -11
  186. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
  187. package/dist/types/components/providers/LoggerProvider/LoggerProvider.vue.d.ts +7 -11
  188. package/dist/types/components/providers/PortalProvider/PortalProvider.vue.d.ts +7 -11
  189. package/dist/types/components/providers/Provider/Provider.vue.d.ts +7 -11
  190. package/dist/types/components/providers/TeleportProvider/TeleportProvider.vue.d.ts +7 -11
  191. package/dist/types/components/providers/TranslationProvider/TranslationOverride.vue.d.ts +7 -11
  192. package/dist/types/components/providers/TranslationProvider/TranslationProvider.vue.d.ts +7 -11
  193. package/dist/types/components/subscriptions/ChargeOnDemandModal/ChargeOnDemandModal.types.d.ts +21 -0
  194. package/dist/types/components/subscriptions/OnDemandItemsCard/OnDemandItemsCard.types.d.ts +7 -0
  195. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.configuration.types.d.ts +27 -0
  196. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.entry.types.d.ts +1 -1
  197. package/dist/types/public/screens/SubscriptionDetails/SubscriptionDetails.types.d.ts +6 -5
  198. package/dist/types/services/paymentMethods.types.d.ts +4 -2
  199. package/dist/types/services/requests.types.d.ts +5 -0
  200. package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +5 -0
  201. package/dist/types/vendor/@solvimon/solvimon-types/types/AgentContext.d.ts +3 -0
  202. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +6 -1
  203. package/dist/types/vendor/@solvimon/solvimon-types/types/ChargeOnDemandPricingItems.d.ts +23 -0
  204. package/dist/types/vendor/@solvimon/solvimon-types/types/CustomFields.d.ts +16 -4
  205. package/dist/types/vendor/@solvimon/solvimon-types/types/Embeddable.d.ts +8 -0
  206. package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +21 -6
  207. package/dist/types/vendor/@solvimon/solvimon-types/types/OAuth.d.ts +28 -0
  208. package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +2 -1
  209. package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
  210. package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +6 -1
  211. package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +5 -0
  212. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingItemConfig.d.ts +5 -0
  213. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanGroups.d.ts +31 -0
  214. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSchedule.d.ts +9 -1
  215. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanScheduleInfo.d.ts +1 -1
  216. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +3 -3
  217. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlans.d.ts +3 -0
  218. package/dist/types/vendor/@solvimon/solvimon-types/types/Product.d.ts +2 -0
  219. package/dist/types/vendor/@solvimon/solvimon-types/types/ProductItem.d.ts +2 -0
  220. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +2 -0
  221. package/dist/types/vendor/@solvimon/solvimon-types/types/ResourceStatus.d.ts +1 -1
  222. package/dist/types/vendor/@solvimon/solvimon-types/types/SeatAssignment.d.ts +22 -0
  223. package/dist/types/vendor/@solvimon/solvimon-types/types/Wallet.d.ts +6 -0
  224. package/dist/types/vendor/@solvimon/solvimon-types/types/Workflows.d.ts +128 -1
  225. package/dist/{useActionDispatchProvider-DDHrhy3i.js → useActionDispatchProvider-CHkVQMaE.js} +1 -1
  226. package/dist/{useActionDispatchProvider-MjTckd4f.mjs → useActionDispatchProvider-DDYqIh3r.mjs} +1 -1
  227. package/dist/{useCustomer-BW0DBEJh.js → useCustomer-DGYtowRy.js} +1 -1
  228. package/dist/{useCustomer-CxnF7r8Z.mjs → useCustomer-XZKWsolE.mjs} +1 -1
  229. package/dist/{useCustomerFormLabels-zPc8QrwJ.mjs → useCustomerFormLabels-CcnkJLcB.mjs} +6 -6
  230. package/dist/useCustomerFormLabels-DAZziqYt.js +1 -0
  231. package/dist/{useExperimentalFeature-9teNYGuP.js → useExperimentalFeature-COOU6IZd.js} +1 -1
  232. package/dist/{useExperimentalFeature-NsSDg-e3.mjs → useExperimentalFeature-ierhOt9Q.mjs} +1 -1
  233. package/dist/{useInvoiceData-GQwk6fl4.mjs → useInvoiceData-BEK-7msA.mjs} +3 -3
  234. package/dist/{useInvoiceData-DvV2AsgC.js → useInvoiceData-CQRn8l9C.js} +1 -1
  235. package/dist/{useInvoicesList-Xnth6s6U.js → useInvoicesList-BQkKyyXa.js} +1 -1
  236. package/dist/{useInvoicesList-CGmFSQSg.mjs → useInvoicesList-C4I118KM.mjs} +7 -7
  237. package/dist/{useLoadInitialData-BvvaWeAe.mjs → useLoadInitialData-CR0kbYw8.mjs} +1 -1
  238. package/dist/{useLoadInitialData-Cjkc70u-.js → useLoadInitialData-CrKnBZs_.js} +1 -1
  239. package/dist/{usePaymentMethodAvailability-DKyscbom.js → usePaymentMethodAvailability-Ci6LeYKt.js} +1 -1
  240. package/dist/{usePaymentMethodAvailability-BWaaj3N3.mjs → usePaymentMethodAvailability-ZH-m3B-A.mjs} +12 -12
  241. package/dist/{usePaymentMethodOptions-l-wVAmIW.mjs → usePaymentMethodOptions-Ciifjo6c.mjs} +15 -13
  242. package/dist/usePaymentMethodOptions-Cqe92ZBn.js +1 -0
  243. package/dist/{usePaymentMethods-DvQVnsSV.mjs → usePaymentMethods-B-OKRyKd.mjs} +1 -1
  244. package/dist/{usePaymentMethods-BDFVB-kK.js → usePaymentMethods-BKwrl82-.js} +1 -1
  245. package/dist/usePayments-Bauj16B-.js +1 -0
  246. package/dist/{usePayments-D_dyuf6S.mjs → usePayments-CV85OV8V.mjs} +46 -41
  247. package/dist/{usePortal-BU4ibdWq.js → usePortal-DSLImEfr.js} +1 -1
  248. package/dist/{usePortal-Br5lYuPT.mjs → usePortal-H8Tv2TnZ.mjs} +1 -1
  249. package/dist/{useSubscription-DRBUt9H5.js → useSubscription-BiYNJT2e.js} +1 -1
  250. package/dist/{useSubscription-CqRae2I9.mjs → useSubscription-DqnxWNKg.mjs} +1 -1
  251. package/dist/{useTimePeriod.es-BxIGnCAP.mjs → useTimePeriod.es-B22-fno3.mjs} +1 -1
  252. package/dist/{useTimePeriod.es-DDos3-EH.js → useTimePeriod.es-D2aiyfd-.js} +1 -1
  253. package/dist/useWatchDebounced-B8iX7ykx.js +1 -0
  254. package/dist/useWatchDebounced-BHlBPcXB.mjs +20 -0
  255. package/package.json +11 -8
  256. package/dist/Checkout.entry.ce-D8O4qJ24.js +0 -2
  257. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D_jcV7VG.js +0 -1
  258. package/dist/InvoiceSummary.vue.es-BOnvORpf.js +0 -1
  259. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-De7h9-fH.js +0 -1
  260. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DnBLj1wZ.mjs +0 -141
  261. package/dist/PaymentIntegrationFormAdyen-BQXXwpUK.js +0 -98
  262. package/dist/PaymentIntegrationFormStripe-Bs4F7oK_.js +0 -102
  263. package/dist/PaymentMethod.vue.es-CXV_ThBY.js +0 -1
  264. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-BwsRDlQJ.js +0 -1
  265. package/dist/PlanCustomizationEditor-0kEXoOcM.js +0 -1
  266. package/dist/PlanCustomizationEditor-Dv69xPbX.mjs +0 -877
  267. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DmVJ2JQE.mjs +0 -131
  268. package/dist/PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-YsI__d0V.js +0 -1
  269. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js +0 -1
  270. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Cd56tuZb.js +0 -1
  271. package/dist/TooltipParagraph.vue.es-7IQdU3Tf.js +0 -1
  272. package/dist/de-DE-DXsDvO5y.js +0 -1
  273. package/dist/en-US-9xdcz3T5.js +0 -1
  274. package/dist/en-US-DHdI11k9.js +0 -1
  275. package/dist/icon-sprite.svg.es-Bt21fMEt.mjs +0 -4
  276. package/dist/icon-sprite.svg.es-Dauis9LS.js +0 -1
  277. package/dist/index-DwueOtPi.js +0 -1
  278. package/dist/it-IT-CcRIzP1A.js +0 -1
  279. package/dist/nl-NL-5PrgQl8q.js +0 -1
  280. package/dist/paymentMethods-Bwym8l9a.js +0 -1
  281. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagement.types.d.ts +0 -47
  282. package/dist/useCustomerFormLabels-C773h3J0.js +0 -1
  283. package/dist/usePaymentMethodOptions-DuXKS36F.js +0 -1
  284. package/dist/usePayments-CIJocDhR.js +0 -1
  285. package/dist/useWatchDebounced-CAU1WI1P.js +0 -1
  286. package/dist/useWatchDebounced-DT5IicPp.mjs +0 -14
@@ -1,2 +0,0 @@
1
- const e=require("vue"),k=require("./customElements-CSzbVZIH.js"),ut=require("./useTimePeriod.es-DDos3-EH.js"),te=require("./formatting.es-C72Nsrmh.js"),ne=require("./Button.vue.es-TCF-bvDF.js"),Ot=require("./ErrorNotification.vue.es-BF6swP7o.js"),zt=require("./countryData.es-C4jHBzfo.js"),Rt=require("./subscriptions-BKER9RUc.js"),me=require("./error-CmduqgVq.js"),dt=require("./TrialChip.vue.es-DhC5Bpmy.js"),jt=require("./useService-H7BjLg8P.js"),$t=require("./invoices-EamWI_jz.js"),re=require("./pricingPlanSchedule-BM8vsKkV.js"),ie=require("./index-DwueOtPi.js"),Ne=require("./useCustomerFormLabels-C773h3J0.js"),Ut=require("./useWatchDebounced-CAU1WI1P.js"),Ft=require("./usePaymentMethodOptions-DuXKS36F.js"),Me=require("./subscription-ZA62t4E9.js"),Be=require("./pricing-BVAld27Y.js"),de=require("./url-vloPOiXd.js"),he=require("./adyen-Druit6gz.js"),Gt=require("./usePortal-BU4ibdWq.js"),Yt=require("./getCountryNameByCode.es-Xxc0nZsH.js"),tt=require("./Expand.vue.es-BtM0EZEr.js"),ae=require("./Input.vue.es-CREdT4nB.js"),oe=require("./Section.vue.es-CBZx5x53.js"),Kt=require("./Alert.vue.es-RyK53a2P.js"),qt=require("./customer-CJonIvSm.js"),ge=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js"),Se=require("./TooltipParagraph.vue.es-7IQdU3Tf.js"),Qt=require("./PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D34fD3Io.js"),nt=require("./Chip.vue.es-CAoisngJ.js"),pt=require("./SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-UdGQMJGY.js"),Ht=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js"),mt=require("./useViewport-hPRVDWCm.js"),se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),Zt=require("./DividerText.vue.es-LJ2kZakb.js"),Ae=require("./adyenSdk-BP2XXzeJ.js"),Xt=require("./payments-Dnjg9Se4.js"),Wt=require("./paymentFailure-Cki8c5BX.js"),Jt=require("./ContentWithAsideLayout-RSdKXqAf.js"),en=require("./cn.es-BLE3T5Rx.js"),tn=require("./sessionReference-m_6Rp4X1.js"),nn={AT:"Austria",BE:"Belgium",BG:"Bulgaria",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GR:"Greece",HR:"Croatia",HU:"Hungary",IE:"Ireland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SE:"Sweden",SI:"Slovenia",SK:"Slovakia"};function gt(t){return Object.keys(nn).includes(t)}function ot(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,i)}return o}function be(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?ot(Object(o),!0).forEach(function(i){on(t,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ot(Object(o)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(o,i))})}return t}function on(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function Ee(t){return typeof t=="function"}function Le(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Pe(t){return Ee(t.$validator)?be({},t):{$validator:t}}function ft(t){return typeof t=="object"?t.$valid:t}function yt(t){return t.$validator||t}function an(t,n){if(!Le(t))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof t}`);if(!Le(n)&&!Ee(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Pe(n);return o.$params=be(be({},o.$params||{}),t),o}function rn(t,n){if(!Ee(t)&&typeof e.unref(t)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof t}`);if(!Le(n)&&!Ee(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const o=Pe(n);return o.$message=t,o}function ln(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=Pe(t);return be(be({},o),{},{$async:!0,$watchTargets:n})}function sn(t){return{$validator(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return e.unref(n).reduce((l,c,m)=>{const u=Object.entries(c).reduce((_,g)=>{let[v,M]=g;const p=t[v]||{},E=Object.entries(p).reduce((x,f)=>{let[I,N]=f;const B=yt(N).call(this,M,c,m,...i),d=ft(B);if(x.$data[I]=B,x.$data.$invalid=!d||!!x.$data.$invalid,x.$data.$error=x.$data.$invalid,!d){let S=N.$message||"";const A=N.$params||{};typeof S=="function"&&(S=S({$pending:!1,$invalid:!d,$params:A,$model:M,$response:B})),x.$errors.push({$property:v,$message:S,$params:A,$response:B,$model:M,$pending:!1,$validator:I})}return{$valid:x.$valid&&d,$data:x.$data,$errors:x.$errors}},{$valid:!0,$data:{},$errors:[]});return _.$data[v]=E.$data,_.$errors[v]=E.$errors,{$valid:_.$valid&&E.$valid,$data:_.$data,$errors:_.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:l.$valid&&u.$valid,$data:l.$data.concat(u.$data),$errors:l.$errors.concat(u.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:o}=n;return o?o.$errors.map(i=>Object.values(i).map(a=>a.map(l=>l.$message)).reduce((a,l)=>a.concat(l),[])):[]}}}const vt=t=>{if(t=e.unref(t),Array.isArray(t))return!!t.length;if(t==null)return!1;if(t===!1)return!0;if(t instanceof Date)return!isNaN(t.getTime());if(typeof t=="object"){for(let n in t)return!0;return!1}return!!String(t).length},cn=t=>(t=e.unref(t),Array.isArray(t)?t.length:typeof t=="object"?Object.keys(t).length:String(t).length);function ce(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return i=>(i=e.unref(i),!vt(i)||n.every(a=>(a.lastIndex=0,a.test(i))))}var un=Object.freeze({__proto__:null,forEach:sn,len:cn,normalizeValidatorObject:Pe,regex:ce,req:vt,unwrap:e.unref,unwrapNormalizedValidator:yt,unwrapValidatorResponse:ft,withAsync:ln,withMessage:rn,withParams:an});ce(/^[a-zA-Z]*$/);ce(/^[a-zA-Z0-9]*$/);ce(/^\d*(\.\d+)?$/);const dn=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;ce(dn);const pn=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;ce(pn);ce(/(^[0-9]*$)|(^-[0-9]+$)/);ce(/^[-]?\d*(\.\d+)?$/);function xe(t){return!!zt.countryData.find(n=>n.key===t)}const _t={AT:{regex:/^ATU\d{8}$/,prefix:"AT",example:"ATU12345678"},BE:{regex:/^BE0?\d{9}$/,prefix:"BE",example:"BE0123456789"},BG:{regex:/^BG\d{9,10}$/,prefix:"BG",example:"BG123456789"},HR:{regex:/^HR\d{11}$/,prefix:"HR",example:"HR12345678901"},CY:{regex:/^CY\d{8}[A-Z]$/,prefix:"CY",example:"CY12345678X"},CZ:{regex:/^CZ\d{8,10}$/,prefix:"CZ",example:"CZ12345678"},DE:{regex:/^DE\d{9}$/,prefix:"DE",example:"DE123456789"},DK:{regex:/^DK\d{8}$/,prefix:"DK",example:"DK12345678"},EE:{regex:/^EE\d{9}$/,prefix:"EE",example:"EE123456789"},GR:{regex:/^(EL|GR)\d{9}$/,prefix:"GR",example:"GR123456789"},ES:{regex:/^ES[A-Z0-9]\d{7}[A-Z0-9]$/,prefix:"ES",example:"ESX1234567X"},FI:{regex:/^FI\d{8}$/,prefix:"FI",example:"FI12345678"},FR:{regex:/^FR[0-9A-Z]{2}\d{9}$/,prefix:"FR",example:"FRXX123456789"},HU:{regex:/^HU\d{8}$/,prefix:"HU",example:"HU12345678"},IE:{regex:/^IE[0-9A-Z]{8,9}$/,prefix:"IE",example:"IE1234567A"},IS:{regex:/^IS\d{5}$/,prefix:"IS",example:"IS12345"},IT:{regex:/^IT\d{11}$/,prefix:"IT",example:"IT12345678901"},LT:{regex:/^LT(\d{9}|\d{12})$/,prefix:"LT",example:"LT123456789 or LT123456789012"},LU:{regex:/^LU\d{8}$/,prefix:"LU",example:"LU12345678"},LV:{regex:/^LV\d{11}$/,prefix:"LV",example:"LV12345678901"},ME:{regex:/^ME\d{9}$/,prefix:"ME",example:"ME123456789"},MT:{regex:/^MT\d{8}$/,prefix:"MT",example:"MT12345678"},NL:{regex:/^NL\d{9}B\d{2}$/,prefix:"NL",example:"NL123456789B01"},PL:{regex:/^PL\d{10}$/,prefix:"PL",example:"PL1234567890"},PT:{regex:/^PT\d{9}$/,prefix:"PT",example:"PT123456789"},RO:{regex:/^RO\d{2,10}$/,prefix:"RO",example:"RO1234567890"},RU:{regex:/^RU(\d{9}|\d{10}|\d{12})$/,prefix:"RU",example:"RU123456789 or RU1234567890 or RU123456789012"},SE:{regex:/^SE\d{10}01$/,prefix:"SE",example:"SE123456789001"},SI:{regex:/^SI\d{8}$/,prefix:"SI",example:"SI12345678"},SK:{regex:/^SK\d{10}$/,prefix:"SK",example:"SK1234567890"},CH:{regex:/^CHE\d{9}(MWST|TVA|IVA)?$/,prefix:"CHE",example:"CHE123456789MWST"},NO:{regex:/^NO\d{9}MVA$/,prefix:"NO",example:"NO123456789MVA"},GB:{regex:/^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,prefix:"GB",example:"GB123456789"},XI:{regex:/^XI(\d{9}|\d{12})$/,prefix:"XI",example:"XI123456789"}},mn=t=>!t||typeof t!="string"||t.trim()===""?!0:Object.values(_t).some(n=>n.regex.test(t)),gn=({$model:t})=>{if(!t||typeof t!="string"||t.trim()==="")return"";const n=e.inject(k.I18N_INJECTION_KEY,null);if(!n)return"Invalid tax ID";const{formatMessage:o}=n,i=Object.values(_t).find(a=>t.toUpperCase().startsWith(a.prefix.toUpperCase()));return i?o({defaultMessage:"Invalid tax ID format. Example: {example}",id:"form_validation.tax_id.invalid_format",description:"Error message when tax ID format is invalid but prefix matches"},{example:i.example}):o({defaultMessage:"Invalid tax ID",id:"taxId.invalid",description:"Error message when tax ID is invalid"})},Ve=un.withMessage(gn,mn),fn="preview",yn="NL",ht=t=>{var n,o;if("organization"in t)return(n=t.organization)==null?void 0:n.registered_address;if("individual"in t)return(o=t.individual)==null?void 0:o.residential_address},vn=t=>{const n=ht(t);return{...(n==null?void 0:n.line1)&&{line1:n.line1},...(n==null?void 0:n.line2)&&{line2:n.line2},...(n==null?void 0:n.city)&&{city:n.city},...(n==null?void 0:n.state)&&{state:n.state},country:(n==null?void 0:n.country)||yn,...(n==null?void 0:n.postal_code)&&{postal_code:n.postal_code}}},_n=t=>{var i,a;const n=vn(t),o=t.type??"INDIVIDUAL";if(o==="ORGANIZATION"){const l="organization"in t?t.organization:void 0,c=(a=(i=l==null?void 0:l.tax_ids)==null?void 0:i[0])==null?void 0:a.id;return{type:o,organization:{legal_name:(l==null?void 0:l.legal_name)||fn,registered_address:n,...c&&{tax_id:Ve.$validator(c,{},{})?c:void 0}}}}return{type:o,individual:{residential_address:n}}},hn={AD:"EUR",AE:"AED",AF:"AFN",AG:"XCD",AI:"XCD",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AS:"USD",AT:"EUR",AU:"AUD",AW:"AWG",AX:"EUR",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BH:"BHD",BI:"BIF",BJ:"XOF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BQ:"USD",BR:"BRL",BS:"BSD",BT:"BTN",BV:"NOK",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CC:"AUD",CD:"CDF",CF:"XAF",CG:"XAF",CH:"CHF",CI:"XOF",CK:"NZD",CL:"CLP",CM:"XAF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CW:"ANG",CX:"AUD",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DM:"XCD",DO:"DOP",DZ:"DZD",EC:"USD",EE:"EUR",EG:"EGP",EH:"MAD",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",FR:"EUR",GA:"XAF",GB:"GBP",GD:"XCD",GE:"GEL",GF:"EUR",GG:"GBP",GH:"GHS",GI:"GIP",GL:"DKK",GM:"GMD",GN:"GNF",GP:"EUR",GQ:"XAF",GR:"EUR",GS:"GBP",GT:"GTQ",GU:"USD",GW:"XOF",GY:"GYD",HK:"HKD",HM:"AUD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IM:"GBP",IN:"INR",IO:"USD",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JE:"GBP",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KI:"AUD",KM:"KMF",KN:"XCD",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LC:"XCD",LI:"CHF",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MF:"EUR",MG:"MGA",MH:"USD",MK:"MKD",ML:"XOF",MM:"MMK",MN:"MNT",MO:"MOP",MP:"USD",MQ:"EUR",MR:"MRU",MS:"XCD",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NR:"AUD",NU:"NZD",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PF:"XPF",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PM:"EUR",PN:"NZD",PR:"USD",PS:"ILS",PT:"EUR",PW:"USD",PY:"PYG",QA:"QAR",RE:"EUR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SJ:"NOK",SK:"EUR",SL:"SLE",SM:"EUR",SN:"XOF",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"USD",SX:"ANG",SY:"SYP",SZ:"SZL",TC:"USD",TD:"XAF",TF:"EUR",TG:"XOF",TH:"THB",TJ:"TJS",TK:"NZD",TL:"USD",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TV:"AUD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYU",UZ:"UZS",VA:"EUR",VC:"XCD",VE:"VES",VG:"USD",VI:"USD",VN:"VND",VU:"VUV",WF:"XPF",WS:"WST",YE:"YER",YT:"EUR",ZA:"ZAR",ZM:"ZMW",ZW:"ZWL"},Mn=t=>{if(t)return hn[t]},Mt=({country:t,pricingCurrencySettings:n,fallbackCurrency:o})=>{const i=Mn(t),a=(n==null?void 0:n.pricing_currencies)??[];return i&&a.includes(i)?i:(n==null?void 0:n.default_pricing_currency)??o??i},bn=()=>{const{getInvoicePreview:t}=$t.createInvoicesService(),n=k.useLogger(),o=e.ref(),i=e.ref(),a=e.ref(),l=e.ref({}),c=e.ref(me.ApiStatus.Initial),m=e.ref({}),u=e.ref(),_=v=>`${v.type}:${v.value}`;return{loadInvoicePreview:async({subscription:v,subscriptionStartAt:M,customer:p={},seatsValues:E,unitsValues:x,enabledPricingIds:f,promotionCode:I})=>{var h,y,C,w,O,z;const N=_n(p);c.value=me.ApiStatus.Loading;const L=re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,type:"DEFAULT"}),B=(h=L==null?void 0:L.pricing_plan_version)==null?void 0:h.pricing_currency_settings,d=(((y=B==null?void 0:B.pricing_currencies)==null?void 0:y.length)??0)>1,S=((w=(C=L==null?void 0:L.pricing_plan_version)==null?void 0:C.billing_period_settings)==null?void 0:w.billing_periods)??[],A=S.length>1,U=S.length>0?S.map(({period:R})=>R):v.billing_period?[v.billing_period]:[],V=Mt({country:(O=ht(p))==null?void 0:O.country,pricingCurrencySettings:B,fallbackCurrency:v.billing_currency});if(!U.length){n.warn("INVOICE_PREVIEW_SKIPPED","No billing period to preview an invoice for",{subscriptionId:v.id}),c.value=me.ApiStatus.Done;return}const s=v.billing_period?_(v.billing_period):_(U[0]),r=U.map(async R=>{var q;const Q=_(R),Y=re.getScheduleCustomizations({enabledPricings:f==null?void 0:f.map(G=>({pricing_id:G})),seatsValues:E,unitsValues:x,pricingPlanScheduleInfos:v.pricing_plan_schedule_infos,pricingCurrency:d?V:void 0,billingPeriod:A?R:void 0})??[];if(I){const G=(q=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:F})=>F.type==="DEFAULT"))==null?void 0:q.id;if(G){const F=Y.find(({pricing_plan_schedule_id:Z})=>Z===G);F?F.promotion_codes=[I]:Y.push({pricing_plan_schedule_id:G,promotion_codes:[I]})}}const K={pricingPlanSubscriptionId:v.id,startAt:M,customizations:Y,customer:N},H=m.value[Q];if(H&&jt.isEqual(K,H))return{periodKey:Q,response:void 0};m.value={...m.value,[Q]:K};const T=await t(K);return{periodKey:Q,response:T}});try{const R={...l.value},Q=await Promise.all(r),Y=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:H})=>H.type==="TRIAL"),K=(z=v.pricing_plan_schedule_infos.find(({pricing_plan_schedule:H})=>H.type==="DEFAULT"))==null?void 0:z.id;Q.forEach(({periodKey:H,response:T})=>{var F;if(!T)return;u.value=(F=T.invoice_infos.at(-1))==null?void 0:F.pricing_plan_schedule_id,Y&&(i.value=T.first_invoice,Y.start_at&&Y.end_at&&(o.value=dt.convertDateRangeToTimePeriod(new Date(Y.start_at),new Date(Y.end_at))));const q=T.invoice_infos.find(({pricing_plan_schedule_id:Z})=>Z===K),G=q==null?void 0:q.invoices[0];G&&(R[H]=G)}),l.value=R,a.value=R[s]}catch(R){throw c.value=me.ApiStatus.Failed,n.error("INVOICE_PREVIEW_FAILED","Failed to load invoice preview",{},R),R}finally{c.value=me.ApiStatus.Done}},invoicePreview:a,invoicePreviewByBillingPeriod:l,trialInvoicePreview:i,trialPeriod:o,lastPreviewScheduleId:u,isPending:e.computed(()=>c.value===me.ApiStatus.Loading)}},it=["email","country"],bt="GENERIC_TAX_ID",at={US:["addressLine1","postalCode"],CA:["state"]},In=t=>!t||!at[t]?it:[...at[t],...it],rt=t=>{const n={...t.addressLine1&&{line1:t.addressLine1},...t.addressLine2&&{line2:t.addressLine2},...t.city&&{city:t.city},...t.state&&{state:t.state},...t.postalCode&&{postal_code:t.postalCode},country:t.country??""};return t.type==="ORGANIZATION"?{type:"ORGANIZATION",organization:{legal_name:t.companyLegalName??"",registered_address:n,...t.companyVatNumber&&{tax_ids:[{id:t.companyVatNumber,type:bt}]}}}:{type:"INDIVIDUAL",individual:{residential_address:n}}};function Nn(){return{getGeoLocation(){return fetch("https://api.country.is/").then(t=>t.json())}}}function Cn({initialState:t,onRequiredFieldChange:n}){const o=e.ref(Ce(t)),i=e.ref(Ce(t)),a=g=>{const v=Ce({...e.toRaw(o.value),...g});o.value=v,i.value=structuredClone(v)},l=e.computed(()=>In(o.value.country)),c=g=>l.value.includes(g),m=ie.useValidation({email:{required:ie.required,email:ie.email},country:{required:ie.required},state:{required:ie.requiredIf(()=>c("state"))},addressLine1:{required:ie.requiredIf(()=>c("addressLine1"))},postalCode:{required:ie.requiredIf(()=>c("postalCode"))},companyLegalName:ie.requiredIf(o.value.type==="ORGANIZATION"),companyVatNumber:{taxId:Ve}},o),u=g=>{g||Nn().getGeoLocation().then(({country:v})=>{o.value.country=v})},_=(g,v)=>{const M=Ne.objectDiff({from:v,to:g}),p=Object.keys(M).find(En);if(p){if(["type","companyVatNumber"].includes(p)){n(g);return}if(p==="seatsValues"){n(g);return}if(p==="unitsValues"){n(g);return}if(p==="enabledPricingIds"){n(g);return}if(p!=="email"&&c(p)){n(g);return}}};return e.onMounted(async()=>{await u(t==null?void 0:t.country)}),Ut.useWatchDebounced(()=>JSON.parse(JSON.stringify(o.value)),_,{debounce:200}),{form:o,validation:m,getIsFieldRequired:c,updateInitialState:a,initialState:i}}const Ce=(t={})=>({email:void 0,country:void 0,type:"INDIVIDUAL",companyLegalName:void 0,firstName:void 0,infix:void 0,lastName:void 0,addressLine1:void 0,addressLine2:void 0,postalCode:void 0,city:void 0,state:void 0,companyVatNumber:void 0,seatsValues:void 0,unitsValues:void 0,enabledPricingIds:void 0,...t});function En(t){return t in Ce()}function An(t,n=void 0){const o=n??[],i=Me.getPricingGroupsFromExtendedPricingPlanSubscription(t);for(const a of i)if(["EXACTLY_ONE","AT_LEAST_ONE"].includes(a.selection_constraint)){const l=a.pricings.map(c=>c.id);if(n!=null&&n.some(c=>l.includes(c)))continue;o.push(a.pricings[0].id)}return o}function Pn(t){return Me.getPricingGroupsFromExtendedPricingPlanSubscription(t).some(o=>o.selection_constraint==="EXACTLY_ONE"||o.selection_constraint==="AT_LEAST_ONE")}function xn(t){const n=Be.getAllPricingsFromScheduleInfos(t.pricing_plan_schedule_infos),o=Me.getPricingGroupsFromExtendedPricingPlanSubscription(t);return n.some(i=>i.product_type==="ADDON")||o.some(i=>i.object_type==="ADDON")}const lt=t=>(t??[]).flatMap(n=>n.configs??[]),It=t=>[...t.configs??[],...lt(t.billing_period_configs),...(t.pricing_currency_configs??[]).flatMap(n=>[...n.configs??[],...lt(n.billing_period_configs)])];function Dn({pricings:t,pricingItemConfigId:n}){var l,c;const o=t.flatMap(m=>m.items??[]).find(m=>{var u;return(u=m.configs)==null?void 0:u.some(_=>_.id===n)}),i=(l=o==null?void 0:o.configs)==null?void 0:l.find(m=>m.id===n),a=(c=o==null?void 0:o.product_items)==null?void 0:c[0];return{config:i,productItem:a}}const Nt="1";function kn(t){const n=Be.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(It);return new Map(n.flatMap(o=>{var i;return(i=o.default_seats_value)!=null&&i.number?[[o.id,o.default_seats_value.number]]:[]}))}function wn(t){var i;const n=(i=t==null?void 0:t.pricing_plan_schedule)==null?void 0:i.seats_values;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?kn(t):new Map;return n.map(({pricing_item_config_id:a,number:l})=>({pricing_item_config_id:a,number:l||o.get(a)||Nt}))}const Ct="1";function Sn(t){const n=Be.getPricingsFromScheduleInfo(t).flatMap(o=>o.items??[]).flatMap(It);return new Map(n.flatMap(o=>{var i;return(i=o.default_units)!=null&&i.number?[[o.id,o.default_units.number]]:[]}))}function Tn(t){var i;const n=(i=t==null?void 0:t.pricing_plan_schedule)==null?void 0:i.units;if(!t||!(n!=null&&n.length))return;const o=t.pricing_plan_version?Sn(t):new Map;return n.map(({pricing_item_config_id:a,number:l})=>({pricing_item_config_id:a,number:l||o.get(a)||Ct}))}const Te="solvimon_checkout_redirect_state";function Ln({initialCountry:t,initialEmail:n,subscriptionId:o,enabledPricingIds:i}){const a=k.useLogger(),l=(()=>{if(t){if(xe(t))return t;a.error("INVALID_COUNTRY_CODE",`invalid country code provided: "${t}"`)}})(),c=(()=>{if(n){if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return n;a.error("INVALID_EMAIL",`invalid email provided: "${n}"`)}})(),m=e.ref(!1),u=e.ref(),{getSubscription:_}=Rt.createSubscriptionsService(),g=bn(),v=e.computed(()=>u.value&&d.form.value.country&&U.value),{paymentMethodOptions:M,get:p,isPending:E,error:x}=Ft.usePaymentMethodOptions(),f=async(s,r)=>{try{await p({subscriptionId:u.value.id,country:s,amount:r})}catch{a.error("PAYMENT_METHOD_OPTIONS_LOAD_FAILED","Failed to load the payment methods the checkout can offer",{},x.value)}},I=e.computed(()=>x.value!==null),N=()=>{const{country:s}=d.form.value;!u.value||!s||!U.value||f(s,U.value)},L=()=>{const s=d.form.value;return g.loadInvoicePreview({subscription:u.value,customer:rt(s),seatsValues:s.seatsValues,unitsValues:s.unitsValues,enabledPricingIds:s.enabledPricingIds??i,promotionCode:s.promotionCode})},B=async s=>{const r=s.promotionCode??d.form.value.promotionCode,h=s.enabledPricingIds??d.form.value.enabledPricingIds,y={...d.form.value,...s};return await g.loadInvoicePreview({subscription:u.value,customer:rt(y),seatsValues:y.seatsValues,unitsValues:y.unitsValues,enabledPricingIds:h,promotionCode:r}),{trialInvoicePreview:g.trialInvoicePreview.value,invoicePreview:g.invoicePreview.value}},d=Cn({initialState:{country:l,email:c},onRequiredFieldChange:()=>{u.value&&L().catch(()=>{})}}),S=async()=>{var w,O,z,R;const s=await _({id:o,expanded:!0}),r=re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:s.pricing_plan_schedule_infos,type:"DEFAULT"}),h=(R=(z=(O=(w=r==null?void 0:r.pricing_plan_version)==null?void 0:w.billing_period_settings)==null?void 0:O.billing_periods)==null?void 0:z[0])==null?void 0:R.period;u.value={...s,billing_period:h??s.billing_period};const y=wn(r),C=Tn(r);d.updateInitialState({...d.form.value,enabledPricingIds:An(s,i),...y?{seatsValues:y}:{},...C?{unitsValues:C}:{}})},A=e.computed(()=>{var Y,K,H,T,q,G,F,Z,W;const s=d.form.value.firstName||d.form.value.infix||d.form.value.lastName?{...d.form.value.firstName?{first_name:d.form.value.firstName}:{},...d.form.value.infix?{infix:d.form.value.infix}:{},...d.form.value.lastName?{last_name:d.form.value.lastName}:{}}:{},r={...d.form.value.addressLine1&&{line1:d.form.value.addressLine1},...d.form.value.addressLine2&&{line2:d.form.value.addressLine2},...d.form.value.city&&{city:d.form.value.city},...d.form.value.postalCode&&{postal_code:d.form.value.postalCode},...d.form.value.state&&{state:d.form.value.state},country:d.form.value.country??""},h=re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((Y=u.value)==null?void 0:Y.pricing_plan_schedule_infos)??[],type:"DEFAULT"}),y=(K=h==null?void 0:h.pricing_plan_version)==null?void 0:K.pricing_currency_settings,C=(((H=y==null?void 0:y.pricing_currencies)==null?void 0:H.length)??0)>1,O=(((q=(T=h==null?void 0:h.pricing_plan_version)==null?void 0:T.billing_period_settings)==null?void 0:q.billing_periods)??[]).length>1,z=re.getScheduleCustomizations({enabledPricings:(G=d.form.value.enabledPricingIds)==null?void 0:G.map(J=>({pricing_id:J})),seatsValues:d.form.value.seatsValues,unitsValues:d.form.value.unitsValues,pricingPlanScheduleInfos:((F=u.value)==null?void 0:F.pricing_plan_schedule_infos)??[],pricingCurrency:C?(Z=u.value)==null?void 0:Z.billing_currency:void 0,billingPeriod:O?(W=u.value)==null?void 0:W.billing_period:void 0}),R=d.form.value.promotionCode,Q=R&&u.value?(()=>{var fe,ye,Ie;const J=z?[...z]:[],le=((fe=J[0])==null?void 0:fe.pricing_plan_schedule_id)??((Ie=re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:((ye=u.value)==null?void 0:ye.pricing_plan_schedule_infos)??[],type:"DEFAULT"}))==null?void 0:Ie.id);if(!le)return z;const ue=J.find(({pricing_plan_schedule_id:X})=>X===le);if(ue)ue.promotion_codes=[R];else{const X=z==null?void 0:z[0];J.push({pricing_plan_schedule_id:le,...(X==null?void 0:X.enabled_pricings)&&{enabled_pricings:X.enabled_pricings},...(X==null?void 0:X.seats_values)&&{seats_values:X.seats_values},...(X==null?void 0:X.units)&&{units:X.units},promotion_codes:[R]})}return J})():z;return{type:"INIT_PRICING_PLAN_SUBSCRIPTION",init_pricing_plan_subscription:{template_pricing_plan_subscription_id:o,...Q&&{pricing_plan_schedule_customizations:Q},customer_details:{email:d.form.value.email??"",type:d.form.value.type,...d.form.value.type==="INDIVIDUAL"?{individual:{residential_address:r,...s?{name:s}:{}}}:{organization:{registered_address:r,legal_name:d.form.value.companyLegalName??"",...d.form.value.companyVatNumber&&Ve.$validator(d.form.value.companyVatNumber,{},{})?{tax_ids:[{id:d.form.value.companyVatNumber,type:bt}]}:{}}}}}}}),U=e.computed(()=>{var s,r;return((s=g.trialInvoicePreview.value)==null?void 0:s.invoice_amount_including_tax)??((r=g.invoicePreview.value)==null?void 0:r.invoice_amount_including_tax)});e.watch([()=>d.form.value.country,U],([s,r])=>{!u.value||!s||!r||f(s,r)});function V(){sessionStorage.setItem(Te,JSON.stringify(d.form.value))}return e.onMounted(async()=>{const s=de.getQueryParam("redirect_status"),r=!!de.getQueryParam(he.PAYMENT_ACCEPTOR_ID_QUERY_STRING),h=!!de.getQueryParam("payment_intent_client_secret")||!!de.getQueryParam("setup_intent_client_secret");s==="succeeded"&&r&&h&&(m.value=!0);const C=sessionStorage.getItem(Te);let w=null;if(C)try{w=JSON.parse(C)}catch{}w&&d.updateInitialState(w);try{await S()}catch(O){throw a.error("SUBSCRIPTION_LOAD_FAILED","Failed to load the subscription the checkout prices",{},O),O}try{await L()}catch{}w&&(d.updateInitialState(w),sessionStorage.removeItem(Te))}),e.watch(v,s=>{s&&N()},{once:!0}),{validatedEmail:c,validatedCountry:l,invoicePreview:g.invoicePreview,invoicePreviewByBillingPeriod:g.invoicePreviewByBillingPeriod,trialInvoicePreview:g.trialInvoicePreview,trialPeriod:g.trialPeriod,loadInvoicePreview:L,updateInvoicePreviewOnBillingInformationChange:B,lastPreviewScheduleId:g.lastPreviewScheduleId,paymentMethodOptions:M,hasPaymentMethodOptionsError:I,retryPaymentMethodOptions:N,isPaymentMethodsPending:E,isInvoicePreviewPending:g.isPending,subscription:u,checkoutForm:d,authorizationContext:A,isPaid:m,amount:U,saveFormStateForRedirect:V}}function Bn({checkoutForm:t,updateInvoicePreviewOnBillingInformationChange:n,formatErrorMessage:o,onInvalidPromotionCode:i,onApplyError:a}){const l=k.useLogger(),c=e.ref(!1),m=e.ref(null),u=(M,p)=>{m.value=o?o({action:M,error:p}):M==="apply"?"Promotion code could not be applied. Please try again.":"Promotion code could not be removed. Please try again."},_=M=>Vn(M)&&M.field==="promotion_codes",g=async M=>{const p=M==null?void 0:M.trim();if(p){m.value=null,t.form.value.promotionCode=p,c.value=!0;try{await n({promotionCode:p})}catch(E){l.capture(E,{code:"PROMOTION_CODE_APPLY_FAILED",message:"Failed to apply promotion code"}),u("apply",E),a==null||a(),_(E)&&(i==null||i()),await v({suppressError:!0,preserveErrorMessage:!0})}finally{c.value=!1}}},v=async({suppressError:M=!1,preserveErrorMessage:p=!1}={})=>{p||(m.value=null),delete t.form.value.promotionCode,c.value=!0;try{await n({})}catch(E){l.capture(E,{code:"PROMOTION_CODE_REMOVE_FAILED",message:"Failed to remove promotion code"}),M||u("remove",E)}finally{c.value=!1}};return{applyPromotionCode:g,removePromotionCode:v,isPromotionCodePending:c,promotionCodeErrorMessage:m}}function Vn(t){return typeof t=="object"&&t!==null&&"field"in t}function On({subscription:t,promotionCode:n,appliedPromotionCode:o,applyPromotionCode:i}){e.watch(t,a=>{a&&n&&(o.value=n,i(n))},{once:!0})}const zn={class:"flex items-center gap-2"},Rn=e.defineComponent({__name:"TaxIDCheckNotice",props:{taxIdValidationResult:{type:Object}},setup(t){const n=t,{formatMessage:o}=k.useIntl(),i=e.computed(()=>n.taxIdValidationResult.valid==="VALID"),a=e.computed(()=>i.value?o({defaultMessage:"VAT number is valid.",id:"tax_check.valid_vat_number",description:"The message shown when the VAT number is valid"}):o({defaultMessage:"VAT number is invalid.",id:"tax_check.invalid_vat_number",description:"The message shown when the VAT number is invalid"}));return(l,c)=>(e.openBlock(),e.createBlock(e.unref(Kt._sfc_main),{type:i.value?"success":"danger",icon:!1},{default:e.withCtx(()=>[e.createElementVNode("div",zn,[e.createVNode(e.unref(k._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value),1)]),_:1})])]),_:1},8,["type"]))}});function jn(t){const{checkTaxID:n}=qt.createCustomerService(),o=e.ref(void 0),i=e.computed(()=>{var v;return((v=t.value.companyVatNumber)==null?void 0:v.trim())??""}),a=e.computed(()=>t.value.companyLegalName??""),l=e.computed(()=>t.value.country),c=e.ref(!1),m=e.computed(()=>gt(l.value??"")),u=e.computed(()=>!!(i.value&&a.value&&l.value)),_=e.computed(()=>m.value&&i.value);async function g(){var v;if(!(!u.value||!m.value||!l.value)){c.value=!0;try{const M=await n({type:"ORGANIZATION",organization:{legal_name:a.value,tax_ids:[{id:i.value,type:"GENERIC_TAX_ID"}],registered_address:{country:l.value}}});(v=M==null?void 0:M.data)!=null&&v.length?o.value=M.data[0]:o.value=void 0}finally{c.value=!1}}}return{runTaxIDCheck:g,taxIdValidationData:o,isTaxIDCheckPending:c,isTaxIDCheckEnabled:u,showViesCheckNotice:_,isSelectedCountryEU:m}}const $n={class:"grid grid-cols-1 gap-1"},Un={class:"grid grid-cols-1 gap-2"},Fn={key:0},Gn={class:"mt-2 flex flex-col gap-3"},Yn={class:"grid grid-cols-3 gap-2"},Kn={key:0},qn={class:"mt-4 grid grid-cols-1 gap-3"},Qn="checkout-form",Hn=e.defineComponent({__name:"CheckoutForm",props:e.mergeModels({validation:{type:null},initialState:{type:Object},readOnlyEmail:{type:String},showCustomerInfoOnTop:{type:Boolean},isBillingInformationMandatory:{type:Boolean},getIsFieldRequired:{type:Function},readOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["submit"],["update:modelValue"]),setup(t){const n=t,o=e.ref(!1),i=e.useModel(t,"modelValue"),a=e.computed({get:()=>i.value.type==="ORGANIZATION",set:f=>{i.value.type=f?"ORGANIZATION":"INDIVIDUAL"}}),l=e.computed(()=>i.value.type==="ORGANIZATION"),c=e.computed({get:()=>i.value.country,set:f=>{i.value.country=f&&xe(f)?f:void 0}}),m=e.computed(()=>i.value.country!=="US"),{isTaxIDCheckEnabled:u,isTaxIDCheckPending:_,taxIdValidationData:g,runTaxIDCheck:v}=jn(i),{$t:M}=k.useIntl(),p=Ne.useCustomerFormLabels(),E=f=>n.getIsFieldRequired(f)?"":" "+M({defaultMessage:"(optional)",id:"checkout.optional_suffix.label",description:"The suffix for optional fields in the checkout form"}),x=e.computed(()=>i.value.country?Yt.getCountryNameByCode(i.value.country):void 0);return(f,I)=>(e.openBlock(),e.createElementBlock("form",{id:Qn,onSubmit:I[12]||(I[12]=e.withModifiers(N=>f.$emit("submit",i.value),["prevent"]))},[e.createElementVNode("div",$n,[e.createVNode(e.unref(oe._sfc_main),{title:e.unref(p).contactInformationTitle},{default:e.withCtx(()=>[e.createElementVNode("div",Un,[t.readOnly?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(k._sfc_main),{variant:"body",tag:"span",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.email),1)]),_:1}),e.createVNode(e.unref(k._sfc_main),{variant:"body-sm",tag:"span",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.email,"onUpdate:modelValue":I[0]||(I[0]=N=>i.value.email=N),required:"",type:"email",name:"email",disabled:!!t.readOnlyEmail,label:e.unref(p).emailLabel,placeholder:e.unref(p).emailPlaceholder+E("email"),error:t.validation.value.email.$errors},null,8,["modelValue","disabled","label","placeholder","error"]),e.createVNode(e.unref(Ne._sfc_main),{"single-model-value":c.value,"onUpdate:singleModelValue":I[3]||(I[3]=N=>c.value=N),required:"",name:"country",label:e.unref(p).countryLabel+E("country"),error:t.validation.value.country.$errors},{"label-suffix":e.withCtx(()=>[!o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:0,size:"xs",intent:"subtle","icon-prefix":"add",class:"py-0.5",onClick:I[1]||(I[1]=N=>o.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"More billing details",description:"Label of the button in the checkout that lets you fill out all billing details",id:"checkout.billing_details.add_billing_details_button.label"})),1)]),_:1})):e.createCommentVNode("",!0),o.value&&!t.isBillingInformationMandatory?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:1,size:"sm",intent:"subtle","icon-prefix":"close",class:"py-0.5",onClick:I[2]||(I[2]=N=>o.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Remove billing details",id:"checkout.billing_details.remove_billing_details_button.label",description:"Label of the button in the checkout that lets you remove the billing details"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["single-model-value","label","error"])],64))]),e.createVNode(e.unref(tt._sfc_main),{"is-open":o.value||!!t.isBillingInformationMandatory},{default:e.withCtx(()=>[o.value||t.isBillingInformationMandatory?(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("div",Gn,[e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.addressLine1,"onUpdate:modelValue":I[4]||(I[4]=N=>i.value.addressLine1=N),name:"address_line_1",label:e.unref(M)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(M)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"})+E("addressLine1"),required:"",error:t.validation.value.addressLine1.$errors},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.addressLine2,"onUpdate:modelValue":I[5]||(I[5]=N=>i.value.addressLine2=N),name:"address_line_2",placeholder:e.unref(M)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"})+E("addressLine2")},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Yn,[e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.postalCode,"onUpdate:modelValue":I[6]||(I[6]=N=>i.value.postalCode=N),name:"postal_code",placeholder:e.unref(p).postalCodePlaceholder+E("postalCode"),error:t.validation.value.addressLine1.$errors},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.city,"onUpdate:modelValue":I[7]||(I[7]=N=>i.value.city=N),name:"city",placeholder:e.unref(p).cityPlaceholder+E("city")},null,8,["modelValue","placeholder"]),e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.state,"onUpdate:modelValue":I[8]||(I[8]=N=>i.value.state=N),name:"state",placeholder:e.unref(p).statePlaceholder+E("state"),error:t.validation.value.state.$errors},null,8,["modelValue","placeholder","error"])])])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["title"]),t.readOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:0},{default:e.withCtx(()=>[e.createVNode(Ne._sfc_main$1,{modelValue:a.value,"onUpdate:modelValue":I[9]||(I[9]=N=>a.value=N),"no-spacing":"",class:"!flex"},null,8,["modelValue"]),e.createVNode(e.unref(tt._sfc_main),{"is-open":l.value},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("div",qn,[e.createVNode(e.unref(ae._sfc_main),{modelValue:i.value.companyLegalName,"onUpdate:modelValue":I[10]||(I[10]=N=>i.value.companyLegalName=N),required:"",name:"legal_name",label:e.unref(p).legalNameLabel,placeholder:e.unref(p).legalNamePlaceholder},null,8,["modelValue","label","placeholder"]),m.value?(e.openBlock(),e.createBlock(e.unref(ae._sfc_main),{key:0,modelValue:i.value.companyVatNumber,"onUpdate:modelValue":I[11]||(I[11]=N=>i.value.companyVatNumber=N),name:"vat_number","input-class":"focus:outline-none focus:ring-0",label:e.unref(p).vatNumberLabel,placeholder:e.unref(p).vatNumberPlaceholder,error:t.validation.value.companyVatNumber.$errors,"suffix-class":"px-2 border-l-0"},e.createSlots({_:2},[e.unref(gt)(i.value.country??"")?{name:"suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(ne._sfc_main),{type:"button",size:"sm",intent:"secondary",disabled:!e.unref(u)||e.unref(_)||t.validation.value.companyVatNumber.$invalid,onClick:e.unref(v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(M)({defaultMessage:"Check",id:"checkout.vat_number.check_button.label",description:"The label for the check button in the checkout form"})),1)]),_:1},8,["disabled","onClick"])]),key:"0"}:void 0]),1032,["modelValue","label","placeholder","error"])):e.createCommentVNode("",!0),e.unref(g)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"opacity-75":e.unref(_)})},[e.createVNode(Rn,{"tax-id-validation-result":e.unref(g)},null,8,["tax-id-validation-result"])],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1}))])],32))}}),Zn={key:0,class:"flex items-center"},Xn=["innerHTML"],Wn=["innerHTML"],Jn=e.defineComponent({__name:"CheckoutTitle",props:{trialPeriod:{type:Object},subscriptionName:{type:String},amount:{type:Object},billingPeriod:{type:Object},countryCode:{type:null},trialStartDate:{type:Date},subscriptionStartDate:{type:Date}},setup(t){const{$t:n}=k.useIntl();return(o,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(k._sfc_main),{variant:"heading-1",class:"inline-block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.trialStartDate?t.subscriptionName:e.unref(n)({defaultMessage:"Pay and subscribe",id:"checkout.page_title",description:"The title of the checkout page"}))+e.toDisplayString(" "),1),t.trialPeriod?(e.openBlock(),e.createBlock(e.unref(dt._sfc_main),{key:0,"trial-period":t.trialPeriod,size:"lg",class:"-translate-y-0.5"},null,8,["trial-period"])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(e.unref(k._sfc_main),{variant:"body-sm",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[t.countryCode?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting {startDate, date, long}.",id:"checkout.trial_period_description",description:"The description of the trial period"},{price:e.unref(te.formatAmount)(t.amount),startDate:t.subscriptionStartDate,period_name:e.unref(te.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`}):e.unref(n)({defaultMessage:"You will be billed <strong>{price}</strong> per {period_name}, starting today.",id:"checkout.subscription_description",description:"The description of the subscription"},{price:e.unref(te.formatAmount)(t.amount),period_name:e.unref(te.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0}),strong:a=>`<strong>${a}</strong>`})},null,8,Wn)):(e.openBlock(),e.createElementBlock("span",Zn,[e.createVNode(e.unref(Se._sfc_main),{"is-dark-mode":""},{tooltip:e.withCtx(()=>[e.createVNode(e.unref(Se.TooltipContent),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se._sfc_main$1),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Will be determined by billing information",description:"Tooltip content for the invoice preview when taxes are not determined by billing information",id:"invoice_preview.taxes_not_determined_by_billing_information_tooltip"})),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(ge._sfc_main$2),{"width-class":"w-10","height-class":"h-4",shade:"darker",class:"mr-1.5 inline-block"})]),_:1}),e.createElementVNode("span",{innerHTML:t.trialStartDate?e.unref(n)({defaultMessage:"per {period_name} starting, {startDate, date, long}",id:"checkout.trial_period_description_without_price",description:"The description of the trial period, while the price is still being determined"},{startDate:t.subscriptionStartDate,period_name:e.unref(te.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})}):e.unref(n)({defaultMessage:"per {period_name}, starting today",id:"checkout.subscription_description_without_price",description:"The description of the subscription, while the price is still being determined"},{period_name:e.unref(te.formatBillingPeriod)(t.billingPeriod,{short:!0,hideValueForExactPeriods:!0})})},null,8,Xn)]))]),_:1})]))}}),eo=t=>{var n;return((n=t.periods)==null?void 0:n.some(o=>o.groups.some(i=>{var a;return(a=i.lines)==null?void 0:a.some(l=>l.product_items.some(c=>c.model_type==="USAGE_BASED"))})))??!1},to={class:"flex min-h-96 w-full items-center justify-center"},no={class:"max-w-sm"},oo=e.defineComponent({__name:"CheckoutNotAvailable",setup(t){const{$t:n}=k.useIntl(),o=()=>{window.location.reload()};return(i,a)=>(e.openBlock(),e.createElementBlock("div",to,[e.createElementVNode("div",no,[e.createVNode(e.unref(k._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Checkout not available",id:"checkout.not_available.title",description:"The title of the checkout not available page"})),1)]),_:1}),e.createVNode(e.unref(k._sfc_main),{variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"The checkout is currently not available.",id:"checkout.not_available.description",description:"The description of the checkout not available page"}))+" ",1),e.createElementVNode("a",{href:"#",class:"text-primary-900 hover:underline",onClick:e.withModifiers(o,["prevent"])},e.toDisplayString(e.unref(n)({defaultMessage:"Reload",id:"checkout.not_available.reload_button",description:"The label of the reload button"})),1),e.createTextVNode(" "+e.toDisplayString(e.unref(n)({defaultMessage:"this page to try again, or contact customer support.",id:"checkout.not_available.contact_support_message",description:"The message shown when the user wants to contact customer support"})),1)]),_:1})])]))}}),io=e.defineComponent({__name:"SubscriptionPaymentCompletedCard",emits:["continue-to-merchant"],setup(t){const{$t:n}=k.useIntl();return(o,i)=>(e.openBlock(),e.createBlock(Qt._sfc_main,{status:"success",title:e.unref(n)({defaultMessage:"Payment successful",id:"subscription_payment_completed_card.title",description:"The title for when a payment has been successful"})},{default:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main),{variant:"body-xs",color:"subtle",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Thank you for subscribing.",id:"subscription_payment_completed_card.thank_you_for_subscribing",description:"The text shown after a successful message before a redirect"})),1)]),_:1})]),_:1},8,["title"]))}}),ao={class:"flex items-start"},ro={class:"flex grow flex-col"},lo={class:"flex items-center gap-1"},so={class:"ml-4 flex items-center self-center"},Et=e.defineComponent({__name:"PricingGroupContent",props:{name:{type:String},description:{type:String}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("div",ro,[e.createElementVNode("div",lo,[e.createVNode(e.unref(k._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name),1)]),_:1}),e.renderSlot(n.$slots,"badge")]),e.createVNode(e.unref(k._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1})]),e.createElementVNode("div",so,[e.renderSlot(n.$slots,"default")])]))}}),co={class:"sv-order-summary__body grid grid-cols-1 gap-1"},uo={class:"px-3 py-2"},po={class:"sv-order-summary__billing-period flex flex-col gap-3"},mo={class:"px-3 py-2"},go={key:3,class:"sv-order-summary__items"},st=e.defineComponent({__name:"OrderSummary",props:{subscription:{type:Object},invoice:{type:Object},invoicePreviewByBillingPeriod:{type:Object},trialInvoice:{type:Object},enabledPricingIds:{type:Array},trialPeriod:{type:Object},avatar:{type:String},isPaid:{type:Boolean},isUsageBased:{type:Boolean},isPreviewAndPaymentMethodsPending:{type:Boolean},collapsible:{type:String},noTitle:{type:Boolean},countryCode:{type:null},variant:{type:String}},emits:["billing-period-change"],setup(t,{emit:n}){const o=t,i=n,{$t:a}=k.useIntl(),{map:l,formatTimePeriod:c}=ut.useTimePeriod(),{isMobileViewport:m}=mt.useViewport(),u=e.computed(()=>m.value?"sm":"xs"),_=r=>`${r.type}:${r.value}`,g=["DAY","WEEK","MONTH","YEAR"],v=r=>g.includes(r),M=r=>{if(!r)return;const[h,y]=r.split(":"),C=Number(y);if(!(!C||!v(h)))return{type:h,value:C}},p=e.computed({get:()=>{const r=o.subscription.billing_period;return r?`${r.type}:${r.value}`:void 0},set:r=>{if(!r)return;const[h,y]=r.split(":"),C=Number(y);C&&v(h)&&i("billing-period-change",{type:h,value:C})}}),E=r=>{var C,w,O,z;const h=(z=(O=(w=(C=o.invoicePreviewByBillingPeriod)==null?void 0:C[_(r)])==null?void 0:w.periods)==null?void 0:O[0])==null?void 0:z.amount_including_tax;if(!h)return;const y=r.type==="MONTH"&&r.value===3?a({defaultMessage:"/quarter",id:"checkout.order_summary_block.billing_period.per_quarter",description:"Period label for quarterly billing"}):a({defaultMessage:"/{period}",id:"checkout.order_summary_block.billing_period.per_label",description:"Period label for billing cycles"},{period:c(r,{prefix:!1,hideValueForExactPeriods:!0})});return a({defaultMessage:"{amount}{period}",id:"checkout.order_summary_block.billing_period.sub_label",description:"Billing period option sublabel showing price per period"},{amount:te.formatAmount(h),period:y})},x=r=>{var h,y,C,w;return(w=(C=(y=(h=o.invoicePreviewByBillingPeriod)==null?void 0:h[_(r)])==null?void 0:y.periods)==null?void 0:C[0])==null?void 0:w.amount_including_tax},f=r=>Number(r.quantity),I=(r,h)=>{if(!h)return;const C={DAY:365,WEEK:52,MONTH:12,YEAR:1}[r.type]/Math.max(r.value??1,1),w=f(h)*C;if(Number.isFinite(w))return{quantity:w.toFixed(2),currency:h.currency}},N=(r,h)=>{if(!r||!h)return;const y=f(r)-f(h);if(!(!Number.isFinite(y)||y<=0))return{quantity:y.toFixed(2),currency:r.currency}},L=r=>{if(!r)return;const h=a({defaultMessage:"Save {amount}",id:"checkout.order_summary_block.billing_period.save_badge.prefix",description:"First line for the savings badge label"},{amount:te.formatAmount(r)}),y=a({defaultMessage:"/year",id:"checkout.order_summary_block.billing_period.save_badge.suffix",description:"Second line for the savings badge label"});return`${h}${y}`},B=e.computed(()=>{var Y,K,H;const r=re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:o.subscription.pricing_plan_schedule_infos??[],type:"DEFAULT"}),h=((K=(Y=r==null?void 0:r.pricing_plan_version)==null?void 0:Y.billing_period_settings)==null?void 0:K.billing_periods)??[],y=new Map,C=T=>{T&&y.set(_(T),T)},w=T=>{var q;(q=T==null?void 0:T.items)==null||q.forEach(G=>{var F,Z;(F=G.billing_period_configs)==null||F.forEach(W=>C(W.billing_period)),(Z=G.pricing_currency_configs)==null||Z.forEach(W=>{var J;(J=W.billing_period_configs)==null||J.forEach(le=>C(le.billing_period))})})};if((((H=r==null?void 0:r.pricing_plan_version)==null?void 0:H.pricing_categories)??[]).forEach(T=>{var q,G;(q=T.pricings)==null||q.forEach(F=>w(F)),(G=T.pricing_groups)==null||G.forEach(F=>{var Z;return(Z=F.pricings)==null?void 0:Z.forEach(W=>w(W))})}),!y.size)return[];const z=h.map(T=>y.get(_(T.period))).filter(T=>!!T),R=new Set(z.map(_)),Q=[...y.values()].filter(T=>!R.has(_(T)));return[...z,...Q]}),d=e.computed(()=>{const r=B.value[B.value.length-1],h=r?I(r,x(r)):void 0;return B.value.map(C=>{const w=C.type==="MONTH"&&C.value===3?a({defaultMessage:"Billed quarterly",id:"checkout.order_summary_block.billing_period.quarterly",description:"Billing period option label for quarterly billing"}):a({defaultMessage:"Billed {period}",id:"checkout.order_summary_block.billing_period.label",description:"Billing period option label for the selected period"},{period:l.value[C.type].full}),O=x(C),z=I(C,O),R=r&&C.type===r.type&&C.value===r.value?void 0:N(z,h),Q=L(R);return{label:w,subLabel:E(C),labelSuffixComponent:Q?{component:nt._sfc_main,props:{color:"primary",content:Q,size:u.value,class:"whitespace-nowrap text-left leading-tight"}}:void 0,hidden:p.value===`${C.type}:${C.value}`,value:`${C.type}:${C.value}`}})}),S=e.computed(()=>{const r=d.value,h=r[0],y=r[r.length-1];return{smallestPeriod:h==null?void 0:h.value,biggestPeriod:y==null?void 0:y.value}}),A=e.computed(()=>d.value.find(r=>r.value===S.value.biggestPeriod)),U=e.computed(()=>d.value.find(r=>r.value===p.value)),V=e.computed(()=>{var Y,K,H,T,q,G,F,Z;const r=d.value,h=r[r.length-1],y=p.value;if(!h||!y||y===h.value)return"";const C=M(h.value);if(!C)return"";const w=(T=(H=(K=(Y=o.invoicePreviewByBillingPeriod)==null?void 0:Y[h.value])==null?void 0:K.periods)==null?void 0:H[0])==null?void 0:T.amount_including_tax,O=M(y),z=(Z=(F=(G=(q=o.invoicePreviewByBillingPeriod)==null?void 0:q[y])==null?void 0:G.periods)==null?void 0:F[0])==null?void 0:Z.amount_including_tax;if(!O||!z)return"";const R=I(O,z),Q=I(C,w);return L(N(R,Q))??""}),s=r=>{const{smallestPeriod:h,biggestPeriod:y}=S.value;p.value=r?y:h};return(r,h)=>(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{class:"sv-order-summary","no-border":"","no-spacing":"","content-background":"none",title:t.noTitle?void 0:e.unref(a)({defaultMessage:"Order summary",id:"checkout.order_summary_block.title",description:"The title of the order summary block that lists the subscription cost in the checkout"})},{default:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(e.unref(oe._sfc_main),{"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[t.subscription?(e.openBlock(),e.createBlock(Ht._sfc_main,{key:0,avatar:t.avatar,invoice:t.invoice,subscription:t.subscription,"enabled-pricing-ids":t.enabledPricingIds,loading:t.isPreviewAndPaymentMethodsPending,"trial-period":t.trialPeriod},null,8,["avatar","invoice","subscription","enabled-pricing-ids","loading","trial-period"])):e.createCommentVNode("",!0)]),_:1}),d.value.length===2?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:0,"no-spacing":"","content-classes":p.value===S.value.biggestPeriod?"border-primary-500":void 0},{default:e.withCtx(()=>{var y;return[e.createElementVNode("div",uo,[e.createElementVNode("div",po,[A.value?(e.openBlock(),e.createBlock(Et,{key:0,name:A.value.label,description:((y=U.value)==null?void 0:y.subLabel)??""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(ie._sfc_main),{"model-value":p.value===S.value.biggestPeriod,"onUpdate:modelValue":s},null,8,["model-value"])]),_:2},[V.value?{name:"badge",fn:e.withCtx(()=>[e.createVNode(e.unref(nt._sfc_main),{intent:"brand",content:V.value,size:u.value,class:"whitespace-nowrap text-left leading-tight"},null,8,["content","size"])]),key:"0"}:void 0]),1032,["name","description"])):e.createCommentVNode("",!0)])])]}),_:1},8,["content-classes"])):d.value.length>2?(e.openBlock(),e.createBlock(e.unref(pt._sfc_main),{key:1,"single-model-value":p.value,"onUpdate:singleModelValue":h[0]||(h[0]=y=>p.value=y),class:"sv-order-summary__billing-period",options:d.value,size:"xl","has-large-dropdown":"","show-sub-label-in-input":"","show-suffix-in-closed-input":""},null,8,["single-model-value","options"])):e.createCommentVNode("",!0),t.isUsageBased?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),{key:2,"no-spacing":"",class:"sv-order-summary__usage"},{default:e.withCtx(()=>[e.createElementVNode("div",mo,[e.createVNode(e.unref(k._sfc_main),{"no-spacing":"",variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"+ Usage",id:"checkout.invoice_preview.usage_based_message",description:"The message shown for the usage based invoice preview"})),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0),t.invoice&&t.variant!=="products-inline"?(e.openBlock(),e.createElementBlock("div",go,[e.createVNode(e.unref(ge._sfc_main$3),{invoice:t.invoice,"wrapper-component":e.unref(oe._sfc_main)},null,8,["invoice","wrapper-component"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(oe._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(ge._sfc_main$1),{key:0,class:"sv-order-summary__invoice-preview",variant:t.variant==="products-inline"?"default":"without-products",invoice:t.invoice,"trial-invoice":t.trialInvoice,"is-paid":t.isPaid,collapsible:t.collapsible,"is-preview-without-taxes":!t.countryCode,"is-customer-facing":""},null,8,["variant","invoice","trial-invoice","is-paid","collapsible","is-preview-without-taxes"])):(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:1,variant:"body-sm",color:"subtle",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Please select a country first",description:"The message shown for the invoice preview when no country is set",id:"checkout.invoice_preview.no_country_selected_message"})),1)]),_:1}))]),_:1})])]),_:1},8,["title"]))}}),fo={key:1},yo={key:2},vo={key:3},_o={key:4},ho=["href"],Mo=e.defineComponent({__name:"MarkdownInline",props:{nodes:{type:Array}},setup(t){return(n,o)=>{const i=e.resolveComponent("MarkdownInline",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(a,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[a.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(a.value),1)],64)):a.type==="break"?(e.openBlock(),e.createElementBlock("br",fo)):a.type==="bold"?(e.openBlock(),e.createElementBlock("strong",yo,[e.createVNode(i,{nodes:a.children},null,8,["nodes"])])):a.type==="italic"?(e.openBlock(),e.createElementBlock("em",vo,[e.createVNode(i,{nodes:a.children},null,8,["nodes"])])):a.type==="underline"?(e.openBlock(),e.createElementBlock("u",_o,[e.createVNode(i,{nodes:a.children},null,8,["nodes"])])):a.type==="link"?(e.openBlock(),e.createElementBlock("a",{key:5,href:a.href,target:"_blank",rel:"noopener noreferrer",class:"underline"},[e.createVNode(i,{nodes:a.children},null,8,["nodes"])],8,ho)):e.createCommentVNode("",!0)],64))),128)}}}),bo=/^<u>([\s\S]*?)<\/u>/i,Io=/^\*\*([\s\S]+?)\*\*/,No=/^\*([\s\S]+?)\*/,Co=/^_([\s\S]+?)_/,Eo=/^\[([^\]]*)\]\(\s*([^)\s]*)\s*\)/,Ao=/^<([a-z][a-z0-9+.-]*:[^>\s]+)>/i,Po=/\n[ \t]*\n/;function _e(t){const n=[];let o="";const i=()=>{o&&(n.push({type:"text",value:o}),o="")};let a=0;for(;a<t.length;){const l=t.slice(a),c=Io.exec(l);if(c){i(),n.push({type:"bold",children:_e(c[1])}),a+=c[0].length;continue}const m=No.exec(l)??Co.exec(l);if(m){i(),n.push({type:"italic",children:_e(m[1])}),a+=m[0].length;continue}const u=bo.exec(l);if(u){i(),n.push({type:"underline",children:_e(u[1])}),a+=u[0].length;continue}const _=Eo.exec(l);if(_){i(),n.push(ct(_[2],_e(_[1]))),a+=_[0].length;continue}const g=Ao.exec(l);if(g){i(),n.push(ct(g[1],[{type:"text",value:g[1]}])),a+=g[0].length;continue}if(t[a]===`
2
- `){i(),n.push({type:"break"}),a+=1;continue}o+=t[a],a+=1}return i(),n}function ct(t,n){const o=de.sanitizeUrl(t);return o?{type:"link",href:o,children:n}:{type:"text",value:At(n)}}function At(t){return t.map(n=>n.type==="text"?n.value:n.type==="break"?" ":At(n.children)).join("")}function xo(t){return t!=null&&t.trim()?t.split(Po).map(n=>n.trim()).filter(Boolean).map(n=>({type:"paragraph",children:_e(n)})):[]}const Do={key:0},ko=e.defineComponent({__name:"MarkdownText",props:{source:{type:[String,null]}},setup(t){const n=t,o=e.computed(()=>xo(n.source));return(i,a)=>o.value.length?(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,c)=>(e.openBlock(),e.createElementBlock("p",{key:c,class:e.normalizeClass({"mt-2":c>0})},[e.createVNode(Mo,{nodes:l.children},null,8,["nodes"])],2))),128))])):e.createCommentVNode("",!0)}});async function Pt(t,n){const{AdyenCheckout:o}=await Ae.loadAdyenSdk();return o(he.getAdyenExpressCheckoutConfiguration({locale:t.locale,amount:t.amount,countryCode:t.countryCode,paymentMethodOptionResponse:t.paymentMethodOptionsResponse,logger:n}))}function xt({props:t,create:n,onMissingButton:o,onMountFailed:i,afterMount:a}){const l=e.ref(),c=k.useLogger(),m=async()=>{const u=await Pt(t,c),_=await n(u);if(!l.value){o();return}try{await _.isAvailable(),_.mount(l.value),a==null||a()}catch(g){i(g)}};return e.onMounted(()=>{m()}),{buttonRef:l}}const wo={key:0,id:"svg-logo",viewBox:"0 0 35 15",class:"h-[44px]"},So={key:1,src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAxcHgiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAxMDEgMzIiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHhtbG5zPSJodHRwOiYjeDJGOyYjeDJGO3d3dy53My5vcmcmI3gyRjsyMDAwJiN4MkY7c3ZnIj48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDEyLjIzNyAyLjggTCA0LjQzNyAyLjggQyAzLjkzNyAyLjggMy40MzcgMy4yIDMuMzM3IDMuNyBMIDAuMjM3IDIzLjcgQyAwLjEzNyAyNC4xIDAuNDM3IDI0LjQgMC44MzcgMjQuNCBMIDQuNTM3IDI0LjQgQyA1LjAzNyAyNC40IDUuNTM3IDI0IDUuNjM3IDIzLjUgTCA2LjQzNyAxOC4xIEMgNi41MzcgMTcuNiA2LjkzNyAxNy4yIDcuNTM3IDE3LjIgTCAxMC4wMzcgMTcuMiBDIDE1LjEzNyAxNy4yIDE4LjEzNyAxNC43IDE4LjkzNyA5LjggQyAxOS4yMzcgNy43IDE4LjkzNyA2IDE3LjkzNyA0LjggQyAxNi44MzcgMy41IDE0LjgzNyAyLjggMTIuMjM3IDIuOCBaIE0gMTMuMTM3IDEwLjEgQyAxMi43MzcgMTIuOSAxMC41MzcgMTIuOSA4LjUzNyAxMi45IEwgNy4zMzcgMTIuOSBMIDguMTM3IDcuNyBDIDguMTM3IDcuNCA4LjQzNyA3LjIgOC43MzcgNy4yIEwgOS4yMzcgNy4yIEMgMTAuNjM3IDcuMiAxMS45MzcgNy4yIDEyLjYzNyA4IEMgMTMuMTM3IDguNCAxMy4zMzcgOS4xIDEzLjEzNyAxMC4xIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDAzMDg3IiBkPSJNIDM1LjQzNyAxMCBMIDMxLjczNyAxMCBDIDMxLjQzNyAxMCAzMS4xMzcgMTAuMiAzMS4xMzcgMTAuNSBMIDMwLjkzNyAxMS41IEwgMzAuNjM3IDExLjEgQyAyOS44MzcgOS45IDI4LjAzNyA5LjUgMjYuMjM3IDkuNSBDIDIyLjEzNyA5LjUgMTguNjM3IDEyLjYgMTcuOTM3IDE3IEMgMTcuNTM3IDE5LjIgMTguMDM3IDIxLjMgMTkuMzM3IDIyLjcgQyAyMC40MzcgMjQgMjIuMTM3IDI0LjYgMjQuMDM3IDI0LjYgQyAyNy4zMzcgMjQuNiAyOS4yMzcgMjIuNSAyOS4yMzcgMjIuNSBMIDI5LjAzNyAyMy41IEMgMjguOTM3IDIzLjkgMjkuMjM3IDI0LjMgMjkuNjM3IDI0LjMgTCAzMy4wMzcgMjQuMyBDIDMzLjUzNyAyNC4zIDM0LjAzNyAyMy45IDM0LjEzNyAyMy40IEwgMzYuMTM3IDEwLjYgQyAzNi4yMzcgMTAuNCAzNS44MzcgMTAgMzUuNDM3IDEwIFogTSAzMC4zMzcgMTcuMiBDIDI5LjkzNyAxOS4zIDI4LjMzNyAyMC44IDI2LjEzNyAyMC44IEMgMjUuMDM3IDIwLjggMjQuMjM3IDIwLjUgMjMuNjM3IDE5LjggQyAyMy4wMzcgMTkuMSAyMi44MzcgMTguMiAyMy4wMzcgMTcuMiBDIDIzLjMzNyAxNS4xIDI1LjEzNyAxMy42IDI3LjIzNyAxMy42IEMgMjguMzM3IDEzLjYgMjkuMTM3IDE0IDI5LjczNyAxNC42IEMgMzAuMjM3IDE1LjMgMzAuNDM3IDE2LjIgMzAuMzM3IDE3LjIgWiI+PC9wYXRoPjxwYXRoIGZpbGw9IiMwMDMwODciIGQ9Ik0gNTUuMzM3IDEwIEwgNTEuNjM3IDEwIEMgNTEuMjM3IDEwIDUwLjkzNyAxMC4yIDUwLjczNyAxMC41IEwgNDUuNTM3IDE4LjEgTCA0My4zMzcgMTAuOCBDIDQzLjIzNyAxMC4zIDQyLjczNyAxMCA0Mi4zMzcgMTAgTCAzOC42MzcgMTAgQyAzOC4yMzcgMTAgMzcuODM3IDEwLjQgMzguMDM3IDEwLjkgTCA0Mi4xMzcgMjMgTCAzOC4yMzcgMjguNCBDIDM3LjkzNyAyOC44IDM4LjIzNyAyOS40IDM4LjczNyAyOS40IEwgNDIuNDM3IDI5LjQgQyA0Mi44MzcgMjkuNCA0My4xMzcgMjkuMiA0My4zMzcgMjguOSBMIDU1LjgzNyAxMC45IEMgNTYuMTM3IDEwLjYgNTUuODM3IDEwIDU1LjMzNyAxMCBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA2Ny43MzcgMi44IEwgNTkuOTM3IDIuOCBDIDU5LjQzNyAyLjggNTguOTM3IDMuMiA1OC44MzcgMy43IEwgNTUuNzM3IDIzLjYgQyA1NS42MzcgMjQgNTUuOTM3IDI0LjMgNTYuMzM3IDI0LjMgTCA2MC4zMzcgMjQuMyBDIDYwLjczNyAyNC4zIDYxLjAzNyAyNCA2MS4wMzcgMjMuNyBMIDYxLjkzNyAxOCBDIDYyLjAzNyAxNy41IDYyLjQzNyAxNy4xIDYzLjAzNyAxNy4xIEwgNjUuNTM3IDE3LjEgQyA3MC42MzcgMTcuMSA3My42MzcgMTQuNiA3NC40MzcgOS43IEMgNzQuNzM3IDcuNiA3NC40MzcgNS45IDczLjQzNyA0LjcgQyA3Mi4yMzcgMy41IDcwLjMzNyAyLjggNjcuNzM3IDIuOCBaIE0gNjguNjM3IDEwLjEgQyA2OC4yMzcgMTIuOSA2Ni4wMzcgMTIuOSA2NC4wMzcgMTIuOSBMIDYyLjgzNyAxMi45IEwgNjMuNjM3IDcuNyBDIDYzLjYzNyA3LjQgNjMuOTM3IDcuMiA2NC4yMzcgNy4yIEwgNjQuNzM3IDcuMiBDIDY2LjEzNyA3LjIgNjcuNDM3IDcuMiA2OC4xMzcgOCBDIDY4LjYzNyA4LjQgNjguNzM3IDkuMSA2OC42MzcgMTAuMSBaIj48L3BhdGg+PHBhdGggZmlsbD0iIzAwOWNkZSIgZD0iTSA5MC45MzcgMTAgTCA4Ny4yMzcgMTAgQyA4Ni45MzcgMTAgODYuNjM3IDEwLjIgODYuNjM3IDEwLjUgTCA4Ni40MzcgMTEuNSBMIDg2LjEzNyAxMS4xIEMgODUuMzM3IDkuOSA4My41MzcgOS41IDgxLjczNyA5LjUgQyA3Ny42MzcgOS41IDc0LjEzNyAxMi42IDczLjQzNyAxNyBDIDczLjAzNyAxOS4yIDczLjUzNyAyMS4zIDc0LjgzNyAyMi43IEMgNzUuOTM3IDI0IDc3LjYzNyAyNC42IDc5LjUzNyAyNC42IEMgODIuODM3IDI0LjYgODQuNzM3IDIyLjUgODQuNzM3IDIyLjUgTCA4NC41MzcgMjMuNSBDIDg0LjQzNyAyMy45IDg0LjczNyAyNC4zIDg1LjEzNyAyNC4zIEwgODguNTM3IDI0LjMgQyA4OS4wMzcgMjQuMyA4OS41MzcgMjMuOSA4OS42MzcgMjMuNCBMIDkxLjYzNyAxMC42IEMgOTEuNjM3IDEwLjQgOTEuMzM3IDEwIDkwLjkzNyAxMCBaIE0gODUuNzM3IDE3LjIgQyA4NS4zMzcgMTkuMyA4My43MzcgMjAuOCA4MS41MzcgMjAuOCBDIDgwLjQzNyAyMC44IDc5LjYzNyAyMC41IDc5LjAzNyAxOS44IEMgNzguNDM3IDE5LjEgNzguMjM3IDE4LjIgNzguNDM3IDE3LjIgQyA3OC43MzcgMTUuMSA4MC41MzcgMTMuNiA4Mi42MzcgMTMuNiBDIDgzLjczNyAxMy42IDg0LjUzNyAxNCA4NS4xMzcgMTQuNiBDIDg1LjczNyAxNS4zIDg1LjkzNyAxNi4yIDg1LjczNyAxNy4yIFoiPjwvcGF0aD48cGF0aCBmaWxsPSIjMDA5Y2RlIiBkPSJNIDk1LjMzNyAzLjMgTCA5Mi4xMzcgMjMuNiBDIDkyLjAzNyAyNCA5Mi4zMzcgMjQuMyA5Mi43MzcgMjQuMyBMIDk1LjkzNyAyNC4zIEMgOTYuNDM3IDI0LjMgOTYuOTM3IDIzLjkgOTcuMDM3IDIzLjQgTCAxMDAuMjM3IDMuNSBDIDEwMC4zMzcgMy4xIDEwMC4wMzcgMi44IDk5LjYzNyAyLjggTCA5Ni4wMzcgMi44IEMgOTUuNjM3IDIuOCA5NS40MzcgMyA5NS4zMzcgMy4zIFoiPjwvcGF0aD48L3N2Zz4",role:"presentation",class:"h-[22px]"},Oe=e.defineComponent({__name:"ExpressPaymentMethodButton",props:{type:{type:String}},emits:["click"],setup(t,{emit:n}){const o=t,i=n,a=e.computed(()=>{switch(o.type){case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";default:return}}),l=e.computed(()=>{switch(o.type){case"applepay":return"!bg-black !py-0";case"googlepay":return"!bg-black bg-[url(https://www.gstatic.com/instantbuy/svg/dark_gpay.svg)] bg-[length:auto_42.5%]";case"paypal":return"!bg-[#ffc439]";default:return}});function c(){i("click")}return(m,u)=>(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{size:"lg","aria-label":a.value,class:e.normalizeClass([l.value,"!block h-11 w-full bg-center bg-no-repeat"]),onClick:c},{default:e.withCtx(()=>[o.type==="applepay"?(e.openBlock(),e.createElementBlock("svg",wo,[...u[0]||(u[0]=[e.createElementVNode("svg",{id:"svg-logo",x:"0",y:"3.85",height:"7.3",width:"35",class:"logo",viewBox:"0 0 105 43",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("title",null,"Apple Logo"),e.createElementVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createElementVNode("g",{fill:"#FFF"},[e.createElementVNode("path",{d:"M19.4028,5.5674 C20.6008,4.0684 21.4138,2.0564 21.1998,0.0004 C19.4458,0.0874 17.3058,1.1574 16.0668,2.6564 C14.9538,3.9414 13.9688,6.0374 14.2258,8.0074 C16.1948,8.1784 18.1618,7.0244 19.4028,5.5674"}),e.createElementVNode("path",{d:"M21.1772,8.3926 C18.3182,8.2226 15.8872,10.0156 14.5212,10.0156 C13.1552,10.0156 11.0642,8.4786 8.8022,8.5196 C5.8592,8.5626 3.1282,10.2276 1.6342,12.8746 C-1.4378,18.1696 0.8232,26.0246 3.8112,30.3376 C5.2622,32.4716 7.0102,34.8206 9.3142,34.7366 C11.4912,34.6506 12.3442,33.3266 14.9902,33.3266 C17.6352,33.3266 18.4042,34.7366 20.7082,34.6936 C23.0972,34.6506 24.5922,32.5586 26.0422,30.4226 C27.7072,27.9906 28.3882,25.6426 28.4312,25.5126 C28.3882,25.4706 23.8232,23.7186 23.7812,18.4676 C23.7382,14.0706 27.3652,11.9786 27.5362,11.8496 C25.4882,8.8196 22.2872,8.4786 21.1772,8.3926"}),e.createElementVNode("path",{d:"M85.5508,43.0381 L85.5508,39.1991 C85.8628,39.2421 86.6158,39.2871 87.0158,39.2871 C89.2138,39.2871 90.4558,38.3551 91.2108,35.9581 L91.6548,34.5371 L83.2428,11.2321 L88.4368,11.2321 L94.2958,30.1421 L94.4068,30.1421 L100.2668,11.2321 L105.3278,11.2321 L96.6048,35.7141 C94.6078,41.3291 92.3208,43.1721 87.4828,43.1721 C87.1048,43.1721 85.8838,43.1271 85.5508,43.0381"}),e.createElementVNode("path",{d:"M42.6499,19.3555 L48.3549,19.3555 C52.6829,19.3555 55.1469,17.0255 55.1469,12.9855 C55.1469,8.9455 52.6829,6.6375 48.3769,6.6375 L42.6499,6.6375 L42.6499,19.3555 Z M49.6869,2.4425 C55.9009,2.4425 60.2289,6.7265 60.2289,12.9625 C60.2289,19.2225 55.8129,23.5285 49.5309,23.5285 L42.6499,23.5285 L42.6499,34.4705 L37.6779,34.4705 L37.6779,2.4425 L49.6869,2.4425 Z"}),e.createElementVNode("path",{d:"M76.5547,25.7705 L76.5547,23.9715 L71.0287,24.3275 C67.9207,24.5275 66.3007,25.6815 66.3007,27.7015 C66.3007,29.6545 67.9887,30.9195 70.6287,30.9195 C74.0027,30.9195 76.5547,28.7665 76.5547,25.7705 M61.4617,27.8345 C61.4617,23.7285 64.5917,21.3755 70.3627,21.0205 L76.5547,20.6425 L76.5547,18.8675 C76.5547,16.2705 74.8457,14.8495 71.8057,14.8495 C69.2967,14.8495 67.4777,16.1375 67.0997,18.1125 L62.6167,18.1125 C62.7497,13.9615 66.6567,10.9435 71.9387,10.9435 C77.6207,10.9435 81.3267,13.9175 81.3267,18.5345 L81.3267,34.4705 L76.7327,34.4705 L76.7327,30.6305 L76.6217,30.6305 C75.3127,33.1395 72.4267,34.7145 69.2967,34.7145 C64.6807,34.7145 61.4617,31.9625 61.4617,27.8345"})])])],-1)])])):o.type==="paypal"?(e.openBlock(),e.createElementBlock("img",So)):e.createCommentVNode("",!0)]),_:1},8,["aria-label","class"]))}}),To={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Lo="ADYEN",Bo=e.defineComponent({__name:"ExpressPaymentMethodApplePay",props:{onBillingInformationChange:{type:Function},amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=e.ref(),l=k.useLogger(),{authorizePayment:c}=Xt.createPaymentsService(),m=o.paymentMethodOptionsResponse.payment_acceptor.id;function u(f){return Wt.createPaymentFailureContext({gateway:"ADYEN",paymentAcceptorId:m,paymentMethodType:"applepay",...f})}const _=async()=>{const{ApplePay:f}=await Ae.loadAdyenSdk(),I=await Pt(o,l),N=new f(I,{isExpress:!0,recurringPaymentRequest:{paymentDescription:o.billingInformation.description,billingAgreement:o.billingInformation.agreement,managementURL:"https://www.google.com",...o.billingInformation.trial&&{trialBilling:{label:o.billingInformation.trial.label,amount:o.billingInformation.trial.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.trial.startDate,recurringPaymentEndDate:o.billingInformation.trial.endDate}},...o.billingInformation.regular&&{regularBilling:{label:o.billingInformation.regular.label,amount:o.billingInformation.regular.amount.quantity.toString(),type:"final",paymentTiming:"recurring",recurringPaymentStartDate:o.billingInformation.regular.startDate,...g(o.billingInformation.regular.interval??{type:"MONTH",value:1})}}},requiredBillingContactFields:["postalAddress"],requiredShippingContactFields:["email"],onPaymentMethodSelected:async(L,B,d)=>{var V,s,r,h,y,C,w;const{invoicePreview:S,trialInvoicePreview:A}=await o.onBillingInformationChange({...((V=d.paymentMethod.billingContact)==null?void 0:V.postalCode)&&{postal_code:d.paymentMethod.billingContact.postalCode},...((s=d.paymentMethod.billingContact)==null?void 0:s.locality)&&{city:d.paymentMethod.billingContact.locality},...p((r=d.paymentMethod.billingContact)==null?void 0:r.countryCode)&&{country:p((h=d.paymentMethod.billingContact)==null?void 0:h.countryCode)}}),U=A?A.invoice_amount_including_tax.quantity.toString():S.invoice_amount_including_tax.quantity.toString();i("update-billing-information",{postal_code:(y=d.paymentMethod.billingContact)==null?void 0:y.postalCode,city:(C=d.paymentMethod.billingContact)==null?void 0:C.locality,country:(w=d.paymentMethod.billingContact)==null?void 0:w.countryCode}),L({newTotal:{label:o.billingInformation.regular.label,amount:U,type:"final"}})},onError:L=>{l.error("APPLE_PAY_ERROR","Apple Pay error",u({reason:"APPLE_PAY_ERROR",cause:L}),L)},onAuthorized:async(L,B)=>{var d;try{const S=L.authorizedEvent;l.info("APPLE_PAY_AUTHORIZED","Apple Pay authorized",{paymentAcceptorId:m,hasPaymentMethod:!!S.payment.token.paymentMethod,hasPaymentData:!!S.payment.token.paymentData,hasBillingContact:!!S.payment.billingContact});const A=S.payment.billingContact,U=L.billingAddress;A?i("update-billing-information",v(A)):U&&i("update-billing-information",M(U));const V={payment_method:he.transformObjectToAdyenObject(S.payment.token.paymentMethod),browser_info:he.transformObjectToAdyenObject(S.payment.token.paymentData)},s=he.createReturnUrl({paymentAcceptorId:m,redirectUrl:window.location.href}),r=await c({payment_acceptor_id:m,payment_gateway_variant:Lo,adyen:{...V,store_payment_method:!0},amount:o.amount,return_url:s});if(l.info("APPLE_PAY_API_RESPONSE","Payment API response received",{paymentAcceptorId:m,status:r.status}),r.status==="FAILURE"){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Payment authorization failed",u({reason:"APPLE_PAY_AUTHORIZATION_REJECTED",extra:{paymentStatus:r.status}})),B.reject();return}if(r.status==="ACTION_REQUIRED"){l.warn("APPLE_PAY_ACTION_REQUIRED","Payment requires additional action",u({reason:"APPLE_PAY_ACTION_REQUIRED",extra:{actionType:(d=r.action)==null?void 0:d.method}})),B.reject();return}l.info("APPLE_PAY_SUCCESS","Apple Pay payment successful, resolving"),B.resolve()}catch(S){l.error("APPLE_PAY_AUTHORIZATION_FAILED","Apple Pay authorization failed",u({reason:"APPLE_PAY_AUTHORIZATION_FAILED",cause:S}),S),B.reject()}}});if(!a.value){l.error("APPLE_PAY_ERROR","Apple Pay button ref not found");return}try{await N.isAvailable(),N.mount(a.value),i("ready")}catch(L){l.error("APPLE_PAY_ERROR","Apple Pay not available on this device",{},L)}},g=f=>{if(!f.value)return;let I=f.value??1,N=f.type.toLowerCase();if(f.type==="WEEK"&&(N="day",I=f.value*7),N==="day"||N==="month"||N==="year"||N==="hour"||N==="minute")return{recurringPaymentIntervalUnit:N,recurringPaymentIntervalCount:I}},v=f=>({postal_code:f.postalCode,city:f.locality,country:f.countryCode}),M=f=>({postal_code:f.postalCode,city:f.city,country:f.country}),p=f=>f&&E(f)?f:void 0,E=f=>xe(f),x=()=>{var I;const f=(I=a.value)==null?void 0:I.querySelector("apple-pay-button");if(f){const N=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});f.dispatchEvent(N)}};return e.onMounted(()=>{_()}),(f,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Oe,{key:0,type:"applepay",onClick:x})):e.createCommentVNode("",!0),e.createElementVNode("div",To,[e.createElementVNode("div",{ref_key:"applePayButtonRef",ref:a},null,512)])],64))}}),Vo={class:"relative overflow-hidden"},Oo=e.defineComponent({__name:"ExpressPaymentMethodPaypal",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=k.useLogger(),{buttonRef:l}=xt({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","The PayPal button reference is not found and cannot be mounted"),onMountFailed:c=>a.error("EXPRESS_CHECKOUT_PAYPAL_ERROR","Failed mounting PayPal express button",{error:c}),create:async c=>{const{PayPal:m}=await Ae.loadAdyenSdk();return new m(c,{isExpress:!0,blockPayPalPayLaterButton:!0,blockPayPalCreditButton:!0,blockPayPalVenmoButton:!0,style:{height:55},onInit:()=>{i("ready")}})}});return(c,m)=>(e.openBlock(),e.createElementBlock("div",Vo,[t.isVisible?(e.openBlock(),e.createBlock(Oe,{key:0,type:"paypal",class:"w-full"})):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"paypalButtonRef",ref:l,class:"absolute inset-0 opacity-[0.0001]"},null,512)]))}}),zo={class:"absolute h-[1px] w-[1px] overflow-hidden opacity-0"},Ro=e.defineComponent({__name:"ExpressPaymentMethodGooglePay",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},isVisible:{type:Boolean},paymentMethodOptionsResponse:{type:Object},billingInformation:{type:Object}},emits:["ready","update-billing-information"],setup(t,{emit:n}){const o=t,i=n,a=k.useLogger(),{buttonRef:l}=xt({props:o,onMissingButton:()=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","The Google Pay button reference is not found and cannot be mounted"),onMountFailed:m=>a.error("EXPRESS_CHECKOUT_GOOGLE_PAY_ERROR","Failed mounting Google Pay express button",{},m),create:async m=>{const{GooglePay:u}=await Ae.loadAdyenSdk();return new u(m,{isExpress:!0})},afterMount:()=>i("ready")}),c=()=>{var u;const m=(u=l.value)==null?void 0:u.querySelector("#gpay-button-online-api-id");if(m){const _=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});m.dispatchEvent(_)}};return(m,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isVisible?(e.openBlock(),e.createBlock(Oe,{key:0,type:"googlepay",onClick:c})):e.createCommentVNode("",!0),e.createElementVNode("div",zo,[e.createElementVNode("div",{ref_key:"googlePayButtonRef",ref:l},null,512)])],64))}}),jo={key:0,class:"mt-4n"},$o={class:"mb-2"},Uo={class:"grid grid-cols-6 gap-1 md:gap-2"},Fo={class:"mt-4 h-4"},Go=2,Yo=e.defineComponent({__name:"ExpressPaymentMethods",props:{amount:{type:Object},countryCode:{type:String},locale:{type:String},paymentMethodsOptionsResponse:{type:null},billingInformation:{type:Object},onBillingInformationChange:{type:Function}},emits:["update-billing-information"],setup(t){const n=["applepay"],o=t,{$t:i}=k.useIntl(),a=e.ref(!1),l=e.ref(!1),c=e.ref(!1),m=e.computed(()=>{var p;if(n.includes("applepay"))return(p=o.paymentMethodsOptionsResponse)==null?void 0:p.find(E=>{var x;return(x=E.options)==null?void 0:x.some(f=>f.name.toLowerCase()==="apple pay"&&f.payment_gateway_variant==="ADYEN")})}),u=e.computed(()=>{var p;if(n.includes("paypal"))return(p=o.paymentMethodsOptionsResponse)==null?void 0:p.find(E=>{var x;return(x=E.options)==null?void 0:x.some(f=>f.name.toLowerCase()==="paypal"&&f.payment_gateway_variant==="ADYEN")})}),_=e.computed(()=>{var p;if(n.includes("googlepay"))return(p=o.paymentMethodsOptionsResponse)==null?void 0:p.find(E=>{var x;return(x=E.options)==null?void 0:x.some(f=>f.name.toLowerCase()==="google pay"&&f.payment_gateway_variant==="ADYEN")})}),g=e.computed(()=>!!(m.value||_.value||u.value)),v=e.computed(()=>{var f;if(((f=o.paymentMethodsOptionsResponse)==null?void 0:f.length)===0)return!1;const p=!m.value||a.value,E=!_.value||l.value,x=!u.value||c.value;return p&&E&&x}),M=e.computed(()=>v.value?(m.value?1:0)+(_.value?1:0)+(u.value?1:0):Go);return(p,E)=>g.value?(e.openBlock(),e.createElementBlock("div",jo,[e.createElementVNode("div",$o,[v.value?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:1,variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Subscribe instantly with",id:"checkout.express_payment_methods.title",description:"The title of the express payment methods block in the checkout form"})),1)]),_:1})):(e.openBlock(),e.createBlock(se._sfc_main,{key:0,variant:"title"}))]),e.createElementVNode("div",Uo,[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(se._sfc_main,{class:"col-span-3 h-11"}),e.createVNode(se._sfc_main,{class:"col-span-3 h-11"})],64)),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!m.value,"!col-span-6":M.value===1,"md:!col-span-3":M.value===2,"!col-span-6 md:!col-span-2":M.value===3}])},[m.value?(e.openBlock(),e.createBlock(Bo,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":m.value,"on-billing-information-change":t.onBillingInformationChange,onReady:E[0]||(E[0]=x=>a.value=!0),onUpdateBillingInformation:E[1]||(E[1]=x=>p.$emit("update-billing-information",x))},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response","on-billing-information-change"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!_.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[_.value?(e.openBlock(),e.createBlock(Ro,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":_.value,onReady:E[2]||(E[2]=x=>l.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["col-span-3 md:col-span-2",{hidden:!u.value,"col-span-6 md:col-span-6":M.value===1,"md:!col-span-3":M.value===2}])},[u.value?(e.openBlock(),e.createBlock(Oo,{key:0,amount:t.amount,"billing-information":t.billingInformation,"country-code":t.countryCode,locale:t.locale,"is-visible":v.value,"payment-method-options-response":u.value,onReady:E[3]||(E[3]=x=>c.value=!0)},null,8,["amount","billing-information","country-code","locale","is-visible","payment-method-options-response"])):e.createCommentVNode("",!0)],2)]),e.createElementVNode("div",Fo,[v.value?(e.openBlock(),e.createBlock(e.unref(Zt._sfc_main),{key:1,text:e.unref(i)({defaultMessage:"Or",id:"checkout.express_payment_methods.divider_text",description:"The text of the divider text in the express payment methods block in the checkout form"}),"text-position":"center"},null,8,["text"])):(e.openBlock(),e.createBlock(se._sfc_main,{key:0,variant:"divider-text"}))])])):e.createCommentVNode("",!0)}}),Ko=["aria-expanded","aria-label"],qo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Qo={class:"flex flex-row items-center gap-2"},Ho=["onKeydown"],Zo=["aria-label"],Xo={class:"flex w-full cursor-pointer flex-row items-center justify-between gap-3 px-3 py-2"},Wo={class:"flex flex-row items-center gap-2"},Jo={class:"sr-only","aria-live":"polite"},ei=e.defineComponent({inheritAttrs:!1,__name:"PromotionCodeSection",props:{promotionCode:{default:null,type:[String,null]}},emits:["update:appliedCode","apply","remove"],setup(t,{emit:n}){const{$t:o}=k.useIntl(),i=t,a=n,l=e.ref(!1),c=e.ref(""),m=e.ref(""),u=e.ref(null),_=e.ref(null),g=en.uniqueId("promotion-code-"),v=`${g}-label`,M=`${g}-panel`,p=e.computed(()=>i.promotionCode!==null&&i.promotionCode!==""),E=e.computed(()=>c.value.trim().length>0),x=e.computed(()=>i.promotionCode??o({defaultMessage:"Promotion applied",id:"checkout.promotion_code.applied_label",description:"Fallback label for an applied promotion code in checkout"})),f=e.computed(()=>l.value?o({defaultMessage:"Collapse promotion code input",id:"checkout.promotion_code.collapse_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is open"}):o({defaultMessage:"Expand promotion code input",id:"checkout.promotion_code.expand_aria_label",description:"Aria label for the promotion code toggle button in checkout, while the input is closed"})),I=e.computed(()=>o({defaultMessage:"Apply promotion code",id:"checkout.promotion_code.apply_aria_label",description:"Aria label for the promotion code apply button in checkout"})),N=e.computed(()=>o({defaultMessage:"Remove promotion code",id:"checkout.promotion_code.remove_aria_label",description:"Aria label for the promotion code remove button in checkout"})),L=()=>{c.value=""},B=()=>{var s;const V=(s=_.value)==null?void 0:s.querySelector("input");V instanceof HTMLInputElement&&V.focus()},d=()=>{l.value&&(l.value=!1)},S=()=>{p.value||(l.value=!l.value)},A=()=>{if(!E.value)return;const V=c.value.trim();a("update:appliedCode",V),a("apply",V),m.value=o({defaultMessage:"Promotion code applied",id:"checkout.promotion_code.applied_status",description:"Aria live message when a promotion code is applied in checkout"}),l.value=!1},U=()=>{a("update:appliedCode",null),a("remove"),m.value=o({defaultMessage:"Promotion code removed",id:"checkout.promotion_code.removed_status",description:"Aria live message when a promotion code is removed in checkout"}),L(),e.nextTick(()=>{var V;(V=u.value)==null||V.focus()})};return e.watch(l,V=>{if(!V){L(),e.nextTick(()=>{var s;(s=u.value)==null||s.focus()});return}e.nextTick(()=>{B()})}),e.watch(()=>i.promotionCode,V=>{V||L()}),(V,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value?(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),e.mergeProps({key:1},V.$attrs,{"no-border":"","no-spacing":"","content-background":"none",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"w-full rounded border border-primary-900 bg-white","aria-label":N.value,onClick:U},[e.createElementVNode("div",Xo,[e.createElementVNode("div",Wo,[e.createVNode(e.unref(ne._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(k._sfc_main),{variant:"body-sm",class:"font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1})]),e.createVNode(e.unref(ne._sfc_main$1),{icon:"close"})])],8,Zo)]),_:1},16)):(e.openBlock(),e.createBlock(e.unref(oe._sfc_main),e.mergeProps({key:0},V.$attrs,{"no-spacing":"",class:"relative w-full"}),{default:e.withCtx(()=>[e.createElementVNode("button",{ref_key:"toggleRef",ref:u,type:"button",class:"w-full","aria-expanded":l.value,"aria-controls":M,"aria-label":f.value,onClick:S},[e.createElementVNode("div",qo,[e.createElementVNode("div",Qo,[e.createVNode(e.unref(ne._sfc_main$1),{icon:"local_activity"}),e.createVNode(e.unref(k._sfc_main),{id:v,variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Add promotion code",id:"checkout.promotion_code.add_label",description:"Label for adding a promotion code in checkout"})),1)]),_:1})]),e.createVNode(e.unref(ne._sfc_main$1),{icon:l.value?"remove":"add"},null,8,["icon"])])],8,Ko),e.withDirectives(e.createElementVNode("div",{id:M,ref_key:"panelRef",ref:_,role:"region","aria-labelledby":v,class:"flex w-full flex-row items-center gap-2 overflow-hidden border-t px-3 py-2",onKeydown:e.withKeys(e.withModifiers(d,["prevent"]),["esc"])},[e.createVNode(e.unref(ae._sfc_main),{modelValue:c.value,"onUpdate:modelValue":s[0]||(s[0]=r=>c.value=r),placeholder:e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.placeholder",description:"Placeholder for promotion code input in checkout"}),"aria-label":e.unref(o)({defaultMessage:"Promotion code",id:"checkout.promotion_code.input_aria_label",description:"Aria label for promotion code input in checkout"}),class:"w-full",onKeydown:e.withKeys(e.withModifiers(A,["prevent"]),["enter"])},null,8,["modelValue","placeholder","aria-label","onKeydown"]),e.createVNode(e.unref(ne._sfc_main),{type:"button",disabled:!E.value,"aria-label":I.value,"aria-disabled":!E.value,onClick:A},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Apply",id:"checkout.promotion_code.apply_button",description:"Button label for applying a promotion code in checkout"})),1)]),_:1},8,["disabled","aria-label","aria-disabled"])],40,Ho),[[e.vShow,l.value]])]),_:1},16)),e.createElementVNode("span",Jo,e.toDisplayString(m.value),1)],64))}}),ti={class:"sv-checkout__header"},ni={class:"sv-checkout__payment-methods"},oi={key:0,class:"sv-checkout__payment-methods-body"},ii={key:3,class:"sv-checkout__payment-form"},ai={class:"sv-checkout__order-summary"},ri={class:"flex flex-col gap-2"},li=e.defineComponent({__name:"Checkout",props:{configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var Ue,Fe,Ge,Ye,Ke,qe,Qe,He,Ze,Xe,We,Je;const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PaymentIntegrationForm-D1oJREmH.js"))),i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./PlanCustomizationEditor-0kEXoOcM.js"))),a=t,l=n,c=e.computed(()=>a.configuration),m=e.ref(),u=e.ref(),_=k.useLogger(),{$t:g,locale:v}=k.useIntl(),{formatTimePeriod:M}=ut.useTimePeriod(),p=Gt.usePortal(),{isMobileViewport:E}=mt.useViewport();if(_.info("COMPONENT_INITIALIZED","Checkout component initialized"),((Ue=p.value)==null?void 0:Ue.type)!=="INIT_PRICING_PLAN_SUBSCRIPTION")throw _.error("INVALID_TOKEN","Invalid token"),Error("Invalid token");p.value.status==="REVOKED"&&(m.value={code:"RESOURCE_REVOKED",message:`Portal url with resource id "${p.value.id}" is revoked`},_.error("RESOURCE_REVOKED",`Portal url with resource id "${p.value.id}" is revoked`));const x=(Ge=(Fe=p.value)==null?void 0:Fe.init_pricing_plan_subscription)==null?void 0:Ge.pricing_plan_subscription_id,f=(Ke=(Ye=p.value)==null?void 0:Ye.init_pricing_plan_subscription)==null?void 0:Ke.success_url,I=((He=(Qe=(qe=p.value)==null?void 0:qe.init_pricing_plan_subscription)==null?void 0:Qe.note)==null?void 0:He.trim())||void 0,{validatedEmail:N,validatedCountry:L,paymentMethodOptions:B,hasPaymentMethodOptionsError:d,retryPaymentMethodOptions:S,subscription:A,isPaymentMethodsPending:U,isInvoicePreviewPending:V,checkoutForm:s,invoicePreview:r,invoicePreviewByBillingPeriod:h,trialInvoicePreview:y,trialPeriod:C,authorizationContext:w,isPaid:O,amount:z,loadInvoicePreview:R,updateInvoicePreviewOnBillingInformationChange:Q,saveFormStateForRedirect:Y}=Ln({initialCountry:(Ze=a.configuration)==null?void 0:Ze.countryCode,initialEmail:(Xe=a.configuration)==null?void 0:Xe.email,subscriptionId:x,enabledPricingIds:(We=a.configuration)==null?void 0:We.enabledPricingIds}),K=e.ref(!1),H=async()=>{var b;await s.validation.value.$validate(),!s.validation.value.$invalid&&(K.value=!0,Y(),(b=u.value)==null||b.submit())},T=()=>{K.value=!1},q=async()=>(await s.validation.value.$validate(),!s.validation.value.$invalid),G=e.computed(()=>!!y.value),F=e.computed(()=>r.value?eo(r.value):!1),Z=e.computed(()=>s.form.value.country&&["US","CA"].includes(s.form.value.country)||!1),W=e.computed({get:()=>s.form.value.enabledPricingIds??[],set:b=>{s.form.value.enabledPricingIds=b}}),J=e.computed(()=>A.value?re.getFirstPricingPlanScheduleOfType({pricingPlanScheduleInfos:A.value.pricing_plan_schedule_infos,type:"DEFAULT"}):void 0),le=e.computed(()=>{var P,D;if(!A.value)return;const b=(D=(P=J.value)==null?void 0:P.pricing_plan_version)==null?void 0:D.pricing_currency_settings;return Mt({country:s.form.value.country,pricingCurrencySettings:b,fallbackCurrency:A.value.billing_currency})}),ue=e.computed(()=>{if(!J.value||!A.value)return new Set;const b=re.getPricingItemConfigMetaById({pricingPlanScheduleInfo:J.value}),P=le.value,D=A.value.billing_period,$=new Set;return b.forEach((j,ee)=>{P&&j.currency!==P||D&&j.billingPeriod&&(j.billingPeriod.type!==D.type||j.billingPeriod.value!==D.value)||$.add(ee)}),$}),fe=e.computed({get:()=>{const b=s.form.value.seatsValues??[],P=ue.value;return P.size?b.filter(({pricing_item_config_id:D})=>P.has(D)):b},set:b=>{const P=s.form.value.seatsValues??[],D=ue.value;if(!D.size){s.form.value.seatsValues=b;return}const $=P.filter(({pricing_item_config_id:j})=>!D.has(j));s.form.value.seatsValues=$.concat(b)}}),ye=e.computed({get:()=>{const b=s.form.value.unitsValues??[],P=ue.value;return P.size?b.filter(({pricing_item_config_id:D})=>P.has(D)):b},set:b=>{const P=s.form.value.unitsValues??[],D=ue.value;if(!D.size){s.form.value.unitsValues=b;return}const $=P.filter(({pricing_item_config_id:j})=>!D.has(j));s.form.value.unitsValues=$.concat(b)}}),Ie=e.computed(()=>{var b,P,D,$,j;return y.value?g({defaultMessage:"{discounted_amount} for {trial_period}, then {subscription_amount}/{billing_period} until canceled, starting {start_date, date, ::MMMMd}.",id:"checkout.agreement.trial",description:"The agreement for the trial period"},{discounted_amount:y.value.tax_summary.total_amount.quantity==="0.00"?g({defaultMessage:"Free",id:"checkout.agreement.trial.free",description:"The free amount for the trial period"}):te.formatAmount(y.value.tax_summary.total_amount),trial_period:M(C.value,{short:!0}),subscription_amount:te.formatAmount(((b=r.value)==null?void 0:b.tax_summary.total_amount)??{quantity:"0.00",currency:"EUR"}),billing_period:M(((P=r.value)==null?void 0:P.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(pe.value)}):g({defaultMessage:"{subscription_amount}/{billing_period} until canceled, starting {start_date, date, long}.",id:"checkout.agreement.subscription",description:"The agreement for the subscription"},{subscription_amount:(D=r.value)!=null&&D.tax_summary.total_amount?te.formatAmount(($=r.value)==null?void 0:$.tax_summary.total_amount):"",billing_period:M(((j=r.value)==null?void 0:j.billing_period)??{type:"MONTH",value:1},{short:!0,singular:!0,hideValueForExactPeriods:!0}),start_date:new Date(pe.value)})}),X=e.computed(()=>{var P;if(!r.value)return;const b=Me.getSubscriptionName({subscription:A.value,fallback:g({defaultMessage:"Subscription",description:"The fallback name for when no subscription name can be determined",id:"customer_overview.subscriptions_block.fallback_subscription_name"})});return{description:b,managementURL:"https://www.solvimon.com/account/billing",agreement:Ie.value,...y.value&&C.value&&{trial:{label:g({defaultMessage:"Trial",id:"checkout.trial.label",description:"The label of the trial"}),amount:y.value.tax_summary.total_amount,startDate:De.value?new Date(De.value):void 0,endDate:ze.value?new Date(ze.value):void 0}},regular:{label:b,amount:r.value.tax_summary.total_amount,startDate:pe.value?new Date(pe.value):void 0,interval:((P=A.value)==null?void 0:P.billing_period)??{type:"MONTH",value:1}}}}),Dt=b=>xe(b),kt=b=>{const{country:P,...D}=b;s.updateInitialState({...D,...P&&Dt(P)?{country:P}:{}})},wt=e.computed(()=>!(N&&L)),De=e.computed(()=>{var D,$,j;const b=($=(D=y.value)==null?void 0:D.periods)==null?void 0:$[0],P=(j=ke.value)==null?void 0:j.trialStartDate;return b!=null&&b.start_at?new Date(b.start_at):P}),ke=e.computed(()=>Me.getFallbackTrialAndSubscriptionStartAndEndDates(A.value)),ze=e.computed(()=>{var D,$,j;const b=($=(D=y.value)==null?void 0:D.periods)==null?void 0:$[0],P=(j=ke.value)==null?void 0:j.trialEndDate;return b!=null&&b.end_at?new Date(b.end_at):P}),pe=e.computed(()=>{var D,$,j;const b=($=(D=r.value)==null?void 0:D.periods)==null?void 0:$[0],P=(j=ke.value)==null?void 0:j.subscriptionStartDate;return b!=null&&b.start_at?new Date(b.start_at):P}),St=e.computed(()=>!!(s.form.value.seatsValues&&s.form.value.seatsValues.length>0||s.form.value.unitsValues&&s.form.value.unitsValues.length>0||A.value&&Pn(A.value)||A.value&&xn(A.value))),ve=e.ref(null),{applyPromotionCode:Re,removePromotionCode:Tt,isPromotionCodePending:Lt,promotionCodeErrorMessage:we}=Bn({checkoutForm:s,updateInvoicePreviewOnBillingInformationChange:Q,formatErrorMessage:({action:b})=>g(b==="apply"?{defaultMessage:"Promotion code could not be applied. Please try again.",id:"checkout.promotion_code.apply_failed",description:"Error message when applying a promotion code in checkout failed"}:{defaultMessage:"Promotion code could not be removed. Please try again.",id:"checkout.promotion_code.remove_failed",description:"Error message when removing a promotion code in checkout failed"}),onInvalidPromotionCode:()=>{ve.value=null},onApplyError:()=>{ve.value=null}});On({subscription:A,promotionCode:(Je=a.configuration)==null?void 0:Je.couponCode,appliedPromotionCode:ve,applyPromotionCode:Re});const je=()=>{f&&de.safeUrlRedirect(f)},Bt=e.computed(()=>{var b;return!((b=a.configuration)!=null&&b.onPaymentSuccess)&&!!f}),Vt=()=>{var b;if(O.value=!0,we.value=null,(b=a.configuration)!=null&&b.onPaymentSuccess){a.configuration.onPaymentSuccess();return}if(f){je();return}},$e=b=>{A.value&&(A.value={...A.value,billing_period:b},R())};return e.onMounted(()=>{l("ready")}),(b,P)=>m.value?(e.openBlock(),e.createBlock(oo,{key:0,class:"sv-checkout sv-root sv-screen sv-checkout--error"})):(e.openBlock(),e.createBlock(e.unref(Jt.ContentWithAsideLayout),{key:1,class:e.normalizeClass(["sv-checkout sv-root sv-screen",{"sv-checkout--paid":e.unref(O)}])},e.createSlots({header:e.withCtx(()=>[e.createElementVNode("div",ti,[e.createVNode(se._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>{var D,$,j;return[e.unref(r)&&e.unref(A)&&pe.value?(e.openBlock(),e.createBlock(Jn,{key:0,class:"sv-checkout__title","trial-start-date":De.value,"trial-period":e.unref(C),"subscription-start-date":pe.value,"subscription-name":((D=e.unref(A))==null?void 0:D.name)??"",amount:($=e.unref(r))==null?void 0:$.invoice_amount_including_tax,"billing-period":(j=e.unref(A))==null?void 0:j.billing_period,"country-code":e.unref(s).form.value.country},null,8,["trial-start-date","trial-period","subscription-start-date","subscription-name","amount","billing-period","country-code"])):e.createCommentVNode("",!0)]}),_:1})])]),content:e.withCtx(()=>{var D,$,j;return[e.unref(O)?(e.openBlock(),e.createBlock(io,{key:0,class:"sv-checkout__completed-payment",onContinueToMerchant:je})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(A)&&e.unref(E)?(e.openBlock(),e.createBlock(st,{key:0,class:"sv-checkout__mobile-order-summary",subscription:e.unref(A),invoice:e.unref(r),"invoice-preview-by-billing-period":e.unref(h),"trial-invoice":e.unref(y),"enabled-pricing-ids":W.value,"trial-period":e.unref(C),avatar:(D=c.value)==null?void 0:D.avatar,"is-paid":e.unref(O),"is-usage-based":F.value,"is-preview-and-payment-methods-pending":e.unref(U)||e.unref(V),"country-code":e.unref(s).form.value.country,collapsible:"collapsed",variant:"products-inline",onBillingPeriodChange:$e},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending","country-code"])):e.createCommentVNode("",!0),St.value&&e.unref(A)?(e.openBlock(),e.createBlock(e.unref(i),{key:1,"seats-values":fe.value,"onUpdate:seatsValues":P[0]||(P[0]=ee=>fe.value=ee),"units-values":ye.value,"onUpdate:unitsValues":P[1]||(P[1]=ee=>ye.value=ee),"enabled-pricing-ids":W.value,"onUpdate:enabledPricingIds":P[2]||(P[2]=ee=>W.value=ee),class:"sv-checkout__plan-customization",subscription:e.unref(A),"initial-seats-values":($=e.unref(s).initialState)==null?void 0:$.value.seatsValues,"initial-units-values":(j=e.unref(s).initialState)==null?void 0:j.value.unitsValues,"billing-period":e.unref(A).billing_period,currency:le.value},null,8,["seats-values","units-values","enabled-pricing-ids","subscription","initial-seats-values","initial-units-values","billing-period","currency"])):e.createCommentVNode("",!0),e.unref(s).form.value.country&&e.unref(z)&&X.value?(e.openBlock(),e.createBlock(Yo,{key:2,class:"sv-checkout__express-payment-methods",amount:e.unref(z),"country-code":e.unref(s).form.value.country,locale:e.unref(v),"payment-methods-options-response":e.unref(B)??[],"billing-information":X.value,"on-billing-information-change":e.unref(Q),onUpdateBillingInformation:kt},null,8,["amount","country-code","locale","payment-methods-options-response","billing-information","on-billing-information-change"])):e.createCommentVNode("",!0),e.createVNode(Hn,{modelValue:e.unref(s).form.value,"onUpdate:modelValue":P[3]||(P[3]=ee=>e.unref(s).form.value=ee),class:"sv-checkout__customer-form",validation:e.unref(s).validation,"read-only-email":e.unref(N),"show-customer-info-on-top":wt.value||e.unref(O),"is-billing-information-mandatory":Z.value,"get-is-field-required":e.unref(s).getIsFieldRequired,"read-only":e.unref(O)},null,8,["modelValue","validation","read-only-email","show-customer-info-on-top","is-billing-information-mandatory","get-is-field-required","read-only"]),e.createElementVNode("div",ni,[e.createVNode(se._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>{var ee,et;return[!e.unref(U)||e.unref(U)&&e.unref(B).length>0?(e.openBlock(),e.createElementBlock("div",oi,[e.createVNode(e.unref(k._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-checkout__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Payment method",id:"checkout.payment_method_block.title",description:"The title of the payment method block in the checkout form"})),1)]),_:1}),e.unref(s).form.value.country?e.unref(d)?(e.openBlock(),e.createBlock(ge._sfc_main,{key:1,class:"sv-checkout__payment-methods-error",icon:"error"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Could not load payment methods",id:"checkout.payment_method_block.load_failed_title",description:"The title shown when the payment methods failed to load"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Check your connection and try again.",id:"checkout.payment_method_block.load_failed_message",description:"The message shown when the payment methods failed to load"})),1)]),action:e.withCtx(()=>[e.createVNode(e.unref(ne._sfc_main),{type:"button",intent:"secondary",size:"sm",class:"sv-action sv-action--secondary sv-checkout__payment-methods-retry",onClick:e.unref(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Try again",id:"checkout.payment_method_block.load_failed_retry_button.label",description:"The label of the button that loads the payment methods again"})),1)]),_:1},8,["onClick"])]),_:1})):e.unref(B).length===0?(e.openBlock(),e.createBlock(ge._sfc_main,{key:2,class:"sv-checkout__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"No payment methods available",id:"checkout.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),_:1})):e.unref(z)&&e.unref(s).form.value.country?(e.openBlock(),e.createElementBlock("div",ii,[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":K.value})},[e.createVNode(e.unref(o),{ref_key:"paymentIntegrationFormRef",ref:u,"country-code":e.unref(s).form.value.country,context:e.unref(w),amount:e.unref(z),email:e.unref(s).form.value.email,variant:"AUTHORIZE","payment-method-options":e.unref(B)??[],"validate-on-submit":q,"redirects-on-success":Bt.value,"force-store-payment-method":"","billing-entity-name":(et=(ee=e.unref(A))==null?void 0:ee.billing_entity)==null?void 0:et.legal_name,onPaymentSuccess:Vt,onPaymentFailed:T,onReady:P[4]||(P[4]=ui=>l("ready"))},null,8,["country-code","context","amount","email","payment-method-options","redirects-on-success","billing-entity-name"])],2)])):e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ge._sfc_main,{key:0,class:"sv-checkout__payment-methods-empty",icon:"captive_portal"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Select your billing country",id:"checkout.payment_method_block.no_country_selected_title",description:"The title shown when no country is selected"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(g)({defaultMessage:"Payment methods will be shown after you select the billing country.",id:"checkout.payment_method_block.no_country_selected_message",description:"The message shown when no country is selected"})),1)]),_:1}))])):e.createCommentVNode("",!0)]}),_:1})])],64))]}),aside:e.withCtx(()=>[e.createElementVNode("div",ai,[e.createVNode(se._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>{var D;return[e.unref(A)&&e.unref(r)?(e.openBlock(),e.createBlock(st,{key:0,subscription:e.unref(A),invoice:e.unref(r),"invoice-preview-by-billing-period":e.unref(h),"trial-invoice":e.unref(y),"enabled-pricing-ids":W.value,"trial-period":e.unref(C),"country-code":e.unref(s).form.value.country,avatar:(D=c.value)==null?void 0:D.avatar,"is-paid":e.unref(O),"is-usage-based":F.value,"is-preview-and-payment-methods-pending":e.unref(U)||e.unref(V),onBillingPeriodChange:$e},null,8,["subscription","invoice","invoice-preview-by-billing-period","trial-invoice","enabled-pricing-ids","trial-period","country-code","avatar","is-paid","is-usage-based","is-preview-and-payment-methods-pending"])):e.createCommentVNode("",!0)]}),_:1})]),e.unref(O)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(ei,{class:"sv-checkout__promotion-code","promotion-code":ve.value,"onUpdate:appliedCode":P[5]||(P[5]=D=>ve.value=D),onRemove:e.unref(Tt),onApply:e.unref(Re)},null,8,["promotion-code","onRemove","onApply"]),e.unref(we)?(e.openBlock(),e.createBlock(e.unref(Ot._sfc_main),{key:0,class:"sv-checkout__promotion-error mt-2",title:e.unref(we)},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",ri,[e.createVNode(se._sfc_main,{class:"sv-checkout__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createBlock(e.unref(ne._sfc_main),{key:0,type:"button",size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",disabled:e.unref(Lt)||e.unref(B).length===0||K.value,loading:K.value,onClick:H},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(G.value?e.unref(g)({defaultMessage:"Start trial",id:"checkout.pay_and_subscribe_button_trial.label",description:"The label of the start trial button in the checkout form"}):e.unref(g)({defaultMessage:"Pay and subscribe",id:"checkout.pay_and_subscribe_button.label",description:"The label of the pay and subscribe button in the checkout form"})),1)]),_:1},8,["disabled","loading"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(pt._sfc_main$1,{"payment-method-options":e.unref(B)},null,8,["payment-method-options"])])],64))]),_:2},[e.unref(I)&&!e.unref(O)?{name:"footer",fn:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main),{tag:"div",variant:"body-xs",color:"subtle",class:"sv-checkout__terms","data-testid":"checkout-terms"},{default:e.withCtx(()=>[e.createVNode(ko,{source:e.unref(I)},null,8,["source"])]),_:1})]),key:"0"}:void 0]),1032,["class"]))}}),si=e.defineComponent({__name:"Checkout.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},emits:["error","ready"],setup(t,{emit:n}){var c;const o=tn.getComponentName("checkout"),i=t,a=n,l=((c=i.configuration)==null?void 0:c.couponCode)??de.getQueryParam("coupon_code")??void 0;return(m,u)=>(e.openBlock(),e.createBlock(e.unref(k._sfc_main$1),{entry:m.$props,"component-name":e.unref(o),"allowed-portal-types":["INIT_PRICING_PLAN_SUBSCRIPTION"],onError:u[1]||(u[1]=_=>m.$emit("error",_))},{default:e.withCtx(()=>{var _,g,v,M,p;return[e.createVNode(li,{configuration:{avatar:(g=(_=t.branding)==null?void 0:_.emblem)==null?void 0:g.public_url,email:(v=t.configuration)==null?void 0:v.email,countryCode:(M=t.configuration)==null?void 0:M.countryCode,enabledPricingIds:(p=t.configuration)==null?void 0:p.enabledPricingIds,couponCode:e.unref(l)},onReady:u[0]||(u[0]=E=>a("ready"))},e.createSlots({_:2},[m.$slots["terms-and-conditions"]?{name:"terms-and-conditions",fn:e.withCtx(()=>[e.renderSlot(m.$slots,"terms-and-conditions")]),key:"0"}:void 0]),1032,["configuration"])]}),_:3},8,["entry","component-name"]))}}),{define:ci}=k.createSolvimonElement(si,"checkout");exports.FALLBACK_SEATS_NUMBER=Nt;exports.FALLBACK_UNITS_NUMBER=Ct;exports._sfc_main=Et;exports.defineSolvimonCheckout=ci;exports.getPricingItemByPricingConfigId=Dn;
@@ -1 +0,0 @@
1
- const e=require("vue"),Je=require("./api.es-duCDtZD9.js"),M=require("./customElements-CSzbVZIH.js"),Ze=require("./sessionReference-m_6Rp4X1.js"),et=require("./useService-H7BjLg8P.js"),Me=require("./ErrorNotification.vue.es-BF6swP7o.js"),J=require("./pricingItemConfigs.es-D4aYkYcf.js"),ue=require("./wallets.es-CNIMW5ay.js"),z=require("./Button.vue.es-TCF-bvDF.js"),j=require("./TooltipParagraph.vue.es-7IQdU3Tf.js"),Z=require("./Section.vue.es-CBZx5x53.js"),Se=require("./Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),xe=require("./RadioGroupExtended.vue.es-Cf5R1P9a.js"),I=require("./index-DwueOtPi.js"),le=require("./formatting.es-C72Nsrmh.js"),tt=require("./Divider.vue.es-UwnWvUTl.js"),Be=require("./Expand.vue.es-BtM0EZEr.js"),Ue=require("./EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-GNPyrcAQ.js"),ot=require("./cn.es-BLE3T5Rx.js"),Pe=require("./invoices-EamWI_jz.js"),nt=require("./useWatchDebounced-CAU1WI1P.js"),at=require("./Input.vue.es-CREdT4nB.js"),re=require("./AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-jWthTJk-.js"),it=require("./SubscriptionSummary.vue_vue_type_script_setup_true_lang-DZKl0Zxp.js"),st=require("./customer.es-BButyYo0.js"),ut=require("./usePaymentMethodOptions-DuXKS36F.js"),Ae=require("./Modal.vue.es-BbdtdxsO.js"),lt=3e4,ne=60,ae=12,rt=e.defineComponent({__name:"DateTimeAgo",props:{date:{},actionVerb:{}},setup(t){const o=60*ne,n=24*o,a=t,{$t:i,formatDate:s}=M.useIntl(),l=e.ref(Date.now());let u;e.onMounted(()=>{u=setInterval(()=>{l.value=Date.now()},lt)}),e.onBeforeUnmount(()=>{clearInterval(u)});const d=(f,v)=>{const p=(v.getFullYear()-f.getFullYear())*ae+(v.getMonth()-f.getMonth());return v.getDate()<f.getDate()?p-1:p},g=e.computed(()=>{const f=Math.max(0,(l.value-a.date.getTime())/1e3);if(f<ne)return i({defaultMessage:"{count, plural, one {# second} other {# seconds}} ago",id:"dateTimeAgo.seconds",description:"Relative time in whole seconds"},{count:Math.trunc(f)});if(f<o)return i({defaultMessage:"{count, plural, one {# minute} other {# minutes}} ago",id:"dateTimeAgo.minutes",description:"Relative time in whole minutes"},{count:Math.trunc(f/ne)});if(f<n)return i({defaultMessage:"{count, plural, one {# hour} other {# hours}} ago",id:"dateTimeAgo.hours",description:"Relative time in whole hours"},{count:Math.trunc(f/o)});const v=d(a.date,new Date(l.value));if(v<1){const p=Math.trunc(f/n);return p===1?i({defaultMessage:"yesterday",id:"dateTimeAgo.yesterday",description:'Relative time for a single day ago, reading as "updated yesterday" once the action verb is in front'}):i({defaultMessage:"{count, plural, one {# day} other {# days}} ago",id:"dateTimeAgo.days",description:"Relative time in whole days"},{count:p})}return v<ae?i({defaultMessage:"{count, plural, one {# month} other {# months}} ago",id:"dateTimeAgo.months",description:"Relative time in whole months"},{count:v}):i({defaultMessage:"{count, plural, one {# year} other {# years}} ago",id:"dateTimeAgo.years",description:"Relative time in whole years"},{count:Math.trunc(v/ae)})}),y=e.computed(()=>a.actionVerb?`${a.actionVerb} ${g.value}`:g.value),S=e.computed(()=>s({date:a.date,format:"dateTime",offsetType:"local"}));return(f,v)=>(e.openBlock(),e.createBlock(j._sfc_main,null,{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(y.value),1)]),_:1}))}}),ct=t=>{const{$t:o,formatNumber:n}=M.useIntl(),a=h=>ue.formatWalletBalanceValue(o,n,h),i=e.computed(()=>{var h,T;return((T=(h=t.walletBalance.wallet)==null?void 0:h.wallet_type)==null?void 0:T.name)||o({defaultMessage:"Balance",id:"wallet_balance.balance_label",description:"Label shown above a wallet's balance amount"})}),s=h=>{var T;return(((T=h.pricing_item)==null?void 0:T.configs)??[]).filter(m=>!!m.on_demand)},l=e.computed(()=>(t.walletBalance.charge_on_demand_pricing_items??[]).filter(h=>s(h).some(T=>J.isFixedPricing(T)||J.isFlexiblePricing(T)))),u=e.computed(()=>l.value.find(h=>s(h).some(T=>J.isFlexiblePricing(T)))),d=e.computed(()=>!!t.showManualTopUp&&l.value.length>0),g=e.computed(()=>!!t.showAutoTopUp&&!!u.value),y=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet)==null?void 0:h.auto_top_up_configs)==null?void 0:T.find(m=>m.status==="ACTIVE")}),S=e.computed(()=>{var h,T;return(T=(h=t.walletBalance.wallet_balance.open_balance)==null?void 0:h.credits)==null?void 0:T.credit_type}),f=(h,T)=>a({credits:{quantity:h,credit_type_id:T,credit_type:S.value}}),v=h=>h.amount?a({amount:h.amount}):h.credits?f(h.credits.quantity,h.credits.credit_type_id):"",p=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.pricing_item_id;if(!m)return;const C=(t.walletBalance.charge_on_demand_pricing_items??[]).filter(A=>A.pricing_item_id===m).flatMap(A=>s(A)).flatMap(A=>A.wallet_grants??[]),B=(T=t.walletBalance.wallet)==null?void 0:T.wallet_type_id;return C.find(A=>A.wallet_type_id===B)??C[0]}),w=e.computed(()=>{var h,T;const m=(h=y.value)==null?void 0:h.topup_amount,C=(T=p.value)==null?void 0:T.credits_grant;if(!m||!C)return"";if(C.credits)return f(C.credits.quantity,C.credits.credit_type_id);if(C.conversion){const B=Number(m.quantity)*Number(C.conversion.rate);return f(String(B),C.conversion.credit_type_id)}return""}),P=e.computed(()=>y.value?o({defaultMessage:"Auto top-up enabled",id:"wallet_balance.auto_top_up_enabled_label",description:"Label shown when a wallet tops itself up automatically"}):o({defaultMessage:"No auto top-up enabled",id:"wallet_balance.auto_top_up_disabled_label",description:"Label shown when a wallet has no automatic top-up configured"})),D=e.computed(()=>{const h=y.value;if(!h)return o({defaultMessage:"Set up an automatic top-up and your balance is increased for you whenever it drops below an amount you choose, so you never run out.",id:"wallet_balance.auto_top_up_setup_explanation",description:"Tooltip explaining what automatic top-ups do, shown when none is configured yet"});const T=h.topup_amount?a({amount:h.topup_amount}):"",m=v(h.threshold);return!T||!m?o({defaultMessage:"Your balance is topped up automatically once it runs low.",id:"wallet_balance.auto_top_up_generic_explanation",description:"Tooltip shown for an active automatic top-up whose amount or threshold is unknown"}):w.value?o({defaultMessage:"Your balance is automatically increased with {topUpCredits} ({topUpAmount}) when it drops below {threshold}.",id:"wallet_balance.auto_top_up_credits_explanation",description:"Tooltip explaining an automatic top-up that grants credits for a paid amount"},{topUpCredits:w.value,topUpAmount:T,threshold:m}):o({defaultMessage:"Your balance is automatically increased with {topUpAmount} when it drops below {threshold}.",id:"wallet_balance.auto_top_up_explanation",description:"Tooltip explaining how the automatic top-up of a wallet balance works"},{topUpAmount:T,threshold:m})});return{walletName:i,formatBalance:a,manualTopUpItems:l,flexibleManualTopUpItem:u,showManualTopUp:d,showAutoTopUp:g,activeTopUpConfig:y,autoTopUpLabel:P,autoTopUpExplanation:D}},dt={class:"flex flex-col gap-3 py-3"},pt={class:"flex flex-col gap-1 px-4"},mt={class:"flex w-full justify-between gap-3"},ft={class:"flex w-full items-center gap-4"},vt={key:0},ht={key:1,class:"flex w-full justify-between gap-3 px-4"},gt={class:"flex min-w-0 items-center gap-1"},_t={class:"flex min-w-0 items-center gap-1"},yt={class:"shrink-0"},bt=e.defineComponent({__name:"WalletBalancesItem",props:{walletBalance:{},showAutoTopUp:{type:Boolean},showManualTopUp:{type:Boolean}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){const o=t,{$t:n}=M.useIntl(),{walletName:a,formatBalance:i,manualTopUpItems:s,flexibleManualTopUpItem:l,showManualTopUp:u,showAutoTopUp:d,activeTopUpConfig:g,autoTopUpLabel:y,autoTopUpExplanation:S}=ct(o);return(f,v)=>(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(M._sfc_main,{variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>{var p,w;return[(p=t.walletBalance.wallet_balance)!=null&&p.balance_at?(e.openBlock(),e.createBlock(rt,{key:0,date:new Date((w=t.walletBalance.wallet_balance)==null?void 0:w.balance_at),"action-verb":e.unref(n)({defaultMessage:"updated",id:"wallet_balance.updated_action_verb",description:"Verb in front of when a wallet balance was last updated, e.g. 'updated 5 minutes ago'"})},null,8,["date","action-verb"])):e.createCommentVNode("",!0)]}),_:1})]),e.createElementVNode("div",ft,[e.createVNode(M._sfc_main,{variant:"body-lg",weight:"semibold","no-spacing":"",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)(o.walletBalance.wallet_balance.open_balance)),1)]),_:1}),e.unref(u)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",onClick:v[0]||(v[0]=p=>f.$emit("top-up",e.unref(s)[0]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Top up",id:"v1V8kA",description:"Button to top up a wallet balance"})),1)]),_:1})):e.createCommentVNode("",!0)])]),f.$slots.graph?(e.openBlock(),e.createElementBlock("div",vt,[e.renderSlot(f.$slots,"graph")])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",gt,[e.createVNode(j._sfc_main,{class:"min-w-0"},{tooltip:e.withCtx(()=>[e.createVNode(j.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(j._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(S)),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",_t,[e.createVNode(M._sfc_main,{variant:"body-sm",color:"secondary","no-spacing":"",class:"truncate"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1}),e.createVNode(z._sfc_main$1,{icon:"info",size:"2xs",class:"shrink-0 cursor-help text-gray-400"})])]),_:1})]),e.createElementVNode("div",yt,[e.unref(g)?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"xs",intent:"secondary",onClick:v[1]||(v[1]=p=>f.$emit("cancel-auto-top-up",e.unref(g)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Disable",id:"wallet_balance.auto_top_up_disable_button",description:"Button to turn off a wallet's automatic top-up"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:1,size:"xs",intent:"secondary",onClick:v[2]||(v[2]=p=>f.$emit("auto-top-up",e.unref(l)))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Enable",id:"wallet_balance.auto_top_up_enable_button",description:"Button to set up a wallet's automatic top-up"})),1)]),_:1}))])])):e.createCommentVNode("",!0)]))}}),wt={class:"flex flex-col gap-2"},Tt=e.defineComponent({__name:"WalletBalances",props:{customerWalletBalances:{},title:{default:void 0},showAutoTopUp:{type:Boolean,default:!1},showManualTopUp:{type:Boolean,default:!1}},emits:["top-up","auto-top-up","cancel-auto-top-up"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(Z._sfc_main,{"no-spacing":"","no-border":"",title:t.title},e.createSlots({default:e.withCtx(()=>[e.createElementVNode("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.customerWalletBalances,a=>(e.openBlock(),e.createBlock(Z._sfc_main,{key:a.wallet_id,"no-spacing":""},{default:e.withCtx(()=>[e.createVNode(bt,{"wallet-balance":a,"show-auto-top-up":t.showAutoTopUp,"show-manual-top-up":t.showManualTopUp,onTopUp:n[0]||(n[0]=i=>o.$emit("top-up",i)),onAutoTopUp:n[1]||(n[1]=i=>o.$emit("auto-top-up",i)),onCancelAutoTopUp:n[2]||(n[2]=i=>o.$emit("cancel-auto-top-up",i))},null,8,["wallet-balance","show-auto-top-up","show-manual-top-up"])]),_:2},1024))),128))])]),_:2},[o.$slots["heading-right"]?{name:"right",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"heading-right")]),key:"0"}:void 0]),1032,["title"]))}});function Ct(){const t=M.createRequestService(),o=M.useConfig();function n(a){return t({url:`${o.apiUrls.config}/portal/customers/${a}/wallets/balance`,query:Je.withExpand({expandParams:Ze.EXPAND_ALL}),options:{method:"POST"},data:{}})}return{getCustomerWalletBalances:n}}function Mt({customerId:t}){const{getCustomerWalletBalances:o}=Ct(),{data:n,execute:a,apiStatus:i,error:s,isPending:l}=et.useService({service:()=>o(t)});return{walletBalances:e.computed(()=>n.value??null),apiStatus:i,error:s,fetch:a,isPending:l}}const ve=(t=[],o)=>{if(o!=null&&o.pricing_item_id)return t.find(n=>(n.charge_on_demand_pricing_items??[]).some(({pricing_item_id:a})=>a===o.pricing_item_id))},St=["TOP_UP","ADD_PAYMENT_METHOD","SUCCESS"],ce=t=>typeof t=="object"&&t!==null&&"pricing_item"in t,xt=t=>[...new Set(((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>ce(o)&&o.pricing_plan_schedule_id?[o.pricing_plan_schedule_id]:[]))],Bt=(t,o)=>{const n=new Set(xt(t));return o.flatMap(a=>{const i=(a.pricing_plan_schedule_infos??[]).filter(({id:s})=>n.has(s));return i.length===0?[]:[{id:a.id,name:a.name||a.reference||a.id,scheduleIds:i.map(({id:s})=>s),enabledPricingIds:i.flatMap(s=>{var l;return(((l=s.pricing_plan_schedule)==null?void 0:l.enabled_pricings)??[]).flatMap(({pricing_id:u})=>u?[u]:[])})}]})},Ut=(t,o)=>{if(!t||o.length===0)return t;const n=new Set(o);return{...t,charge_on_demand_pricing_items:(t.charge_on_demand_pricing_items??[]).filter(a=>ce(a)&&!!a.pricing_plan_schedule_id&&n.has(a.pricing_plan_schedule_id))}},Ne=t=>((t==null?void 0:t.charge_on_demand_pricing_items)??[]).flatMap(o=>{var a,i;if(!ce(o))return[];const n=o.pricing_item_id??((a=o.pricing_item)==null?void 0:a.id);return n?(((i=o.pricing_item)==null?void 0:i.configs)??[]).map(s=>{const l=kt(s,t),u=Pt(s,t);return{pricingItemId:n,...o.pricing_plan_schedule_id&&{pricingPlanScheduleId:o.pricing_plan_schedule_id},config:s,...l&&{flexiblePricing:l},...u&&{fixedPricing:u}}}):[]});function Pt(t,o){var s,l,u;if(!t.on_demand||!J.hasOneOfPricingTypes(t,["FIXED"]))return;const n=(u=(l=(s=t.details)==null?void 0:s.bands)==null?void 0:l[0])==null?void 0:u.fixed_amount;if(!n)return;const a=ke(o),i=a?Nt(t,o):void 0;return{amount:n,value:i&&a?de(i.quantity,a):{amount:n}}}const ke=t=>{var o;return(o=t==null?void 0:t.wallet_balance.balance)==null?void 0:o.credits},Ee=(t,o)=>{var a;const n=(a=o==null?void 0:o.wallet)==null?void 0:a.wallet_type_id;return(t.wallet_grants??[]).filter(({wallet_type_id:i})=>!n||i===n)},At=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.conversion))==null?void 0:n.credits_grant)==null?void 0:a.conversion},Nt=(t,o)=>{var n,a;return(a=(n=Ee(t,o).find(({credits_grant:i})=>i==null?void 0:i.credits))==null?void 0:n.credits_grant)==null?void 0:a.credits},de=(t,o)=>({credits:{...o,quantity:t}}),Ve=(t,o)=>{const n=Number(t),a=Number(o);return Number.isFinite(n)&&Number.isFinite(a)?String(n*a):void 0};function kt(t,o){var d,g,y,S,f,v,p;if(!t.on_demand||!J.isFlexiblePricing(t))return;const n=(g=(d=t.details)==null?void 0:d.bands)==null?void 0:g[0],a=((y=n==null?void 0:n.minimum_amount)==null?void 0:y.currency)??((S=n==null?void 0:n.maximum_amount)==null?void 0:S.currency)??((v=(f=o==null?void 0:o.wallet_balance.balance)==null?void 0:f.amount)==null?void 0:v.currency);if(!a)return;const i=ke(o),s=i?At(t,o):void 0,l=(p=i==null?void 0:i.credit_type)==null?void 0:p.unit_name,u=w=>{if(!w)return;const P=i&&s?Ve(w.quantity,s.rate):void 0;return P!==void 0&&i?de(P,i):{amount:w}};return{config:{...(n==null?void 0:n.minimum_amount)&&{minimum_amount:n.minimum_amount},...(n==null?void 0:n.maximum_amount)&&{maximum_amount:n.maximum_amount}},currency:a,...s&&{creditsConfiguration:{conversionRate:s.rate,...(l==null?void 0:l.singular)&&{unitNameSingle:l.singular},...(l==null?void 0:l.plural)&&{unitNamePlural:l.plural}}},bounds:{...u(n==null?void 0:n.minimum_amount)&&{minimum:u(n==null?void 0:n.minimum_amount)},...u(n==null?void 0:n.maximum_amount)&&{maximum:u(n==null?void 0:n.maximum_amount)}}}}const Et=t=>{var o,n,a,i,s;return!!((o=t.fixedPricing)!=null&&o.value.credits)||!!((n=t.flexiblePricing)!=null&&n.creditsConfiguration)||!!((s=((a=t.flexiblePricing)==null?void 0:a.bounds.minimum)??((i=t.flexiblePricing)==null?void 0:i.bounds.maximum))!=null&&s.credits)},Vt=t=>{var o;for(const{fixedPricing:n,flexiblePricing:a}of t){const i=(n==null?void 0:n.value.credits)??((o=(a==null?void 0:a.bounds.minimum)??(a==null?void 0:a.bounds.maximum))==null?void 0:o.credits);if(i!=null&&i.credit_type_id)return i.credit_type_id}},$t=(t=[])=>{for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return a}},$e=(t=[])=>{var o,n,a;for(const{fixedPricing:i,flexiblePricing:s}of t){const l=(i==null?void 0:i.value.credits)??((o=(s==null?void 0:s.bounds.minimum)??(s==null?void 0:s.bounds.maximum))==null?void 0:o.credits);if((a=(n=l==null?void 0:l.credit_type)==null?void 0:n.unit_name)!=null&&a.plural)return l.credit_type.unit_name.plural}},Ot=(t=[])=>{var o;for(const{flexiblePricing:n}of t){const a=(o=n==null?void 0:n.creditsConfiguration)==null?void 0:o.conversionRate;if(a)return a}},It=(t=[])=>{for(const{flexiblePricing:o}of t){const{minimum_amount:n,maximum_amount:a}=(o==null?void 0:o.config)??{};if(n||a)return{...n&&{minimum:n},...a&&{maximum:a}}}return{}},Dt=(t=[])=>{if(t.some(Et)){const o=Vt(t);return o?{creditTypeId:o}:void 0}for(const{flexiblePricing:o,fixedPricing:n}of t){const a=(o==null?void 0:o.currency)??(n==null?void 0:n.amount.currency);if(a)return{currency:a}}},qt=(t,o)=>{var l;if(t.fixedPricing)return t.fixedPricing.value;if(!t.flexiblePricing||!o)return;const{bounds:n,creditsConfiguration:a}=t.flexiblePricing,i=(l=n.minimum??n.maximum)==null?void 0:l.credits,s=a?Ve(o.quantity,a.conversionRate):void 0;return i&&s!==void 0?de(s,i):{amount:o}},Oe=(t=[])=>{const o=Dt(t);if(o)return{denomination:o,chargeCurrency:$t(t)??"",creditUnitName:$e(t),conversionRate:Ot(t),topUpBounds:It(t)}},Rt=400;function Ft({pricingPlanScheduleId:t,pricingItems:o}){const{previewChargeOnDemandPricingItems:n}=Pe.createInvoicesService(),a=M.useLogger(),i=e.ref(),s=e.ref(!1),l=M.createLatestGuard(),u=async()=>{const d=t.value,g=l();if(!d||!o.value){o.value&&!d&&a.warn("INVOICE_PREVIEW_SKIPPED","Skipped the top-up invoice preview: no schedule to charge it on",{missing:["pricingPlanScheduleId"]}),i.value=void 0,s.value=!1;return}s.value=!0;try{const y=await n({pricingPlanScheduleId:d,pricingItems:o.value});g()&&(i.value=y)}catch(y){g()&&(i.value=void 0),a.error("INVOICE_PREVIEW_FAILED","Failed to load top-up invoice preview",{},y)}finally{g()&&(s.value=!1)}};return nt.useWatchDebounced(o,()=>void u(),{debounce:Rt,deep:!0}),u(),{invoicePreview:i,isPreviewPending:s,loadPreview:u}}const Lt={key:0},Ie=e.defineComponent({__name:"TopUpInvoicePreview",props:{pricingPlanScheduleId:{type:String},pricingItems:{type:Array}},setup(t){const o=t,{$t:n}=M.useIntl(),a=e.computed(()=>o.pricingPlanScheduleId),i=e.computed(()=>o.pricingItems),{invoicePreview:s}=Ft({pricingPlanScheduleId:a,pricingItems:i});return(l,u)=>(e.openBlock(),e.createBlock(Se._sfc_main,{class:"sv-top-up-invoice-preview h-[152px]","data-testid":"top-up-invoice-preview-skeleton"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(ot._sfc_main),{required:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"You will pay",description:"Label above the preview of what topping up will be invoiced for",id:"topup_modal.invoice_preview.label"})),1)]),_:1}),e.createVNode(e.unref(Z._sfc_main),{"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ue._sfc_main$1),{invoice:e.unref(s),"is-customer-facing":""},null,8,["invoice"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))}}),De=(t,o)=>t.currency??o??t.creditTypeId??"",he=(t,o)=>({quantity:t??null,currency:o}),ie=(t,{denomination:o,chargeCurrency:n,creditUnitName:a,minimumTopUp:i})=>{var s,l,u,d,g;return{enabled:(t==null?void 0:t.status)==="ACTIVE",threshold:he(((l=(s=t==null?void 0:t.threshold)==null?void 0:s.amount)==null?void 0:l.quantity)??((d=(u=t==null?void 0:t.threshold)==null?void 0:u.credits)==null?void 0:d.quantity),De(o,a)),topUpAmount:he(((g=t==null?void 0:t.topup_amount)==null?void 0:g.quantity)??i,n)}},Yt=(t,o)=>{var a;const n=(a=t.threshold)==null?void 0:a.quantity;return n?o.creditTypeId?{credits:{quantity:n,credit_type_id:o.creditTypeId}}:{amount:{quantity:n,currency:o.currency??""}}:{}},ge=(t,o)=>{var n;return(n=t.topUpAmount)!=null&&n.quantity?{quantity:t.topUpAmount.quantity,currency:t.topUpAmount.currency??o}:void 0},qe=(t,{denomination:o,chargeCurrency:n})=>({status:t.enabled?"ACTIVE":"INACTIVE",threshold:Yt(t,o),...ge(t,n)&&{topup_amount:ge(t,n)}}),_e=(t,o)=>qe(ie(t,o),o),ye=(t,o)=>JSON.stringify(t)===JSON.stringify(o),be=t=>{const o=Number(t==null?void 0:t.quantity);return t!=null&&t.quantity&&Number.isFinite(o)?o:void 0},Wt=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t>=n},Ht=(t,o)=>{const n=Number(o==null?void 0:o.quantity);return t===null||!(o!=null&&o.quantity)||!Number.isFinite(n)||t<=n},ee=t=>{const o=Number(t);return t!=null&&t!==""&&Number.isFinite(o)?o:void 0},pe=(t,o,n)=>{const a=ee(t),i=ee(n);if(!(a===void 0||i===void 0||i<=0))return o==="CREDITS"?a/i:a*i},we=(t,o,n,a)=>o===n?ee(t):pe(t,o,a),zt=(t,o,n)=>o==="CREDITS"?pe(t,"AMOUNT",n):ee(t),me=t=>t.toFixed(2),Te=(t,o)=>o==="AMOUNT"?me(t):String(Number(t.toFixed(6))),Re=(t,o,n,a)=>{const i=zt(t==null?void 0:t.quantity,o,n);if(i!==void 0)return o==="CREDITS"?a(i):me(i)},jt=["data-testid"],se=e.defineComponent({__name:"ConvertedAmountInput",props:e.mergeModels({unit:{type:String},modelBase:{type:String},entryBase:{type:String},conversionRate:{type:String},showConversionHint:{type:Boolean},currency:{type:String},creditUnitName:{type:String},bounds:{type:Object},label:{type:String},name:{type:String},required:{type:Boolean},disabled:{type:Boolean},error:{type:[String,Object,Array]}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>o.entryBase??o.modelBase),l=e.computed(()=>s.value!==o.modelBase&&ee(o.conversionRate)!==void 0),u=e.ref("");e.watch(()=>[n.value,s.value,o.modelBase,o.conversionRate],([m])=>{if(!l.value){u.value=m??"";return}if(m===g(u.value))return;const C=we(m,o.modelBase,s.value,o.conversionRate);u.value=C===void 0?"":Te(C,s.value)},{immediate:!0});function d(m){return typeof m=="string"?m:typeof m=="number"?String(m):""}function g(m){const C=we(m,s.value,o.modelBase,o.conversionRate);return C===void 0?"":Te(C,o.modelBase)}const y=e.computed({get:()=>u.value,set:m=>{u.value=d(m),n.value=l.value?g(u.value):u.value}}),S=e.computed(()=>pe(u.value,s.value,o.conversionRate)),f=e.computed(()=>o.creditUnitName?o.creditUnitName:s.value==="CREDITS"?o.unit:a({defaultMessage:"credits",description:"Generic name for a wallet credit, where its credit type does not name one",id:"converted_amount_input.credits"})),v=(m,C)=>le.formatAmount({quantity:me(m),currency:C}),p=m=>`${i(m)} ${f.value}`,w=e.computed(()=>{const m=o.error;return Array.isArray(m)?m.length>0:!!(e.isRef(m)?m.value:m)}),P=e.computed(()=>{const m=S.value;if(!(w.value||!o.showConversionHint||m===void 0))return s.value==="CREDITS"?o.currency?a({defaultMessage:"Will cost {amount} excluding taxes",description:"Helper text under a credits field, naming what those credits cost in money",id:"converted_amount_input.cost"},{amount:v(m,o.currency)}):void 0:a({defaultMessage:"Buys about {credits}",description:"Helper text under a money field, naming the credits that amount converts into",id:"converted_amount_input.buys"},{credits:p(m)})}),D=m=>Re(m,s.value,o.conversionRate,i),h=e.computed(()=>{var m,C,B,A;return s.value==="CREDITS"?f.value:((C=(m=o.bounds)==null?void 0:m.minimum)==null?void 0:C.currency)??((A=(B=o.bounds)==null?void 0:B.maximum)==null?void 0:A.currency)??o.unit}),T=e.computed(()=>{var A,_;const m=D((A=o.bounds)==null?void 0:A.minimum),C=D((_=o.bounds)==null?void 0:_.maximum),B=h.value;if(m&&C)return a({defaultMessage:"Between {minimum} and {maximum} {unit}",description:"Range of what a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.range"},{minimum:m,maximum:C,unit:B});if(m)return a({defaultMessage:"At least {minimum} {unit}",description:"Smallest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.minimum"},{minimum:m,unit:B});if(C)return a({defaultMessage:"Up to {maximum} {unit}",description:"Largest amount a flexible top-up may be charged for, beside its label",id:"converted_amount_input.bounds.maximum"},{maximum:C,unit:B})});return(m,C)=>(e.openBlock(),e.createBlock(e.unref(at._sfc_main),{modelValue:y.value,"onUpdate:modelValue":C[0]||(C[0]=B=>y.value=B),class:"sv-converted-amount-input",type:"number","as-text-type":"",name:t.name,label:t.label,required:t.required,disabled:t.disabled,error:t.error},e.createSlots({suffix:e.withCtx(()=>[e.createElementVNode("span",{"data-testid":`${t.name}-unit`},e.toDisplayString(t.unit),9,jt)]),_:2},[T.value?{name:"label-suffix",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-bounds`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value),1)]),_:1},8,["data-testid"])]),key:"0"}:void 0,P.value?{name:"helper",fn:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle","no-spacing":"","data-testid":`${t.name}-conversion`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.value),1)]),_:1},8,["data-testid"])]),key:"1"}:void 0]),1032,["modelValue","name","label","required","disabled","error"]))}}),Qt=e.defineComponent({__name:"Section",props:{emphasized:{type:Boolean,default:!1},contentClasses:{type:String},contentBackground:{type:String},title:{type:String},noSpacing:{type:Boolean},hasError:{type:Boolean},noBorder:{type:Boolean}},setup(t){const o=t,n=["sv-section__accent relative","before:absolute before:inset-y-0.5 before:left-0.5 before:w-0.5","before:rounded-full before:bg-primary-600"].join(" "),a=e.computed(()=>[o.emphasized?n:void 0,o.contentClasses].filter(Boolean).join(" ")),i=e.computed(()=>{const{emphasized:s,...l}=o;return l});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{class:"sv-section","content-classes":a.value}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[s.$slots.right?{name:"right",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"right")]),key:"0"}:void 0]),1040,["content-classes"]))}}),Gt={class:"flex grow flex-col"},Fe=e.defineComponent({__name:"AutoTopUpConfig",props:{config:{type:Object},denomination:{type:Object},creditUnitName:{type:String},chargeCurrency:{type:String},conversionRate:{type:String},topUpBounds:{type:Object},showThresholdConversion:{type:Boolean,default:!0},contained:{type:Boolean},alwaysEnabled:{type:Boolean},disabled:{type:Boolean}},emits:["save"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s,formatNumber:l}=M.useIntl(),u=e.computed(()=>{var _,x;return{denomination:a.denomination,chargeCurrency:a.chargeCurrency,creditUnitName:a.creditUnitName,minimumTopUp:(x=(_=a.topUpBounds)==null?void 0:_.minimum)==null?void 0:x.quantity}}),d=e.ref(ie(a.config,u.value)),g=e.computed(()=>De(a.denomination,a.creditUnitName)),y=e.computed(()=>a.denomination.creditTypeId?"CREDITS":"AMOUNT"),S=e.computed(()=>y.value==="CREDITS"?g.value:a.chargeCurrency),f=e.computed({get:()=>{var _;return((_=d.value.threshold)==null?void 0:_.quantity)??""},set:_=>{d.value.threshold={quantity:_||null,currency:g.value}}}),v=e.computed({get:()=>{var _;return((_=d.value.topUpAmount)==null?void 0:_.quantity)??""},set:_=>{d.value.topUpAmount={quantity:_||null,currency:a.chargeCurrency}}});e.watch(()=>[a.config,u.value],([_,x])=>{ye(_e(_,x),P())||(d.value=ie(_,x))});const p=e.computed({get:()=>a.alwaysEnabled||d.value.enabled,set:_=>{d.value.enabled=_}}),w=e.computed(()=>qe({...d.value,enabled:p.value},u.value)),P=()=>w.value,D=e.reactive({threshold:e.computed(()=>be(d.value.threshold)??null),topUpAmount:e.computed(()=>be(d.value.topUpAmount)??null)}),h=_=>{if(!_)return"";const x=Re(_,y.value,a.conversionRate,l);return x===void 0?le.formatAmount(_):`${x} ${S.value}`},T=I.requiredIf(()=>p.value),m=I.useValidation({threshold:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the balance to top up at.",description:"Error shown under the auto top-up threshold when it is left empty",id:"auto_topup_config.threshold.required"}),T),notNegative:I.common.withMessage(()=>s({defaultMessage:"The balance to top up at cannot be negative.",description:"Error shown under the auto top-up threshold when it is below zero",id:"auto_topup_config.threshold.not_negative"}),_=>_===null||_>=0)},topUpAmount:{required:I.common.withMessage(()=>s({defaultMessage:"Enter the amount to top up with.",description:"Error shown under the auto top-up amount when it is left empty",id:"auto_topup_config.amount.required"}),T),positive:I.common.withMessage(()=>s({defaultMessage:"Top up with more than zero.",description:"Error shown under the auto top-up amount when it is zero or negative",id:"auto_topup_config.amount.positive"}),_=>_===null||_>0),atLeastMinimum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at least {minimum}.",description:"Error shown under the auto top-up amount when it is below what the pricing allows",id:"auto_topup_config.amount.at_least_minimum"},{minimum:h((_=a.topUpBounds)==null?void 0:_.minimum)})},_=>{var x;return Wt(_,(x=a.topUpBounds)==null?void 0:x.minimum)}),withinMaximum:I.common.withMessage(()=>{var _;return s({defaultMessage:"Top up with at most {maximum}.",description:"Error shown under the auto top-up amount when it is above what the pricing allows",id:"auto_topup_config.amount.within_maximum"},{maximum:h((_=a.topUpBounds)==null?void 0:_.maximum)})},_=>{var x;return Ht(_,(x=a.topUpBounds)==null?void 0:x.maximum)})}},D),C=e.computed(()=>!ye(P(),_e(a.config,u.value)));function B(){return m.value.$touch(),m.value.$invalid?void 0:P()}function A(){const _=B();_&&i("save",_)}return o({submit:A,validate:B,rule:w,hasChanges:C,isInvalid:e.computed(()=>m.value.$invalid)}),(_,x)=>(e.openBlock(),e.createBlock(Qt,{class:"sv-auto-topup-config","content-background":t.contained?"gray":"none","no-spacing":!t.contained,"no-border":!t.contained},{default:e.withCtx(()=>[t.alwaysEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(I._sfc_main),{key:0,modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=q=>p.value=q),"no-spacing":"","label-position":"before",class:"!flex",disabled:t.disabled},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",Gt,[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Auto top-up",description:"Title of the automatic wallet top-up settings",id:"auto_topup_config.title"})),1)]),_:1}),e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-xs",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Automatically top up your balance when it runs low.",description:"Subtitle of the automatic wallet top-up settings",id:"auto_topup_config.subtitle"})),1)]),_:1})])]),_:1},8,["modelValue","disabled"])),e.createVNode(e.unref(Be._sfc_main),{"is-open":p.value},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid grid-cols-1 gap-3",{"mt-4":!t.alwaysEnabled}])},[e.createVNode(se,{modelValue:f.value,"onUpdate:modelValue":x[1]||(x[1]=q=>f.value=q),name:"auto-top-up-threshold",unit:g.value,"model-base":y.value,"entry-base":y.value,currency:t.chargeCurrency,"conversion-rate":t.conversionRate,"show-conversion-hint":t.showThresholdConversion,required:"",disabled:t.disabled,error:e.unref(m).threshold.$errors,label:e.unref(s)({defaultMessage:"When your balance falls below",description:"Label of the balance at which an automatic top-up is charged",id:"auto_topup_config.threshold.label"})},null,8,["modelValue","unit","model-base","entry-base","currency","conversion-rate","show-conversion-hint","disabled","error","label"]),e.createVNode(se,{modelValue:v.value,"onUpdate:modelValue":x[2]||(x[2]=q=>v.value=q),name:"auto-top-up-amount",unit:S.value,"model-base":"AMOUNT","entry-base":y.value,currency:t.chargeCurrency,"credit-unit-name":t.creditUnitName,"conversion-rate":t.conversionRate,bounds:t.topUpBounds,"show-conversion-hint":"",required:"",disabled:t.disabled,error:e.unref(m).topUpAmount.$errors,label:e.unref(s)({defaultMessage:"Top-up with",description:"Label of the amount every automatic top-up adds",id:"auto_topup_config.amount.label"})},null,8,["modelValue","unit","entry-base","currency","credit-unit-name","conversion-rate","bounds","disabled","error","label"])],2)):e.createCommentVNode("",!0)]),_:1},8,["is-open"])]),_:1},8,["content-background","no-spacing","no-border"]))}}),Ce=t=>{const o=Date.parse(t??"");return Number.isFinite(o)?o:0};function Le({paymentMethods:t,selectedPaymentMethodId:o,preferredPaymentMethodId:n}){const a=e.computed(()=>[...t.value??[]].sort((i,s)=>Ce(s.created_at)-Ce(i.created_at)));return e.watch(()=>[t.value,n==null?void 0:n.value,o.value],([i,s,l],u)=>{var S;const d=u==null?void 0:u[0],g=i==null?void 0:i.find(({id:f})=>!(d!=null&&d.some(v=>v.id===f)));if(g&&(d!=null&&d.length)){o.value=g.id;return}const y=f=>!!f&&!!(i!=null&&i.some(v=>v.id===f));y(l)||(o.value=y(s)?s:(S=(i==null?void 0:i.find(({is_default:f})=>f))??a.value[0])==null?void 0:S.id)},{immediate:!0}),{sortedPaymentMethods:a}}function te(){const{$t:t,formatNumber:o}=M.useIntl(),n=i=>ue.formatWalletBalanceValue(t,o,i);return{formatValue:n,formatOpenBalance:i=>n(i==null?void 0:i.wallet_balance.open_balance)}}const Kt={class:"sv-top-up-form"},Xt={class:"grid grid-cols-1 gap-4"},Jt={class:"grid grid-cols-1 gap-1"},Zt={class:"sv-top-up-form__option-details"},eo={key:0},to=e.defineComponent({__name:"TopUpModalForm",props:{topUpPricingItems:{type:null},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},autoTopUpConfig:{type:Object}},emits:["add-payment-method","success","save-auto-top-up","failure"],setup(t,{expose:o,emit:n}){const a=t,i=n,{$t:s}=M.useIntl(),{formatValue:l}=te(),u=e.ref({pricing_plan_schedule_id:"",pricing_items:[],start_at:"",finalize_immediately:!1,payment_method_id:void 0,preview:!0}),d=e.computed(()=>{const r=(a.topUpPricingItems??[]).filter(c=>c.flexiblePricing||c.fixedPricing);return[...r.filter(({flexiblePricing:c})=>c),...r.filter(({flexiblePricing:c})=>!c)]}),g=r=>d.value.find(c=>c.pricingItemId===r),y=e.computed(()=>{var r,c;return(c=(r=a.topUpPricingItems)==null?void 0:r.find(b=>b.pricingPlanScheduleId))==null?void 0:c.pricingPlanScheduleId});e.watch(y,r=>{u.value.pricing_plan_schedule_id=r??""},{immediate:!0});const S=r=>{const{config:c,currency:b}=r.flexiblePricing??{},N=c==null?void 0:c.minimum_amount;return N&&b?{quantity:N.quantity,currency:b}:void 0},f=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.pricing_item_id},set:r=>{const c=g(typeof r=="string"?r:void 0);if(!c){u.value.pricing_items=[];return}const b=S(c);u.value.pricing_items=[{pricing_item_id:c.pricingItemId,...b&&{flexible_amount:b}}]}});e.watch(d,r=>{if(r.some(({pricingItemId:N})=>{var V;return N===((V=u.value.pricing_items[0])==null?void 0:V.pricing_item_id)}))return;const b=r.find(({flexiblePricing:N})=>N)??r[0];f.value=b==null?void 0:b.pricingItemId},{immediate:!0});const v=e.computed({get:()=>{var r;return(r=u.value.pricing_items[0])==null?void 0:r.flexible_amount},set:r=>{var b;const c=(b=u.value.pricing_items[0])==null?void 0:b.pricing_item_id;c&&(u.value.pricing_items=[{pricing_item_id:c,...r&&{flexible_amount:r}}])}}),p=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.fixedPricing;return c!=null&&c.value.credits?le.formatAmount(c.amount):void 0},w=e.computed(()=>{var r;return(r=g(String(f.value)))==null?void 0:r.flexiblePricing}),P=e.computed({get:()=>{var r;return((r=v.value)==null?void 0:r.quantity)??""},set:r=>{var b;const c=(b=w.value)==null?void 0:b.currency;v.value=r&&c?{quantity:r,currency:c}:void 0}}),D=r=>r.creditsConfiguration?"CREDITS":"AMOUNT",h=e.computed(()=>$e(a.topUpPricingItems)),T=r=>r.creditsConfiguration?h.value??r.creditsConfiguration.unitNamePlural??r.creditsConfiguration.unitNameSingle??"":r.currency,m=r=>{var b;const c=(b=g(String(r)))==null?void 0:b.flexiblePricing;return c?[c]:[]},C=r=>{var c;return!!((c=g(String(r)))!=null&&c.flexiblePricing)},B=e.computed(()=>d.value.map(r=>{var c;return{value:r.pricingItemId,label:r.fixedPricing?l(r.fixedPricing.value):s({defaultMessage:"Choose your own amount",description:"Label of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.label"}),...((c=r.flexiblePricing)==null?void 0:c.bounds.minimum)&&r.flexiblePricing.bounds.maximum&&{description:s({defaultMessage:"Between {minimum} and {maximum}",description:"Bounds of the choose-your-amount option in the top-up modal",id:"topup_modal.flexible_option.bounds"},{minimum:l(r.flexiblePricing.bounds.minimum),maximum:l(r.flexiblePricing.bounds.maximum)})}}})),A=e.computed(()=>{const r=u.value.pricing_items.filter(c=>{var b;return!((b=g(c.pricing_item_id))!=null&&b.flexiblePricing)||!!c.flexible_amount});return r.length>0?r:void 0}),_=e.computed(()=>!a.autoTopUpConfig&&d.value.some(({flexiblePricing:c})=>c)?Oe(a.topUpPricingItems):void 0),x=e.ref(),{chargeOnDemandPricingItems:q}=Pe.createInvoicesService(),Q=M.useLogger(),R=e.ref(!1),L=e.computed(()=>!!u.value.pricing_plan_schedule_id&&!!A.value&&!!u.value.payment_method_id),G=e.reactive({paymentMethodId:e.computed(()=>u.value.payment_method_id??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>s({defaultMessage:"Select a payment method to pay for this top-up.",description:"Error shown under the payment methods in the top-up modal when none is selected on submit",id:"topup_modal.payment_method_required"}),I.required)}},G),Y=e.computed(()=>{const[r]=u.value.pricing_items,c=g(r==null?void 0:r.pricing_item_id);return c?qt(c,r==null?void 0:r.flexible_amount):void 0});async function K(){var c,b,N;W.value.$touch();const r=(c=x.value)==null?void 0:c.validate();if(!(W.value.$invalid||(b=x.value)!=null&&b.isInvalid||!L.value||R.value)){R.value=!0;try{const V=await q({pricing_plan_schedule_id:u.value.pricing_plan_schedule_id,pricing_items:A.value??[],payment_method_id:u.value.payment_method_id,preview:!1});r&&((N=x.value)!=null&&N.hasChanges)&&u.value.payment_method_id&&i("save-auto-top-up",{rule:r,paymentMethodId:u.value.payment_method_id}),i("success",V)}catch(V){Q.error("TOP_UP_FAILED","Failed to charge the wallet top-up",{},V),i("failure",V)}finally{R.value=!1}}}o({submit:K,isCharging:R,canSubmit:L,chargedValue:Y});const H=e.computed({get:()=>u.value.payment_method_id??void 0,set:r=>{u.value.payment_method_id=r}}),{sortedPaymentMethods:X}=Le({paymentMethods:e.computed(()=>a.paymentMethods),selectedPaymentMethodId:H});return(r,c)=>(e.openBlock(),e.createElementBlock("form",Kt,[e.createElementVNode("div",Xt,[e.createElementVNode("div",Jt,[B.value.length>0?(e.openBlock(),e.createBlock(e.unref(xe._sfc_main),{key:0,modelValue:f.value,"onUpdate:modelValue":c[3]||(c[3]=b=>f.value=b),class:"sv-top-up-form__options",name:"top-up-pricing-item",direction:"column",required:"",disabled:R.value,options:B.value,"show-radio":!1,label:e.unref(s)({defaultMessage:"Top up amount",description:"Label above the list of ways to top up the wallet in the top-up modal",id:"topup_modal.pricing_items.label"})},{label:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("span",null,e.toDisplayString(b.label),1),p(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",weight:"normal","no-spacing":"",class:"sv-top-up-form__option-cost"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p(N)),1)]),_:2},1024)):e.createCommentVNode("",!0)]),description:e.withCtx(({option:b,optionValue:N})=>[e.createElementVNode("div",Zt,[b.description&&!C(N)?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),m(N).length>0?(e.openBlock(),e.createBlock(e.unref(Be._sfc_main),{key:1,"is-open":String(N)===f.value,lazy:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(N),V=>{var k;return e.openBlock(),e.createElementBlock("div",{key:V.currency,class:"sv-top-up-form__amount grid grid-cols-1 gap-3",onClick:c[1]||(c[1]=e.withModifiers(()=>{},["stop"])),onKeydown:c[2]||(c[2]=e.withModifiers(()=>{},["stop"]))},[b.description?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,tag:"span",variant:"body-xs",color:"subtle","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.description),1)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(se,{modelValue:P.value,"onUpdate:modelValue":c[0]||(c[0]=O=>P.value=O),name:"top-up-amount","model-base":"AMOUNT",unit:T(V),"entry-base":D(V),currency:V.currency,"conversion-rate":(k=V.creditsConfiguration)==null?void 0:k.conversionRate,required:"",disabled:R.value},null,8,["modelValue","unit","entry-base","currency","conversion-rate","disabled"])],32)}),128))]),_:2},1032,["is-open"])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","disabled","options","label"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createVNode(Ie,{"pricing-plan-schedule-id":y.value,"pricing-items":A.value},null,8,["pricing-plan-schedule-id","pricing-items"])]),_.value?(e.openBlock(),e.createElementBlock("div",eo,[e.createVNode(Fe,e.mergeProps({ref_key:"autoTopUpFormRef",ref:x,class:"sv-top-up-form__auto-top-up"},_.value,{contained:"","show-threshold-conversion":!1,disabled:R.value}),null,16,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(e.unref(tt._sfc_main),{spacing:"xs"})]),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"payment-method",{},()=>[e.createVNode(re._sfc_main,{modelValue:H.value,"onUpdate:modelValue":c[4]||(c[4]=b=>H.value=b),class:"sv-top-up-form__payment-methods","payment-methods":e.unref(X),required:"",error:e.unref(W).paymentMethodId.$errors,"payment-method-options":t.paymentMethodOptions,disabled:R.value,label:e.unref(s)({defaultMessage:"Payment method",description:"Label above the payment method that pays for the top-up, in the top-up modal",id:"topup_modal.payment_method_selector.label"}),onAddPaymentMethod:c[5]||(c[5]=b=>i("add-payment-method"))},null,8,["modelValue","payment-methods","error","payment-method-options","disabled","label"])])])])]))}}),oo={class:"sv-top-up-success grid grid-cols-1 gap-4"},no=e.defineComponent({__name:"TopUpModalSuccess",props:{addedValue:{type:Object},invoice:{type:Object}},setup(t){const{$t:o}=M.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",oo,[t.invoice?(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),{key:0,"content-background":"none"},{default:e.withCtx(()=>[e.createVNode(e.unref(M._sfc_main),{tag:"span",variant:"body-sm",weight:"semibold",class:"mb-2 block"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Receipt",description:"Heading above the invoice a completed top-up produced",id:"topup_modal.success.receipt.heading"})),1)]),_:1}),e.createVNode(e.unref(Ue._sfc_main$1),{invoice:t.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})):e.createCommentVNode("",!0)]))}});function ao({step:t,currentBalance:o,topUpValue:n}){const{$t:a,formatNumber:i}=M.useIntl(),s=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add payment method",description:"Title of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.title"}):t.value==="SUCCESS"?a({defaultMessage:"Top-up complete",description:"Title of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_title"}):a({defaultMessage:"Top up balance",description:"Title of the wallet top-up modal",id:"topup_modal.title"})),l=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Add a new payment method for topping up your balance.",description:"Subtitle of the top-up modal while the customer is adding a payment method",id:"topup_modal.add_payment_method.subtitle"}):t.value==="SUCCESS"?a({defaultMessage:"Your payment went through.",description:"Subtitle of the top-up modal once the top-up has been charged",id:"topup_modal.success.modal_subtitle"}):a({defaultMessage:"Your current balance is {balance}.",description:"Subtitle of the top-up modal showing the current wallet balance",id:"topup_modal.subtitle"},{balance:o.value})),u=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Back",description:"Label of the button that leaves the add payment method step in the top-up modal",id:"topup_modal.back_button.label"}):a({defaultMessage:"Cancel",description:"Label of the button that closes the top-up modal",id:"topup_modal.cancel_button.label"})),d=e.computed(()=>t.value==="ADD_PAYMENT_METHOD"?a({defaultMessage:"Save payment method",description:"Label of the confirm button in the top-up modal while adding a payment method",id:"topup_modal.save_payment_method.label"}):t.value==="SUCCESS"?a({defaultMessage:"Done",description:"Label of the button that dismisses the top-up modal once the top-up has been charged",id:"topup_modal.done_button.label"}):n.value?a({defaultMessage:"Top up balance with {value}",description:"Label of the confirm button in the top-up modal once an amount is entered",id:"topup_modal.confirm_button.label"},{value:ue.formatWalletBalanceValue(a,i,n.value)}):a({defaultMessage:"Top up balance",description:"Label of the confirm button in the top-up modal while no amount is entered",id:"topup_modal.confirm_button.empty.label"}));return{title:s,subTitle:l,cancelButtonText:u,confirmButtonText:d}}function Ye({isOpen:t,customer:o}){const{paymentMethodOptions:n,get:a,isPending:i}=ut.usePaymentMethodOptions();e.watch(()=>[t.value,o.value],([l,u])=>{!l||!u||a({customerId:u.id,country:st.getCustomerCountry(u)})},{immediate:!0});const s=e.computed(()=>i.value?void 0:n.value);return{paymentMethodOptions:n,settledOptions:s,isPending:i}}function io(t){const o=e.ref(0),n=i=>{o.value=(i==null?void 0:i.offsetHeight)??0},a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i=>{var l;const s=(l=i[0])==null?void 0:l.target;n(s instanceof HTMLElement?s:void 0)});return e.watch(t,(i,s)=>{s&&(a==null||a.unobserve(s)),n(i),i&&(a==null||a.observe(i))},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{a==null||a.disconnect()}),o}const so=["inert"],uo=300,lo="1rem",ro=e.defineComponent({__name:"SlidingPanes",props:{panes:{type:Array},current:{type:String}},setup(t){const o=t,n=e.ref(!1);let a;e.watch(()=>o.current,()=>{n.value=!0,clearTimeout(a),a=setTimeout(()=>{n.value=!1},uo)}),e.onBeforeUnmount(()=>{clearTimeout(a)});const i=e.ref({}),s={},l=y=>s[y]??(s[y]=S=>{i.value[y]=S instanceof HTMLElement?S:void 0}),u=e.computed(()=>i.value[o.current]),d=io(u),g=e.computed(()=>{const y=o.panes.indexOf(o.current);return y>0?`translateX(calc(${-y} * (100% + ${lo})))`:"translateX(0px)"});return(y,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sv-sliding-panes__viewport relative -mx-2 overflow-hidden px-2",n.value?"transition-[height] duration-300 ease-in-out motion-reduce:transition-none":""]),style:e.normalizeStyle(e.unref(d)?{height:`${e.unref(d)}px`}:void 0)},[e.createElementVNode("div",{class:"sv-sliding-panes__track flex items-start gap-4 transition-transform duration-300 ease-in-out motion-reduce:transition-none",style:e.normalizeStyle({transform:g.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.panes,f=>(e.openBlock(),e.createElementBlock("div",{key:f,class:"sv-sliding-panes__pane w-full shrink-0",inert:f!==t.current||void 0},[e.createElementVNode("div",{ref_for:!0,ref:l(f)},[e.renderSlot(y.$slots,f)],512)],8,so))),128))],4)],6))}}),co={class:"grid grid-cols-1 gap-4 pb-4"},We=e.defineComponent({__name:"WalletModalShell",props:{showModal:{type:Boolean},title:{type:String},subTitle:{type:String},cancelButtonText:{type:String},confirmButtonText:{type:String},isPending:{type:Boolean},panes:{type:Array},step:{type:String},addPaymentMethodPane:{type:String},customer:{type:Object},paymentMethodOptions:{type:Array},isPaymentMethodOptionsPending:{type:Boolean},isAddingPaymentMethod:{type:Boolean}},emits:["confirm","cancel","payment-success","payment-failed"],setup(t,{expose:o}){const n=t,a=e.ref(),i=e.computed(()=>n.panes.filter(s=>s!==n.addPaymentMethodPane));return o({submit:()=>{var s;return(s=a.value)==null?void 0:s.submit()},isSaving:e.computed(()=>{var s;return!!((s=a.value)!=null&&s.isSaving)})}),(s,l)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{"no-click-away":"","show-modal":t.showModal,size:"lg",title:t.title,"sub-title":t.subTitle,"cancel-button-text":t.cancelButtonText,"confirm-button-text":t.confirmButtonText,"is-loading":t.isPending,onConfirm:l[2]||(l[2]=u=>s.$emit("confirm")),onClose:l[3]||(l[3]=u=>s.$emit("cancel"))},e.createSlots({body:e.withCtx(()=>[e.createElementVNode("div",co,[e.createVNode(ro,{panes:t.panes,current:t.step},e.createSlots({[t.addPaymentMethodPane]:e.withCtx(()=>[e.createVNode(re._sfc_main$1,{ref_key:"paneRef",ref:a,customer:t.customer,"payment-method-options":t.paymentMethodOptions,"is-loading":t.isPaymentMethodOptionsPending,"is-active":t.isAddingPaymentMethod,onSuccess:l[0]||(l[0]=u=>s.$emit("payment-success")),onFailure:l[1]||(l[1]=u=>s.$emit("payment-failed",u))},null,8,["customer","payment-method-options","is-loading","is-active"])]),_:2},[e.renderList(i.value,u=>({name:u,fn:e.withCtx(()=>[e.renderSlot(s.$slots,u)])}))]),1032,["panes","current"])])]),_:2},[s.$slots.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"footer")]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-loading"]))}}),He=t=>{var o;return(((o=t==null?void 0:t.wallet)==null?void 0:o.auto_top_up_configs)??[]).find(({status:n})=>n==="ACTIVE")},ze=t=>t?{status:t.status,threshold:t.threshold,...t.topup_amount&&{topup_amount:t.topup_amount}}:void 0,je=(t,o=[])=>{if(t!=null&&t.pricing_item_id&&t.pricing_plan_schedule_id)return{pricingItemId:t.pricing_item_id,pricingPlanScheduleId:t.pricing_plan_schedule_id};const n=o.find(({flexiblePricing:a,pricingPlanScheduleId:i})=>a&&i);return n!=null&&n.pricingPlanScheduleId?{pricingItemId:n.pricingItemId,pricingPlanScheduleId:n.pricingPlanScheduleId}:void 0},Qe=({rule:t,walletBalanceItem:o,chargeTarget:n,paymentMethodId:a})=>{var s,l;const i=!!(((s=t==null?void 0:t.threshold)==null?void 0:s.amount)??((l=t==null?void 0:t.threshold)==null?void 0:l.credits));if(!(!t||!i||!(o!=null&&o.wallet_id)||!n||!a))return{wallet_id:o.wallet_id,status:t.status,threshold:t.threshold,pricing_plan_schedule_id:n.pricingPlanScheduleId,pricing_item_id:n.pricingItemId,payment_method_id:a,...t.topup_amount&&{topup_amount:t.topup_amount}}};function Ge({step:t,name:o,returnTo:n}){const a=e.ref();return{paneRef:a,isActive:e.computed(()=>t.value===o),isSaving:e.computed(()=>{var i;return!!((i=a.value)!=null&&i.isSaving)}),open:()=>{t.value=o},leave:()=>{t.value=n},submit:()=>{var i;return(i=a.value)==null?void 0:i.submit()}}}function Ke(){const t=M.createRequestService(),o=M.useConfig(),n="/portal/auto-top-up-configs";function a(u){return t({url:`${o.apiUrls.config}${n}`,query:{...u},isCollection:!0})}function i(u){return t({url:`${o.apiUrls.config}${n}/${u}`})}function s(u){return t({url:`${o.apiUrls.config}${n}`,options:{method:"POST"},data:u})}function l(u){return t({url:`${o.apiUrls.config}${n}/${u}/deactivate`,options:{method:"POST"}})}return{getAutoTopUpConfigs:a,getAutoTopUpConfig:i,createAutoTopUpConfig:s,deactivateAutoTopUpConfig:l}}function Xe(){const{createAutoTopUpConfig:t}=Ke(),o=M.useLogger(),n=e.ref(!1);return{save:async i=>{if(!i||n.value)return{saved:!1};n.value=!0;try{return await t(i),{saved:!0}}catch(s){return o.error("AUTO_TOP_UP_SAVE_FAILED","Failed to save the automatic top-up rule",{},s),{saved:!1,error:s}}finally{n.value=!1}},isSaving:n}}const po={key:0,class:"mb-4"},mo={class:"sr-only"},fo={class:"flex flex-col gap-2"},vo=e.defineComponent({__name:"TopUpModal",props:{showModal:{type:Boolean},selectedBalanceItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object},subscriptions:{type:Array}},emits:["confirm","close","auto-top-up-saved","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.computed(()=>ze(He(n.selectedBalanceItem))),u=e.computed(()=>s(n.selectedBalanceItem)),d=e.computed(()=>Bt(n.selectedBalanceItem,n.subscriptions??[])),g=e.ref();e.watch(d,U=>{var E;U.some(({id:oe})=>oe===g.value)||(g.value=(E=U[0])==null?void 0:E.id)},{immediate:!0});const y=e.computed(()=>d.value.length>1),S=e.computed(()=>d.value.map(({id:U,name:$})=>({value:U,label:$}))),f=e.computed(()=>Object.fromEntries(d.value.flatMap(({id:U,enabledPricingIds:$})=>{const E=(n.subscriptions??[]).find(({id:oe})=>oe===U);return E?[[U,{subscription:E,enabledPricingIds:$}]]:[]}))),v=e.computed(()=>{var $;if(!n.selectedBalanceItem||!(($=n.subscriptions)!=null&&$.length))return n.selectedBalanceItem;const U=d.value.find(({id:E})=>E===g.value);return U?Ut(n.selectedBalanceItem,U.scheduleIds):{...n.selectedBalanceItem,charge_on_demand_pricing_items:[]}}),p=e.computed(()=>Ne(v.value)),{paymentMethodOptions:w,settledOptions:P,isPending:D}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),h=e.ref("TOP_UP"),T=e.computed(()=>(n.paymentMethods??[]).length>0),m=e.computed(()=>!D.value&&(w.value??[]).length===0),C=e.computed(()=>h.value==="TOP_UP"&&!T.value&&m.value),B=e.ref(),A=e.ref(),_=()=>{L(),a("payment-success")},{paneRef:x,isActive:q,isSaving:Q,open:R,leave:L,submit:G}=Ge({step:h,name:"ADD_PAYMENT_METHOD",returnTo:"TOP_UP"}),{save:W}=Xe(),Y=e.ref(),K=e.computed(()=>{var U;return(U=Y.value)==null?void 0:U.chargedValue}),H=e.computed(()=>{var U;return Q.value||!!((U=Y.value)!=null&&U.isCharging)}),{title:X,subTitle:r,cancelButtonText:c,confirmButtonText:b}=ao({step:h,currentBalance:u,topUpValue:K}),N=()=>{var U;if(q.value){G();return}(U=Y.value)==null||U.submit()},V=async({rule:U,paymentMethodId:$})=>{const{saved:E}=await W(Qe({rule:U,walletBalanceItem:n.selectedBalanceItem,chargeTarget:je(void 0,p.value),paymentMethodId:$}));E&&a("auto-top-up-saved")},k=U=>{var $;B.value=U,A.value=($=Y.value)==null?void 0:$.chargedValue,h.value="SUCCESS"},O=()=>{a("confirm"),a("close")},F=()=>{if(!H.value){if(q.value){L();return}if(h.value==="SUCCESS"){O();return}a("close")}},fe=e.ref(0);return e.watch(()=>n.showModal,U=>{U&&(h.value="TOP_UP",B.value=void 0,A.value=void 0,fe.value+=1)}),(U,$)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:x,"show-modal":t.showModal,title:e.unref(X),"sub-title":e.unref(r),"cancel-button-text":e.unref(c),"confirm-button-text":e.unref(b),"is-pending":H.value,panes:e.unref(St),step:h.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(w),"is-payment-method-options-pending":e.unref(D),"is-adding-payment-method":e.unref(q),onConfirm:N,onCancel:F,onPaymentSuccess:_,onPaymentFailed:$[1]||($[1]=E=>U.$emit("payment-failed",E))},e.createSlots({TOP_UP:e.withCtx(()=>[y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(xe._sfc_main),{modelValue:g.value,"onUpdate:modelValue":$[0]||($[0]=E=>g.value=E),class:"sv-topup-modal__subscription",name:"top-up-subscription",direction:"column",required:"",options:S.value,"show-radio":!1,label:e.unref(i)({defaultMessage:"Subscription to top up",description:"Label above the list of subscriptions a top-up can be charged against, in the top-up modal",id:"topup_modal.subscriptions.label"})},{prefix:e.withCtx(({optionValue:E})=>[f.value[String(E)]?(e.openBlock(),e.createBlock(it._sfc_main,{key:0,class:"sv-topup-modal__subscription-option grow","no-spacing":"",subscription:f.value[String(E)].subscription,"enabled-pricing-ids":f.value[String(E)].enabledPricingIds},null,8,["subscription","enabled-pricing-ids"])):e.createCommentVNode("",!0)]),label:e.withCtx(({option:E})=>[e.createElementVNode("span",mo,e.toDisplayString(E.label),1)]),_:1},8,["modelValue","options","label"])])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(to,{key:fe.value,ref_key:"topUpFormRef",ref:Y,"top-up-pricing-items":p.value,"payment-methods":t.paymentMethods,"auto-top-up-config":l.value,"payment-method-options":e.unref(P),onAddPaymentMethod:e.unref(R),onSuccess:k,onSaveAutoTopUp:V},null,8,["top-up-pricing-items","payment-methods","auto-top-up-config","payment-method-options","onAddPaymentMethod"]))]),SUCCESS:e.withCtx(()=>[B.value?(e.openBlock(),e.createBlock(no,{key:0,"added-value":A.value,invoice:B.value},null,8,["added-value","invoice"])):e.createCommentVNode("",!0)]),_:2},[h.value==="SUCCESS"||C.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",fo,[h.value==="SUCCESS"?(e.openBlock(),e.createBlock(e.unref(z._sfc_main),{key:0,size:"lg","data-testid":"done",onClick:O},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(z._sfc_main),{size:"lg",disabled:"","data-testid":"confirm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)),1)]),_:1}),e.createVNode(e.unref(z._sfc_main),{size:"lg",intent:"subtle","data-testid":"cancel",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)),1)]),_:1})],64))])]),key:"0"}:void 0]),1032,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),ho=["AUTO_TOP_UP","ADD_PAYMENT_METHOD"],go={class:"grid grid-cols-1 gap-4"},_o=e.defineComponent({__name:"AutoTopUpModal",props:{showModal:{type:Boolean},walletBalanceItem:{type:Object},topUpItem:{type:Object},paymentMethods:{type:Array},customer:{type:Object}},emits:["saved","close","payment-success","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),{formatOpenBalance:s}=te(),l=e.ref("AUTO_TOP_UP"),u=e.computed(()=>s(n.walletBalanceItem)),d=e.computed(()=>Ne(n.walletBalanceItem)),g=e.computed(()=>Oe(d.value)),y=e.computed(()=>He(n.walletBalanceItem)),S=e.computed(()=>ze(y.value)),f=e.computed(()=>je(n.topUpItem,d.value)),v=e.ref(),p=e.computed(()=>{var O,F;const k=(F=(O=v.value)==null?void 0:O.rule)==null?void 0:F.topup_amount;return k!=null&&k.quantity&&f.value?[{pricing_item_id:f.value.pricingItemId,flexible_amount:k}]:void 0}),w=e.computed(()=>{var k;return(k=f.value)==null?void 0:k.pricingPlanScheduleId}),P=e.ref(),{sortedPaymentMethods:D}=Le({paymentMethods:e.computed(()=>n.paymentMethods),selectedPaymentMethodId:P,preferredPaymentMethodId:e.computed(()=>{var k;return(k=y.value)==null?void 0:k.payment_method_id})}),{paymentMethodOptions:h,settledOptions:T,isPending:m}=Ye({isOpen:e.computed(()=>n.showModal),customer:e.computed(()=>n.customer)}),{paneRef:C,isActive:B,isSaving:A,open:_,leave:x,submit:q}=Ge({step:l,name:"ADD_PAYMENT_METHOD",returnTo:"AUTO_TOP_UP"}),{save:Q,isSaving:R}=Xe(),L=e.computed(()=>A.value||R.value),G=e.reactive({paymentMethodId:e.computed(()=>P.value??null)}),W=I.useValidation({paymentMethodId:{required:I.common.withMessage(()=>i({defaultMessage:"Select a payment method to pay for automatic top-ups.",description:"Error shown in the auto top-up modal when no payment method is selected",id:"auto_topup_modal.payment_method.required"}),I.required)}},G),Y=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Title of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.title"}):i({defaultMessage:"Automatic top-up",description:"Title of the automatic wallet top-up modal",id:"auto_topup_modal.title"})),K=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"This method pays for every automatic top-up.",description:"Subtitle of the auto top-up modal while the customer is adding a payment method",id:"auto_topup_modal.add_payment_method.subtitle"}):i({defaultMessage:"Your current balance is {balance}. Enable auto top so you can stay productive",description:"Subtitle of the automatic wallet top-up modal, naming the balance",id:"auto_topup_modal.subtitle"},{balance:u.value})),H=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Back",description:"Button returning from adding a payment method to the auto top-up rule",id:"auto_topup_modal.add_payment_method.cancel"}):i({defaultMessage:"Cancel",description:"Button dismissing the auto top-up modal",id:"auto_topup_modal.cancel"})),X=e.computed(()=>l.value==="ADD_PAYMENT_METHOD"?i({defaultMessage:"Add payment method",description:"Button storing the payment method being added in the auto top-up modal",id:"auto_topup_modal.add_payment_method.confirm"}):i({defaultMessage:"Save",description:"Button saving the automatic top-up rule",id:"auto_topup_modal.confirm"}));async function r(){var F;if(W.value.$touch(),L.value)return;const{saved:k,error:O}=await Q(Qe({rule:(F=v.value)==null?void 0:F.validate(),walletBalanceItem:n.walletBalanceItem,chargeTarget:f.value,paymentMethodId:P.value}));if(k){a("saved"),a("close");return}O&&a("payment-failed",O)}const c=()=>{if(B.value){q();return}r()},b=()=>{x(),a("payment-success")},N=()=>{if(!L.value){if(B.value){x();return}a("close")}},V=e.ref(0);return e.watch(()=>n.showModal,k=>{k&&(l.value="AUTO_TOP_UP",P.value=void 0,V.value+=1)}),(k,O)=>(e.openBlock(),e.createBlock(We,{ref_key:"addPaymentMethodRef",ref:C,"show-modal":t.showModal,title:Y.value,"sub-title":K.value,"cancel-button-text":H.value,"confirm-button-text":X.value,"is-pending":L.value,panes:e.unref(ho),step:l.value,"add-payment-method-pane":"ADD_PAYMENT_METHOD",customer:t.customer,"payment-method-options":e.unref(h),"is-payment-method-options-pending":e.unref(m),"is-adding-payment-method":e.unref(B),onConfirm:c,onCancel:N,onPaymentSuccess:b,onPaymentFailed:O[1]||(O[1]=F=>k.$emit("payment-failed",F))},{AUTO_TOP_UP:e.withCtx(()=>[e.createElementVNode("div",go,[g.value?(e.openBlock(),e.createBlock(Fe,e.mergeProps({key:V.value,ref_key:"autoTopUpFormRef",ref:v,class:"sv-auto-topup-modal__rule"},g.value,{config:S.value,"always-enabled":"",disabled:L.value}),null,16,["config","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ie,{"pricing-plan-schedule-id":w.value,"pricing-items":p.value},null,8,["pricing-plan-schedule-id","pricing-items"]),e.createVNode(re._sfc_main,{modelValue:P.value,"onUpdate:modelValue":O[0]||(O[0]=F=>P.value=F),class:"sv-auto-topup-modal__payment-method","payment-methods":e.unref(D),"payment-method-options":e.unref(T),disabled:L.value,error:e.unref(W).paymentMethodId.$errors,label:e.unref(i)({defaultMessage:"Pay automatic top-ups with",description:"Label above the payment method an automatic top-up is charged to",id:"auto_topup_modal.payment_method.label"}),onAddPaymentMethod:e.unref(_)},null,8,["modelValue","payment-methods","payment-method-options","disabled","error","label","onAddPaymentMethod"])])]),_:1},8,["show-modal","title","sub-title","cancel-button-text","confirm-button-text","is-pending","panes","step","customer","payment-method-options","is-payment-method-options-pending","is-adding-payment-method"]))}}),yo={class:"sv-auto-topup-cancellation-modal sv-auto-topup-cancellation-modal__body flex flex-col gap-3"},bo=e.defineComponent({__name:"AutoTopUpCancellationModal",props:{showModal:{type:Boolean},config:{type:Object}},emits:["confirmed","close"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=M.useLogger(),{formatValue:l}=te(),{deactivateAutoTopUpConfig:u}=Ke(),d=e.ref(!1),g=e.ref(!1);e.watch(()=>n.showModal,v=>{v&&(g.value=!1)});const y=e.computed(()=>{var w,P;const v=(w=n.config)==null?void 0:w.threshold,p=(P=n.config)==null?void 0:P.topup_amount;return!(v!=null&&v.amount)&&!(v!=null&&v.credits)?i({defaultMessage:"Your balance will no longer be topped up automatically. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.explanation"}):p?i({defaultMessage:"Your balance will no longer be topped up with {amount} when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming what it charged and when",id:"auto_topup_cancellation_modal.explanation_with_amount"},{amount:l({amount:p}),threshold:l(v)}):i({defaultMessage:"Your balance will no longer be topped up automatically when it falls below {threshold}. You can still top up whenever you want to.",description:"Explanation in the modal that turns a wallet automatic top-up off, naming the threshold",id:"auto_topup_cancellation_modal.explanation_with_threshold"},{threshold:l(v)})}),S=async()=>{var p;const v=(p=n.config)==null?void 0:p.id;if(!(!v||d.value)){d.value=!0,g.value=!1;try{await u(v),a("confirmed"),a("close")}catch(w){s.error("AUTO_TOP_UP_CANCELLATION_FAILED","Failed to turn off a wallet's automatic top-up",{},w),g.value=!0}finally{d.value=!1}}},f=()=>{d.value||a("close")};return(v,p)=>(e.openBlock(),e.createBlock(e.unref(Ae.Modal),{size:"sm","show-modal":t.showModal,"is-loading":d.value,"no-click-away":d.value,"no-backdrop-close":d.value,title:e.unref(i)({defaultMessage:"Turn off automatic top-up",description:"Title of the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.title"}),"confirm-button-text":e.unref(i)({defaultMessage:"Yes, turn it off",description:"Button confirming that a wallet automatic top-up is turned off",id:"auto_topup_cancellation_modal.confirm"}),"cancel-button-text":e.unref(i)({defaultMessage:"Cancel",description:"Button dismissing the modal that turns a wallet automatic top-up off",id:"auto_topup_cancellation_modal.cancel"}),onConfirm:S,onClose:f},{body:e.withCtx(()=>[e.createElementVNode("div",yo,[e.createVNode(e.unref(M._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-auto-topup-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.value),1)]),_:1}),g.value?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),{key:0,class:"sv-auto-topup-cancellation-modal__error sv-error",title:e.unref(i)({defaultMessage:"Could not turn off the automatic top-up. Please try again later.",description:"Error shown when turning a wallet automatic top-up off failed",id:"auto_topup_cancellation_modal.failed"})},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","is-loading","no-click-away","no-backdrop-close","title","confirm-button-text","cancel-button-text"]))}}),wo=e.defineComponent({inheritAttrs:!1,__name:"CustomerWalletBalances",props:{hasError:{type:Boolean},isLoading:{type:Boolean},walletBalances:{type:Array},showTopUpButton:{type:Boolean},customer:{type:Object},paymentMethods:{type:Array},subscriptions:{type:Array}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","payment-failed"],setup(t,{emit:o}){const n=t,a=o,{$t:i}=M.useIntl(),s=e.ref(),l=e.computed(()=>ve(n.walletBalances,s.value)),u=e.computed(()=>!!l.value),d=e.ref(),g=e.computed(()=>!!d.value),y=e.computed(()=>ve(n.walletBalances,d.value)),S=e.ref(),f=e.computed(()=>!!S.value);return(v,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.isLoading?(e.openBlock(),e.createBlock(Se._sfc_main,e.mergeProps({key:0,variant:"section"},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-loading min-h-48","data-testid":"customer-wallet-balances-skeleton"}),null,16)):t.hasError?(e.openBlock(),e.createBlock(e.unref(Me._sfc_main),e.mergeProps({key:1},v.$attrs,{class:"sv-wallet-balances sv-root sv-component sv-error",title:e.unref(i)({defaultMessage:"Could not load wallet balances",description:"Error shown when wallet balances fail to load",id:"wallet_balance.load_failed"})}),null,16,["title"])):t.walletBalances.length>0?(e.openBlock(),e.createBlock(e.unref(Tt),e.mergeProps({key:2},v.$attrs,{class:"sv-wallet-balances sv-root sv-component","customer-wallet-balances":t.walletBalances,"show-auto-top-up":"","show-manual-top-up":"",title:e.unref(i)({defaultMessage:"{count, plural, one {Wallet} other {Wallets}}",description:"Title for the wallets block on the customer overview page",id:"customer_overview.wallet_balances_block.title"},{count:String(t.walletBalances.length)}),onTopUp:p[0]||(p[0]=w=>s.value=w),onAutoTopUp:p[1]||(p[1]=w=>d.value=w),onCancelAutoTopUp:p[2]||(p[2]=w=>S.value=w)}),null,16,["customer-wallet-balances","title"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(vo,{key:3,"show-modal":u.value,"selected-balance-item":l.value,"payment-methods":t.paymentMethods,customer:t.customer,subscriptions:t.subscriptions,onClose:p[3]||(p[3]=w=>s.value=void 0),onConfirm:p[4]||(p[4]=w=>a("top-up-charged")),onPaymentSuccess:p[5]||(p[5]=w=>a("payment-method-stored")),onPaymentFailed:p[6]||(p[6]=w=>a("payment-failed",w))},null,8,["show-modal","selected-balance-item","payment-methods","customer","subscriptions"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(_o,{key:4,"show-modal":g.value,"wallet-balance-item":y.value,"top-up-item":d.value,"payment-methods":t.paymentMethods,customer:t.customer,onClose:p[7]||(p[7]=w=>d.value=void 0),onSaved:p[8]||(p[8]=w=>a("auto-top-up-saved")),onPaymentSuccess:p[9]||(p[9]=w=>a("payment-method-stored")),onPaymentFailed:p[10]||(p[10]=w=>a("payment-failed",w))},null,8,["show-modal","wallet-balance-item","top-up-item","payment-methods","customer"])):e.createCommentVNode("",!0),t.showTopUpButton?(e.openBlock(),e.createBlock(bo,{key:5,"show-modal":f.value,config:S.value,onClose:p[11]||(p[11]=w=>S.value=void 0),onConfirmed:p[12]||(p[12]=w=>a("auto-top-up-cancelled"))},null,8,["show-modal","config"])):e.createCommentVNode("",!0)],64))}});exports._sfc_main=wo;exports.useCustomerWalletBalances=Mt;