@solvimon/solvimon-web 0.1.0-alpha.14 → 0.1.0-alpha.16

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 (126) hide show
  1. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-0_VYW5Wu.js → BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js} +1 -1
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-D8ZeVBWO.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs} +2 -2
  3. package/dist/ContentWithAsideLayout-DHpnJfGA.js +1 -0
  4. package/dist/{ContentWithAsideLayout-DhfUkZZg.mjs → ContentWithAsideLayout-Dy9xgxuF.mjs} +6 -3
  5. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DEqfojR8.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs} +8 -23
  6. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js +1 -0
  7. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CFLR4ptB.js → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DU6X3zxr.js} +1 -1
  8. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-COnrD4ew.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-ryvFEQMV.mjs} +1 -1
  9. package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-DdpPrYxi.js +1 -0
  10. package/dist/InvoiceHeader.vue_vue_type_script_setup_true_lang-bAiAbtMi.mjs +27 -0
  11. package/dist/{PaymentHistoryBlock-DUeSRR3k.js → PaymentHistoryBlock-BGbTy4Se.js} +1 -1
  12. package/dist/{PaymentHistoryBlock-BTRFc4ki.mjs → PaymentHistoryBlock-BKMttUyk.mjs} +1 -1
  13. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-TgZYSSQe.js → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js} +1 -1
  14. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-GeyErAW6.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs} +1 -1
  15. package/dist/{PaymentIntegrationForm-DX6kv0_v.mjs → PaymentIntegrationForm-CypW6fZY.mjs} +1 -1
  16. package/dist/{PaymentIntegrationForm-CQntx0TH.js → PaymentIntegrationForm-D4QupHWl.js} +1 -1
  17. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js +1 -0
  18. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dkd-Cp8c.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs} +736 -162
  19. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-B8eNptZp.mjs +145 -0
  20. package/dist/PaymentMethodForm.vue_vue_type_script_setup_true_lang-eWmC5GOT.js +1 -0
  21. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs +139 -0
  22. package/dist/PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js +1 -0
  23. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BVoS3ZXS.js +1 -0
  24. package/dist/{SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D-BFQZiM.mjs → SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs} +24 -23
  25. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-D-hpJL8I.js → SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js} +1 -1
  26. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-B7IOIy-v.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs} +4 -4
  27. package/dist/component-Bg2JVC_O.mjs +933 -0
  28. package/dist/component-Bs8oszfD.js +1 -0
  29. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  30. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  31. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  32. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
  33. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  34. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  35. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  36. package/dist/components/Invoice/Invoice.es.js +14 -13
  37. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  38. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  39. package/dist/components/InvoiceHeader/InvoiceHeader.ce.d.ts +3 -0
  40. package/dist/components/InvoiceHeader/InvoiceHeader.cjs.js +1 -0
  41. package/dist/components/InvoiceHeader/InvoiceHeader.es.js +123 -0
  42. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  43. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  44. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  45. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  46. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  47. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +11 -110
  48. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  49. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +5 -5
  50. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  51. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  52. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  53. package/dist/components/WalletBalances/WalletBalances.es.js +3 -3
  54. package/dist/core/index.cjs.js +1 -1
  55. package/dist/core/index.es.js +1 -1
  56. package/dist/core/types.d.ts +4 -0
  57. package/dist/{customer-Bn6GdxP8.mjs → customer-Bv_fqXzO.mjs} +1 -1
  58. package/dist/{customer-CGyZojAB.js → customer-_W8gIX5m.js} +1 -1
  59. package/dist/{en-US-G2HBHqjq.js → en-US-C0gIE4Q1.js} +1 -1
  60. package/dist/{en-US-BKhsdJQ2.mjs → en-US-DAgOSlgv.mjs} +19 -12
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.es.js +1 -1
  63. package/dist/{invoices-Rs-QBUGS.mjs → invoices-BGb0AwVF.mjs} +2 -2
  64. package/dist/{invoices-DDeL8tvI.js → invoices-D-OKipCg.js} +1 -1
  65. package/dist/{nl-NL-DvVsMfhA.js → nl-NL-Br7muSHK.js} +1 -1
  66. package/dist/{nl-NL-BdeAy1tY.mjs → nl-NL-DCsmrA8A.mjs} +9 -2
  67. package/dist/paymentMethods-DIbB759g.js +1 -0
  68. package/dist/{paymentMethods-DOH9-6M1.mjs → paymentMethods-DvqlWe96.mjs} +11 -3
  69. package/dist/{payments-DGPENXiS.mjs → payments-CpzTVrQM.mjs} +1 -1
  70. package/dist/{payments-C0vYbn5Q.js → payments-DMDDI3MK.js} +1 -1
  71. package/dist/{registry-7UKVW93Q.mjs → registry-B-If1W_u.mjs} +9 -3
  72. package/dist/registry-uG2isab0.js +1 -0
  73. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  74. package/dist/screens/Checkout/Checkout.es.js +103 -70
  75. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  76. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -13
  77. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  78. package/dist/screens/PayInvoice/PayInvoice.es.js +45 -34
  79. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.ce.d.ts +3 -0
  80. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.cjs.js +1 -0
  81. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.es.js +231 -0
  82. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  83. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +29 -34
  84. package/dist/solvimon-web.css +1 -1
  85. package/dist/{subscriptions-BIGqt2N0.mjs → subscriptions-BPYyv09M.mjs} +2 -2
  86. package/dist/{subscriptions-CcpEwubd.js → subscriptions-CC61I6Nj.js} +1 -1
  87. package/dist/{adyen-D0yvZvq5.mjs → url-1Lbg5Yni.mjs} +35 -35
  88. package/dist/url-B6-3PkW2.js +1 -0
  89. package/dist/{useActionDispatchProvider-aqYyqIdb.js → useActionDispatchProvider-BHTknMoH.js} +1 -1
  90. package/dist/{useActionDispatchProvider-Ca1YbU61.mjs → useActionDispatchProvider-Dz8-e4gZ.mjs} +1 -1
  91. package/dist/{useCustomer-DUA8Y-2I.mjs → useCustomer-VVJi8z2w.mjs} +2 -2
  92. package/dist/{useCustomer-D9ZrqMFY.js → useCustomer-Z24KchWC.js} +1 -1
  93. package/dist/useIncrementalLoading-CuSndpP2.js +1 -0
  94. package/dist/{useIncrementalLoading-C1LKdVP8.mjs → useIncrementalLoading-DmOT2MXH.mjs} +4 -4
  95. package/dist/{useInvoiceData-HNnt3703.js → useInvoiceData-Bl87gzIS.js} +1 -1
  96. package/dist/{useInvoiceData-Bz4a2Mfa.mjs → useInvoiceData-Di5pLPM0.mjs} +2 -2
  97. package/dist/{useInvoicesList-DXBTGdcI.js → useInvoicesList-CFk-_oVK.js} +1 -1
  98. package/dist/{useInvoicesList-b2_fiHsc.mjs → useInvoicesList-z19cteaD.mjs} +4 -4
  99. package/dist/{useLoadInitialData-D0t-Lk3k.js → useLoadInitialData-CTqfiMTN.js} +1 -1
  100. package/dist/{useLoadInitialData-Cyp1xpuv.mjs → useLoadInitialData-CkpryfjF.mjs} +1 -1
  101. package/dist/{usePaymentMethodOptions-r0Opz7BC.mjs → usePaymentMethodOptions-BoGHJjng.mjs} +2 -2
  102. package/dist/{usePaymentMethodOptions-DgGDcVeE.js → usePaymentMethodOptions-BsCZnCQW.js} +1 -1
  103. package/dist/{usePaymentMethods-BHLXXaCa.js → usePaymentMethods-AC-4rrR9.js} +1 -1
  104. package/dist/{usePaymentMethods-C-NCtOom.mjs → usePaymentMethods-ocHmNoP7.mjs} +2 -2
  105. package/dist/{usePayments-DADpdoI7.js → usePayments-CgXZeWrU.js} +1 -1
  106. package/dist/{usePayments-BtByiIMy.mjs → usePayments-D85eB5l4.mjs} +3 -3
  107. package/dist/{usePortal-CpW3EDD-.mjs → usePortal-B1O1zgdV.mjs} +1 -1
  108. package/dist/{usePortal-DhaZBAGi.js → usePortal-DVD7PcWI.js} +1 -1
  109. package/dist/{useService-C0h9UlQW.js → useService-CHrkefKd.js} +1 -1
  110. package/dist/{useService-BcYQRxPS.mjs → useService-DF57xuDd.mjs} +1 -1
  111. package/dist/{useWalletBalanceItems-COzKSpmt.js → useWalletBalanceItems-BL-R5foK.js} +1 -1
  112. package/dist/{useWalletBalanceItems-DKz-2vUy.mjs → useWalletBalanceItems-COQDLfoZ.mjs} +3 -3
  113. package/dist/{vendor-ui-CdOX_IS-.mjs → vendor-ui-B8IlviSs.mjs} +6483 -5867
  114. package/dist/vendor-ui-C3Tq-qY_.js +1 -0
  115. package/package.json +5 -4
  116. package/dist/ContentWithAsideLayout-B5B8Kwaw.js +0 -1
  117. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-zdBaVj-K.js +0 -1
  118. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BhGQB-c9.js +0 -1
  119. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BuJGxitV.js +0 -1
  120. package/dist/adyen-BvNyYAg-.js +0 -1
  121. package/dist/component-By_A1VHh.js +0 -1
  122. package/dist/component-CGfjV_7z.mjs +0 -889
  123. package/dist/paymentMethods-BR9w3qy8.js +0 -1
  124. package/dist/registry-DrV0jFnM.js +0 -1
  125. package/dist/useIncrementalLoading-FNH4k4a3.js +0 -1
  126. package/dist/vendor-ui-1SHma7t1.js +0 -1
