@solvimon/solvimon-web 0.1.0-alpha.21 → 0.1.0-alpha.22

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 (216) hide show
  1. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-B9WTpz0k.js → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Co3XAxaY.js} +1 -1
  2. package/dist/{AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DJCMa2Lz.mjs → AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-DFv-awxb.mjs} +6 -6
  3. package/dist/{Avatar.vue.es-CJw5z7Uu.js → Avatar.vue.es-D42J_izE.js} +1 -1
  4. package/dist/{Avatar.vue.es-ChcLSNaN.mjs → Avatar.vue.es-DNJ-jexx.mjs} +1 -1
  5. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CTQ5RMtx.js → BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js} +1 -1
  6. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DApMAncl.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs} +4 -4
  7. package/dist/{Button.vue.es-VQCd3V3C.mjs → Button.vue.es-Dz-2L8dJ.mjs} +1 -1
  8. package/dist/{Button.vue.es-BWl37nzm.js → Button.vue.es-M_jXZda4.js} +1 -1
  9. package/dist/{Checkout.entry.ce-DRHqEFd7.mjs → Checkout.entry.ce-B5-0AM67.mjs} +1298 -1225
  10. package/dist/Checkout.entry.ce-C52gkrNZ.js +1 -0
  11. package/dist/{Chip.vue.es-CXG8o1Qf.mjs → Chip.vue.es-DMK9C78d.mjs} +2 -2
  12. package/dist/{Chip.vue.es-DUgjuRWm.js → Chip.vue.es-G8doKsZb.js} +1 -1
  13. package/dist/{ContextMenu.vue.es-BllxeDTt.js → ContextMenu.vue.es-B3Rz6Ojk.js} +1 -1
  14. package/dist/{ContextMenu.vue.es-C6TKlSXs.mjs → ContextMenu.vue.es-CzkkNoJG.mjs} +4 -4
  15. package/dist/{CustomerBillingInformation.vue.es-CMCZ-lIM.js → CustomerBillingInformation.vue.es-BmtU9Pk0.js} +1 -1
  16. package/dist/{CustomerBillingInformation.vue.es-CKQH_ds0.mjs → CustomerBillingInformation.vue.es-Db6bN2RZ.mjs} +2 -2
  17. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js} +1 -1
  18. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BxwllXwU.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs} +5 -5
  19. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js +1 -0
  20. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CtaoLbrM.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs} +485 -501
  21. package/dist/{DividerText.vue.es-BBdydUy_.js → DividerText.vue.es-D-QxT2OD.js} +1 -1
  22. package/dist/{DividerText.vue.es-Bomiy4if.mjs → DividerText.vue.es-IK2fns6f.mjs} +1 -1
  23. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js} +1 -1
  24. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C9elbdbF.mjs → EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-lhJnqrrh.mjs} +4 -4
  25. package/dist/{ErrorNotification.vue.es-C6ngWAVU.mjs → ErrorNotification.vue.es-BGckEwHf.mjs} +2 -2
  26. package/dist/{ErrorNotification.vue.es-0ZC_DozN.js → ErrorNotification.vue.es-Cd2UKPAz.js} +1 -1
  27. package/dist/{IconButton.vue.es-DGLIdHkR.js → IconButton.vue.es-BTAkuFsm.js} +1 -1
  28. package/dist/{IconButton.vue.es-DAR7e8NA.mjs → IconButton.vue.es-C4dQEQAc.mjs} +2 -2
  29. package/dist/{IconTitle.vue.es-Bbusc4wK.mjs → IconTitle.vue.es-BmX68uJx.mjs} +3 -3
  30. package/dist/{IconTitle.vue.es-D-q6w2E-.js → IconTitle.vue.es-CmR2xoeu.js} +1 -1
  31. package/dist/{Input.vue.es-AY1c0Rui.mjs → Input.vue.es-BGPELaZU.mjs} +2 -2
  32. package/dist/{Input.vue.es-BN95nPBw.js → Input.vue.es-CTOrmrcB.js} +1 -1
  33. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-1WjSbPEP.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CMEOOuSU.mjs} +2 -2
  34. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-qiBCPY8l.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-bheNAKzK.js} +1 -1
  35. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-Xo9BR6AD.js +1 -0
  36. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-D99nuBRE.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-avhwysNq.mjs} +3 -3
  37. package/dist/{InvoiceSummary.vue.es-Bs5c2Ovx.mjs → InvoiceSummary.vue.es-BWLiwlNs.mjs} +692 -705
  38. package/dist/InvoiceSummary.vue.es-hpG8Tq1D.js +1 -0
  39. package/dist/{Modal.vue.es-Chi6_MH_.js → Modal.vue.es-BD4vUaOQ.js} +1 -1
  40. package/dist/{Modal.vue.es-DSkC4eMv.mjs → Modal.vue.es-B_G8NQS2.mjs} +5 -5
  41. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-vD88j_U7.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BnilyGBO.mjs} +3 -3
  42. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-Draz_8Ts.js → PaymentErrorCard.vue_vue_type_script_setup_true_lang-CSv-Luvz.js} +1 -1
  43. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js} +1 -1
  44. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DVif_ME8.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs} +3 -3
  45. package/dist/{PaymentHistoryBlock-budeR7ep.mjs → PaymentHistoryBlock-ComJzB3H.mjs} +1 -1
  46. package/dist/{PaymentHistoryBlock-DGJ_PiVq.js → PaymentHistoryBlock-DSHW_eW1.js} +1 -1
  47. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Dv-3suBX.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DUN0Hf2v.js} +1 -1
  48. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C28ofG7N.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-hjtksV2D.mjs} +4 -4
  49. package/dist/{PaymentIntegrationForm-Crrhar96.mjs → PaymentIntegrationForm-CH5B6BY5.mjs} +1 -1
  50. package/dist/{PaymentIntegrationForm-DqqGcEP1.js → PaymentIntegrationForm-CwfCLnKt.js} +1 -1
  51. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C4bk0m8g.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs} +3 -3
  52. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js} +1 -1
  53. package/dist/{PaymentIntegrationFormAdyen-DM-xMcm0.mjs → PaymentIntegrationFormAdyen-DfN7cPYZ.mjs} +5 -5
  54. package/dist/{PaymentIntegrationFormAdyen-DronjwO3.js → PaymentIntegrationFormAdyen-Q48aDXR7.js} +1 -1
  55. package/dist/{PaymentIntegrationFormStripe-ybM6wirp.js → PaymentIntegrationFormStripe-BSEqarl7.js} +1 -1
  56. package/dist/{PaymentIntegrationFormStripe-yBm4KnpV.mjs → PaymentIntegrationFormStripe-CBsXDuhy.mjs} +4 -4
  57. package/dist/{PaymentMethod.vue.es-Ctw9Es1g.js → PaymentMethod.vue.es-D18g-QB4.js} +1 -1
  58. package/dist/{PaymentMethod.vue.es-BdMcKq8_.mjs → PaymentMethod.vue.es-DkQdPXfk.mjs} +3 -3
  59. package/dist/{PaymentMethodForm-C1bIGX10.mjs → PaymentMethodForm-CpIZKfPH.mjs} +1 -1
  60. package/dist/{PaymentMethodForm-BQ5TVHlS.js → PaymentMethodForm-DK8ntFA0.js} +1 -1
  61. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-5KKkuVt5.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs} +5 -5
  62. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-V88bCeDt.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js} +1 -1
  63. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-CnmZ9dvP.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs} +6 -6
  64. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-B_207kq5.js → PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js} +1 -1
  65. package/dist/PlanCustomizationEditor-0zCXN-cv.mjs +877 -0
  66. package/dist/PlanCustomizationEditor-XpofGULc.js +1 -0
  67. package/dist/{PricingGroupRangeInput.vue.es-Bnb-ARie.mjs → PricingGroupRangeInput.vue.es-8_5nfZDI.mjs} +4 -4
  68. package/dist/{PricingGroupRangeInput.vue.es-D82XvoC_.js → PricingGroupRangeInput.vue.es-QnpfHxaY.js} +1 -1
  69. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CxMkCmti.js → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-CGJhKKNL.js} +1 -1
  70. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-skQMgHEL.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-t6h1j6WD.mjs} +5 -5
  71. package/dist/{RadioGroupExtended.vue.es-WDbo_yj1.mjs → RadioGroupExtended.vue.es-C92xlCFQ.mjs} +3 -3
  72. package/dist/{RadioGroupExtended.vue.es-B1YtLNKG.js → RadioGroupExtended.vue.es-Cb1iD73r.js} +1 -1
  73. package/dist/{Section.vue.es-DuK52y67.js → Section.vue.es-Btff-cLY.js} +1 -1
  74. package/dist/{Section.vue.es-By1JltGi.mjs → Section.vue.es-DQ5H7mqW.mjs} +1 -1
  75. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Ct3ZNq-j.js → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BfvX14E3.js} +1 -1
  76. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-CS3KIkPL.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DKsunuGT.mjs} +6 -6
  77. package/dist/{SubscriptionSchedules-DDCjVEbG.mjs → SubscriptionSchedules-Dc0rUnnf.mjs} +1 -1
  78. package/dist/{SubscriptionSchedules-DEjIERyF.js → SubscriptionSchedules-pzNsego6.js} +1 -1
  79. package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-JAedXFzq.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-Brs9qDs5.mjs} +1655 -1620
  80. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-nmVRb6hj.js +1 -0
  81. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-DVMS4gJQ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-C1mkIPMr.mjs} +3 -3
  82. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js → SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js} +1 -1
  83. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DiXmEjUD.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js} +1 -1
  84. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BckZJtOc.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs} +7 -7
  85. package/dist/{TooltipParagraph.vue.es-sTgWAgcd.js → TooltipParagraph.vue.es-BaqCDjl8.js} +1 -1
  86. package/dist/{TooltipParagraph.vue.es-DYu2ReL7.mjs → TooltipParagraph.vue.es-CIedcXGT.mjs} +1 -1
  87. package/dist/{TrialChip.vue.es-Cl-9_pdr.js → TrialChip.vue.es-BzNI94k0.js} +1 -1
  88. package/dist/{TrialChip.vue.es-DX53r0ku.mjs → TrialChip.vue.es-DkBuMNr_.mjs} +2 -2
  89. package/dist/{cn.es-DjnGlmqV.mjs → cn.es-BGqYNPM3.mjs} +2 -2
  90. package/dist/{cn.es-CNvIP217.js → cn.es-CvmLj7KH.js} +1 -1
  91. package/dist/components/BillingInformation/BillingInformation.cjs +1 -1
  92. package/dist/components/BillingInformation/BillingInformation.mjs +4 -4
  93. package/dist/components/BillingInformationForm/BillingInformationForm.cjs +1 -1
  94. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +6 -6
  95. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs +1 -1
  96. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +4 -4
  97. package/dist/components/Invoice/Invoice.cjs +1 -1
  98. package/dist/components/Invoice/Invoice.mjs +9 -9
  99. package/dist/components/InvoiceDetails/InvoiceDetails.cjs +1 -1
  100. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +3 -3
  101. package/dist/components/InvoiceHeader/InvoiceHeader.cjs +1 -1
  102. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +2 -2
  103. package/dist/components/InvoicesList/InvoicesList.cjs +1 -1
  104. package/dist/components/InvoicesList/InvoicesList.mjs +3 -3
  105. package/dist/components/PaymentHistory/PaymentHistory.cjs +1 -1
  106. package/dist/components/PaymentHistory/PaymentHistory.mjs +3 -3
  107. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs +1 -1
  108. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +5 -5
  109. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs +1 -1
  110. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +4 -4
  111. package/dist/components/SubscriptionsList/SubscriptionsList.cjs +1 -1
  112. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +5 -5
  113. package/dist/components/WalletBalances/WalletBalances.cjs +1 -1
  114. package/dist/components/WalletBalances/WalletBalances.mjs +3 -3
  115. package/dist/{customElements-Com2NiGU.mjs → customElements-CSE7dwUr.mjs} +312 -282
  116. package/dist/{customElements-Bt8PbjIn.js → customElements-Vox1PB6G.js} +42 -18
  117. package/dist/{customer-CKgMJEgv.mjs → customer-5krPxZ8i.mjs} +1 -1
  118. package/dist/{customer-Q4JGfVfq.js → customer-Dsq-Moea.js} +1 -1
  119. package/dist/{de-DE-DqLD4IX2.js → de-DE-BSlbAnPE.js} +1 -1
  120. package/dist/{de-DE-Ds_yJLS3.js → de-DE-C3DzP1nj.js} +1 -1
  121. package/dist/{de-DE-DBO5f-Eu.mjs → de-DE-DXsG-vXA.mjs} +13 -8
  122. package/dist/{de-DE-CVCmzlNH.mjs → de-DE-DsFtpLsx.mjs} +2 -0
  123. package/dist/{en-US-CvFmmI_O.js → en-US-9xdcz3T5.js} +1 -1
  124. package/dist/{en-US-3UmnS23B.mjs → en-US-C939IZ5i.mjs} +13 -8
  125. package/dist/{en-US-DVR9O7b_.mjs → en-US-DvkvbV0p.mjs} +2 -0
  126. package/dist/{en-US-C51ILrVv.js → en-US-X_pSFsNm.js} +1 -1
  127. package/dist/index.cjs +1 -1
  128. package/dist/index.mjs +1 -1
  129. package/dist/{invoices-CV9iAUHf.mjs → invoices-DRgfpkJ6.mjs} +8 -5
  130. package/dist/invoices-xOV2YaEV.js +1 -0
  131. package/dist/{it-IT-CxBRisRm.mjs → it-IT-BxpwB3oJ.mjs} +8 -3
  132. package/dist/it-IT-DT3rfjOY.js +1 -0
  133. package/dist/{it-IT-CDMnnFKZ.mjs → it-IT-TE7oqvXa.mjs} +2 -0
  134. package/dist/{it-IT-Dxw59eR_.js → it-IT-YBtHAao1.js} +1 -1
  135. package/dist/{nl-NL-Btbfd9p2.js → nl-NL-C8wnyKju.js} +1 -1
  136. package/dist/nl-NL-DfkhOJKc.js +1 -0
  137. package/dist/{nl-NL-o3UvtSNg.mjs → nl-NL-Di3-JArV.mjs} +2 -0
  138. package/dist/{nl-NL-BWGkVweu.mjs → nl-NL-na2I4aiP.mjs} +8 -3
  139. package/dist/{paymentMethods-ChWAwDSF.js → paymentMethods-CRDIw9lz.js} +1 -1
  140. package/dist/{paymentMethods-BuwoJ1y9.mjs → paymentMethods-PmkHYomw.mjs} +1 -1
  141. package/dist/{payments-C_cMXQzE.mjs → payments-Dvqh6CGW.mjs} +1 -1
  142. package/dist/{payments-DGckugN0.js → payments-jAgXhdp_.js} +1 -1
  143. package/dist/pricingItemConfigs.es-D4aYkYcf.js +1 -0
  144. package/dist/{pricingItemConfigs.es-DMf1e6y7.mjs → pricingItemConfigs.es-ORxsk_YS.mjs} +23 -22
  145. package/dist/pricingPlanSchedule-BM8vsKkV.js +1 -0
  146. package/dist/pricingPlanSchedule-BPrS2WRd.mjs +132 -0
  147. package/dist/screens/Checkout/Checkout.cjs +1 -1
  148. package/dist/screens/Checkout/Checkout.mjs +2 -2
  149. package/dist/screens/CustomerOverview/CustomerOverview.cjs +1 -1
  150. package/dist/screens/CustomerOverview/CustomerOverview.mjs +11 -11
  151. package/dist/screens/PayInvoice/PayInvoice.cjs +1 -1
  152. package/dist/screens/PayInvoice/PayInvoice.mjs +13 -13
  153. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs +1 -1
  154. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +9 -9
  155. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs +1 -1
  156. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +20 -20
  157. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs +1 -1
  158. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +19 -19
  159. package/dist/{subscription-CvfAEJeP.mjs → subscription-CrVOr5MF.mjs} +1 -1
  160. package/dist/{subscription-9GORG-Gt.js → subscription-ZA62t4E9.js} +1 -1
  161. package/dist/{subscriptions-B5VqRayX.mjs → subscriptions-XDyI2Cqm.mjs} +1 -1
  162. package/dist/{subscriptions-X0Ciw8z3.js → subscriptions-fJcj88X9.js} +1 -1
  163. package/dist/types/components/customer/CheckoutForm/CheckoutForm.types.d.ts +1 -0
  164. package/dist/types/components/subscriptions/PlanCustomizationForm/PlanCustomizationEditor.types.d.ts +1 -0
  165. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditor.types.d.ts +6 -0
  166. package/dist/types/components/subscriptions/PlanCustomizationForm/UnitsEditorItem.types.d.ts +6 -0
  167. package/dist/types/composables/useInvoicePreview.types.d.ts +1 -0
  168. package/dist/types/public/components/Invoice/Invoice.types.d.ts +1 -1
  169. package/dist/types/public/components/InvoiceHeader/InvoiceHeader.types.d.ts +1 -1
  170. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +1 -1
  171. package/dist/{useActionDispatchProvider-e2lQXTid.mjs → useActionDispatchProvider-B8-oycQk.mjs} +1 -1
  172. package/dist/{useActionDispatchProvider-B54GYEY7.js → useActionDispatchProvider-CNAuaHdm.js} +1 -1
  173. package/dist/{useCustomer-CC9zxV6c.mjs → useCustomer-CP8eWUZV.mjs} +1 -1
  174. package/dist/{useCustomer-BJwJ9BkJ.js → useCustomer-DSx-wN-6.js} +1 -1
  175. package/dist/useCustomerFormLabels-DW6jnDYH.mjs +968 -0
  176. package/dist/useCustomerFormLabels-TVTgy0MT.js +1 -0
  177. package/dist/{useExperimentalFeature-B0IFn3Uw.mjs → useExperimentalFeature-BvE_EOX-.mjs} +1 -1
  178. package/dist/{useExperimentalFeature-8Mzpj5wc.js → useExperimentalFeature-CC-DrIcL.js} +1 -1
  179. package/dist/{useInvoiceData-Bblwdl0f.js → useInvoiceData-CRRPdXc6.js} +1 -1
  180. package/dist/{useInvoiceData-6mHUZC9a.mjs → useInvoiceData-D8ds05CX.mjs} +2 -2
  181. package/dist/{useInvoicesList-_U1-tn9_.js → useInvoicesList-DIfQcvER.js} +1 -1
  182. package/dist/{useInvoicesList-B5H5JfvY.mjs → useInvoicesList-SJU5YWBQ.mjs} +7 -7
  183. package/dist/{useLoadInitialData-CezlvhBV.js → useLoadInitialData-DsabgMLZ.js} +1 -1
  184. package/dist/{useLoadInitialData-ux_wpNiR.mjs → useLoadInitialData-MUljS38K.mjs} +1 -1
  185. package/dist/{usePaymentMethodAvailability-DRwrBdto.js → usePaymentMethodAvailability-Bt7P9InI.js} +1 -1
  186. package/dist/{usePaymentMethodAvailability-CkR4TwoV.mjs → usePaymentMethodAvailability-D0NUanyF.mjs} +4 -4
  187. package/dist/{usePaymentMethodOptions-BfnLBZOo.mjs → usePaymentMethodOptions-B7JYkGsw.mjs} +1 -1
  188. package/dist/{usePaymentMethodOptions-B6GIM9q4.js → usePaymentMethodOptions-cT1o-BA1.js} +1 -1
  189. package/dist/{usePaymentMethods-C3QfLSrP.mjs → usePaymentMethods-CpzqXQUT.mjs} +1 -1
  190. package/dist/{usePaymentMethods-GFmQRp0X.js → usePaymentMethods-DNVw2eVg.js} +1 -1
  191. package/dist/{usePayments-SQF_V7oL.js → usePayments-D9Eo-uBk.js} +1 -1
  192. package/dist/{usePayments-BkwGyZT0.mjs → usePayments-Gx9kBvNB.mjs} +6 -6
  193. package/dist/{usePortal-DDG9b6FI.mjs → usePortal-3VCZwSUE.mjs} +1 -1
  194. package/dist/{usePortal-BdM7hDge.js → usePortal-DsebXdhx.js} +1 -1
  195. package/dist/{useSubscription-BJJYHYgr.mjs → useSubscription-DnL1wVh1.mjs} +1 -1
  196. package/dist/{useSubscription-Q4C2DPhw.js → useSubscription-K_gP9TeX.js} +1 -1
  197. package/dist/{useTimePeriod.es-pepm2TpV.js → useTimePeriod.es-CmltiTE-.js} +1 -1
  198. package/dist/{useTimePeriod.es-9tZvAhyb.mjs → useTimePeriod.es-DMtKzcoB.mjs} +1 -1
  199. package/dist/wallets.es-CNIMW5ay.js +1 -0
  200. package/dist/wallets.es-eH2C2ygn.mjs +102 -0
  201. package/package.json +1 -1
  202. package/dist/Checkout.entry.ce-BTVuGyNq.js +0 -1
  203. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js +0 -1
  204. package/dist/InvoiceEntryView.vue_vue_type_script_setup_true_lang-BXTInmf9.js +0 -1
  205. package/dist/InvoiceSummary.vue.es-B0MPR0oI.js +0 -1
  206. package/dist/PlanCustomizationEditor-CCOTD6Qu.mjs +0 -769
  207. package/dist/PlanCustomizationEditor-CiZnVCM6.js +0 -1
  208. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BlX0W6lw.js +0 -1
  209. package/dist/invoices-CvpL4rv5.js +0 -1
  210. package/dist/it-IT-CFEfSpPH.js +0 -1
  211. package/dist/nl-NL-jtVgF3jx.js +0 -1
  212. package/dist/pricingItemConfigs.es-DlybwIh1.js +0 -1
  213. package/dist/pricingPlanSchedule-COfmWv_o.js +0 -1
  214. package/dist/pricingPlanSchedule-J1nb9pCu.mjs +0 -129
  215. package/dist/useCustomerFormLabels-72Pxw8X5.js +0 -1
  216. package/dist/useCustomerFormLabels-V2YuYMLU.mjs +0 -930
