@solvimon/solvimon-web 0.1.0-alpha.17 → 0.1.0-alpha.18

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 (168) hide show
  1. package/README.md +28 -26
  2. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-C2IRj-FB.mjs +238 -0
  3. package/dist/AddPaymentMethodPane.vue_vue_type_script_setup_true_lang-Rub9ifBk.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BrPsTuoW.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BWnZ98RQ.mjs} +2 -2
  5. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-BuQ8bzar.js → BillingInformation.vue_vue_type_script_setup_true_lang-DurgWlLC.js} +1 -1
  6. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CuWrBcoK.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-D7gL7dZX.mjs} +3 -3
  7. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Df7CsbiW.js +1 -0
  8. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-OUg4yv7r.mjs +2654 -0
  9. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-mM5udvi8.js +1 -0
  10. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BIpg-MSJ.mjs +53 -0
  11. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BM3p8Pk8.js +1 -0
  12. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D5eSNYH2.js +1 -0
  13. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-wxP5IaGt.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DbY35gE_.mjs} +1 -1
  14. package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-05NKI2A0.js → InvoiceHeader.vue_vue_type_script_setup_true_lang-Ci8r6tuC.js} +1 -1
  15. package/dist/{InvoiceHeader.vue_vue_type_script_setup_true_lang-17v07F58.mjs → InvoiceHeader.vue_vue_type_script_setup_true_lang-jshby9pF.mjs} +1 -1
  16. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-CNKxTtO7.js +1 -0
  17. package/dist/PaymentErrorCard.vue_vue_type_script_setup_true_lang-DBMgilG2.mjs +153 -0
  18. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CupZFJSF.mjs +52 -0
  19. package/dist/PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-D6lpD1zo.js +1 -0
  20. package/dist/{PaymentHistoryBlock-BitwS9Re.mjs → PaymentHistoryBlock-Bxr8lUGs.mjs} +1 -1
  21. package/dist/{PaymentHistoryBlock-ZtmPXXwI.js → PaymentHistoryBlock-COjIVYX4.js} +1 -1
  22. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Bmgx7PSt.js +1 -0
  23. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-C3ZUDUdw.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CDjGab5p.mjs} +1 -1
  24. package/dist/{PaymentIntegrationForm-BZTzCUiu.js → PaymentIntegrationForm-BSauhuKv.js} +1 -1
  25. package/dist/{PaymentIntegrationForm-BK2aLPCo.mjs → PaymentIntegrationForm-PIT8gHYN.mjs} +1 -1
  26. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-5XKz3kop.js +1 -0
  27. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-COO2ZUhN.mjs +148 -0
  28. package/dist/PaymentIntegrationFormAdyen-B-Jbu2hU.js +1 -0
  29. package/dist/PaymentIntegrationFormAdyen-Cjj9aK0E.mjs +729 -0
  30. package/dist/PaymentIntegrationFormStripe-Bnn8S1o5.js +1 -0
  31. package/dist/PaymentIntegrationFormStripe-arpua_ZT.mjs +545 -0
  32. package/dist/PaymentMethodForm-B7T5rrNz.mjs +4 -0
  33. package/dist/PaymentMethodForm-CLz3ZS-b.js +1 -0
  34. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-C4Zf92QP.mjs} +2 -2
  35. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-zRr8iihy.js → PaymentMethodForm.vue_vue_type_script_setup_true_lang-UH9AVXnG.js} +1 -1
  36. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIIt6fGp.mjs} +76 -30
  37. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-ifai5HVr.js +1 -0
  38. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D1TcP9PR.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DaWlLor0.mjs} +2 -2
  39. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-DdUoeTUL.js +1 -0
  40. package/dist/{SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BMXr26gF.mjs → SubscriptionSchedules.vue_vue_type_script_setup_true_lang-CyYhYYRp.mjs} +1 -1
  41. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DdjYVNku.js +1 -0
  42. package/dist/SubscriptionSummary.vue_vue_type_script_setup_true_lang-Cu55ZvCH.js +1 -0
  43. package/dist/{EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-C3cqlbGY.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-z8P1u1Gi.mjs} +16 -63
  44. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-BKDMwuyh.js +1 -0
  45. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BDqX6OaE.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BOUSk2ZB.mjs} +5 -5
  46. package/dist/adyen-BMDZQBUG.js +1 -0
  47. package/dist/{url-BjZ1Pg0l.mjs → adyen-Ba-mF3Jy.mjs} +31 -73
  48. package/dist/component--Y7Igv5i.mjs +1022 -0
  49. package/dist/component-DIy1hvJM.js +1 -0
  50. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  51. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  52. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  53. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +4 -4
  54. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  55. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  56. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  57. package/dist/components/Invoice/Invoice.es.js +7 -7
  58. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  59. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  60. package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -1
  61. package/dist/components/InvoiceHeader/InvoiceHeader.es.js +4 -4
  62. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  63. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  64. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  65. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  66. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  67. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +6 -6
  68. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  69. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +4 -4
  70. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  71. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  72. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  73. package/dist/components/WalletBalances/WalletBalances.es.js +21 -7
  74. package/dist/core/action-request.types.d.ts +1 -13
  75. package/dist/core/index.cjs.js +1 -1
  76. package/dist/core/index.es.js +1 -1
  77. package/dist/{customer-DAgdegIW.mjs → customer-DovIxTG1.mjs} +1 -1
  78. package/dist/{customer-AfRcAZ5P.js → customer-brfznoHY.js} +1 -1
  79. package/dist/en-US-BvOHPudj.js +1 -0
  80. package/dist/{en-US-DSzSbgL5.mjs → en-US-CXDO3qhq.mjs} +53 -0
  81. package/dist/index-BMWWP8xj.js +1 -0
  82. package/dist/index-Do7kzLpg.mjs +265 -0
  83. package/dist/index.cjs.js +1 -1
  84. package/dist/index.es.js +1 -1
  85. package/dist/{invoices-BHgajZHq.js → invoices-Cf3dSYSj.js} +1 -1
  86. package/dist/{invoices-BXDgW8ch.mjs → invoices-Dk-z04lg.mjs} +2 -2
  87. package/dist/{nl-NL-Li7RW89R.mjs → nl-NL-BgL_PuBn.mjs} +55 -1
  88. package/dist/nl-NL-COGUFg60.js +1 -0
  89. package/dist/{paymentMethods-xzFD2L30.mjs → paymentMethods-BnF1XYS1.mjs} +21 -5
  90. package/dist/paymentMethods-DVDC_WfL.js +1 -0
  91. package/dist/{payments-DMvmB5vg.js → payments-DVZFO5yb.js} +1 -1
  92. package/dist/{payments-DV6csRej.mjs → payments-TnRjtlOw.mjs} +1 -1
  93. package/dist/{pricing-BEjY_5wb.js → pricing-CuYndX6t.js} +1 -1
  94. package/dist/{pricing-B1uImUm4.mjs → pricing-GwLCiSzs.mjs} +1 -1
  95. package/dist/{pricingPlanSchedule-C_cqUyTk.mjs → pricingPlanSchedule-CXG3CQ61.mjs} +3 -1
  96. package/dist/{registry-CyENvS6l.mjs → registry-Ck0Gb6rj.mjs} +1 -1
  97. package/dist/{registry-CeMxLjwU.js → registry-Cra6yoB4.js} +1 -1
  98. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  99. package/dist/screens/Checkout/Checkout.es.js +37 -36
  100. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  101. package/dist/screens/CustomerOverview/CustomerOverview.es.js +32 -56
  102. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  103. package/dist/screens/PayInvoice/PayInvoice.es.js +28 -12
  104. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -1
  105. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +28 -18
  106. package/dist/screens/SubscriptionDetails/SubscriptionDetails.cjs.js +1 -1
  107. package/dist/screens/SubscriptionDetails/SubscriptionDetails.es.js +436 -89
  108. package/dist/screens/SubscriptionManagement/SubscriptionManagement.cjs.js +1 -1
  109. package/dist/screens/SubscriptionManagement/SubscriptionManagement.es.js +28 -37
  110. package/dist/solvimon-web.css +1 -1
  111. package/dist/{subscription-B4dBAY9C.mjs → subscription-C41lG-rH.mjs} +1 -1
  112. package/dist/subscriptions-BFCKVHnP.js +1 -0
  113. package/dist/subscriptions-vEE4Y7qm.mjs +58 -0
  114. package/dist/{useActionDispatchProvider-zB_GKeUR.mjs → useActionDispatchProvider-BlEf-RZ5.mjs} +1 -1
  115. package/dist/{useActionDispatchProvider-bqR_FeM4.js → useActionDispatchProvider-aJOy3kr1.js} +1 -1
  116. package/dist/{useCustomer-bO4D6e4Z.js → useCustomer-C1XTqmrQ.js} +1 -1
  117. package/dist/{useCustomer-VfeQ6rG2.mjs → useCustomer-Cw8LXT6S.mjs} +2 -2
  118. package/dist/{useIncrementalLoading-C59FXHzp.mjs → useIncrementalLoading-8WtKZ-mP.mjs} +2 -2
  119. package/dist/useIncrementalLoading-CkY2klIW.js +1 -0
  120. package/dist/{useInvoiceData-CxxkBTGY.js → useInvoiceData-BrxMo4Zt.js} +1 -1
  121. package/dist/{useInvoiceData-Dhg-hx8C.mjs → useInvoiceData-Cy_ysMsq.mjs} +2 -2
  122. package/dist/{useInvoicesList-DBz7T7sM.mjs → useInvoicesList-DMsZn1tE.mjs} +4 -4
  123. package/dist/{useInvoicesList-BXZ9uV9i.js → useInvoicesList-DmisMQzy.js} +1 -1
  124. package/dist/{useLoadInitialData-BhpIg7OF.mjs → useLoadInitialData-BP1v7qhd.mjs} +1 -1
  125. package/dist/{useLoadInitialData-BqiAFNFi.js → useLoadInitialData-_BjCD0Jc.js} +1 -1
  126. package/dist/{usePaymentMethodOptions-PcMjtMSF.mjs → usePaymentMethodOptions-CWfGvW0U.mjs} +9 -3
  127. package/dist/{usePaymentMethodOptions-DszFvgKX.js → usePaymentMethodOptions-xeSTmaVo.js} +1 -1
  128. package/dist/{usePaymentMethods-Bb1Xbads.js → usePaymentMethods-CAFMvSOr.js} +1 -1
  129. package/dist/{usePaymentMethods-B5AbGWsn.mjs → usePaymentMethods-Cyk4cjoE.mjs} +2 -2
  130. package/dist/{usePayments-is5c66Z6.js → usePayments-BieVBaz-.js} +1 -1
  131. package/dist/{usePayments-DgoZoBZh.mjs → usePayments-D88XSZfS.mjs} +10 -4
  132. package/dist/{usePortal-DWLtNqBB.mjs → usePortal-0NDlbFr9.mjs} +1 -1
  133. package/dist/{usePortal-C4qWsJeq.js → usePortal-B954nyEB.js} +1 -1
  134. package/dist/{useService-DKm3QtT4.js → useService-BiljI7XA.js} +1 -1
  135. package/dist/{useService-BZqFkz7p.mjs → useService-CqfJi5ST.mjs} +1 -1
  136. package/dist/{useSubscription-CEZJw6wZ.mjs → useSubscription-9rJpFNUF.mjs} +9 -3
  137. package/dist/{useSubscription-DuUNc1_l.js → useSubscription-k3limdu_.js} +1 -1
  138. package/dist/vendor-ui-Dfh3_g4q.js +1 -0
  139. package/dist/{vendor-ui-BoGKOJ36.mjs → vendor-ui-ItGf7wJV.mjs} +1912 -1800
  140. package/package.json +12 -5
  141. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-1Op9GjGZ.js +0 -1
  142. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js +0 -1
  143. package/dist/CustomerWalletBalances.vue_vue_type_script_setup_true_lang-D2BhuXsh.mjs +0 -77
  144. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js +0 -1
  145. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-dwIv_xxf.js +0 -1
  146. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CMGK71zZ.js +0 -1
  147. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-B_yDNGK8.mjs +0 -1537
  148. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-GN3WAr10.js +0 -1
  149. package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-BQIN3zuf.mjs +0 -156
  150. package/dist/PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DyL2-vV0.js +0 -1
  151. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-OvGGejpX.js +0 -1
  152. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BxqIfmkK.js +0 -1
  153. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js +0 -1
  154. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CyAFjCh7.js +0 -1
  155. package/dist/component-CUJ_G2Nw.mjs +0 -962
  156. package/dist/component-CiKxWtdx.js +0 -1
  157. package/dist/en-US-QzQnGXP1.js +0 -1
  158. package/dist/index-CzL1ZcGi.mjs +0 -85
  159. package/dist/index-DRdBmZ2-.js +0 -1
  160. package/dist/nl-NL-C4rr-1tr.js +0 -1
  161. package/dist/paymentMethods-BMcc-eTl.js +0 -1
  162. package/dist/subscriptions-CrNDM9qa.mjs +0 -79
  163. package/dist/subscriptions-DC-mxa17.js +0 -1
  164. package/dist/url-D8GJi5rF.js +0 -1
  165. package/dist/useIncrementalLoading-BgWuwoMo.js +0 -1
  166. package/dist/useTopUpModal-DNyWrHDv.mjs +0 -1012
  167. package/dist/useTopUpModal-DeF-cfCK.js +0 -1
  168. package/dist/vendor-ui-BuRqLx74.js +0 -1