@@ -1,21 +1,21 @@
1
1
  import { ref, computed, onMounted, watch, defineComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, useModel, createElementBlock, withModifiers, Fragment, createCommentVNode, createSlots, normalizeClass, mergeModels, renderList, renderSlot, toRef, nextTick, withDirectives, withKeys, vShow, defineAsyncComponent } from "vue";
2
- import { V as taxId, k as isEqual, W as convertDateRangeToTimePeriod, K as useValidation, L as objectDiff, X as isEmpty, u as useIntl, Y as _sfc_main$o, b as _sfc_main$p, Z as isEUCountry, $ as isValidCountryCode, a0 as getCountryNameByCode, _ as _sfc_main$q, O as _sfc_main$r, Q as _sfc_main$s, e as _sfc_main$t, a1 as _sfc_main$u, R as _sfc_main$v, a2 as _sfc_main$w, a3 as _sfc_main$x, a4 as _sfc_main$y, a5 as TooltipContent, a6 as _sfc_main$z, a7 as formatBillingPeriod, y as formatAmount, a8 as _sfc_main$B, a9 as useTimePeriod, f as _sfc_main$C, aa as _sfc_main$E, ab as _sfc_main$F, D as _sfc_main$G, F as _sfc_main$I, ac as _sfc_main$J, l as _sfc_main$K, ad as usePricingItem, ae as _sfc_main$L, af as _sfc_main$M, ag as uniqueId, C as _sfc_main$N } from "../../vendor-ui-CdOX_IS-.mjs";
3
- import { a as useLogger, _ as _sfc_main$Q, d as defineCustomElement, g as getComponentName } from "../../component-CGfjV_7z.mjs";
4
- import { c as createSubscriptionsService } from "../../subscriptions-BIGqt2N0.mjs";
2
+ import { X as taxId, n as isEqual, Y as convertDateRangeToTimePeriod, M as useValidation, N as objectDiff, Z as isEmpty, u as useIntl, $ as _sfc_main$o, e as _sfc_main$p, a0 as isEUCountry, a1 as isValidCountryCode, a2 as getCountryNameByCode, _ as _sfc_main$q, R as _sfc_main$r, S as _sfc_main$s, c as _sfc_main$t, a3 as _sfc_main$u, U as _sfc_main$v, a4 as _sfc_main$w, a5 as _sfc_main$x, a6 as _sfc_main$y, a7 as TooltipContent, a8 as _sfc_main$z, a9 as formatBillingPeriod, B as formatAmount, aa as _sfc_main$B, ab as useTimePeriod, k as _sfc_main$C, ac as _sfc_main$E, ad as _sfc_main$F, F as _sfc_main$G, H as _sfc_main$I, ae as _sfc_main$J, A as _sfc_main$K, af as usePricingItem, ag as _sfc_main$L, ah as _sfc_main$M, ai as uniqueId, E as _sfc_main$N } from "../../vendor-ui-B8IlviSs.mjs";
3
+ import { a as useLogger, _ as _sfc_main$Q, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
4
+ import { c as createSubscriptionsService } from "../../subscriptions-BPYyv09M.mjs";
5
5
  import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
6
- import { c as createInvoicesService } from "../../invoices-Rs-QBUGS.mjs";
6
+ import { c as createInvoicesService } from "../../invoices-BGb0AwVF.mjs";
7
7
  import { a as requiredIf, r as required, e as email } from "../../index-CzL1ZcGi.mjs";
8
8
  import { u as useWatchDebounced } from "../../useWatchDebounced-Zmxd6InB.mjs";
9
- import { c as createPaymentMethodsService } from "../../paymentMethods-DOH9-6M1.mjs";
10
- import { u as useService } from "../../useService-BcYQRxPS.mjs";
11
- import { u as usePortal } from "../../usePortal-CpW3EDD-.mjs";
12
- import { c as createCustomerService } from "../../customer-Bn6GdxP8.mjs";
13
- import { _ as _sfc_main$A, e as getAdyenExpressCheckoutConfiguration, c as transformObjectToAdyenObject, d as createReturnUrl, s as safeUrlRedirect } from "../../adyen-D0yvZvq5.mjs";
14
- import { _ as _sfc_main$D, a as _sfc_main$O, b as _sfc_main$P } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D-BFQZiM.mjs";
9
+ import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
10
+ import { u as useService } from "../../useService-DF57xuDd.mjs";
11
+ import { g as getQueryParam, P as PAYMENT_ACCEPTOR_ID_QUERY_STRING, _ as _sfc_main$A, e as getAdyenExpressCheckoutConfiguration, d as transformObjectToAdyenObject, c as createReturnUrl, s as safeUrlRedirect } from "../../url-1Lbg5Yni.mjs";
12
+ import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
13
+ import { c as createCustomerService } from "../../customer-Bv_fqXzO.mjs";
14
+ import { _ as _sfc_main$D, a as _sfc_main$O, b as _sfc_main$P } from "../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cqk-vonA.mjs";
15
15
  import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
16
16
  import { _ as _sfc_main$H } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
17
- import { c as createPaymentsService } from "../../payments-DGPENXiS.mjs";
18
- import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
17
+ import { c as createPaymentsService } from "../../payments-CpzTVrQM.mjs";
18
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
19
19
  function getFirstPricingPlanScheduleOfType({
20
20
  pricingPlanScheduleInfos,
21
21
  type
@@ -802,6 +802,7 @@ function isSubscriptionWithAddonProducts(subscription) {
802
802
  return pricings.some((pricing) => pricing.product_type === "ADDON") || pricingGroups.some((pricingGroup) => pricingGroup.object_type === "ADDON");
803
803
  }
804
804
  const DEFAULT_TAX_IDENTIFIER_TYPE = "GENERIC_TAX_ID";
805
+ const REDIRECT_FORM_STATE_KEY = "solvimon_checkout_redirect_state";
805
806
  function useCheckoutView({
806
807
  initialCountry,
807
808
  initialEmail,
@@ -999,19 +1000,46 @@ function useCheckoutView({
999
1000
  if (!subscription.value || !country || !amountValue) {
1000
1001
  return;
1001
1002
  }
1002
- void loadPaymentMethodOptions({
1003
+ loadPaymentMethodOptions({
1003
1004
  subscriptionId: subscription.value.id,
1004
1005
  country,
1005
1006
  amount: amountValue
1007
+ }).catch((err) => {
1008
+ console.log(err);
1006
1009
  });
1007
1010
  }
1008
1011
  );
1012
+ function saveFormStateForRedirect() {
1013
+ sessionStorage.setItem(REDIRECT_FORM_STATE_KEY, JSON.stringify(checkoutForm.form.value));
1014
+ }
1009
1015
  onMounted(async () => {
1016
+ const redirectStatus = getQueryParam("redirect_status");
1017
+ const hasPaymentAcceptorId = !!getQueryParam(PAYMENT_ACCEPTOR_ID_QUERY_STRING);
1018
+ const hasClientSecret = !!getQueryParam("payment_intent_client_secret") || !!getQueryParam("setup_intent_client_secret");
1019
+ const isSuccessfulRedirect = redirectStatus === "succeeded" && hasPaymentAcceptorId && hasClientSecret;
1020
+ if (isSuccessfulRedirect) {
1021
+ isPaid.value = true;
1022
+ }
1023
+ const raw = sessionStorage.getItem(REDIRECT_FORM_STATE_KEY);
1024
+ let savedFormState = null;
1025
+ if (raw) {
1026
+ try {
1027
+ savedFormState = JSON.parse(raw);
1028
+ } catch {
1029
+ }
1030
+ }
1031
+ if (savedFormState) {
1032
+ checkoutForm.updateInitialState(savedFormState);
1033
+ }
1010
1034
  await loadSubscription();
1011
1035
  try {
1012
1036
  await loadInvoicePreview();
1013
1037
  } catch {
1014
1038
  }
1039
+ if (savedFormState) {
1040
+ checkoutForm.updateInitialState(savedFormState);
1041
+ sessionStorage.removeItem(REDIRECT_FORM_STATE_KEY);
1042
+ }
1015
1043
  });
1016
1044
  watch(
1017
1045
  shouldLoadPaymentMethodOptions,
@@ -1041,7 +1069,8 @@ function useCheckoutView({
1041
1069
  checkoutForm,
1042
1070
  authorizationContext,
1043
1071
  isPaid,
1044
- amount
1072
+ amount,
1073
+ saveFormStateForRedirect
1045
1074
  };
1046
1075
  }
1047
1076
  function usePromotionCode({
@@ -1382,7 +1411,9 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1382
1411
  }, 8, ["single-model-value", "label", "error"])
1383
1412
  ], 64))
1384
1413
  ]),
1385
- createVNode(unref(_sfc_main$u), null, {
1414
+ createVNode(unref(_sfc_main$u), {
1415
+ "is-open": showBillingDetails.value || !!__props.isBillingInformationMandatory
1416
+ }, {
1386
1417
  default: withCtx(() => [
1387
1418
  showBillingDetails.value || __props.isBillingInformationMandatory ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
1388
1419
  createElementVNode("div", _hoisted_4$5, [
@@ -1451,7 +1482,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1451
1482
  ])) : createCommentVNode("", true)
1452
1483
  ]),
1453
1484
  _: 1
1454
- })
1485
+ }, 8, ["is-open"])
1455
1486
  ]),