@@ -1,9 +1,9 @@
1
1
  import { g as I } from "./comparators.es-D8WGL-c4.mjs";
2
- const a = (e, n) => {
2
+ const o = (e, n) => {
3
3
  var i;
4
4
  const t = (i = e.details) == null ? void 0 : i.pricing_type;
5
5
  return !!t && n.includes(t);
6
- }, O = (e) => a(e, ["FLAT", "FLAT_TOP_UP"]), S = (e) => a(e, ["FLAT_TOP_UP", "TIERED_TOP_UP", "STAIR_STEP_TOP_UP"]), b = (e) => a(e, ["TIERED", "TIERED_TOP_UP"]), g = (e) => a(e, ["STAIR_STEP", "STAIR_STEP_TOP_UP"]), R = (e) => a(e, ["FIXED"]), D = (e) => a(e, ["FLEXIBLE"]), m = (e) => {
6
+ }, O = (e) => o(e, ["FLAT", "FLAT_TOP_UP"]), S = (e) => o(e, ["FLAT_TOP_UP", "TIERED_TOP_UP", "STAIR_STEP_TOP_UP"]), D = (e) => e == null || e === "" ? 1 : Number(e), R = (e) => o(e, ["TIERED", "TIERED_TOP_UP"]), g = (e) => o(e, ["STAIR_STEP", "STAIR_STEP_TOP_UP"]), U = (e) => o(e, ["FIXED"]), b = (e) => o(e, ["FLEXIBLE"]), m = (e) => {
7
7
  var n, i;
8
8
  return [
9
9
  e,
@@ -12,7 +12,7 @@ const a = (e, n) => {
12
12
  (t) => m(t)
13
13
  )) ?? []
14
14
  ];
15
- }, U = (e) => {
15
+ }, h = (e) => {
16
16
  var n, i;
17
17
  return (i = (n = e.conditions) == null ? void 0 : n.meter_properties) != null && i.length ? {
18
18
  operator: "AND",
@@ -25,30 +25,30 @@ const a = (e, n) => {
25
25
  }
26
26
  }))