@@ -1,13 +1,13 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, renderSlot, ref, normalizeProps, guardReactiveProps } from "vue";
2
- import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component-CUJ_G2Nw.mjs";
3
- import { e as _sfc_main$4, u as useIntl, _ as _sfc_main$5, c as _sfc_main$8 } from "../../vendor-ui-BoGKOJ36.mjs";
2
+ import { _ as _sfc_main$9, d as defineCustomElement, g as getComponentName } from "../../component--Y7Igv5i.mjs";
3
+ import { a as _sfc_main$4, u as useIntl, b as _sfc_main$5, k as _sfc_main$8 } from "../../vendor-ui-ItGf7wJV.mjs";
4
4
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
5
- import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-DVeB_mqK.mjs";
6
- import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-CIQ0vsko.mjs";
7
- import { u as useCustomer } from "../../useCustomer-VfeQ6rG2.mjs";
8
- import { u as usePaymentMethods } from "../../usePaymentMethods-B5AbGWsn.mjs";
9
- import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-PcMjtMSF.mjs";
10
- import { u as useLoadInitialData } from "../../useLoadInitialData-BhpIg7OF.mjs";
5
+ import { _ as _sfc_main$6 } from "../../PaymentMethodsList.vue_vue_type_script_setup_true_lang-CIIt6fGp.mjs";
6
+ import { _ as _sfc_main$7 } from "../../PaymentMethodForm.vue_vue_type_script_setup_true_lang-C4Zf92QP.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-Cw8LXT6S.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-Cyk4cjoE.mjs";
9
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-CWfGvW0U.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-BP1v7qhd.mjs";
11
11
  const _hoisted_1 = { class: "grid gap-4 sm:grid-cols-1 md:grid-cols-2" };