1456
1487
  _: 1
1457
1488
  }, 8, ["title"]),
@@ -1494,7 +1525,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1494
1525
  ]),
1495
1526
  _: 1
1496
1527
  }, 8, ["modelValue"]),
1497
- createVNode(unref(_sfc_main$u), null, {
1528
+ createVNode(unref(_sfc_main$u), { "is-open": isCompanyPurchase.value }, {
1498
1529
  default: withCtx(() => [
1499
1530
  isCompanyPurchase.value ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
1500
1531
  createElementVNode("div", _hoisted_8$1, [
@@ -1566,7 +1597,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1566
1597
  ])) : createCommentVNode("", true)
1567
1598
  ]),
1568
1599
  _: 1
1569
- })
1600
+ }, 8, ["is-open"])
1570
1601
  ]),
1571
1602
  _: 1
1572
1603
  })) : createCommentVNode("", true)
@@ -1821,22 +1852,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1821
1852
  })), 1)
1822
1853
  ]),
1823
1854
  _: 1
1824
- }),
1825
- createVNode(unref(_sfc_main$t), {
1826
- color: "gray",
1827
- variant: "outline",
1828
- size: "xs",
1829
- class: "align-center",
1830
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("continue-to-merchant"))
1831
- }, {
1832
- default: withCtx(() => [
1833
- createTextVNode(toDisplayString(unref($t)({
1834
- defaultMessage: "Continue to merchant",
1835
- id: "subscription_payment_completed_card.continue",
1836
- description: "The text for the continue button"
1837
- })), 1)
1838
- ]),
1839
- _: 1
1840
1855
  })