27
27
  } : void 0;
28
- }, h = (e) => m(e).map((n) => n.id), l = {
28
+ }, A = (e) => m(e).map((n) => n.id), l = {
29
29
  tieredStepped: 260,
30
30
  flatFixedNone: 130,
31
31
  header: 48
32
- }, A = (e) => {
32
+ }, N = (e) => {
33
33
  var n, i;
34
- const t = !!((n = e.details) != null && n.bands || (i = e.details) != null && i.pricing_type), r = a(e, ["TIERED", "TIERED_TOP_UP", "TOP_TIERED"]) || g(e);
34
+ const t = !!((n = e.details) != null && n.bands || (i = e.details) != null && i.pricing_type), r = o(e, ["TIERED", "TIERED_TOP_UP", "TOP_TIERED"]) || g(e);
35
35
  return t ? r ? l.tieredStepped : l.flatFixedNone : l.header;
36
- }, C = (e) => ({
36
+ }, f = (e) => ({
37
37
  pricing: n,
38
38
  item: i,
39
39
  config: t
40
40
  }) => {
41
41
  var r, d, u, _;
42
42
  const P = (s) => {
43
- var v, p, c, T;
44
- return (v = s.conditions) != null && v.name ? (p = s.conditions) == null ? void 0 : p.name : (c = s.conditions) != null && c.meter_properties ? I(e)(
45
- (T = s.conditions) == null ? void 0 : T.meter_properties.map((o) => {
43
+ var v, c, p, T;
44
+ return (v = s.conditions) != null && v.name ? (c = s.conditions) == null ? void 0 : c.name : (p = s.conditions) != null && p.meter_properties ? I(e)(
45
+ (T = s.conditions) == null ? void 0 : T.meter_properties.map((a) => {
46
46
  var E;
47
47
  return {
48
- propertyName: ((E = o == null ? void 0 : o.meter_property) == null ? void 0 : E.name) ?? "Unknown",
49
- comparator: o.comparator,
50
- value: o.value,
51
- values: o.values
48
+ propertyName: ((E = a == null ? void 0 : a.meter_property) == null ? void 0 : E.name) ?? "Unknown",
49
+ comparator: a.comparator,
50
+ value: a.value,
51
+ values: a.values
52
52
  };
53
53
  }),
54
54
  { hasFormatting: !1 }
@@ -61,16 +61,17 @@ const a = (e, n) => {
61
61
  ].filter(Boolean).join(" - ");
62
62
  };
63
63
  export {
64
- D as a,
65
- b,
64
+ b as a,
65
+ R as b,
66
66
  S as c,
67
- C as d,
68
- U as e,
67
+ f as d,
68
+ h as e,
69
69
  g as f,
70
70
  m as g,
71
- a as h,
72
- R as i,
73
- A as j,
71
+ o as h,
72
+ U as i,
73
+ N as j,
74
74
  O as k,
75
- h as l
75
+ A as l,
76
+ D as r
76
77
  };
@@ -0,0 +1 @@
1
+ function v({pricingPlanScheduleInfos:e,type:i}){return(e??[]).find(t=>{var n;return(((n=t.pricing_plan_schedule)==null?void 0:n.type)??t.type)===i})}function D(e){var i;return(i=A(e.flatMap(({pricing_plan_schedule_infos:t})=>t??[])))==null?void 0:i.id}const m=e=>{var i;return Date.parse(e.start_at??((i=e.pricing_plan_schedule)==null?void 0:i.start_at))};function A(e){const i=Date.now();return e.filter(t=>{const n=t.pricing_plan_schedule,o=(n==null?void 0:n.type)??t.type,u=m(t),d=t.end_at??(n==null?void 0:n.end_at),_=d?Date.parse(d):void 0,y=Number.isFinite(u)&&u<=i,h=_===void 0||!Number.isFinite(_)||_>i;return o==="DEFAULT"&&y&&h}).sort((t,n)=>m(n)-m(t)).at(0)}function F({pricingPlanScheduleInfo:e,pricingId:i}){var t;return(((t=e.pricing_plan_version)==null?void 0:t.pricing_categories)??[]).flatMap(n=>n.pricing_groups??[]).find(n=>(n.pricings??[]).some(o=>o.id===i))}function I({pricingPlanScheduleInfo:e}){const i=new Map;return(e.pricing_plan_version.pricing_categories??[]).forEach(n=>{var o;(o=n.pricings)==null||o.forEach(u=>{var d;(d=u.items)==null||d.forEach(_=>{var y,h,E;(y=_.billing_period_configs)==null||y.forEach(c=>{var p;(p=c.configs)==null||p.forEach(a=>{var g,r,s,f;if(a.id){const l=(f=(s=(r=(g=a.details)==null?void 0:g.bands)==null?void 0:r.find(b=>{var P;return(P=b.amount)==null?void 0:P.currency}))==null?void 0:s.amount)==null?void 0:f.currency;i.set(a.id,{...l&&{currency:l},billingPeriod:c.billing_period})}})}),(h=_.configs)==null||h.forEach(c=>{var p,a,g,r;if(c.id){const s=(r=(g=(a=(p=c.details)==null?void 0:p.bands)==null?void 0:a.find(f=>{var l;return(l=f.amount)==null?void 0:l.currency}))==null?void 0:g.amount)==null?void 0:r.currency;i.set(c.id,{...s&&{currency:s}})}}),(E=_.pricing_currency_configs)==null||E.forEach(c=>{var a,g;const p=c.currency;(a=c.billing_period_configs)==null||a.forEach(r=>{var s;(s=r.configs)==null||s.forEach(f=>{f.id&&i.set(f.id,{currency:p,billingPeriod:r.billing_period})})}),(g=c.configs)==null||g.forEach(r=>{r.id&&i.set(r.id,{currency:p})})})})})}),i}const S=({pricing_item_config_id:e,number:i})=>({pricing_item_config_id:e,number:i});function M({enabledPricings:e,seatsValues:i,unitsValues:t,pricingPlanScheduleInfos:n,pricingCurrency:o,billingPeriod:u}){const d=v({pricingPlanScheduleInfos:n,type:"DEFAULT"});if(!(!d||!e&&!i&&!t))return[{pricing_plan_schedule_id:d.id,enabled_pricings:e,seats_values:i==null?void 0:i.map(S),...t&&{units:t.map(S)},...o&&{pricing_currency:o},...u&&{billing_period:u}}]}exports.getActiveDefaultScheduleId=D;exports.getActiveDefaultScheduleInfo=A;exports.getFirstPricingPlanScheduleOfType=v;exports.getPricingGroupByPricingId=F;exports.getPricingItemConfigMetaById=I;exports.getScheduleCustomizations=M;
@@ -0,0 +1,132 @@
1
+ function D({
2
+ pricingPlanScheduleInfos: r,
3
+ type: i
4
+ }) {
5
+ return (r ?? []).find(
6
+ (t) => {
7
+ var n;
8
+ return (((n = t.pricing_plan_schedule) == null ? void 0 : n.type) ?? t.type) === i;
9
+ }
10
+ );
11
+ }
12
+ function P(r) {
13
+ var i;
14
+ return (i = S(
15
+ r.flatMap(
16
+ ({ pricing_plan_schedule_infos: t }) => t ?? []
17
+ )
18
+ )) == null ? void 0 : i.id;
19
+ }
20
+ const E = (r) => {
21
+ var i;
22
+ return Date.parse(r.start_at ?? ((i = r.pricing_plan_schedule) == null ? void 0 : i.start_at));
23
+ };
24
+ function S(r) {
25
+ const i = Date.now();
26
+ return r.filter((t) => {
27
+ const n = t.pricing_plan_schedule, a = (n == null ? void 0 : n.type) ?? t.type, g = E(t), s = t.end_at ?? (n == null ? void 0 : n.end_at), u = s ? Date.parse(s) : void 0, y = Number.isFinite(g) && g <= i, h = u === void 0 || !Number.isFinite(u) || u > i;
28
+ return a === "DEFAULT" && y && h;
29
+ }).sort((t, n) => E(n) - E(t)).at(0);
30
+ }
31
+ function F({
32
+ pricingPlanScheduleInfo: r,
33
+ pricingId: i
34
+ }) {
35
+ var t;
36
+ return (((t = r.pricing_plan_version) == null ? void 0 : t.pricing_categories) ?? []).flatMap((n) => n.pricing_groups ?? []).find((n) => (n.pricings ?? []).some((a) => a.id === i));
37
+ }
38
+ function M({
39
+ pricingPlanScheduleInfo: r
40
+ }) {
41
+ const i = /* @__PURE__ */ new Map();
42
+ return (r.pricing_plan_version.pricing_categories ?? []).forEach((n) => {
43
+ var a;
44
+ (a = n.pricings) == null || a.forEach((g) => {
45
+ var s;
46
+ (s = g.items) == null || s.forEach((u) => {
47
+ var y, h, m;
48
+ (y = u.billing_period_configs) == null || y.forEach((e) => {
49
+ var d;
50
+ (d = e.configs) == null || d.forEach((o) => {
51
+ var p, c, _, f;
52
+ if (o.id) {
53
+ const l = (f = (_ = (c = (p = o.details) == null ? void 0 : p.bands) == null ? void 0 : c.find(
54
+ (A) => {
55
+ var b;
56
+ return (b = A.amount) == null ? void 0 : b.currency;
57
+ }
58
+ )) == null ? void 0 : _.amount) == null ? void 0 : f.currency;
59
+ i.set(o.id, {
60
+ ...l && { currency: l },
61
+ billingPeriod: e.billing_period
62
+ });
63
+ }
64
+ });
65
+ }), (h = u.configs) == null || h.forEach((e) => {
66
+ var d, o, p, c;
67
+ if (e.id) {
68
+ const _ = (c = (p = (o = (d = e.details) == null ? void 0 : d.bands) == null ? void 0 : o.find(
69
+ (f) => {
70
+ var l;
71
+ return (l = f.amount) == null ? void 0 : l.currency;
72
+ }
73
+ )) == null ? void 0 : p.amount) == null ? void 0 : c.currency;
74
+ i.set(e.id, {
75
+ ..._ && { currency: _ }
76
+ });
77
+ }
78
+ }), (m = u.pricing_currency_configs) == null || m.forEach((e) => {
79
+ var o, p;
80
+ const d = e.currency;
81
+ (o = e.billing_period_configs) == null || o.forEach((c) => {
82
+ var _;
83
+ (_ = c.configs) == null || _.forEach((f) => {
84
+ f.id && i.set(f.id, {
85
+ currency: d,
86
+ billingPeriod: c.billing_period
87
+ });
88
+ });
89
+ }), (p = e.configs) == null || p.forEach((c) => {
90
+ c.id && i.set(c.id, { currency: d });
91
+ });
92
+ });
93
+ });
94
+ });
95
+ }), i;
96
+ }
97
+ const v = ({ pricing_item_config_id: r, number: i }) => ({
98
+ pricing_item_config_id: r,
99
+ number: i
100
+ });
101
+ function w({
102
+ enabledPricings: r,
103
+ seatsValues: i,
104
+ unitsValues: t,
105
+ pricingPlanScheduleInfos: n,
106
+ pricingCurrency: a,
107
+ billingPeriod: g
108
+ }) {
109
+ const s = D({
110
+ pricingPlanScheduleInfos: n,
111
+ type: "DEFAULT"
112
+ });
113
+ if (!(!s || !r && !i && !t))
114
+ return [
115
+ {
116
+ pricing_plan_schedule_id: s.id,
117
+ enabled_pricings: r,
118
+ seats_values: i == null ? void 0 : i.map(v),
119
+ ...t && { units: t.map(v) },
120
+ ...a && { pricing_currency: a },
121
+ ...g && { billing_period: g }
122
+ }
123
+ ];
124
+ }
125
+ export {
126
+ P as a,
127
+ w as b,
128
+ S as c,
129
+ F as d,
130
+ M as e,
131
+ D as g
132
+ };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../Checkout.entry.ce-BTVuGyNq.js");require("../../customElements-Bt8PbjIn.js");exports.defineSolvimonCheckout=e.defineSolvimonCheckout;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../Checkout.entry.ce-C52gkrNZ.js");require("../../customElements-Vox1PB6G.js");exports.defineSolvimonCheckout=e.defineSolvimonCheckout;
@@ -1,5 +1,5 @@
1
- import { d as m } from "../../Checkout.entry.ce-DRHqEFd7.mjs";
2
- import "../../customElements-Com2NiGU.mjs";
1
+ import { d as m } from "../../Checkout.entry.ce-B5-0AM67.mjs";
2
+ import "../../customElements-CSE7dwUr.mjs";
3
3
  export {
4
4
  m as defineSolvimonCheckout
5
5
  };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),P=require("../../error-CmduqgVq.js"),T=require("../../ContentWithAsideLayout-C6yMIVJF.js"),g=require("../../useInvoicesList-_U1-tn9_.js"),k=require("../../usePortal-BdM7hDge.js"),_=require("../../customElements-Bt8PbjIn.js"),h=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DiXmEjUD.js"),E=require("../../useCustomer-BJwJ9BkJ.js"),x=require("../../usePaymentMethods-GFmQRp0X.js"),U=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-CTQ5RMtx.js"),j=require("../../useLoadInitialData-CezlvhBV.js"),V=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js"),W=require("../../CustomerPaymentMethods.lib-BKgQTCtc.js"),S=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js"),D=require("../../pricingPlanSchedule-COfmWv_o.js"),F=require("../../component-B7ZDyqBp.js"),$=2,R=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(i){var f;const p=i,u=k.usePortal(),c=_.useLogger(),o=(f=u.value)==null?void 0:f.customer_id,n=E.useCustomer({customerId:o}),l=g.useInvoicesList({customerId:o,batchSize:5}),s=h.useSubscriptionsList({customerId:o}),r=x.usePaymentMethods({customerId:o}),m=S.useCustomerWalletBalances({customerId:o}),w=e.computed(()=>{var t;return((t=m.walletBalances.value)==null?void 0:t.wallet_balances)??[]}),C=e.computed(()=>s.items.value.slice(0,$)),b=e.computed(()=>{var t;return r.items.value.slice(0,((t=p.configuration)==null?void 0:t.maxItems)??W.DEFAULT_MAX_ITEMS)}),{isLoading:a}=j.useLoadInitialData(n.get.execute(),l.fetchInitial(),s.fetchAll(),r.fetchAll(),m.fetch()),B=()=>{r.fetchAll()},d=()=>{m.fetch()},L=e.computed(()=>D.getActiveDefaultScheduleId(s.items.value));return e.watch([L,()=>s.items.value],([t,v])=>{t||v.length===0||c.warn("ACTIVE_SCHEDULE_NOT_FOUND","No schedule is currently being billed",{schedules:v.flatMap(({pricing_plan_schedule_infos:O})=>(O??[]).map(({id:q,type:M,start_at:A,end_at:I,...N})=>{var y;return{id:q,type:((y=N.pricing_plan_schedule)==null?void 0:y.type)??M,start_at:A,end_at:I}}))})}),(t,v)=>(e.openBlock(),e.createBlock(e.unref(T.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(n).customer.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(n).customer.value,subscriptions:C.value,"payment-methods":e.unref(r).items.value,"is-loading":e.unref(a)},null,8,["customer","subscriptions","payment-methods","is-loading"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(l).items.value,"has-more-items":e.unref(l).hasNextBatch.value,"is-loading":e.unref(a),onLoadMore:e.unref(l).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(S._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(m).apiStatus.value===e.unref(P.ApiStatus).Failed,"is-loading":e.unref(a),"wallet-balances":w.value,"show-top-up-button":"",customer:e.unref(n).customer.value,"payment-methods":e.unref(r).items.value,subscriptions:e.unref(s).items.value,onTopUpCharged:d,onAutoTopUpSaved:d,onAutoTopUpCancelled:d,onPaymentMethodStored:B},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),e.createVNode(V._sfc_main,{class:"sv-customer-overview__payment-methods",configuration:i.configuration,"is-loading":e.unref(a),"payment-methods":b.value},null,8,["configuration","is-loading","payment-methods"]),e.unref(n).customer.value?(e.openBlock(),e.createBlock(U._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(a),customer:e.unref(n).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),H=e.defineComponent({__name:"CustomerOverview.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}},setup(i){const p=F.getComponentName("customer-overview");return(u,c)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main$1),{entry:u.$props,"component-name":e.unref(p),"allowed-portal-types":["CUSTOMER"],onError:c[0]||(c[0]=o=>u.$emit("error",o))},{default:e.withCtx(()=>[e.createVNode(R,{configuration:i.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:z}=_.createSolvimonElement(H,"customer-overview");exports.defineSolvimonCustomerOverview=z;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),P=require("../../error-CmduqgVq.js"),T=require("../../ContentWithAsideLayout-C6yMIVJF.js"),g=require("../../useInvoicesList-DIfQcvER.js"),k=require("../../usePortal-DsebXdhx.js"),_=require("../../customElements-Vox1PB6G.js"),h=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-CFmCJK8M.js"),E=require("../../useCustomer-DSx-wN-6.js"),x=require("../../usePaymentMethods-DNVw2eVg.js"),U=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BEVkWJXT.js"),j=require("../../useLoadInitialData-DsabgMLZ.js"),V=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js"),W=require("../../CustomerPaymentMethods.lib-BKgQTCtc.js"),S=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js"),D=require("../../pricingPlanSchedule-BM8vsKkV.js"),F=require("../../component-B7ZDyqBp.js"),$=2,R=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(i){var f;const p=i,u=k.usePortal(),c=_.useLogger(),o=(f=u.value)==null?void 0:f.customer_id,n=E.useCustomer({customerId:o}),l=g.useInvoicesList({customerId:o,batchSize:5}),s=h.useSubscriptionsList({customerId:o}),r=x.usePaymentMethods({customerId:o}),m=S.useCustomerWalletBalances({customerId:o}),w=e.computed(()=>{var t;return((t=m.walletBalances.value)==null?void 0:t.wallet_balances)??[]}),C=e.computed(()=>s.items.value.slice(0,$)),b=e.computed(()=>{var t;return r.items.value.slice(0,((t=p.configuration)==null?void 0:t.maxItems)??W.DEFAULT_MAX_ITEMS)}),{isLoading:a}=j.useLoadInitialData(n.get.execute(),l.fetchInitial(),s.fetchAll(),r.fetchAll(),m.fetch()),B=()=>{r.fetchAll()},d=()=>{m.fetch()},L=e.computed(()=>D.getActiveDefaultScheduleId(s.items.value));return e.watch([L,()=>s.items.value],([t,v])=>{t||v.length===0||c.warn("ACTIVE_SCHEDULE_NOT_FOUND","No schedule is currently being billed",{schedules:v.flatMap(({pricing_plan_schedule_infos:O})=>(O??[]).map(({id:q,type:M,start_at:A,end_at:I,...N})=>{var y;return{id:q,type:((y=N.pricing_plan_schedule)==null?void 0:y.type)??M,start_at:A,end_at:I}}))})}),(t,v)=>(e.openBlock(),e.createBlock(e.unref(T.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(n).customer.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(n).customer.value,subscriptions:C.value,"payment-methods":e.unref(r).items.value,"is-loading":e.unref(a)},null,8,["customer","subscriptions","payment-methods","is-loading"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(l).items.value,"has-more-items":e.unref(l).hasNextBatch.value,"is-loading":e.unref(a),onLoadMore:e.unref(l).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(S._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(m).apiStatus.value===e.unref(P.ApiStatus).Failed,"is-loading":e.unref(a),"wallet-balances":w.value,"show-top-up-button":"",customer:e.unref(n).customer.value,"payment-methods":e.unref(r).items.value,subscriptions:e.unref(s).items.value,onTopUpCharged:d,onAutoTopUpSaved:d,onAutoTopUpCancelled:d,onPaymentMethodStored:B},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),e.createVNode(V._sfc_main,{class:"sv-customer-overview__payment-methods",configuration:i.configuration,"is-loading":e.unref(a),"payment-methods":b.value},null,8,["configuration","is-loading","payment-methods"]),e.unref(n).customer.value?(e.openBlock(),e.createBlock(U._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(a),customer:e.unref(n).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),H=e.defineComponent({__name:"CustomerOverview.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}},setup(i){const p=F.getComponentName("customer-overview");return(u,c)=>(e.openBlock(),e.createBlock(e.unref(_._sfc_main$1),{entry:u.$props,"component-name":e.unref(p),"allowed-portal-types":["CUSTOMER"],onError:c[0]||(c[0]=o=>u.$emit("error",o))},{default:e.withCtx(()=>[e.createVNode(R,{configuration:i.configuration},null,8,["configuration"])]),_:1},8,["entry","component-name"]))}}),{define:z}=_.createSolvimonElement(H,"customer-overview");exports.defineSolvimonCustomerOverview=z;
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as C, computed as p, watch as P, openBlock as d, createBlock as v, unref as e, withCtx as f, createVNode as g, createCommentVNode as b } from "vue";
2
2
  import { A as j } from "../../error-BHVZJGwD.mjs";
3
3
  import { C as x } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
4
- import { u as D, _ as F } from "../../useInvoicesList-B5H5JfvY.mjs";
5
- import { u as W } from "../../usePortal-DDG9b6FI.mjs";
6
- import { b as k, d as R, e as V } from "../../customElements-Com2NiGU.mjs";
7
- import { u as H, _ as z } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BckZJtOc.mjs";
8
- import { u as X } from "../../useCustomer-CC9zxV6c.mjs";
9
- import { u as q } from "../../usePaymentMethods-C3QfLSrP.mjs";
10
- import { _ as G } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-DApMAncl.mjs";
11
- import { u as J } from "../../useLoadInitialData-ux_wpNiR.mjs";
12
- import { _ as K } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BxwllXwU.mjs";
4
+ import { u as D, _ as F } from "../../useInvoicesList-SJU5YWBQ.mjs";
5
+ import { u as W } from "../../usePortal-3VCZwSUE.mjs";
6
+ import { b as k, d as R, e as V } from "../../customElements-CSE7dwUr.mjs";
7
+ import { u as H, _ as z } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DSoNs7Xx.mjs";
8
+ import { u as X } from "../../useCustomer-CP8eWUZV.mjs";
9
+ import { u as q } from "../../usePaymentMethods-CpzqXQUT.mjs";
10
+ import { _ as G } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-D1uVidXk.mjs";
11
+ import { u as J } from "../../useLoadInitialData-MUljS38K.mjs";
12
+ import { _ as K } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-fESZVyPe.mjs";
13
13
  import { D as Q } from "../../CustomerPaymentMethods.lib-B_753rau.mjs";
14
- import { u as Y, _ as Z } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-CtaoLbrM.mjs";
15
- import { a as ee } from "../../pricingPlanSchedule-J1nb9pCu.mjs";
14
+ import { u as Y, _ as Z } from "../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-DdMHG1_Y.mjs";
15
+ import { a as ee } from "../../pricingPlanSchedule-BPrS2WRd.mjs";
16
16
  import { g as te } from "../../component-5wqcK7yz.mjs";
17
17
  const oe = 2, se = /* @__PURE__ */ C({
18
18
  __name: "CustomerOverview",
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../../formatting.es-C72Nsrmh.js"),k=require("../../Button.vue.es-BWl37nzm.js"),x=require("../../index.es-BclokHQX.js"),w=require("../../usePayments-SQF_V7oL.js"),B=require("../../InvoiceSummary.vue.es-B0MPR0oI.js"),M=require("../../Section.vue.es-DuK52y67.js"),f=require("../../customElements-Bt8PbjIn.js"),_=require("../../ContentWithAsideLayout-C6yMIVJF.js"),O=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CcEEdHQJ.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),S=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-Db6jAkqD.js"),P=require("../../usePaymentMethodAvailability-DRwrBdto.js"),V=require("../../customer.es-BButyYo0.js"),A=require("../../useLoadInitialData-CezlvhBV.js"),I=require("../../usePaymentMethodOptions-B6GIM9q4.js"),N=require("../../usePaymentMethods-GFmQRp0X.js"),T=require("../../component-B7ZDyqBp.js"),q={class:"flex items-center gap-1 border-0 py-0"},z=["id","name","disabled","value"],E=["for"],L=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean},label:{},id:{},name:{},value:{},disabled:{type:Boolean},size:{default:"md"}},setup(t){const n=t,o=x.useVModel(n,"modelValue"),s={sm:"size-2",md:"size-4"},r=e.computed(()=>s[n.size]),l={sm:"text-xs",md:"text-sm"},c=e.computed(()=>l[n.size]);return(a,i)=>(e.openBlock(),e.createElementBlock("label",q,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.id},a.$attrs,{"onUpdate:modelValue":i[0]||(i[0]=m=>e.isRef(o)?o.value=m:null),name:t.name,disabled:t.disabled,value:t.value,type:"checkbox",class:["rounded checked:bg-primary-600 checked:hover:bg-primary-700",{"border border-gray-300 checked:border-gray-300 checked:bg-gray-400 checked:hover:bg-gray-500":t.disabled,"bg-gray-100":t.disabled&&!e.unref(o),"bg-gray-300 text-primary-600":!t.disabled&&e.unref(o),"cursor-pointer":!t.disabled,[r.value]:!0}],onClickCapture:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))}),null,16,z),[[e.vModelCheckbox,e.unref(o)]]),e.createElementVNode("span",{for:t.id,class:e.normalizeClass(["leading-tight",{[c.value]:!0}])},e.toDisplayString(t.label),11,E)]))}}),j=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},intent:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String},preventDoubleClick:{type:Boolean}},emits:["click"],setup(t){const n=t,{$t:o}=f.useIntl(),s=e.computed(()=>({intent:n.intent??"primary",disabled:n.disabled,iconPrefix:n.iconPrefix,iconSuffix:n.iconSuffix,loading:n.loading,pill:n.pill,size:n.size??"lg",square:n.square,tag:n.tag,type:n.type})),r=e.computed(()=>{var c,a,i;switch((c=n.paymentMethod)==null?void 0:c.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(a=n.paymentMethod)!=null&&a.paymentMethodType?e.capitalize((i=n.paymentMethod)==null?void 0:i.paymentMethodType):""}}),l=e.computed(()=>n.amount&&n.paymentMethod?o({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:b.formatAmount(n.amount),type:r.value}):n.amount?o({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:b.formatAmount(n.amount),type:r.value}):o({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(c,a)=>(e.openBlock(),e.createBlock(e.unref(k._sfc_main),e.mergeProps(s.value,{class:"w-full",onClick:a[0]||(a[0]=i=>c.$emit("click",i))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},16))}}),$={class:"mt-4"},D={key:0},R=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:n}=f.useIntl(),o=t,{availability:s}=P.usePaymentMethodAvailability({paymentMethodOptions:()=>o.paymentMethodOptions,isLoading:()=>o.isLoading,context:()=>{var y;return{invoiceId:(y=o.invoice)==null?void 0:y.id}}}),r=e.ref(),l=e.ref(!0),c=e.ref(),a=e.ref(!1);function i(){if(!c.value)throw new Error("payment integration form not found");a.value=!0,c.value.submit()}const m=()=>{o.configuration.onPaymentSuccess&&o.configuration.onPaymentSuccess()},v=()=>{a.value=!1};return(y,d)=>(e.openBlock(),e.createBlock(e.unref(_.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(w._sfc_main),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var h,u;return[t.isLoading?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(h=t.invoice)!=null&&h.paid?(e.openBlock(),e.createBlock(S._sfc_main,{key:1,status:"success",title:e.unref(n)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(b.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(S._sfc_main,{key:2,status:"error",title:e.unref(n)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.unref(s)==="READY"?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,title:e.unref(n)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":a.value})},[e.createVNode(O._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:c,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"store-payment-method":l.value,"invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions??[],variant:"AUTHORIZE",onPaymentSuccess:m,onPaymentFailed:v,onSelect:d[0]||(d[0]=p=>r.value=p)},null,8,["amount","country-code","context","customer-id","store-payment-method","invoice-id","payment-method-options"]),e.createElementVNode("div",$,[e.createVNode(e.unref(L),{id:"pay-invoice-store-payment-method",modelValue:l.value,"onUpdate:modelValue":d[1]||(d[1]=p=>l.value=p),label:e.unref(n)({id:"pay_invoice.store_payment_method.label",defaultMessage:"Save this payment method for future payments",description:"Label of the checkbox that stores the payment method while paying an invoice"})},null,8,["modelValue","label"])])],2)]),_:1},8,["title"])):(e.openBlock(),e.createBlock(P._sfc_main,{key:1,variant:"AUTHORIZE","seller-name":(u=t.invoice.billing_entity)==null?void 0:u.legal_name},{default:e.withCtx(()=>[t.downloadService?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:0,type:"button",intent:"secondary",onClick:d[2]||(d[2]=()=>{var p;return(p=t.downloadService)==null?void 0:p.call(t,t.invoice.id)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Download invoice",description:"Button that downloads the invoice when it cannot be paid online",id:"pay_invoice.unavailable.download_invoice"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["seller-name"]))],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice&&!t.invoice.paid&&e.unref(s)==="READY"?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(j,{disabled:!r.value||a.value,loading:a.value,amount:t.amount,"payment-method":r.value,onClick:i},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),F=e.defineComponent({__name:"PayInvoice.entry.view",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}},setup(t){const n=t,{invoice:o,get:s,downloadInvoicePdf:r,error:l}=w.useInvoice({invoiceId:n.configuration.invoiceId}),{payments:c,get:a}=w.usePayments(),{fetchInitial:i}=N.usePaymentMethods({customerId:n.portalObject.customer_id}),{paymentMethodOptions:m,get:v}=I.usePaymentMethodOptions(),y=async()=>{const u=await s();await v({customerId:u.customer.id,amount:u.open_invoice_amount})},{isLoading:d}=A.useLoadInitialData(y(),i(),a(n.configuration.invoiceId)),h=e.computed(()=>{var u;return(u=o.value)!=null&&u.customer?V.getCustomerCountry(o.value.customer):void 0});return(u,p)=>{var C;return e.renderSlot(u.$slots,"default",{invoice:e.unref(o),isLoading:e.unref(d),amount:(C=e.unref(o))==null?void 0:C.open_invoice_amount,countryCode:h.value,paymentMethodOptions:e.unref(m),paymentAttempts:e.unref(c),downloadService:e.unref(r),error:e.unref(l)})}}}),U=e.defineComponent({__name:"PayInvoice.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}},setup(t){const n=T.getComponentName("pay-invoice");return(o,s)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main$1),{entry:o.$props,"component-name":e.unref(n),"allowed-portal-types":["CUSTOMER"],onError:s[0]||(s[0]=r=>o.$emit("error",r))},{default:e.withCtx(()=>[e.createVNode(F,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:r,isLoading:l,amount:c,countryCode:a,paymentMethodOptions:i,paymentAttempts:m,downloadService:v,error:y})=>[e.createVNode(R,{"is-loading":l,invoice:r,amount:c,"country-code":a,"payment-method-options":i,configuration:t.configuration,"payment-attempts":m??[],"download-service":v,error:y},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service","error"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:W}=f.createSolvimonElement(U,"pay-invoice");exports.defineSolvimonPayInvoice=W;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../../formatting.es-C72Nsrmh.js"),k=require("../../Button.vue.es-M_jXZda4.js"),x=require("../../index.es-BclokHQX.js"),w=require("../../usePayments-D9Eo-uBk.js"),B=require("../../InvoiceSummary.vue.es-hpG8Tq1D.js"),M=require("../../Section.vue.es-Btff-cLY.js"),f=require("../../customElements-Vox1PB6G.js"),_=require("../../ContentWithAsideLayout-C6yMIVJF.js"),O=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DzSQC951.js"),g=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),S=require("../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DIJbzWMV.js"),P=require("../../usePaymentMethodAvailability-Bt7P9InI.js"),V=require("../../customer.es-BButyYo0.js"),A=require("../../useLoadInitialData-DsabgMLZ.js"),I=require("../../usePaymentMethodOptions-cT1o-BA1.js"),N=require("../../usePaymentMethods-DNVw2eVg.js"),T=require("../../component-B7ZDyqBp.js"),q={class:"flex items-center gap-1 border-0 py-0"},z=["id","name","disabled","value"],E=["for"],L=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean},label:{},id:{},name:{},value:{},disabled:{type:Boolean},size:{default:"md"}},setup(t){const n=t,o=x.useVModel(n,"modelValue"),s={sm:"size-2",md:"size-4"},r=e.computed(()=>s[n.size]),l={sm:"text-xs",md:"text-sm"},c=e.computed(()=>l[n.size]);return(a,i)=>(e.openBlock(),e.createElementBlock("label",q,[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.id},a.$attrs,{"onUpdate:modelValue":i[0]||(i[0]=m=>e.isRef(o)?o.value=m:null),name:t.name,disabled:t.disabled,value:t.value,type:"checkbox",class:["rounded checked:bg-primary-600 checked:hover:bg-primary-700",{"border border-gray-300 checked:border-gray-300 checked:bg-gray-400 checked:hover:bg-gray-500":t.disabled,"bg-gray-100":t.disabled&&!e.unref(o),"bg-gray-300 text-primary-600":!t.disabled&&e.unref(o),"cursor-pointer":!t.disabled,[r.value]:!0}],onClickCapture:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))}),null,16,z),[[e.vModelCheckbox,e.unref(o)]]),e.createElementVNode("span",{for:t.id,class:e.normalizeClass(["leading-tight",{[c.value]:!0}])},e.toDisplayString(t.label),11,E)]))}}),j=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},intent:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String},preventDoubleClick:{type:Boolean}},emits:["click"],setup(t){const n=t,{$t:o}=f.useIntl(),s=e.computed(()=>({intent:n.intent??"primary",disabled:n.disabled,iconPrefix:n.iconPrefix,iconSuffix:n.iconSuffix,loading:n.loading,pill:n.pill,size:n.size??"lg",square:n.square,tag:n.tag,type:n.type})),r=e.computed(()=>{var c,a,i;switch((c=n.paymentMethod)==null?void 0:c.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(a=n.paymentMethod)!=null&&a.paymentMethodType?e.capitalize((i=n.paymentMethod)==null?void 0:i.paymentMethodType):""}}),l=e.computed(()=>n.amount&&n.paymentMethod?o({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:b.formatAmount(n.amount),type:r.value}):n.amount?o({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:b.formatAmount(n.amount),type:r.value}):o({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(c,a)=>(e.openBlock(),e.createBlock(e.unref(k._sfc_main),e.mergeProps(s.value,{class:"w-full",onClick:a[0]||(a[0]=i=>c.$emit("click",i))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1},16))}}),$={class:"mt-4"},D={key:0},R=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:n}=f.useIntl(),o=t,{availability:s}=P.usePaymentMethodAvailability({paymentMethodOptions:()=>o.paymentMethodOptions,isLoading:()=>o.isLoading,context:()=>{var y;return{invoiceId:(y=o.invoice)==null?void 0:y.id}}}),r=e.ref(),l=e.ref(!0),c=e.ref(),a=e.ref(!1);function i(){if(!c.value)throw new Error("payment integration form not found");a.value=!0,c.value.submit()}const m=()=>{o.configuration.onPaymentSuccess&&o.configuration.onPaymentSuccess()},v=()=>{a.value=!1};return(y,d)=>(e.openBlock(),e.createBlock(e.unref(_.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(g._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(w._sfc_main),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var h,u;return[t.isLoading?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(h=t.invoice)!=null&&h.paid?(e.openBlock(),e.createBlock(S._sfc_main,{key:1,status:"success",title:e.unref(n)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(k._sfc_main$1),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(b.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(S._sfc_main,{key:2,status:"error",title:e.unref(n)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(f._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.unref(s)==="READY"?(e.openBlock(),e.createBlock(e.unref(M._sfc_main),{key:0,title:e.unref(n)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none opacity-60":a.value})},[e.createVNode(O._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:c,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"store-payment-method":l.value,"invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions??[],variant:"AUTHORIZE",onPaymentSuccess:m,onPaymentFailed:v,onSelect:d[0]||(d[0]=p=>r.value=p)},null,8,["amount","country-code","context","customer-id","store-payment-method","invoice-id","payment-method-options"]),e.createElementVNode("div",$,[e.createVNode(e.unref(L),{id:"pay-invoice-store-payment-method",modelValue:l.value,"onUpdate:modelValue":d[1]||(d[1]=p=>l.value=p),label:e.unref(n)({id:"pay_invoice.store_payment_method.label",defaultMessage:"Save this payment method for future payments",description:"Label of the checkbox that stores the payment method while paying an invoice"})},null,8,["modelValue","label"])])],2)]),_:1},8,["title"])):(e.openBlock(),e.createBlock(P._sfc_main,{key:1,variant:"AUTHORIZE","seller-name":(u=t.invoice.billing_entity)==null?void 0:u.legal_name},{default:e.withCtx(()=>[t.downloadService?(e.openBlock(),e.createBlock(e.unref(k._sfc_main),{key:0,type:"button",intent:"secondary",onClick:d[2]||(d[2]=()=>{var p;return(p=t.downloadService)==null?void 0:p.call(t,t.invoice)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Download invoice",description:"Button that downloads the invoice when it cannot be paid online",id:"pay_invoice.unavailable.download_invoice"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["seller-name"]))],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(g._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(B._sfc_main),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice&&!t.invoice.paid&&e.unref(s)==="READY"?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(j,{disabled:!r.value||a.value,loading:a.value,amount:t.amount,"payment-method":r.value,onClick:i},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),F=e.defineComponent({__name:"PayInvoice.entry.view",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}},setup(t){const n=t,{invoice:o,get:s,downloadInvoicePdf:r,error:l}=w.useInvoice({invoiceId:n.configuration.invoiceId}),{payments:c,get:a}=w.usePayments(),{fetchInitial:i}=N.usePaymentMethods({customerId:n.portalObject.customer_id}),{paymentMethodOptions:m,get:v}=I.usePaymentMethodOptions(),y=async()=>{const u=await s();await v({customerId:u.customer.id,amount:u.open_invoice_amount})},{isLoading:d}=A.useLoadInitialData(y(),i(),a(n.configuration.invoiceId)),h=e.computed(()=>{var u;return(u=o.value)!=null&&u.customer?V.getCustomerCountry(o.value.customer):void 0});return(u,p)=>{var C;return e.renderSlot(u.$slots,"default",{invoice:e.unref(o),isLoading:e.unref(d),amount:(C=e.unref(o))==null?void 0:C.open_invoice_amount,countryCode:h.value,paymentMethodOptions:e.unref(m),paymentAttempts:e.unref(c),downloadService:e.unref(r),error:e.unref(l)})}}}),U=e.defineComponent({__name:"PayInvoice.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}},setup(t){const n=T.getComponentName("pay-invoice");return(o,s)=>(e.openBlock(),e.createBlock(e.unref(f._sfc_main$1),{entry:o.$props,"component-name":e.unref(n),"allowed-portal-types":["CUSTOMER"],onError:s[0]||(s[0]=r=>o.$emit("error",r))},{default:e.withCtx(()=>[e.createVNode(F,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:r,isLoading:l,amount:c,countryCode:a,paymentMethodOptions:i,paymentAttempts:m,downloadService:v,error:y})=>[e.createVNode(R,{"is-loading":l,invoice:r,amount:c,"country-code":a,"payment-method-options":i,configuration:t.configuration,"payment-attempts":m??[],"download-service":v,error:y},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service","error"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:W}=f.createSolvimonElement(U,"pay-invoice");exports.defineSolvimonPayInvoice=W;
@@ -1,20 +1,20 @@
1
1
  import { defineComponent as k, computed as w, openBlock as l, createElementBlock as I, withDirectives as R, createElementVNode as O, mergeProps as L, withModifiers as _, unref as n, isRef as F, vModelCheckbox as D, normalizeClass as j, toDisplayString as S, capitalize as N, createBlock as u, withCtx as r, createTextVNode as x, ref as M, createVNode as p, createCommentVNode as b, Fragment as U, renderSlot as W, normalizeProps as q, guardReactiveProps as H } from "vue";
2
2
  import { f as $ } from "../../formatting.es-RclXHhKo.mjs";
3
- import { _ as V, a as K } from "../../Button.vue.es-VQCd3V3C.mjs";
3
+ import { _ as V, a as K } from "../../Button.vue.es-Dz-2L8dJ.mjs";
4
4
  import { u as Y } from "../../index.es-CXkP_k3u.mjs";
5
- import { _ as Z, u as G, a as J } from "../../usePayments-BkwGyZT0.mjs";
6
- import { _ as Q } from "../../InvoiceSummary.vue.es-Bs5c2Ovx.mjs";
7
- import { _ as X } from "../../Section.vue.es-By1JltGi.mjs";
8
- import { u as E, _ as z, d as ee, e as te } from "../../customElements-Com2NiGU.mjs";
5
+ import { _ as Z, u as G, a as J } from "../../usePayments-Gx9kBvNB.mjs";
6
+ import { _ as Q } from "../../InvoiceSummary.vue.es-BWLiwlNs.mjs";
7
+ import { _ as X } from "../../Section.vue.es-DQ5H7mqW.mjs";
8
+ import { u as E, _ as z, d as ee, e as te } from "../../customElements-CSE7dwUr.mjs";
9
9
  import { C as ne } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
10
- import { _ as ae } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-C4bk0m8g.mjs";
10
+ import { _ as ae } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BqYk4_T9.mjs";
11
11
  import { _ as A } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DRLoYWGY.mjs";
12
- import { _ as T } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DVif_ME8.mjs";
13
- import { u as oe, _ as ie } from "../../usePaymentMethodAvailability-CkR4TwoV.mjs";
12
+ import { _ as T } from "../../PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-DuorCFo9.mjs";
13
+ import { u as oe, _ as ie } from "../../usePaymentMethodAvailability-D0NUanyF.mjs";
14
14
  import { g as re } from "../../customer.es-B5ppZf0j.mjs";
15
- import { u as se } from "../../useLoadInitialData-ux_wpNiR.mjs";
16
- import { u as ce } from "../../usePaymentMethodOptions-BfnLBZOo.mjs";
17
- import { u as le } from "../../usePaymentMethods-C3QfLSrP.mjs";
15
+ import { u as se } from "../../useLoadInitialData-MUljS38K.mjs";
16
+ import { u as ce } from "../../usePaymentMethodOptions-B7JYkGsw.mjs";
17
+ import { u as le } from "../../usePaymentMethods-CpzqXQUT.mjs";
18
18
  import { g as de } from "../../component-5wqcK7yz.mjs";
19
19
  const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name", "disabled", "value"], ye = ["for"], pe = /* @__PURE__ */ k({
20
20
  __name: "Checkbox",
@@ -238,7 +238,7 @@ const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name
238
238
  key: 0,
239
239
  invoice: e.invoice,
240
240
  "payment-attempts": e.paymentAttempts,
241
- "download-service": () => e.downloadService(e.invoice.id)
241
+ "download-service": () => e.downloadService(e.invoice)
242
242
  }, null, 8, ["invoice", "payment-attempts", "download-service"])) : b("", !0)
243
243
  ]),
244
244
  _: 1
@@ -366,7 +366,7 @@ const me = { class: "flex items-center gap-1 border-0 py-0" }, ue = ["id", "name
366
366
  intent: "secondary",
367
367
  onClick: v[2] || (v[2] = () => {
368
368
  var h;
369
- return (h = e.downloadService) == null ? void 0 : h.call(e, e.invoice.id);
369
+ return (h = e.downloadService) == null ? void 0 : h.call(e, e.invoice);
370
370
  })
371
371
  }, {
372
372
  default: r(() => [
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("../../Button.vue.es-BWl37nzm.js"),y=require("../../Section.vue.es-DuK52y67.js"),c=require("../../customElements-Bt8PbjIn.js"),g=require("../../ContentWithAsideLayout-C6yMIVJF.js"),f=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-B_207kq5.js"),h=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-V88bCeDt.js"),_=require("../../useCustomer-BJwJ9BkJ.js"),v=require("../../usePaymentMethods-GFmQRp0X.js"),S=require("../../usePaymentMethodOptions-B6GIM9q4.js"),C=require("../../useLoadInitialData-CezlvhBV.js"),M=require("../../component-B7ZDyqBp.js"),k={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},O={key:0},B=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup(o){return(r,a)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",null,[e.createVNode(e.unref(c._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]),_:1}),o.description?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:0,variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.description),1)]),_:1})):e.createCommentVNode("",!0)]),r.$slots.right?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(r.$slots,"right")])):e.createCommentVNode("",!0)]))}}),b=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default","delete","added"],setup(o,{emit:r}){const a=r,{$t:i}=c.useIntl(),n=e.ref(!1),m=()=>{n.value=!1,a("added")};return(d,t)=>(e.openBlock(),e.createBlock(e.unref(g.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(B,{title:e.unref(i)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(i)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(y._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(f._sfc_main,{"payment-methods":o.paymentMethods,onSetDefault:t[0]||(t[0]=s=>a("set-default")),onDelete:t[1]||(t[1]=s=>a("delete"))},null,8,["payment-methods"])]),_:1}),n.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,customer:o.customer,"payment-method-options":o.paymentMethodOptions,onSuccess:m},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,intent:"secondary",onClick:t[2]||(t[2]=s=>n.value=!1)},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:2,intent:"secondary",onClick:t[3]||(t[3]=s=>n.value=!0)},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),P=e.defineComponent({__name:"PaymentMethodsManagement.entry.view",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}},setup(o){const r=o,a=r.portalObject.customer_id,{customer:i,get:n}=_.useCustomer({customerId:a}),{items:m,fetchInitial:d}=v.usePaymentMethods({customerId:r.portalObject.customer_id}),{paymentMethodOptions:t,get:s}=S.usePaymentMethodOptions(),{isLoading:p}=C.useLoadInitialData(n.execute(),d(),s({customerId:r.portalObject.customer_id}));return(u,x)=>e.renderSlot(u.$slots,"default",{customer:e.unref(i),paymentMethods:e.unref(m),paymentMethodOptions:e.unref(t),isLoading:e.unref(p),refreshPaymentMethods:e.unref(d)})}}),w=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup(o){const r=M.getComponentName("payment-methods-management");return(a,i)=>(e.openBlock(),e.createBlock(e.unref(c._sfc_main$1),{entry:a.$props,"component-name":e.unref(r),"allowed-portal-types":["CUSTOMER"],onError:i[0]||(i[0]=n=>a.$emit("error",n))},{default:e.withCtx(()=>[e.createVNode(P,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:n,paymentMethods:m,paymentMethodOptions:d,isLoading:t,refreshPaymentMethods:s})=>[n?(e.openBlock(),e.createBlock(b,{key:0,"is-loading":t,"payment-methods":m,"payment-method-options":d,customer:n,onSetDefault:s,onDelete:s,onAdded:s},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault","onDelete","onAdded"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:N}=c.createSolvimonElement(w,"payment-methods-management");exports.defineSolvimonPaymentMethodsManagement=N;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("../../Button.vue.es-M_jXZda4.js"),y=require("../../Section.vue.es-Btff-cLY.js"),c=require("../../customElements-Vox1PB6G.js"),g=require("../../ContentWithAsideLayout-C6yMIVJF.js"),f=require("../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-H3vrPllf.js"),h=require("../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-D7fDguwa.js"),_=require("../../useCustomer-DSx-wN-6.js"),v=require("../../usePaymentMethods-DNVw2eVg.js"),S=require("../../usePaymentMethodOptions-cT1o-BA1.js"),C=require("../../useLoadInitialData-DsabgMLZ.js"),M=require("../../component-B7ZDyqBp.js"),k={class:"grid gap-4 sm:grid-cols-1 md:grid-cols-2"},O={key:0},B=e.defineComponent({__name:"ScreenTitle",props:{title:{type:String},description:{type:String}},setup(o){return(r,a)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",null,[e.createVNode(e.unref(c._sfc_main),{variant:"heading-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]),_:1}),o.description?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:0,variant:"body-sm",color:"subtle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.description),1)]),_:1})):e.createCommentVNode("",!0)]),r.$slots.right?(e.openBlock(),e.createElementBlock("div",O,[e.renderSlot(r.$slots,"right")])):e.createCommentVNode("",!0)]))}}),b=e.defineComponent({__name:"PaymentMethodsManagement",props:{customer:{type:Object},paymentMethods:{type:Array},paymentMethodOptions:{type:Array},isLoading:{type:Boolean},error:{type:null}},emits:["set-default","delete","added"],setup(o,{emit:r}){const a=r,{$t:i}=c.useIntl(),n=e.ref(!1),m=()=>{n.value=!1,a("added")};return(d,t)=>(e.openBlock(),e.createBlock(e.unref(g.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(B,{title:e.unref(i)({defaultMessage:"Payment methods",id:"screens.payment_method_management.title",description:"The title for the payment method management screen "}),description:e.unref(i)({defaultMessage:"Add a new payment method or set a default payment method for your payments.",id:"screens.payment_method_management.description",description:"The descriptive text for the payment method management screen"})},null,8,["title","description"])]),content:e.withCtx(()=>[e.createVNode(e.unref(y._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:"Your payment methods"},{default:e.withCtx(()=>[e.createVNode(f._sfc_main,{"payment-methods":o.paymentMethods,onSetDefault:t[0]||(t[0]=s=>a("set-default")),onDelete:t[1]||(t[1]=s=>a("delete"))},null,8,["payment-methods"])]),_:1}),n.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,customer:o.customer,"payment-method-options":o.paymentMethodOptions,onSuccess:m},null,8,["customer","payment-method-options"])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,intent:"secondary",onClick:t[2]||(t[2]=s=>n.value=!1)},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("Cancel",-1)])]),_:1})):(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:2,intent:"secondary",onClick:t[3]||(t[3]=s=>n.value=!0)},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("Add payment method",-1)])]),_:1}))]),_:1}))}}),P=e.defineComponent({__name:"PaymentMethodsManagement.entry.view",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}},setup(o){const r=o,a=r.portalObject.customer_id,{customer:i,get:n}=_.useCustomer({customerId:a}),{items:m,fetchInitial:d}=v.usePaymentMethods({customerId:r.portalObject.customer_id}),{paymentMethodOptions:t,get:s}=S.usePaymentMethodOptions(),{isLoading:p}=C.useLoadInitialData(n.execute(),d(),s({customerId:r.portalObject.customer_id}));return(u,x)=>e.renderSlot(u.$slots,"default",{customer:e.unref(i),paymentMethods:e.unref(m),paymentMethodOptions:e.unref(t),isLoading:e.unref(p),refreshPaymentMethods:e.unref(d)})}}),w=e.defineComponent({__name:"PaymentMethodsManagement.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}},setup(o){const r=M.getComponentName("payment-methods-management");return(a,i)=>(e.openBlock(),e.createBlock(e.unref(c._sfc_main$1),{entry:a.$props,"component-name":e.unref(r),"allowed-portal-types":["CUSTOMER"],onError:i[0]||(i[0]=n=>a.$emit("error",n))},{default:e.withCtx(()=>[e.createVNode(P,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:n,paymentMethods:m,paymentMethodOptions:d,isLoading:t,refreshPaymentMethods:s})=>[n?(e.openBlock(),e.createBlock(b,{key:0,"is-loading":t,"payment-methods":m,"payment-method-options":d,customer:n,onSetDefault:s,onDelete:s,onAdded:s},null,8,["is-loading","payment-methods","payment-method-options","customer","onSetDefault","onDelete","onAdded"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:N}=c.createSolvimonElement(w,"payment-methods-management");exports.defineSolvimonPaymentMethodsManagement=N;
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as f, openBlock as i, createElementBlock as h, createElementVNode as b, createVNode as c, unref as t, withCtx as m, createTextVNode as u, toDisplayString as _, createBlock as p, createCommentVNode as g, renderSlot as M, ref as C, normalizeProps as A, guardReactiveProps as j } from "vue";
2
- import { _ as S } from "../../Button.vue.es-VQCd3V3C.mjs";
3
- import { _ as k } from "../../Section.vue.es-By1JltGi.mjs";
4
- import { _ as v, u as P, d as L, e as w } from "../../customElements-Com2NiGU.mjs";
2
+ import { _ as S } from "../../Button.vue.es-Dz-2L8dJ.mjs";
3
+ import { _ as k } from "../../Section.vue.es-DQ5H7mqW.mjs";
4
+ import { _ as v, u as P, d as L, e as w } from "../../customElements-CSE7dwUr.mjs";
5
5
  import { C as D } from "../../ContentWithAsideLayout-Bnbsq8_5.mjs";
6
- import { _ as T } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-CnmZ9dvP.mjs";
7
- import { _ as B } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-5KKkuVt5.mjs";
8
- import { u as I } from "../../useCustomer-CC9zxV6c.mjs";
9
- import { u as N } from "../../usePaymentMethods-C3QfLSrP.mjs";
10
- import { u as x } from "../../usePaymentMethodOptions-BfnLBZOo.mjs";
11
- import { u as E } from "../../useLoadInitialData-ux_wpNiR.mjs";
6
+ import { _ as T } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-C6BcIkEV.mjs";
7
+ import { _ as B } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-C1tGJsay.mjs";
8
+ import { u as I } from "../../useCustomer-CP8eWUZV.mjs";
9
+ import { u as N } from "../../usePaymentMethods-CpzqXQUT.mjs";
10
+ import { u as x } from "../../usePaymentMethodOptions-B7JYkGsw.mjs";
11
+ import { u as E } from "../../useLoadInitialData-MUljS38K.mjs";
12
12
  import { g as F } from "../../component-5wqcK7yz.mjs";
13
13
  const R = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" }, V = { key: 0 }, z = /* @__PURE__ */ f({
14
14
  __name: "ScreenTitle",
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../IconButton.vue.es-DGLIdHkR.js"),P=require("../../Button.vue.es-BWl37nzm.js"),A=require("../../ErrorNotification.vue.es-0ZC_DozN.js"),b=require("../../customElements-Bt8PbjIn.js"),$=require("../../ContentWithAsideLayout-C6yMIVJF.js"),I=require("../../useActionDispatchProvider-B54GYEY7.js"),E=require("../../subscription-9GORG-Gt.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C_yKvYtG.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-n097Xf1H.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-DXO9xpFT.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),T=require("../../Section.vue.es-DuK52y67.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-Ctw9Es1g.js"),F=require("../../Modal.vue.es-Chi6_MH_.js"),Y=require("../../subscriptions-X0Ciw8z3.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-D-Fa54M6.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-ChWAwDSF.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-Q4C2DPhw.js"),Q=require("../../useCustomer-BJwJ9BkJ.js"),X=require("../../usePaymentMethods-GFmQRp0X.js"),ee=require("../../useLoadInitialData-CezlvhBV.js"),te=require("../../component-B7ZDyqBp.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-DEjIERyF.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},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}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},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}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("../../IconButton.vue.es-BTAkuFsm.js"),P=require("../../Button.vue.es-M_jXZda4.js"),A=require("../../ErrorNotification.vue.es-Cd2UKPAz.js"),b=require("../../customElements-Vox1PB6G.js"),$=require("../../ContentWithAsideLayout-C6yMIVJF.js"),I=require("../../useActionDispatchProvider-CNAuaHdm.js"),E=require("../../subscription-ZA62t4E9.js"),L=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-Cnlbp0om.js"),O=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BGHaTx1A.js"),R=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CM_8Asmw.js"),U=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DypW8aNJ.js"),T=require("../../Section.vue.es-Btff-cLY.js"),j=require("../../pricing-BVAld27Y.js"),V=require("../../formatting.es-C72Nsrmh.js"),W=require("../../PaymentMethod.vue.es-D18g-QB4.js"),F=require("../../Modal.vue.es-BD4vUaOQ.js"),Y=require("../../subscriptions-fJcj88X9.js"),z=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-s5_uhyuB.js"),G=require("../../api.es-duCDtZD9.js"),H=require("../../useIncrementalLoading-CaWOE8Xl.js"),Z=require("../../paymentMethods-CRDIw9lz.js"),J=require("../../error-CmduqgVq.js"),K=require("../../useSubscription-K_gP9TeX.js"),Q=require("../../useCustomer-DSx-wN-6.js"),X=require("../../usePaymentMethods-DNVw2eVg.js"),ee=require("../../useLoadInitialData-DsabgMLZ.js"),te=require("../../component-B7ZDyqBp.js");function ne({subscription:t}){const{dispatchAction:s}=I.useActionDispatchProvider(),i=e.computed(()=>{if(!t.value)return!1;const u=t.value.inactive_periods;return!u||u.length===0}),n=e.computed(()=>{var g;const u=(g=t.value)==null?void 0:g.inactive_periods;return Array.isArray(u)&&u.length>0}),a=e.ref();return{isCancellable:i,isRenewable:n,pendingVariant:a,cancel:()=>{t.value&&(a.value="CANCEL")},renew:()=>{t.value&&(a.value="RENEW")},dismiss:()=>{a.value=void 0},manage:()=>{t.value&&s({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}function ie(t){var n,a,o,r,c,d,u;const s=(o=(a=(n=t.items)==null?void 0:n[0])==null?void 0:a.configs)==null?void 0:o[0],i=(c=(r=s==null?void 0:s.details)==null?void 0:r.bands)==null?void 0:c[0];return{amount:(i==null?void 0:i.amount)??(i==null?void 0:i.fixed_amount),billingPeriod:((d=s==null?void 0:s.details)==null?void 0:d.pricing_period)??((u=s==null?void 0:s.details)==null?void 0:u.billing_period)}}function oe(t){var n,a,o;const s=new Set((((n=t.pricing_plan_schedule)==null?void 0:n.enabled_pricings)??[]).map(({pricing_id:r})=>r));return s.size===0?[]:(((o=(a=t.pricing_plan_version)==null?void 0:a.pricing_categories)==null?void 0:o.flatMap(r=>r.pricing_groups??[]))??[]).flatMap(r=>(r.pricings??[]).filter(c=>s.has(c.id)).map(c=>({pricingId:c.id,pricingGroupId:r.id,groupName:r.name,name:j.getNameFromPricing(c)||r.name,...ie(c)})))}const ae={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},se={class:"sv-enabled-pricings-list__item-content grow"},re=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>{const{amount:a,billingPeriod:o}=s.entry;if(a)return o?i({defaultMessage:"{amount} per {period}",id:"enabled_pricings_list.item.price",description:'The recurring price of an enabled pricing, e.g. "€ 100,00 per month"'},{amount:V.formatAmount(a),period:V.formatBillingPeriod(o,{short:!0,hideValueForExactPeriods:!0})}):V.formatAmount(a)});return(a,o)=>(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",se,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"subtle",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"h3",variant:"heading-3","no-spacing":"",class:"sv-enabled-pricings-list__item-name"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.name),1)]),_:1}),n.value?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,tag:"span",variant:"body-sm",color:"subtle",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(P._sfc_main),{intent:"secondary",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:o[0]||(o[0]=r=>a.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Upgrade",id:"enabled_pricings_list.item.upgrade_button.label",description:"Label for the button that changes which pricing is enabled for a group"})),1)]),_:1})])]),_:1}))}}),ce={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},le=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const s=t,{$t:i}=b.useIntl(),n=e.computed(()=>oe(s.pricingPlanSchedule));return(a,o)=>n.value.length>0?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(i)({defaultMessage:"Upgrades",id:"enabled_pricings_list.title",description:"Title for the block listing the pricings enabled on a subscription"})},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(re,{key:r.pricingId,entry:r,onUpgrade:o[0]||(o[0]=c=>a.$emit("upgrade",c))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});function ue({variant:t,renewableUntil:s,billingPeriodEndsAt:i}){const{$t:n}=b.useIntl(),a=e.computed(()=>t.value==="RENEW"),o=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):n({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),r=e.computed(()=>a.value?s.value?n({defaultMessage:"You can renew your subscription until {date}. After this period you can only create a new subscription.",description:"Explanation of the deadline for undoing a cancellation, shown in the renew subscription modal",id:"subscription_cancellation_modal.renew.explanation_with_date"},{date:s.value}):n({defaultMessage:"Your subscription will continue as before, and billing will resume on its usual schedule.",description:"Explanation of what happens when a cancellation is undone, shown in the renew subscription modal when no end date is known",id:"subscription_cancellation_modal.renew.explanation"}):i.value?n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until {date}.",description:"Explanation of what happens when a running subscription is cancelled, naming the date access ends, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation_with_date"},{date:i.value}):n({defaultMessage:"Your subscription will be canceled, but you’ll continue to have access until the end of the billing period.",description:"Explanation of what happens when a running subscription is cancelled, shown in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.explanation"})),c=e.computed(()=>a.value?n({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):n({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),d=e.computed(()=>n({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),u=e.computed(()=>a.value?n({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):n({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}));return{title:o,explanation:r,confirmButtonText:c,cancelButtonText:d,errorMessage:u}}const de=50;function pe(){const{getPaymentMethods:t}=Z.createPaymentMethodsService(),s=e.shallowRef();return{paymentMethod:s,get:async({customerId:n,paymentMethodId:a})=>{const o=await G.getPaginatedFullList(async r=>{const c=await t({customerId:n,pagination:{page:r,pageSize:de}});if(!H.isApiSuccessCollectionResponse(c))throw new Error("Could not load the customer’s payment methods.");return c});return s.value=o.data.find(({id:r})=>r===a),s.value}}}const me={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},be={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},fe={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},ge=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(t,{emit:s}){const i=t,n=s,{$t:a,formatDate:o}=b.useIntl(),r=b.useLogger(),{setSubscriptionCancellation:c}=Y.createSubscriptionsService(),d=e.computed(()=>i.variant),u=e.computed(()=>{var _;const l=((_=i.subscription)==null?void 0:_.inactive_periods)??[],f=l.find(({type:N})=>N==="CANCEL")??l[0];if(f)return o({date:f.start_at,format:"date",offsetType:"local"})}),g=e.computed(()=>{var f,_;const l=(_=(f=i.subscription)==null?void 0:f.next_invoice)==null?void 0:_.invoice_date;if(l)return o({date:l,format:"date",offsetType:"local"})}),y=g,w=e.computed(()=>{var l,f;return(((f=(l=E.getMostRecentScheduleInfo(i.subscription))==null?void 0:l.pricing_plan_schedule)==null?void 0:f.enabled_pricings)??[]).map(({pricing_id:_})=>_).filter(_=>!!_)}),{title:h,explanation:C,confirmButtonText:S,cancelButtonText:k,errorMessage:B}=ue({variant:d,renewableUntil:u,billingPeriodEndsAt:g}),{paymentMethod:v,get:M}=pe();e.watch([()=>i.showModal,()=>{var l;return(l=i.subscription)==null?void 0:l.payment_method_id},()=>{var l;return(l=i.subscription)==null?void 0:l.customer_id}],([l,f,_])=>{var N;!l||!f||!_||f!==((N=v.value)==null?void 0:N.id)&&M({customerId:_,paymentMethodId:f}).catch(()=>{})},{immediate:!0});const p=e.ref(!1),m=e.ref(!1);e.watch(()=>i.showModal,l=>{l&&(m.value=!1)});const x=async()=>{if(!(!i.subscription||!i.variant||p.value)){p.value=!0,m.value=!1;try{await c({id:i.subscription.id,variant:i.variant}),n("confirmed"),n("close")}catch(l){r.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:i.variant},l),m.value=!0}finally{p.value=!1}}},q=()=>{p.value||n("close")};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(F.Modal),{size:"md","show-modal":t.showModal,title:e.unref(h),"confirm-button-text":e.unref(S),"cancel-button-text":e.unref(k),"is-loading":p.value,"no-click-away":p.value,"no-backdrop-close":p.value,onConfirm:x,onClose:q},{body:e.withCtx(()=>[e.createElementVNode("div",me,[e.createVNode(e.unref(b._sfc_main),{variant:"body-sm",color:"subtle",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)),1)]),_:1}),t.subscription?(e.openBlock(),e.createBlock(e.unref(T._sfc_main),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(z._sfc_main,{subscription:t.subscription,avatar:t.avatar,"enabled-pricing-ids":w.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(y)||e.unref(v)?(e.openBlock(),e.createElementBlock("div",be,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Renews",description:"Label before the date the subscription renews, shown in the cancel subscription modal",id:"subscription_cancellation_modal.renews_label"})),1)]),_:1}),e.createVNode(e.unref(b._sfc_main),{tag:"span",variant:"body-xs",color:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createBlock(e.unref(W._sfc_main),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(v)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(B)},null,8,["title"])):e.createCommentVNode("",!0)])]),_:1},8,["show-modal","title","confirm-button-text","cancel-button-text","is-loading","no-click-away","no-backdrop-close"]))}}),_e={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},he=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},avatar:{type:String},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","auto-top-up-saved","auto-top-up-cancelled","payment-method-stored","subscription-changed"],setup(t,{emit:s}){const i=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../SubscriptionSchedules-pzNsego6.js"))),n=t,a=s,{$t:o}=b.useIntl(),{isCancellable:r,isRenewable:c,pendingVariant:d,cancel:u,renew:g,dismiss:y,manage:w}=ne({subscription:e.toRef(n,"subscription")}),h=e.ref();e.watch(d,p=>{p&&(h.value=void 0)});const C=()=>{h.value=d.value,a("subscription-changed")},S=e.computed(()=>{if(h.value)return h.value==="RENEW"?o({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):o({defaultMessage:"Your subscription has been cancelled. You keep access until the end of the billing period.",id:"subscription_details.cancel_success",description:"Confirmation shown after a subscription has been cancelled"})}),k=e.computed(()=>E.getMostRecentScheduleInfo(n.subscription)),B=e.computed(()=>(n.paymentMethods??[]).find(({id:p})=>{var m;return p===((m=n.subscription)==null?void 0:m.payment_method_id)})),v=e.computed(()=>n.subscription?[n.subscription]:[]),M=e.computed(()=>E.getSubscriptionName({subscription:n.subscription,fallback:o({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(p,m)=>(e.openBlock(),e.createBlock(e.unref($.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(e.unref(b._sfc_main),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M.value),1)]),_:1}),e.unref(c)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:0,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(g)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Renew subscription",id:"subscription_details.renew_button.label",description:"Label for the renew subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createBlock(e.unref(P._sfc_main),{key:1,intent:"secondary",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Cancel subscription",id:"subscription_details.cancel_button.label",description:"Label for the cancel subscription button on the subscription details page"})),1)]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]),content:e.withCtx(()=>[S.value?(e.openBlock(),e.createBlock(e.unref(D._sfc_main),{key:0,class:"sv-subscription-details__cancellation-success",type:"success",title:S.value},null,8,["title"])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(o)({defaultMessage:"Unable to load this subscription. Please try again later.",id:"subscription_details.load_error",description:"Error message shown when the subscription cannot be loaded on the subscription details page"})},null,8,["title"])):t.isLoading?(e.openBlock(),e.createBlock(U._sfc_main,{key:2,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createBlock(e.unref(i),{key:3,class:"sv-subscription-details__schedules","schedules-data":t.schedulesData??[],configuration:{subscriptionId:t.subscription.id},"is-loading":t.isLoading},null,8,["schedules-data","configuration","is-loading"])):(e.openBlock(),e.createBlock(R._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Subscription not found",id:"subscription_details.empty_state.title",description:"Title shown when the requested subscription does not exist"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"This subscription is no longer available.",id:"subscription_details.empty_state.message",description:"Message shown when the requested subscription does not exist"})),1)]),_:1}))]),aside:e.withCtx(()=>[e.createVNode(L._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":!!t.hasWalletBalancesError,"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:v.value,onTopUpCharged:m[0]||(m[0]=x=>p.$emit("top-up-charged")),onAutoTopUpSaved:m[1]||(m[1]=x=>p.$emit("auto-top-up-saved")),onAutoTopUpCancelled:m[2]||(m[2]=x=>p.$emit("auto-top-up-cancelled")),onPaymentMethodStored:m[3]||(m[3]=x=>p.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),k.value?(e.openBlock(),e.createBlock(le,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":k.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(O._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[B.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(ge,{"show-modal":!!e.unref(d),variant:e.unref(d),subscription:t.subscription,avatar:t.avatar,onConfirmed:C,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),ve=e.defineComponent({__name:"SubscriptionDetails.entry.view",props:{configuration:{type:Object},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}},setup(t){const s=t,i=s.portalObject.customer_id,{subscription:n,withPlanData:a,get:o,error:r}=K.useSubscription({subscriptionId:s.configuration.subscriptionId}),{customer:c,get:d}=Q.useCustomer({customerId:i}),{items:u,fetchAll:g}=X.usePaymentMethods({customerId:i}),{walletBalances:y,apiStatus:w,fetch:h}=L.useCustomerWalletBalances({customerId:i}),{isLoading:C}=ee.useLoadInitialData(o(),d.execute(),g(),h()),S=e.computed(()=>n.value?a(n.value):[]),k=e.computed(()=>{var v;return((v=y.value)==null?void 0:v.wallet_balances)??[]}),B=e.computed(()=>w.value===J.ApiStatus.Failed);return(v,M)=>e.renderSlot(v.$slots,"default",{subscription:e.unref(n),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(u),walletBalances:k.value,hasWalletBalancesError:B.value,isLoading:e.unref(C),error:e.unref(r),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(g),refreshSubscription:e.unref(o)})}}),ye=e.defineComponent({__name:"SubscriptionDetails.entry",props:{configuration:{type:Object},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}},setup(t){const s=te.getComponentName("subscription-details");return(i,n)=>(e.openBlock(),e.createBlock(e.unref(b._sfc_main$1),{entry:i.$props,"component-name":e.unref(s),"allowed-portal-types":["CUSTOMER"],onError:n[0]||(n[0]=a=>i.$emit("error",a))},{default:e.withCtx(()=>[e.createVNode(ve,e.normalizeProps(e.guardReactiveProps(i.$props)),{default:e.withCtx(({subscription:a,schedulesData:o,customer:r,paymentMethods:c,walletBalances:d,hasWalletBalancesError:u,isLoading:g,error:y,refreshWalletBalances:w,refreshPaymentMethods:h,refreshSubscription:C})=>[e.createVNode(he,{subscription:a,"schedules-data":o,customer:r,avatar:t.configuration.avatar,"payment-methods":c,"wallet-balances":d,"has-wallet-balances-error":u,"is-loading":g,error:y,onTopUpCharged:w,onAutoTopUpSaved:w,onAutoTopUpCancelled:w,onPaymentMethodStored:h,onSubscriptionChanged:C},null,8,["subscription","schedules-data","customer","avatar","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onAutoTopUpSaved","onAutoTopUpCancelled","onPaymentMethodStored","onSubscriptionChanged"])]),_:1},16)]),_:1},8,["entry","component-name"]))}}),{define:we}=b.createSolvimonElement(ye,"subscription-details");exports.defineSolvimonSubscriptionDetails=we;