12
12
  const _hoisted_2 = { key: 0 };
13
13
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -53,7 +53,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
53
53
  isLoading: { type: Boolean },
54
54
  error: { type: null }
55
55
  },
56
- emits: ["set-default"],
56
+ emits: ["set-default", "delete"],
57
57
  setup(__props, { emit: __emit }) {
58
58
  const emit = __emit;
59
59
  const { $t } = useIntl();
@@ -84,7 +84,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
84
84
  default: withCtx(() => [
85
85
  createVNode(_sfc_main$6, {
86
86
  "payment-methods": __props.paymentMethods,
87
- onSetDefault: _cache[0] || (_cache[0] = ($event) => emit("set-default"))
87
+ onSetDefault: _cache[0] || (_cache[0] = ($event) => emit("set-default")),
88
+ onDelete: _cache[1] || (_cache[1] = ($event) => emit("delete"))
88
89
  }, null, 8, ["payment-methods"])
89
90
  ]),
90
91
  _: 1
@@ -98,9 +99,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
98
99
  key: 1,
99
100
  color: "gray",
100
101
  variant: "outline",
101
- onClick: _cache[1] || (_cache[1] = ($event) => showPaymentMethodForm.value = false)
102
+ onClick: _cache[2] || (_cache[2] = ($event) => showPaymentMethodForm.value = false)
102
103
  }, {
103
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
104
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
104
105
  createTextVNode("Cancel", -1)
105
106
  ])]),
106
107
  _: 1
@@ -108,9 +109,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
108
109
  key: 2,
109
110
  color: "gray",
110
111
  variant: "outline",