1841
1856
  ]),
1842
1857
  _: 1
@@ -2112,15 +2127,13 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2112
2127
  const registerPeriodsFromPricing = (pricing) => {
2113
2128
  var _a2;
2114
2129
  (_a2 = pricing == null ? void 0 : pricing.items) == null ? void 0 : _a2.forEach((item) => {
2115
- var _a3, _b2, _c2;
2116
- (_a3 = item.configs) == null ? void 0 : _a3.forEach((config) => registerPeriod(config.billing_period));
2117
- (_b2 = item.billing_period_configs) == null ? void 0 : _b2.forEach(
2130
+ var _a3, _b2;
2131
+ (_a3 = item.billing_period_configs) == null ? void 0 : _a3.forEach(
2118
2132
  (periodConfig) => registerPeriod(periodConfig.billing_period)
2119
2133
  );
2120
- (_c2 = item.pricing_currency_configs) == null ? void 0 : _c2.forEach((currencyConfig) => {
2121
- var _a4, _b3;
2122
- (_a4 = currencyConfig.configs) == null ? void 0 : _a4.forEach((config) => registerPeriod(config.billing_period));
2123
- (_b3 = currencyConfig.billing_period_configs) == null ? void 0 : _b3.forEach(
2134
+ (_b2 = item.pricing_currency_configs) == null ? void 0 : _b2.forEach((currencyConfig) => {
2135
+ var _a4;
2136
+ (_a4 = currencyConfig.billing_period_configs) == null ? void 0 : _a4.forEach(
2124
2137
  (periodConfig) => registerPeriod(periodConfig.billing_period)
2125
2138
  );
2126
2139
  });
@@ -2884,7 +2897,7 @@ const _hoisted_1$a = {
2884
2897
  };
2885
2898
  const _hoisted_2$6 = { class: "mb-2" };
2886
2899
  const _hoisted_3$3 = { class: "grid grid-cols-6 gap-1 md:gap-2" };
2887
- const _hoisted_4$3 = { class: "h-4 mt-4" };
2900
+ const _hoisted_4$3 = { class: "mt-4 h-4" };
2888
2901
  const DEFAULT_EXPRESS_PAYMENT_BUTTON_COUNT = 2;
2889
2902
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
2890
2903
  __name: "ExpressPaymentMethods",
@@ -2912,7 +2925,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2912
2925
  return (_a = props.paymentMethodsOptionsResponse) == null ? void 0 : _a.find(
2913
2926
  (entry) => {
2914
2927
  var _a2;
2915
- return (_a2 = entry.options) == null ? void 0 : _a2.some((option) => option.name.toLowerCase() === "apple pay");
2928
+ return (_a2 = entry.options) == null ? void 0 : _a2.some(
2929
+ (option) => option.name.toLowerCase() === "apple pay" && option.payment_gateway_variant === "ADYEN"
2930
+ );
2916
2931
  }
2917
2932
  );
2918
2933
  });
@@ -2924,7 +2939,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2924
2939
  return (_a = props.paymentMethodsOptionsResponse) == null ? void 0 : _a.find(
2925
2940
  (entry) => {
2926
2941
  var _a2;
2927
- return (_a2 = entry.options) == null ? void 0 : _a2.some((option) => option.name.toLowerCase() === "paypal");
2942
+ return (_a2 = entry.options) == null ? void 0 : _a2.some(
2943
+ (option) => option.name.toLowerCase() === "paypal" && option.payment_gateway_variant === "ADYEN"
2944
+ );
2928
2945
  }
2929
2946
  );
2930
2947
  });
@@ -2936,7 +2953,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2936
2953
  return (_a = props.paymentMethodsOptionsResponse) == null ? void 0 : _a.find(
2937
2954
  (entry) => {
2938
2955
  var _a2;
2939
- return (_a2 = entry.options) == null ? void 0 : _a2.some((option) => option.name.toLowerCase() === "google pay");
2956
+ return (_a2 = entry.options) == null ? void 0 : _a2.some(
2957
+ (option) => option.name.toLowerCase() === "google pay" && option.payment_gateway_variant === "ADYEN"
2958
+ );
2940
2959
  }
2941
2960
  );
2942
2961
  });
@@ -2982,8 +3001,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2982
3001
  ]),
2983
3002
  createElementVNode("div", _hoisted_3$3, [
2984
3003
  !isReady.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2985
- createVNode(_sfc_main$H, { class: "h-11 col-span-3" }),
2986
- createVNode(_sfc_main$H, { class: "h-11 col-span-3" })
3004
+ createVNode(_sfc_main$H, { class: "col-span-3 h-11" }),
3005
+ createVNode(_sfc_main$H, { class: "col-span-3 h-11" })
2987
3006
  ], 64)) : createCommentVNode("", true),
2988
3007
  createElementVNode("div", {
2989
3008
  class: normalizeClass(["col-span-3 md:col-span-2", {
@@ -3197,14 +3216,14 @@ function useSeatBasedPricing({
3197
3216
  pricingItemConfigId
3198
3217
  }) {
3199
3218
  return computed(() => {
3200
- var _a, _b, _c, _d, _e, _f;
3219
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3201
3220
  const { config, productItem } = getPricingItemByPricingConfigId({
3202
3221
  pricings,
3203
3222
  pricingItemConfigId
3204
3223
  });
3205
3224
  return {
3206
3225
  billing: {
3207
- period: config == null ? void 0 : config.billing_period,
3226
+ period: (_b = (_a = config == null ? void 0 : config.billing_period_configs) == null ? void 0 : _a[0]) == null ? void 0 : _b.billing_period,
3208
3227
  billedInAdvance: config == null ? void 0 : config.billing_in_advance
3209
3228
  },
3210
3229
  product: {
@@ -3212,8 +3231,8 @@ function useSeatBasedPricing({
3212
3231
  description: productItem == null ? void 0 : productItem.description
3213
3232
  },
3214
3233
  pricing: {
3215
- ...((_a = config == null ? void 0 : config.details) == null ? void 0 : _a.pricing_type) === "FLAT" && { amount: (_d = (_c = (_b = config.details) == null ? void 0 : _b.bands) == null ? void 0 : _c[0]) == null ? void 0 : _d.amount },
3216
- ...((_e = config == null ? void 0 : config.details) == null ? void 0 : _e.pricing_type) === "TIERED" && { tiered: { bands: (_f = config.details) == null ? void 0 : _f.bands } }
3234
+ ...((_c = config == null ? void 0 : config.details) == null ? void 0 : _c.pricing_type) === "FLAT" && { amount: (_f = (_e = (_d = config.details) == null ? void 0 : _d.bands) == null ? void 0 : _e[0]) == null ? void 0 : _f.amount },
3235
+ ...((_g = config == null ? void 0 : config.details) == null ? void 0 : _g.pricing_type) === "TIERED" && { tiered: { bands: (_h = config.details) == null ? void 0 : _h.bands } }
3217
3236
  }
3218
3237
  };
3219
3238
  });
@@ -3334,7 +3353,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3334
3353
  ], 10, _hoisted_3$2)
3335
3354
  ]),
3336
3355
  ((_c = (_b = unref(seats).pricing) == null ? void 0 : _b.tiered) == null ? void 0 : _c.bands) ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
3337
- createVNode(unref(_sfc_main$u), null, {
3356
+ createVNode(unref(_sfc_main$u), { "is-open": isExpanded.value }, {
3338
3357
  default: withCtx(() => [
3339
3358
  isExpanded.value ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
3340
3359
  createVNode(_sfc_main$a, {
@@ -3344,7 +3363,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
3344
3363
  ])) : createCommentVNode("", true)
3345
3364
  ]),
3346
3365
  _: 1
3347
- })
3366
+ }, 8, ["is-open"])
3348
3367
  ])) : createCommentVNode("", true)
3349
3368
  ]);
3350
3369
  };
@@ -4154,7 +4173,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4154
4173
  setup(__props, { emit: __emit }) {
4155
4174
  var _a, _b, _c, _d, _e, _f, _g, _h;
4156
4175
  const PaymentIntegrationForm = defineAsyncComponent(
4157
- () => import("../../PaymentIntegrationForm-DX6kv0_v.mjs")
4176
+ () => import("../../PaymentIntegrationForm-CypW6fZY.mjs")
4158
4177
  );
4159
4178
  const props = __props;
4160
4179
  const emit = __emit;
@@ -4194,21 +4213,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4194
4213
  isPaid,
4195
4214
  amount,
4196
4215
  loadInvoicePreview,
4197
- updateInvoicePreviewOnBillingInformationChange
4216
+ updateInvoicePreviewOnBillingInformationChange,
4217
+ saveFormStateForRedirect
4198
4218
  } = useCheckoutView({
4199
4219
  initialCountry: (_f = props.configuration) == null ? void 0 : _f.countryCode,
4200
4220
  initialEmail: (_g = props.configuration) == null ? void 0 : _g.email,
4201
4221
  subscriptionId,
4202
4222
  enabledPricingIds: (_h = props.configuration) == null ? void 0 : _h.enabledPricingIds
4203
4223
  });
4224
+ const isPaymentPending = ref(false);
4204
4225
  const handleSubmit = async () => {
4205
4226
  var _a2;
4206
4227
  await checkoutForm.validation.value.$validate();
4207
4228
  if (checkoutForm.validation.value.$invalid) {
4208
4229
  return;
4209
4230
  }
4231
+ isPaymentPending.value = true;
4232
+ saveFormStateForRedirect();
4210
4233
  (_a2 = paymentIntegrationFormRef.value) == null ? void 0 : _a2.submit();
4211
4234
  };