111
- onClick: _cache[2] || (_cache[2] = ($event) => showPaymentMethodForm.value = true)
112
+ onClick: _cache[3] || (_cache[3] = ($event) => showPaymentMethodForm.value = true)
112
113
  }, {
113
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
114
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
114
115
  createTextVNode("Add payment method", -1)
115
116
  ])]),
116
117
  _: 1
@@ -199,15 +200,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
199
200
  }, {
200
201
  default: withCtx(() => [
201
202
  createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
202
- default: withCtx(({ customer, paymentMethods, paymentMethodOptions, isLoading, refreshPaymentMethods }) => [
203
+ default: withCtx(({
204
+ customer,
205
+ paymentMethods,
206
+ paymentMethodOptions,
207
+ isLoading,
208
+ refreshPaymentMethods
209
+ }) => [
203
210
  customer ? (openBlock(), createBlock(_sfc_main$2, {
204
211
  key: 0,
205
212
  "is-loading": isLoading,
206
213
  "payment-methods": paymentMethods,
207
214
  "payment-method-options": paymentMethodOptions,
208
215
  customer,
209
- onSetDefault: refreshPaymentMethods
210
- }, null, 8, ["is-loading", "payment-methods", "payment-method-options", "customer", "onSetDefault"])) : createCommentVNode("", true)
216
+ onSetDefault: refreshPaymentMethods,
217
+ onDelete: refreshPaymentMethods
218
+ }, null, 8, ["is-loading", "payment-methods", "payment-method-options", "customer", "onSetDefault", "onDelete"])) : createCommentVNode("", true)
211
219
  ]),
212
220
  _: 1
213
221
  }, 16)
@@ -217,7 +225,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
217
225
  };
218
226
  }
219
227
  });
220
- const SolvimonPaymentMethodsManagement = defineCustomElement(_sfc_main);
228
+ const SolvimonPaymentMethodsManagement = defineCustomElement(
229
+ _sfc_main
230
+ );
221
231
  const COMPONENT_NAME = getComponentName("payment-methods-management");