4235
+ const handlePaymentFailed = () => {
4236
+ isPaymentPending.value = false;
4237
+ };
4212
4238
  const handleValidateOnSubmit = async () => {
4213
4239
  await checkoutForm.validation.value.$validate();
4214
4240
  return !checkoutForm.validation.value.$invalid;
@@ -4621,19 +4647,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4621
4647
  ]),
4622
4648
  _: 1
4623
4649
  })) : unref(amount) && unref(checkoutForm).form.value.country ? (openBlock(), createElementBlock("div", _hoisted_4, [
4624
- createVNode(unref(PaymentIntegrationForm), {
4625
- ref_key: "paymentIntegrationFormRef",
4626
- ref: paymentIntegrationFormRef,
4627
- "country-code": unref(checkoutForm).form.value.country,
4628
- context: unref(authorizationContext),
4629
- amount: unref(amount),
4630
- variant: "AUTHORIZE",
4631
- "payment-method-options": unref(paymentMethodOptions) ?? [],
4632
- "validate-on-submit": handleValidateOnSubmit,
4633
- "force-store-payment-method": "",
4634
- onPaymentSuccess: handlePaymentSuccess,
4635
- onReady: _cache[3] || (_cache[3] = ($event) => emit("ready"))
4636
- }, null, 8, ["country-code", "context", "amount", "payment-method-options"])
4650
+ createElementVNode("div", {
4651
+ class: normalizeClass({ "pointer-events-none opacity-60": isPaymentPending.value })
4652
+ }, [
4653
+ createVNode(unref(PaymentIntegrationForm), {
4654
+ ref_key: "paymentIntegrationFormRef",
4655
+ ref: paymentIntegrationFormRef,
4656
+ "country-code": unref(checkoutForm).form.value.country,
4657
+ context: unref(authorizationContext),
4658
+ amount: unref(amount),
4659
+ email: unref(checkoutForm).form.value.email,
4660
+ variant: "AUTHORIZE",
4661
+ "payment-method-options": unref(paymentMethodOptions) ?? [],
4662
+ "validate-on-submit": handleValidateOnSubmit,
4663
+ "force-store-payment-method": "",
4664
+ onPaymentSuccess: handlePaymentSuccess,
4665
+ onPaymentFailed: handlePaymentFailed,
4666
+ onReady: _cache[3] || (_cache[3] = ($event) => emit("ready"))
4667
+ }, null, 8, ["country-code", "context", "amount", "email", "payment-method-options"])
4668
+ ], 2)
4637
4669
  ])) : createCommentVNode("", true)
4638
4670
  ])) : createCommentVNode("", true)
4639
4671
  ]),
@@ -4695,7 +4727,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4695
4727
  type: "button",
4696
4728
  size: "lg",
4697
4729
  class: "sv-action sv-action--primary sv-action--full-width sv-checkout__submit w-full",
4698
- disabled: unref(isPromotionCodePending) || unref(paymentMethodOptions).length === 0,
4730
+ disabled: unref(isPromotionCodePending) || unref(paymentMethodOptions).length === 0 || isPaymentPending.value,
4731
+ loading: isPaymentPending.value,
4699
4732
  onClick: handleSubmit
4700
4733
  }, {
4701
4734
  default: withCtx(() => [
@@ -4710,7 +4743,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4710
4743
  })), 1)
4711
4744
  ]),
4712
4745
  _: 1
4713
- }, 8, ["disabled"])) : createCommentVNode("", true)
4746
+ }, 8, ["disabled", "loading"])) : createCommentVNode("", true)
4714
4747
  ]),
4715
4748
  _: 1
4716
4749
  })) : createCommentVNode("", true),
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),r=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),o=require("../../useInvoicesList-DXBTGdcI.js"),s=require("../../usePortal-DhaZBAGi.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-D-hpJL8I.js"),a=require("../../useCustomer-D9ZrqMFY.js"),i=require("../../usePaymentMethods-BHLXXaCa.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-0_VYW5Wu.js"),l=require("../../useLoadInitialData-D0t-Lk3k.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-zdBaVj-K.js"),m=require("../../paymentMethods-BR9w3qy8.js"),d=require("../../useService-C0h9UlQW.js"),v=require("../../useWalletBalanceItems-COzKSpmt.js"),p=require("../../component-By_A1VHh.js");const f=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(p){var f;const y=null==(f=s.usePortal().value)?void 0:f.customer_id,_=a.useCustomer({customerId:y}),g=o.useInvoicesList({customerId:y,batchSize:5}),h=n.useSubscriptionsList({customerId:y,batchSize:2}),b=i.usePaymentMethods({customerId:y}),S=function({customerId:e,amount:t}){const{getPaymentMethodOptions:r}=m.createPaymentMethodsService(),{data:o,execute:s,error:n,apiStatus:a,isPending:i}=d.useService({initialValue:[],service:async()=>(await r({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:o,fetch:s,isPending:i}}({customerId:y}),j=v.useCustomerWalletBalances({customerId:y}),C=v.useWalletBalanceItems(j.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),S.fetch(),j.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(r.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(_).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(b).items.value,"is-loading":e.unref(w),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(o._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(w),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(j).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(C)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(w),"payment-methods":e.unref(b).items.value},null,8,["is-loading","payment-methods"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(w),customer:e.unref(_).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),y=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:t=>(r,o)=>{var s,n,a,i;return e.openBlock(),e.createBlock(p._sfc_main,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(s=t.branding)?void 0:s.colors)?void 0:n.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:o[0]||(o[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(f)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=p.defineCustomElement(y),g=p.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=_,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,_)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),r=require("../../useInvoicesList-CFk-_oVK.js"),s=require("../../usePortal-DVD7PcWI.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-56vu59V4.js"),a=require("../../useCustomer-Z24KchWC.js"),i=require("../../usePaymentMethods-AC-4rrR9.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-BI3Lg7nO.js"),l=require("../../useLoadInitialData-CTqfiMTN.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-C_uHr21N.js"),m=require("../../paymentMethods-DIbB759g.js"),d=require("../../useService-CHrkefKd.js"),v=require("../../useWalletBalanceItems-BL-R5foK.js"),p=require("../../component-Bs8oszfD.js");const y=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(p){var y;const f=null==(y=s.usePortal().value)?void 0:y.customer_id,_=a.useCustomer({customerId:f}),g=r.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=i.usePaymentMethods({customerId:f}),j=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=m.createPaymentMethodsService(),{data:r,execute:s,error:n,apiStatus:a,isPending:i}=d.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:a,items:r,fetch:s,isPending:i}}({customerId:f}),C=v.useCustomerWalletBalances({customerId:f}),S=v.useWalletBalanceItems(C.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),j.fetch(),C.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),{class:"sv-customer-overview sv-root sv-screen"},{header:e.withCtx(()=>[e.unref(_).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,class:"sv-customer-overview__subscriptions",customer:e.unref(_).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(b).items.value,"is-loading":e.unref(w),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"sv-customer-overview__invoices",invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(w),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(v._sfc_main,{class:"sv-customer-overview__wallet-balances","has-error":e.unref(C).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(w),"wallet-balances":e.unref(S)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{class:"sv-customer-overview__payment-methods","is-loading":e.unref(w),"payment-methods":e.unref(b).items.value},null,8,["is-loading","payment-methods"]),e.unref(_).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"sv-customer-overview__billing-information","is-loading":e.unref(w),customer:e.unref(_).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),f=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:t=>(o,r)=>{var s,n,a,i;return e.openBlock(),e.createBlock(p._sfc_main,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(s=t.branding)?void 0:s.colors)?void 0:n.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=p.defineCustomElement(f),g=p.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=_,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,_)};
@@ -1,18 +1,18 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
2
  import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
3
- import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
4
- import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-b2_fiHsc.mjs";
5
- import { u as usePortal } from "../../usePortal-CpW3EDD-.mjs";
6
- import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-B7IOIy-v.mjs";
7
- import { u as useCustomer } from "../../useCustomer-DUA8Y-2I.mjs";
8
- import { u as usePaymentMethods } from "../../usePaymentMethods-C-NCtOom.mjs";
9
- import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-D8ZeVBWO.mjs";
10
- import { u as useLoadInitialData } from "../../useLoadInitialData-Cyp1xpuv.mjs";
11
- import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DEqfojR8.mjs";
12
- import { c as createPaymentMethodsService } from "../../paymentMethods-DOH9-6M1.mjs";
13
- import { u as useService } from "../../useService-BcYQRxPS.mjs";
14
- import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-DKz-2vUy.mjs";
15
- import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-CGfjV_7z.mjs";
3
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
4
+ import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-z19cteaD.mjs";
5
+ import { u as usePortal } from "../../usePortal-B1O1zgdV.mjs";
6
+ import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DB1p61kZ.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-VVJi8z2w.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-ocHmNoP7.mjs";
9
+ import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-BYBAO4Au.mjs";
10
+ import { u as useLoadInitialData } from "../../useLoadInitialData-CkpryfjF.mjs";
11
+ import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CTnn1gkW.mjs";
12
+ import { c as createPaymentMethodsService } from "../../paymentMethods-DvqlWe96.mjs";
13
+ import { u as useService } from "../../useService-DF57xuDd.mjs";
14
+ import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-COQDLfoZ.mjs";
15
+ import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
16
16
  function useCustomerPaymentMethodOptions({
17
17
  customerId,
18
18
  amount
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-By_A1VHh.js"),n=require("../../vendor-ui-1SHma7t1.js"),o=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BhGQB-c9.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../adyen-BvNyYAg-.js"),c=require("../../useLoadInitialData-D0t-Lk3k.js"),l=require("../../usePayments-DADpdoI7.js"),s=require("../../usePaymentMethodOptions-DgGDcVeE.js"),u=require("../../usePaymentMethods-BHLXXaCa.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{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}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.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(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({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:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$3),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),d={key:0},m=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:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref();function m(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const y=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,v)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$14),{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 o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({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(n._sfc_main$1),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$6),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({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(n._sfc_main$1),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,title:e.unref(c)({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.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,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,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:y,onSelect:v[0]||(v[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$13),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:m},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=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 o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=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:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(m,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-Bs8oszfD.js"),n=require("../../vendor-ui-C3Tq-qY_.js"),o=require("../../ContentWithAsideLayout-DHpnJfGA.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../url-B6-3PkW2.js"),c=require("../../useLoadInitialData-CTqfiMTN.js"),l=require("../../usePayments-CgXZeWrU.js"),s=require("../../usePaymentMethodOptions-BsCZnCQW.js"),u=require("../../usePaymentMethods-AC-4rrR9.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{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}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),r=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),i=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.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(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({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:n.formatAmount(o.amount),type:i.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:i.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),e.mergeProps(r.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),d={key:0},m=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:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref(),m=e.ref(!1);function y(){if(!u.value)throw new Error("payment integration form not found");m.value=!0,u.value.submit()}const v=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()},f=()=>{m.value=!1};return(l,g)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(r._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$2),{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 o,l;return[t.isLoading?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(i._sfc_main,{key:1,status:"success",title:e.unref(c)({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(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$14),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(i._sfc_main,{key:2,status:"error",title:e.unref(c)({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(n._sfc_main$3),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({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},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,title:e.unref(c)({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":m.value})},[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,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,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:v,onPaymentFailed:f,onSelect:g[0]||(g[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])],2)]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$15),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(p,{disabled:!s.value||m.value,loading:m.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","loading","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=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 o=t,{invoice:a,get:r,downloadInvoicePdf:i}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:d}=l.usePayments(),{fetchInitial:m}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),m(),d(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(f),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(i)})}}}),v=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:n=>(o,a)=>{var r,i,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(i=null==(r=n.branding)?void 0:r.colors)?void 0:i.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:r,paymentMethodOptions:i,paymentAttempts:c,downloadService:l})=>[e.createVNode(m,{"is-loading":o,invoice:t,amount:a,"country-code":r,"payment-method-options":i,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=t.defineCustomElement(v),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=f,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,f)};
@@ -1,14 +1,14 @@
1
- import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
- import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-CGfjV_7z.mjs";
3
- import { u as useIntl, y as formatAmount, e as _sfc_main$4, z as _sfc_main$6, b as _sfc_main$8, l as _sfc_main$9, _ as _sfc_main$a, A as _sfc_main$c, x as getCustomerCountry } from "../../vendor-ui-CdOX_IS-.mjs";
4
- import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
5
- import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dkd-Cp8c.mjs";
1
+ import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, createElementVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-Bg2JVC_O.mjs";
3
+ import { u as useIntl, B as formatAmount, c as _sfc_main$4, C as _sfc_main$6, e as _sfc_main$8, A as _sfc_main$9, _ as _sfc_main$a, d as _sfc_main$c, g as getCustomerCountry } from "../../vendor-ui-B8IlviSs.mjs";
4
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Dy9xgxuF.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs";
6
6
  import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
7
- import { _ as _sfc_main$7 } from "../../adyen-D0yvZvq5.mjs";
8
- import { u as useLoadInitialData } from "../../useLoadInitialData-Cyp1xpuv.mjs";
9
- import { u as useInvoice, a as usePayments } from "../../usePayments-BtByiIMy.mjs";
10
- import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-r0Opz7BC.mjs";
11
- import { u as usePaymentMethods } from "../../usePaymentMethods-C-NCtOom.mjs";
7
+ import { _ as _sfc_main$7 } from "../../url-1Lbg5Yni.mjs";
8
+ import { u as useLoadInitialData } from "../../useLoadInitialData-CkpryfjF.mjs";
9
+ import { u as useInvoice, a as usePayments } from "../../usePayments-D85eB5l4.mjs";
10
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-BoGHJjng.mjs";
11
+ import { u as usePaymentMethods } from "../../usePaymentMethods-ocHmNoP7.mjs";
12
12
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
13
  __name: "PayButton",
14
14
  props: {
@@ -182,10 +182,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
182
182
  const props = __props;
183
183
  const selectedPaymentMethod = ref();
184
184
  const paymentIntegrationFormRef = ref();
185
+ const isPaymentPending = ref(false);
185
186
  function handleSubmit() {
186
187
  if (!paymentIntegrationFormRef.value) {
187
188
  throw new Error("payment integration form not found");
188
189
  }
190
+ isPaymentPending.value = true;
189
191
  paymentIntegrationFormRef.value.submit();
190
192
  }
191
193
  const handlePaymentSuccess = () => {
@@ -193,6 +195,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
193
195
  props.configuration.onPaymentSuccess();
194
196
  }
195
197
  };
198
+ const handlePaymentFailed = () => {
199
+ isPaymentPending.value = false;
200
+ };
196
201
  return (_ctx, _cache) => {
197
202
  return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
198
203
  header: withCtx(() => [
@@ -261,28 +266,33 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
261
266
  "no-spacing": ""
262
267
  }, {
263
268
  default: withCtx(() => [
264
- createVNode(_sfc_main$b, {
265
- ref_key: "paymentIntegrationFormRef",
266
- ref: paymentIntegrationFormRef,
267
- amount: __props.amount,
268
- "country-code": __props.countryCode,
269
- context: {
270
- type: "INVOICE",
271
- related_resource_ids: [
272
- {
273
- type: "INVOICE",
274
- id: __props.invoice.id
275
- }
276
- ]
277
- },
278
- "customer-id": __props.invoice.customer.id,
279
- "force-store-payment-method": "",
280
- "invoice-id": __props.invoice.id,
281
- "payment-method-options": __props.paymentMethodOptions,
282
- variant: "AUTHORIZE",
283
- onPaymentSuccess: handlePaymentSuccess,
284
- onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
285
- }, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
269
+ createElementVNode("div", {
270
+ class: normalizeClass({ "pointer-events-none opacity-60": isPaymentPending.value })
271
+ }, [
272
+ createVNode(_sfc_main$b, {
273
+ ref_key: "paymentIntegrationFormRef",
274
+ ref: paymentIntegrationFormRef,
275
+ amount: __props.amount,
276
+ "country-code": __props.countryCode,
277
+ context: {
278
+ type: "INVOICE",
279
+ related_resource_ids: [
280
+ {
281
+ type: "INVOICE",
282
+ id: __props.invoice.id
283
+ }
284
+ ]
285
+ },
286
+ "customer-id": __props.invoice.customer.id,
287
+ "force-store-payment-method": "",
288
+ "invoice-id": __props.invoice.id,
289
+ "payment-method-options": __props.paymentMethodOptions,
290
+ variant: "AUTHORIZE",
291
+ onPaymentSuccess: handlePaymentSuccess,
292
+ onPaymentFailed: handlePaymentFailed,
293
+ onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
294
+ }, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
295
+ ], 2)
286
296
  ]),
287
297
  _: 1
288
298
  }, 8, ["title"])) : createCommentVNode("", true)
@@ -304,11 +314,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
304
314
  }),
305
315
  __props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
306
316
  createVNode(_sfc_main$3, {
307
- disabled: !selectedPaymentMethod.value,
317
+ disabled: !selectedPaymentMethod.value || isPaymentPending.value,
318
+ loading: isPaymentPending.value,
308
319
  amount: __props.amount,
309
320
  "payment-method": selectedPaymentMethod.value,
310
321
  onClick: handleSubmit
311
- }, null, 8, ["disabled", "amount", "payment-method"])
322
+ }, null, 8, ["disabled", "loading", "amount", "payment-method"])
312
323
  ])) : createCommentVNode("", true)
313
324
  ]),
314
325
  _: 1
@@ -0,0 +1,3 @@
1
+ export declare const SolvimonPaymentMethodsManagement: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
+ export declare const COMPONENT_NAME: string;
3
+ export declare const defineSolvimonPaymentMethodsManagement: () => void;