222
232
  const defineSolvimonPaymentMethodsManagement = () => {
223
233
  if (!customElements.get(COMPONENT_NAME)) {
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-CiKxWtdx.js"),i=require("../../vendor-ui-BuRqLx74.js"),n=require("../../ContentWithAsideLayout-DHpnJfGA.js"),s=require("../../useActionDispatchProvider-bqR_FeM4.js"),r=require("../../subscription-b0OPx8Du.js"),a=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BbuEBiY3.js"),o=require("../../SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BKz2QQn9.js"),l=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-C66beqgf.js"),c=require("../../useTopUpModal-DeF-cfCK.js"),u=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),d=require("../../pricing-BEjY_5wb.js"),p=require("../../ApiStatus-oqvUEWJx.js"),m=require("../../useSubscription-DuUNc1_l.js"),g=require("../../useCustomer-bO4D6e4Z.js"),b=require("../../usePaymentMethods-Bb1Xbads.js"),_=require("../../useLoadInitialData-BqiAFNFi.js");function y(e){var t,i,n,s,r,a,o;const l=null==(n=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:n[0],c=null==(r=null==(s=null==l?void 0:l.details)?void 0:s.bands)?void 0:r[0];return{amount:(null==c?void 0:c.amount)??(null==c?void 0:c.fixed_amount),billingPeriod:(null==(a=null==l?void 0:l.details)?void 0:a.pricing_period)??(null==(o=null==l?void 0:l.details)?void 0:o.billing_period)}}const v={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},f={class:"sv-enabled-pricings-list__item-content grow"},h=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const n=t,{$t:s}=i.useIntl(),r=e.computed(()=>{const{amount:e,billingPeriod:t}=n.entry;if(e)return t?s({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:i.formatAmount(e),period:i.formatBillingPeriod(t,{short:!0,hideValueForExactPeriods:!0})}):i.formatAmount(e)});return(n,a)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",v,[e.createElementVNode("div",f,[e.createVNode(e.unref(i._sfc_main$3),{tag:"span",variant:"body-sm",weight:"semibold",shade:"lighter",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$3),{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}),r.value?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$3),{key:0,tag:"span",variant:"body-sm",shade:"lighter",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(i._sfc_main$1),{variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:a[0]||(a[0]=e=>n.$emit("upgrade",t.entry))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({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}))}}),w={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},S=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const n=t,{$t:s}=i.useIntl(),r=e.computed(()=>function(e){var t,i,n;const s=new Set(((null==(t=e.pricing_plan_schedule)?void 0:t.enabled_pricings)??[]).map(({pricing_id:e})=>e));return 0===s.size?[]:((null==(n=null==(i=e.pricing_plan_version)?void 0:i.pricing_categories)?void 0:n.flatMap(e=>e.pricing_groups??[]))??[]).flatMap(e=>(e.pricings??[]).filter(e=>s.has(e.id)).map(t=>({pricingId:t.id,pricingGroupId:e.id,groupName:e.name,name:d.getNameFromPricing(t)||e.name,...y(t)})))}(n.pricingPlanSchedule));return(t,n)=>r.value.length>0?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:0,class:"sv-enabled-pricings-list","content-background":"none","no-border":"","no-spacing":"",title:e.unref(s)({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",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,i=>(e.openBlock(),e.createBlock(h,{key:i.pricingId,entry:i,onUpgrade:n[0]||(n[0]=e=>t.$emit("upgrade",e))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}}),C={class:"sv-subscription-details__header flex flex-col gap-2 md:flex-row md:items-center"},k=e.defineComponent({__name:"SubscriptionDetails",props:{subscription:{type:Object},schedulesData:{type:Array},customer:{type:Object},paymentMethods:{type:Array},walletBalances:{default:()=>[],type:Array},hasWalletBalancesError:{type:Boolean},isLoading:{type:Boolean},error:{type:null}},emits:["top-up-charged","payment-method-stored"],setup(t){const d=t,{$t:p}=i.useIntl(),{isCancellable:m,isRenewable:g,cancel:b,renew:_,manage:y}=function({subscription:t}){const{dispatchAction:i}=s.useActionDispatchProvider();return{isCancellable:e.computed(()=>{if(!t.value)return!1;const e=t.value.inactive_periods;return!e||0===e.length}),isRenewable:e.computed(()=>{var e;const i=null==(e=t.value)?void 0:e.inactive_periods;return Array.isArray(i)&&i.length>0}),cancel:()=>{t.value&&i({action:"cancel-subscription",data:{subscriptionId:t.value.id}})},renew:()=>{t.value&&i({action:"renew-subscription",data:{subscriptionId:t.value.id}})},manage:()=>{t.value&&i({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}({subscription:e.toRef(d,"subscription")}),v=e.computed(()=>r.getMostRecentScheduleInfo(d.subscription)),f=e.ref(),h=c.useTopUpModal(f),w=e.computed(()=>r.getSubscriptionName({subscription:d.subscription,fallback:p({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(s,r)=>(e.openBlock(),e.createBlock(e.unref(n.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",C,[e.createVNode(e.unref(i._sfc_main$3),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1}),e.unref(g)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(_)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({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(m)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:1,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(b)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({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(()=>[t.error?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$10),{key:0,class:"sv-subscription-details__error sv-error",title:e.unref(p)({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:1,variant:"section",class:"min-h-[220px]"})):t.subscription?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(e.unref(i._sfc_main),{"no-spacing":"",class:"sv-subscription-details__summary"},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{subscription:t.subscription},null,8,["subscription"])]),_:1}),e.createVNode(o._sfc_main,{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"])],64)):(e.openBlock(),e.createBlock(a._sfc_main$1,{key:3,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)({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(p)({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":Boolean(t.hasWalletBalancesError),"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",onTopUp:r[0]||(r[0]=e=>f.value=e)},null,8,["has-error","is-loading","wallet-balances"]),v.value?(e.openBlock(),e.createBlock(S,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":v.value,onUpgrade:e.unref(y)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),e.createVNode(c._sfc_main,{"show-modal":e.unref(h).showModal.value,"payment-methods":t.paymentMethods,customer:t.customer,"selected-balance-item":f.value,onClose:r[1]||(r[1]=e=>f.value=void 0),onConfirm:r[2]||(r[2]=e=>s.$emit("top-up-charged")),onPaymentSuccess:r[3]||(r[3]=e=>s.$emit("payment-method-stored"))},null,8,["show-modal","payment-methods","customer","selected-balance-item"])]),_:1}))}}),B=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 i=t,n=i.portalObject.customer_id,{subscription:s,withPlanData:r,get:a,error:o}=m.useSubscription({subscriptionId:i.configuration.subscriptionId}),{customer:c,get:u}=g.useCustomer({customerId:n}),{items:d,fetchAll:y}=b.usePaymentMethods({customerId:n}),{walletBalances:v,apiStatus:f,fetch:h}=l.useCustomerWalletBalances({customerId:n}),{isLoading:w}=_.useLoadInitialData(a(),u.execute(),y(),h()),S=e.computed(()=>s.value?r(s.value):[]),C=e.computed(()=>{var e;return(null==(e=v.value)?void 0:e.wallet_balances)??[]}),k=e.computed(()=>f.value===p.ApiStatus.Failed);return(t,i)=>e.renderSlot(t.$slots,"default",{subscription:e.unref(s),schedulesData:S.value,customer:e.unref(c),paymentMethods:e.unref(d),walletBalances:C.value,hasWalletBalancesError:k.value,isLoading:e.unref(w),error:e.unref(o),refreshWalletBalances:e.unref(h),refreshPaymentMethods:e.unref(y)})}}),x=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:i=>(n,s)=>{var r,a,o,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(j),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(a=null==(r=i.branding)?void 0:r.colors)?void 0:a.primary,"secondary-color":null==(l=null==(o=i.branding)?void 0:o.colors)?void 0:l.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,"css-overrides":i.cssOverrides,onError:s[0]||(s[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(B,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({subscription:t,schedulesData:i,customer:n,paymentMethods:s,walletBalances:r,hasWalletBalancesError:a,isLoading:o,error:l,refreshWalletBalances:c,refreshPaymentMethods:u})=>[e.createVNode(k,{subscription:t,"schedules-data":i,customer:n,"payment-methods":s,"wallet-balances":r,"has-wallet-balances-error":a,"is-loading":o,error:l,onTopUpCharged:c,onPaymentMethodStored:u},null,8,["subscription","schedules-data","customer","payment-methods","wallet-balances","has-wallet-balances-error","is-loading","error","onTopUpCharged","onPaymentMethodStored"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),N=t.defineCustomElement(x),j=t.getComponentName("subscription-details");exports.COMPONENT_NAME=j,exports.SolvimonSubscriptionDetails=N,exports.defineSolvimonSubscriptionDetails=()=>{customElements.get(j)||customElements.define(j,N)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-DIy1hvJM.js"),n=require("../../vendor-ui-Dfh3_g4q.js"),a=require("../../ContentWithAsideLayout-DHpnJfGA.js"),i=require("../../useActionDispatchProvider-aJOy3kr1.js"),o=require("../../subscription-b0OPx8Du.js"),s=require("../../SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DdjYVNku.js"),r=require("../../CustomerWalletBalances.vue_vue_type_script_setup_true_lang-mM5udvi8.js"),l=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Df7CsbiW.js"),c=require("../../EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-BM3p8Pk8.js"),u=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),d=require("../../pricing-CuYndX6t.js"),p=require("../../subscriptions-BFCKVHnP.js"),m=require("../../SubscriptionSummary.vue_vue_type_script_setup_true_lang-Cu55ZvCH.js"),b=require("../../paymentMethods-DVDC_WfL.js"),g=require("../../ApiStatus-oqvUEWJx.js"),_=require("../../useSubscription-k3limdu_.js"),f=require("../../useCustomer-C1XTqmrQ.js"),v=require("../../usePaymentMethods-CAFMvSOr.js"),h=require("../../useLoadInitialData-_BjCD0Jc.js");function y(e){var t,n,a,i,o,s,r;const l=null==(a=null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.configs)?void 0:a[0],c=null==(o=null==(i=null==l?void 0:l.details)?void 0:i.bands)?void 0:o[0];return{amount:(null==c?void 0:c.amount)??(null==c?void 0:c.fixed_amount),billingPeriod:(null==(s=null==l?void 0:l.details)?void 0:s.pricing_period)??(null==(r=null==l?void 0:l.details)?void 0:r.billing_period)}}const w={class:"sv-enabled-pricings-list__item-body flex items-center gap-4"},C={class:"sv-enabled-pricings-list__item-content grow"},x=e.defineComponent({__name:"EnabledPricingsListItem",props:{entry:{type:Object}},emits:["upgrade"],setup(t){const a=t,{$t:i}=n.useIntl(),o=e.computed(()=>{const{amount:e,billingPeriod:t}=a.entry;if(e)return t?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:n.formatAmount(e),period:n.formatBillingPeriod(t,{short:!0,hideValueForExactPeriods:!0})}):n.formatAmount(e)});return(a,s)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{class:"sv-enabled-pricings-list__item"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",C,[e.createVNode(e.unref(n._sfc_main$1),{tag:"span",variant:"body-xs",shade:"lighter",class:"sv-enabled-pricings-list__item-group"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.entry.groupName),1)]),_:1}),e.createVNode(e.unref(n._sfc_main$1),{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}),o.value?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,tag:"span",variant:"body-sm",shade:"lighter",class:"sv-enabled-pricings-list__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.unref(n._sfc_main$6),{variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-enabled-pricings-list__item-upgrade shrink-0",type:"button",size:"xs",onClick:s[0]||(s[0]=e=>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}))}}),S={class:"sv-enabled-pricings-list__items grid grid-cols-1 gap-2"},k=e.defineComponent({__name:"EnabledPricingsList",props:{pricingPlanSchedule:{type:Object}},emits:["upgrade"],setup(t){const a=t,{$t:i}=n.useIntl(),o=e.computed(()=>function(e){var t,n,a;const i=new Set(((null==(t=e.pricing_plan_schedule)?void 0:t.enabled_pricings)??[]).map(({pricing_id:e})=>e));return 0===i.size?[]:((null==(a=null==(n=e.pricing_plan_version)?void 0:n.pricing_categories)?void 0:a.flatMap(e=>e.pricing_groups??[]))??[]).flatMap(e=>(e.pricings??[]).filter(e=>i.has(e.id)).map(t=>({pricingId:t.id,pricingGroupId:e.id,groupName:e.name,name:d.getNameFromPricing(t)||e.name,...y(t)})))}(a.pricingPlanSchedule));return(t,a)=>o.value.length>0?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{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",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,n=>(e.openBlock(),e.createBlock(x,{key:n.pricingId,entry:n,onUpgrade:a[0]||(a[0]=e=>t.$emit("upgrade",e))},null,8,["entry"]))),128))])]),_:1},8,["title"])):e.createCommentVNode("",!0)}});const B={class:"sv-subscription-cancellation-modal sv-subscription-cancellation-modal__body flex flex-col gap-3"},M={key:0,class:"sv-subscription-cancellation-modal__meta flex flex-wrap items-center gap-x-6 gap-y-2 px-3 pb-2"},N={key:0,class:"sv-subscription-cancellation-modal__renews flex gap-1"},V=e.defineComponent({__name:"SubscriptionCancellationModal",props:{showModal:{type:Boolean},variant:{type:null},subscription:{type:Object},avatar:{type:String}},emits:["confirmed","close"],setup(a,{emit:i}){const s=a,r=i,{$t:l,formatDate:c}=n.useIntl(),u=t.useLogger(),{setSubscriptionCancellation:d}=p.createSubscriptionsService(),g=e.computed(()=>s.variant),_=e.computed(()=>{var e;const t=(null==(e=s.subscription)?void 0:e.inactive_periods)??[],n=t.find(({type:e})=>"CANCEL"===e)??t[0];if(n)return c({date:n.start_at,format:"date",offsetType:"local"})}),f=e.computed(()=>{var e,t;const n=null==(t=null==(e=s.subscription)?void 0:e.next_invoice)?void 0:t.invoice_date;if(n)return c({date:n,format:"date",offsetType:"local"})}),v=f,h=e.computed(()=>{var e,t;return((null==(t=null==(e=o.getMostRecentScheduleInfo(s.subscription))?void 0:e.pricing_plan_schedule)?void 0:t.enabled_pricings)??[]).map(({pricing_id:e})=>e).filter(e=>Boolean(e))}),{title:y,explanation:w,confirmButtonText:C,cancelButtonText:x,errorMessage:S}=function({variant:t,renewableUntil:a,billingPeriodEndsAt:i}){const{$t:o}=n.useIntl(),s=e.computed(()=>"RENEW"===t.value);return{title:e.computed(()=>s.value?o({defaultMessage:"Renew subscription",description:"Title of the renew subscription confirmation modal",id:"subscription_cancellation_modal.renew.title"}):o({defaultMessage:"Cancel subscription",description:"Title of the cancel subscription confirmation modal",id:"subscription_cancellation_modal.cancel.title"})),explanation:e.computed(()=>s.value?a.value?o({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:a.value}):o({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?o({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}):o({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"})),confirmButtonText:e.computed(()=>s.value?o({defaultMessage:"Renew subscription",description:"Label of the confirm button in the renew subscription modal",id:"subscription_cancellation_modal.renew.confirm_button.label"}):o({defaultMessage:"Cancel subscription",description:"Label of the confirm button in the cancel subscription modal",id:"subscription_cancellation_modal.cancel.confirm_button.label"})),cancelButtonText:e.computed(()=>o({defaultMessage:"Cancel",description:"Label of the button that dismisses the cancellation modal",id:"subscription_cancellation_modal.cancel_button.label"})),errorMessage:e.computed(()=>s.value?o({defaultMessage:"We could not renew your subscription. Please try again.",description:"Error shown when undoing a cancellation fails",id:"subscription_cancellation_modal.renew.error"}):o({defaultMessage:"We could not cancel your subscription. Please try again.",description:"Error shown when cancelling a subscription fails",id:"subscription_cancellation_modal.cancel.error"}))}}({variant:g,renewableUntil:_,billingPeriodEndsAt:f}),{paymentMethod:k,get:V}=function(){const{getPaymentMethods:t}=b.createPaymentMethodsService(),a=e.shallowRef();return{paymentMethod:a,get:async({customerId:e,paymentMethodId:i})=>{const o=await n.getPaginatedFullList(async a=>{const i=await t({customerId:e,pagination:{page:a,pageSize:50}});if(!n.isApiSuccessCollectionResponse(i))throw new Error("Could not load the customer’s payment methods.");return i});return a.value=o.data.find(({id:e})=>e===i),a.value}}}();e.watch([()=>s.showModal,()=>{var e;return null==(e=s.subscription)?void 0:e.payment_method_id},()=>{var e;return null==(e=s.subscription)?void 0:e.customer_id}],([e,t,n])=>{var a;e&&t&&n&&t!==(null==(a=k.value)?void 0:a.id)&&V({customerId:n,paymentMethodId:t}).catch(()=>{})},{immediate:!0});const E=e.ref(!1),T=e.ref(!1);e.watch(()=>s.showModal,e=>{e&&(T.value=!1)});const j=async()=>{if(s.subscription&&s.variant&&!E.value){E.value=!0,T.value=!1;try{await d({id:s.subscription.id,variant:s.variant}),r("confirmed"),r("close")}catch(e){u.error("SUBSCRIPTION_CANCELLATION_FAILED","Failed to change the cancellation state of a subscription",{variant:s.variant},e),T.value=!0}finally{E.value=!1}}},A=()=>{E.value||r("close")};return(t,i)=>(e.openBlock(),e.createBlock(e.unref(n.Modal),{size:"md","show-modal":a.showModal,title:e.unref(y),"confirm-button-text":e.unref(C),"cancel-button-text":e.unref(x),"is-loading":E.value,"no-click-away":E.value,"no-backdrop-close":E.value,onConfirm:j,onClose:A},{body:e.withCtx(()=>[e.createElementVNode("div",B,[e.createVNode(e.unref(n._sfc_main$1),{variant:"body-sm",shade:"lighter",tag:"p",class:"sv-subscription-cancellation-modal__explanation"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(w)),1)]),_:1}),a.subscription?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{key:0,"no-spacing":"",class:"sv-subscription-cancellation-modal__subscription"},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{subscription:a.subscription,avatar:a.avatar,"enabled-pricing-ids":h.value},null,8,["subscription","avatar","enabled-pricing-ids"]),e.unref(v)||e.unref(k)?(e.openBlock(),e.createElementBlock("div",M,[e.unref(v)?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(e.unref(n._sfc_main$1),{tag:"span",variant:"body-xs",shade:"light",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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(n._sfc_main$1),{tag:"span",variant:"body-xs",shade:"light"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v)),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$8),{key:1,variant:"condensed",class:"sv-subscription-cancellation-modal__payment-method","payment-method":e.unref(k)},null,8,["payment-method"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$16),{key:1,class:"sv-subscription-cancellation-modal__error sv-error",title:e.unref(S)},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"},T=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:d}){const p=t,m=d,{$t:b}=n.useIntl(),{isCancellable:g,isRenewable:_,pendingVariant:f,cancel:v,renew:h,dismiss:y,manage:w}=function({subscription:t}){const{dispatchAction:n}=i.useActionDispatchProvider(),a=e.computed(()=>{if(!t.value)return!1;const e=t.value.inactive_periods;return!e||0===e.length}),o=e.computed(()=>{var e;const n=null==(e=t.value)?void 0:e.inactive_periods;return Array.isArray(n)&&n.length>0}),s=e.ref();return{isCancellable:a,isRenewable:o,pendingVariant:s,cancel:()=>{t.value&&(s.value="CANCEL")},renew:()=>{t.value&&(s.value="RENEW")},dismiss:()=>{s.value=void 0},manage:()=>{t.value&&n({action:"manage-subscription",data:{subscriptionId:t.value.id}})}}}({subscription:e.toRef(p,"subscription")}),C=e.ref();e.watch(f,e=>{e&&(C.value=void 0)});const x=()=>{C.value=f.value,m("subscription-changed")},S=e.computed(()=>{if(C.value)return"RENEW"===C.value?b({defaultMessage:"Your subscription has been renewed.",id:"subscription_details.renew_success",description:"Confirmation shown after a cancellation has been undone"}):b({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"})}),B=e.computed(()=>o.getMostRecentScheduleInfo(p.subscription)),M=e.computed(()=>(p.paymentMethods??[]).find(({id:e})=>{var t;return e===(null==(t=p.subscription)?void 0:t.payment_method_id)})),N=e.computed(()=>p.subscription?[p.subscription]:[]),T=e.computed(()=>o.getSubscriptionName({subscription:p.subscription,fallback:b({defaultMessage:"Subscription details",id:"subscription_details.title",description:"Title for the subscription details page"})}));return(i,o)=>(e.openBlock(),e.createBlock(e.unref(a.ContentWithAsideLayout),{class:"sv-subscription-details sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",E,[e.createVNode(e.unref(n._sfc_main$1),{variant:"heading-2",tag:"h1",class:"sv-subscription-details__title grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.value),1)]),_:1}),e.unref(_)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$6),{key:0,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__renew w-full md:w-auto",type:"button",onClick:e.unref(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)({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(g)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$6),{key:1,variant:"outline",color:"gray",class:"sv-action sv-action--secondary sv-subscription-details__cancel w-full md:w-auto",type:"button",onClick:e.unref(v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)({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(n._sfc_main$30),{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(n._sfc_main$16),{key:1,class:"sv-subscription-details__error sv-error",title:e.unref(b)({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(s._sfc_main,{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(c._sfc_main,{key:4,class:"sv-subscription-details__empty-state",icon:"receipt_long"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b)({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(b)({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(r._sfc_main,{class:"sv-subscription-details__wallet-balances","has-error":Boolean(t.hasWalletBalancesError),"is-loading":t.isLoading,"wallet-balances":t.walletBalances,"show-top-up-button":"",customer:t.customer,"payment-methods":t.paymentMethods,subscriptions:N.value,onTopUpCharged:o[0]||(o[0]=e=>i.$emit("top-up-charged")),onAutoTopUpSaved:o[1]||(o[1]=e=>i.$emit("auto-top-up-saved")),onAutoTopUpCancelled:o[2]||(o[2]=e=>i.$emit("auto-top-up-cancelled")),onPaymentMethodStored:o[3]||(o[3]=e=>i.$emit("payment-method-stored"))},null,8,["has-error","is-loading","wallet-balances","customer","payment-methods","subscriptions"]),B.value?(e.openBlock(),e.createBlock(k,{key:0,class:"sv-subscription-details__upgrades","pricing-plan-schedule":B.value,onUpgrade:e.unref(w)},null,8,["pricing-plan-schedule","onUpgrade"])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createBlock(l._sfc_main,{key:1,class:"sv-subscription-details__payment-method","is-loading":t.isLoading,"payment-methods":[M.value],configuration:{showViewAllButton:!1,showAddButton:!1}},null,8,["is-loading","payment-methods"])):e.createCommentVNode("",!0),e.createVNode(V,{"show-modal":Boolean(e.unref(f)),variant:e.unref(f),subscription:t.subscription,avatar:t.avatar,onConfirmed:x,onClose:e.unref(y)},null,8,["show-modal","variant","subscription","avatar","onClose"])]),_:1}))}}),j=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 n=t,a=n.portalObject.customer_id,{subscription:i,withPlanData:o,get:s,error:l}=_.useSubscription({subscriptionId:n.configuration.subscriptionId}),{customer:c,get:u}=f.useCustomer({customerId:a}),{items:d,fetchAll:p}=v.usePaymentMethods({customerId:a}),{walletBalances:m,apiStatus:b,fetch:y}=r.useCustomerWalletBalances({customerId:a}),{isLoading:w}=h.useLoadInitialData(s(),u.execute(),p(),y()),C=e.computed(()=>i.value?o(i.value):[]),x=e.computed(()=>{var e;return(null==(e=m.value)?void 0:e.wallet_balances)??[]}),S=e.computed(()=>b.value===g.ApiStatus.Failed);return(t,n)=>e.renderSlot(t.$slots,"default",{subscription:e.unref(i),schedulesData:C.value,customer:e.unref(c),paymentMethods:e.unref(d),walletBalances:x.value,hasWalletBalancesError:S.value,isLoading:e.unref(w),error:e.unref(l),refreshWalletBalances:e.unref(y),refreshPaymentMethods:e.unref(p),refreshSubscription:e.unref(s)})}}),A=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:n=>(a,i)=>{var o,s,r,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(P),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(o=n.branding)?void 0:o.colors)?void 0:s.primary,"secondary-color":null==(l=null==(r=n.branding)?void 0:r.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,"css-overrides":n.cssOverrides,onError:i[0]||(i[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(j,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({subscription:t,schedulesData:a,customer:i,paymentMethods:o,walletBalances:s,hasWalletBalancesError:r,isLoading:l,error:c,refreshWalletBalances:u,refreshPaymentMethods:d,refreshSubscription:p})=>[e.createVNode(T,{subscription:t,"schedules-data":a,customer:i,avatar:n.configuration.avatar,"payment-methods":o,"wallet-balances":s,"has-wallet-balances-error":r,"is-loading":l,error:c,onTopUpCharged:u,onAutoTopUpSaved:u,onAutoTopUpCancelled:u,onPaymentMethodStored:d,onSubscriptionChanged:p},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,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),L=t.defineCustomElement(A),P=t.getComponentName("subscription-details");exports.COMPONENT_NAME=P,exports.SolvimonSubscriptionDetails=L,exports.defineSolvimonSubscriptionDetails=()=>{customElements.get(P)||customElements.define(P,L)};