@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 +1 @@
1
- const e=require("vue"),i=require("./vendor-ui-1SHma7t1.js"),t=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),o=require("./useActionDispatchProvider-aqYyqIdb.js"),n=e.defineComponent({__name:"BillingInformation",props:{customer:{type:Object},isLoading:{type:Boolean},configuration:{default:()=>({showEditButton:!0}),type:Object}},emits:["edit-billing-information"],setup(n){const{$t:s}=i.useIntl(),{dispatchAction:r}=o.useActionDispatchProvider();return(o,a)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"sv-billing-information sv-root sv-component sv-loading min-h-[100px]","data-testid":"billing-information-skeleton"})):(e.openBlock(),e.createBlock(e.unref(i._sfc_main$2),{key:1,class:"sv-billing-information sv-root sv-component",customer:n.customer,"fallback-to-reference":!1},e.createSlots({_:2},[n.configuration.showEditButton?{name:"settings",fn:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main$3),{size:"sm",variant:"ghost",color:"gray","icon-prefix":"edit",class:"sv-action sv-action--ghost sv-billing-information__edit",onClick:a[0]||(a[0]=i=>e.unref(r)({action:"edit-billing-information"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Edit",id:"customer_overview.billing_information_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer billing information"})),1)]),_:1})]),key:"0"}:void 0]),1032,["customer"]))}});exports._sfc_main=n;
1
+ const e=require("vue"),i=require("./vendor-ui-C3Tq-qY_.js"),t=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),o=require("./useActionDispatchProvider-BHTknMoH.js"),n=e.defineComponent({__name:"BillingInformation",props:{customer:{type:Object},isLoading:{type:Boolean},configuration:{default:()=>({showEditButton:!0}),type:Object}},emits:["edit-billing-information"],setup(n){const{$t:s}=i.useIntl(),{dispatchAction:r}=o.useActionDispatchProvider();return(o,a)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"sv-billing-information sv-root sv-component sv-loading min-h-[100px]","data-testid":"billing-information-skeleton"})):(e.openBlock(),e.createBlock(e.unref(i._sfc_main$4),{key:1,class:"sv-billing-information sv-root sv-component",customer:n.customer,"fallback-to-reference":!1},e.createSlots({_:2},[n.configuration.showEditButton?{name:"settings",fn:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main$1),{size:"sm",variant:"ghost",color:"gray","icon-prefix":"edit",class:"sv-action sv-action--ghost sv-billing-information__edit",onClick:a[0]||(a[0]=i=>e.unref(r)({action:"edit-billing-information"}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Edit",id:"customer_overview.billing_information_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer billing information"})),1)]),_:1})]),key:"0"}:void 0]),1032,["customer"]))}});exports._sfc_main=n;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, createSlots, withCtx, createVNode, createTextVNode, toDisplayString } from "vue";
2
- import { u as useIntl, c as _sfc_main$2, e as _sfc_main$3 } from "./vendor-ui-CdOX_IS-.mjs";
2
+ import { u as useIntl, j as _sfc_main$2, c as _sfc_main$3 } from "./vendor-ui-B8IlviSs.mjs";
3
3
  import { _ as _sfc_main$1 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
4
- import { u as useActionDispatchProvider } from "./useActionDispatchProvider-Ca1YbU61.mjs";
4
+ import { u as useActionDispatchProvider } from "./useActionDispatchProvider-Dz8-e4gZ.mjs";
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  __name: "BillingInformation",
7
7
  props: {
@@ -0,0 +1 @@
1
+ const e=require("vue"),o={class:"sv-layout grid w-full grid-cols-1 gap-4"},t={key:0,class:"sv-layout__header"},l={class:"sv-layout__body flex flex-col items-start gap-6 md:flex-row"},s={class:"sv-layout__content grid w-full grow grid-cols-1 gap-4 md:w-auto"},r={key:0,class:"sv-layout__aside grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"};const a=((e,o)=>{const t=e.__vccOpts||e;for(const[l,s]of o)t[l]=s;return t})({},[["render",function(a,c){return e.openBlock(),e.createElementBlock("div",o,[a.$slots.header?(e.openBlock(),e.createElementBlock("div",t,[e.renderSlot(a.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",l,[e.createElementVNode("div",s,[e.renderSlot(a.$slots,"content")]),a.$slots.aside?(e.openBlock(),e.createElementBlock("aside",r,[e.renderSlot(a.$slots,"aside")])):e.createCommentVNode("",!0)])])}]]);exports.ContentWithAsideLayout=a;
@@ -14,7 +14,10 @@ const _hoisted_2 = {
14
14
  };
15
15
  const _hoisted_3 = { class: "sv-layout__body flex flex-col items-start gap-6 md:flex-row" };
16
16
  const _hoisted_4 = { class: "sv-layout__content grid w-full grow grid-cols-1 gap-4 md:w-auto" };
17
- const _hoisted_5 = { class: "sv-layout__aside grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0" };
17
+ const _hoisted_5 = {
18
+ key: 0,
19
+ class: "sv-layout__aside grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"
20
+ };
18
21
  function _sfc_render(_ctx, _cache) {
19
22
  return openBlock(), createElementBlock("div", _hoisted_1, [
20
23
  _ctx.$slots["header"] ? (openBlock(), createElementBlock("div", _hoisted_2, [
@@ -24,9 +27,9 @@ function _sfc_render(_ctx, _cache) {
24
27
  createElementVNode("div", _hoisted_4, [
25
28
  renderSlot(_ctx.$slots, "content")
26
29
  ]),
27
- createElementVNode("aside", _hoisted_5, [
30
+ _ctx.$slots.aside ? (openBlock(), createElementBlock("aside", _hoisted_5, [
28
31
  renderSlot(_ctx.$slots, "aside")
29
- ])
32
+ ])) : createCommentVNode("", true)
30
33
  ])
31
34
  ]);
32
35
  }
@@ -1,11 +1,8 @@
1
- import { defineComponent, computed, openBlock, createBlock, unref, createSlots, withCtx, createElementBlock, Fragment, renderList, createVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
- import { u as useIntl, _ as _sfc_main$2, j as _sfc_main$3, b as _sfc_main$4, e as _sfc_main$5 } from "./vendor-ui-CdOX_IS-.mjs";
1
+ import { defineComponent, computed, openBlock, createBlock, unref, createSlots, withCtx, createVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { u as useIntl, _ as _sfc_main$2, e as _sfc_main$4, c as _sfc_main$5 } from "./vendor-ui-B8IlviSs.mjs";
3
+ import { _ as _sfc_main$3 } from "./PaymentMethodsList.vue_vue_type_script_setup_true_lang-BUTqn4Ey.mjs";
3
4
  import { _ as _sfc_main$6 } from "./Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
4
- import { u as useActionDispatchProvider } from "./useActionDispatchProvider-Ca1YbU61.mjs";
5
- const _hoisted_1 = {
6
- key: 0,
7
- class: "sv-payment-methods__list flex flex-col gap-2"
8
- };
5
+ import { u as useActionDispatchProvider } from "./useActionDispatchProvider-Dz8-e4gZ.mjs";
9
6
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10
7
  __name: "CustomerPaymentMethodsBlock",
11
8
  props: {
@@ -35,22 +32,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
35
32
  )
36
33
  }, createSlots({
37
34
  default: withCtx(() => [
38
- hasPaymentMethods.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
39
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.paymentMethods, (paymentMethod) => {
40
- return openBlock(), createBlock(unref(_sfc_main$2), {
41
- key: paymentMethod.id,
42
- class: "sv-payment-methods__item"
43
- }, {
44
- default: withCtx(() => [
45
- createVNode(unref(_sfc_main$3), {
46
- class: "sv-payment-methods__item-content",
47
- "payment-method": paymentMethod
48
- }, null, 8, ["payment-method"])
49
- ]),
50
- _: 2
51
- }, 1024);
52
- }), 128))
53
- ])) : (openBlock(), createBlock(unref(_sfc_main$2), {
35
+ hasPaymentMethods.value ? (openBlock(), createBlock(_sfc_main$3, {
36
+ key: 0,
37
+ "payment-methods": __props.paymentMethods
38
+ }, null, 8, ["payment-methods"])) : (openBlock(), createBlock(unref(_sfc_main$2), {
54
39
  key: 1,
55
40
  class: "sv-empty-state sv-payment-methods__empty"
56
41
  }, {
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),o=require("./PaymentMethodsList.vue_vue_type_script_setup_true_lang-Be_fF-R_.js"),n=require("./Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),a=require("./useActionDispatchProvider-BHTknMoH.js"),s=e.defineComponent({__name:"CustomerPaymentMethodsBlock",props:{paymentMethods:{type:Array},limit:{default:2,type:Number},isLoading:{type:Boolean},showViewAllButton:{type:Boolean},showAddButton:{type:Boolean}},emits:["view-all-payment-methods","add-payment-method"],setup(n){const a=n,{$t:s}=t.useIntl(),i=e.computed(()=>a.paymentMethods.length>0);return(a,d)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-payment-methods","no-spacing":"","no-border":"",title:e.unref(s)({defaultMessage:"{count, plural, one {Payment method} other {Payment methods}}",description:"Title for the payment methods block on the customer overview page",id:"customer_overview.payment_methods.title"},{count:String(n.paymentMethods.length)})},e.createSlots({default:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(o._sfc_main,{key:0,"payment-methods":n.paymentMethods},null,8,["payment-methods"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-empty-state sv-payment-methods__empty"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-sm",shade:"lighter","no-spacing":"",class:"sv-payment-methods__empty-message"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add a payment method for recurring invoice payments.",description:"Helper text for adding a payment method when no payment methods are configured",id:"customer_overview.payment_methods_block.add_payment_method_helper_text"})),1)]),_:1}),n.showAddButton?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,class:"sv-action sv-action--secondary sv-action--full-width sv-payment-methods__add mt-4 w-full",variant:"outline",color:"gray","icon-prefix":"add",type:"button",onClick:d[1]||(d[1]=e=>a.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add payment method",description:"Text for the add payment method button that is shown when no payment methods have been configured",id:"customer_overview.payment_methods_block.add_payment_method_button_label"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),_:2},[n.showViewAllButton?{name:"right",fn:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$1),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",class:"sv-action sv-action--ghost sv-payment-methods__view-all",type:"button",onClick:d[0]||(d[0]=e=>a.$emit("view-all-payment-methods"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"View all",id:"customer_overview.payment_methods_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer invoices"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),i=e.defineComponent({__name:"CustomerPaymentMethods",props:{isLoading:{type:Boolean},paymentMethods:{type:Array},maxPaymentMethods:{type:Number},configuration:{default:()=>({showViewAllButton:!0,showAddButton:!0}),type:Object}},setup(t){const{dispatchAction:o}=a.useActionDispatchProvider();return(a,i)=>{var d,m;return t.isLoading?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,variant:"section",class:"sv-payment-methods sv-root sv-component sv-loading h-72","data-testid":"customer-payment-methods-skeleton"})):(e.openBlock(),e.createBlock(s,{key:1,class:"sv-payment-methods sv-root sv-component","is-loading":t.isLoading,"payment-methods":t.paymentMethods,"show-view-all-button":null==(d=t.configuration)?void 0:d.showViewAllButton,"show-add-button":null==(m=t.configuration)?void 0:m.showAddButton,onViewAllPaymentMethods:i[0]||(i[0]=t=>e.unref(o)({action:"view-all-payment-methods"})),onAddPaymentMethod:i[1]||(i[1]=t=>e.unref(o)({action:"add-payment-method"}))},null,8,["is-loading","payment-methods","show-view-all-button","show-add-button"]))}}});exports._sfc_main=i;
@@ -1 +1 @@
1
- const e=require("vue"),i=require("./vendor-ui-1SHma7t1.js"),t={key:0,class:"sv-invoice-details__body flex flex-col gap-2"},o={class:"sv-invoice-details__row"},a={class:"sv-invoice-details__row"},n=e.defineComponent({__name:"InvoiceDetailsBlock",props:{invoice:{type:Object}},setup(n){const{$t:c,formatDate:s}=i.useIntl();return(d,l)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{class:"sv-invoice-details",title:e.unref(c)({defaultMessage:"Invoice details",description:"Title for the invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.title"})},{default:e.withCtx(()=>[n.invoice?(e.openBlock(),e.createElementBlock("div",t,[e.createElementVNode("div",o,[e.createVNode(e.unref(i._sfc_main$1),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Invoice date",description:"Title for the invoice date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.invoice_date"})),1)]),_:1}),n.invoice.invoice_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({date:n.invoice.invoice_date,format:"date",timezone:n.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",a,[e.createVNode(e.unref(i._sfc_main$1),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Due date",description:"Title for the due date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.due_date"})),1)]),_:1}),n.invoice.due_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({date:n.invoice.due_date,format:"date",timezone:n.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}});exports._sfc_main=n;
1
+ const e=require("vue"),i=require("./vendor-ui-C3Tq-qY_.js"),t={key:0,class:"sv-invoice-details__body flex flex-col gap-2"},o={class:"sv-invoice-details__row"},a={class:"sv-invoice-details__row"},n=e.defineComponent({__name:"InvoiceDetailsBlock",props:{invoice:{type:Object}},setup(n){const{$t:c,formatDate:s}=i.useIntl();return(d,l)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{class:"sv-invoice-details",title:e.unref(c)({defaultMessage:"Invoice details",description:"Title for the invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.title"})},{default:e.withCtx(()=>[n.invoice?(e.openBlock(),e.createElementBlock("div",t,[e.createElementVNode("div",o,[e.createVNode(e.unref(i._sfc_main$3),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Invoice date",description:"Title for the invoice date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.invoice_date"})),1)]),_:1}),n.invoice.invoice_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$3),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({date:n.invoice.invoice_date,format:"date",timezone:n.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",a,[e.createVNode(e.unref(i._sfc_main$3),{variant:"caps-heading",class:"sv-invoice-details__label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({defaultMessage:"Due date",description:"Title for the due date in invoice details block on the invoice overview page",id:"sdk.invoice_details.invoice_details_block.due_date"})),1)]),_:1}),n.invoice.due_date?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$3),{key:0,variant:"body-xs",class:"sv-invoice-details__value"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({date:n.invoice.due_date,format:"date",timezone:n.invoice.customer.timezone,offsetType:"offsetted"})),1)]),_:1})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:1},8,["title"]))}});exports._sfc_main=n;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createElementBlock, createElementVNode, createVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
- import { u as useIntl, _ as _sfc_main$1, b as _sfc_main$2 } from "./vendor-ui-CdOX_IS-.mjs";
2
+ import { u as useIntl, _ as _sfc_main$1, e as _sfc_main$2 } from "./vendor-ui-B8IlviSs.mjs";
3
3
  const _hoisted_1 = {
4
4
  key: 0,
5
5
  class: "sv-invoice-details__body flex flex-col gap-2"
@@ -0,0 +1 @@
1
+ const e=require("vue"),o=require("./vendor-ui-C3Tq-qY_.js"),n=e.defineComponent({__name:"InvoiceHeader",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup:n=>(i,t)=>(e.openBlock(),e.createBlock(e.unref(o._sfc_main$2),{class:"sv-invoice-header sv-root sv-component","payment-attempts":n.payments??[],invoice:n.invoice,"download-service":()=>n.invoiceDownloadService(n.invoice.id),"show-download-button":n.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]))});exports._sfc_main=n;
@@ -0,0 +1,27 @@
1
+ import { defineComponent, openBlock, createBlock, unref } from "vue";
2
+ import { d as _sfc_main$1 } from "./vendor-ui-B8IlviSs.mjs";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "InvoiceHeader",
5
+ props: {
6
+ isLoading: { type: Boolean },
7
+ invoice: { type: Object },
8
+ payments: { type: Array },
9
+ invoiceDownloadService: { type: Function },
10
+ configuration: { type: Object }
11
+ },
12
+ setup(__props) {
13
+ return (_ctx, _cache) => {
14
+ return openBlock(), createBlock(unref(_sfc_main$1), {
15
+ class: "sv-invoice-header sv-root sv-component",
16
+ "payment-attempts": __props.payments ?? [],
17
+ invoice: __props.invoice,
18
+ "download-service": () => __props.invoiceDownloadService(__props.invoice.id),
19
+ "show-download-button": __props.configuration.enableDownloadButton,
20
+ variant: "external"
21
+ }, null, 8, ["payment-attempts", "invoice", "download-service", "show-download-button"]);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ _sfc_main as _
27
+ };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-TgZYSSQe.js");exports.default=e._sfc_main;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CixdxEGm.js");exports.default=e._sfc_main;
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-GeyErAW6.mjs";
1
+ import { _ as _sfc_main } from "./PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-tM7f_fQS.mjs";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1 +1 @@
1
- const e=require("vue"),t=require("./vendor-ui-1SHma7t1.js"),a={class:"sv-payment-history"},n={class:"sv-payment-history__items flex flex-col-reverse gap-1"},s={class:"sv-payment-history__item-header mb-2 flex items-center justify-between"},r=e.defineComponent({__name:"PaymentHistoryBlock",props:{paymentAttempts:{type:Array},customer:{type:Object}},setup(r){const{$t:o,formatDate:i}=t.useIntl(),m={AUTHORIZED:"green",CANCELLED:"red",ERROR:"red",PENDING:"orange",PENDING_REFUND:"orange",REFUNDED:"orange",CHARGED_BACK:"orange",REFUSED:"red"};return(c,l)=>(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(e.unref(t._sfc_main$1),{tag:"h2",variant:"heading-3",class:"sv-payment-history__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Payment history",description:"Title for the payment history block on the invoice details page",id:"sdk.invoice_details.payment_history.title"})),1)]),_:1}),e.createElementVNode("div",n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.paymentAttempts,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:a.id,class:"sv-payment-history__item mt-1 md:mt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$1),{variant:"caps-heading",class:"sv-payment-history__item-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Payment attempt",description:"Title for the payment attempt block",id:"sdk.invoice_details.payment_history.payment_attempt"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$4),{class:"sv-payment-history__item-status",color:m[a.result]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatEnum)(a.result)),1)]),_:2},1032,["color"])]),a.payment_method_details?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$5),{key:0,class:"sv-payment-history__payment-method","payment-method":a.payment_method_details},{description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({date:a.created_at,format:"dateTime",offsetType:"offsetted",timezone:r.customer.timezone})),1)]),_:2},1032,["payment-method"])):e.createCommentVNode("",!0)]),_:2},1024))),128))])]))}});exports._sfc_main=r;
1
+ const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),a={class:"sv-payment-history"},n={class:"sv-payment-history__items flex flex-col-reverse gap-1"},s={class:"sv-payment-history__item-header mb-2 flex items-center justify-between"},r=e.defineComponent({__name:"PaymentHistoryBlock",props:{paymentAttempts:{type:Array},customer:{type:Object}},setup(r){const{$t:o,formatDate:i}=t.useIntl(),m={AUTHORIZED:"green",CANCELLED:"red",ERROR:"red",PENDING:"orange",PENDING_REFUND:"orange",REFUNDED:"orange",CHARGED_BACK:"orange",REFUSED:"red"};return(c,l)=>(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(e.unref(t._sfc_main$3),{tag:"h2",variant:"heading-3",class:"sv-payment-history__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Payment history",description:"Title for the payment history block on the invoice details page",id:"sdk.invoice_details.payment_history.title"})),1)]),_:1}),e.createElementVNode("div",n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.paymentAttempts,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:a.id,class:"sv-payment-history__item mt-1 md:mt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$3),{variant:"caps-heading",class:"sv-payment-history__item-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Payment attempt",description:"Title for the payment attempt block",id:"sdk.invoice_details.payment_history.payment_attempt"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$5),{class:"sv-payment-history__item-status",color:m[a.result]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatEnum)(a.result)),1)]),_:2},1032,["color"])]),a.payment_method_details?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$6),{key:0,class:"sv-payment-history__payment-method","payment-method":a.payment_method_details},{description:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({date:a.created_at,format:"dateTime",offsetType:"offsetted",timezone:r.customer.timezone})),1)]),_:2},1032,["payment-method"])):e.createCommentVNode("",!0)]),_:2},1024))),128))])]))}});exports._sfc_main=r;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, createBlock, createCommentVNode } from "vue";
2
- import { u as useIntl, b as _sfc_main$1, _ as _sfc_main$2, f as _sfc_main$3, h as formatEnum, j as _sfc_main$4 } from "./vendor-ui-CdOX_IS-.mjs";
2
+ import { u as useIntl, e as _sfc_main$1, _ as _sfc_main$2, k as _sfc_main$3, l as formatEnum, m as _sfc_main$4 } from "./vendor-ui-B8IlviSs.mjs";
3
3
  const _hoisted_1 = { class: "sv-payment-history" };
4
4
  const _hoisted_2 = { class: "sv-payment-history__items flex flex-col-reverse gap-1" };
5
5
  const _hoisted_3 = { class: "sv-payment-history__item-header mb-2 flex items-center justify-between" };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dkd-Cp8c.mjs";
1
+ import { _ as _sfc_main } from "./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CrGSfZZs.mjs";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BhGQB-c9.js");exports.default=e._sfc_main;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BBEM-YPz.js");exports.default=e._sfc_main;
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./vendor-ui-C3Tq-qY_.js"),n=require("./url-B6-3PkW2.js"),a=require("./payments-DMDDI3MK.js"),o=require("./paymentMethods-DIbB759g.js"),r=require("./component-Bs8oszfD.js"),i=e=>{var t;return"ADYEN"===(null==(t=e.integration.payment_gateway)?void 0:t.variant)},s=e=>{var t;return"STRIPE"===(null==(t=e.integration.payment_gateway)?void 0:t.variant)},c=({selectedIntegration:e,paymentMethodOption:t})=>{var n,a;return e===(null==(a=null==(n=t.integration)?void 0:n.payment_gateway)?void 0:a.variant)},d="https://js.stripe.com/dahlia/stripe.js",m=`<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width, initial-scale=1">\n<style>\n* { box-sizing: border-box; margin: 0; padding: 0; }\nbody { overflow: hidden; }\n</style>\n</head>\n<body>\n<div id="stripe-root"></div>\n<script src="${d}"><\/script>\n<script>\n(function () {\n let stripe, elements, countryCode, email, name, parentOrigin;\n\n window.addEventListener('message', function (event) {\n if (!event.data || typeof event.data !== 'object') return;\n if (event.source !== window.parent) return;\n\n if (event.data.type === 'stripe:init') {\n parentOrigin = event.origin;\n countryCode = event.data.countryCode;\n email = event.data.email;\n name = event.data.name;\n stripe = Stripe(event.data.publicKey);\n elements = stripe.elements(event.data.options);\n const paymentElement = elements.create('payment', { layout: { type: 'accordion', defaultCollapsed: false }, wallets: event.data.options.wallets, fields: event.data.options.fields });\n\n paymentElement.on('ready', function () {\n parent.postMessage({ type: 'stripe:ready' }, parentOrigin);\n });\n\n paymentElement.on('change', function (e) {\n parent.postMessage({ type: 'stripe:change', paymentMethodType: e.value.type }, parentOrigin);\n });\n\n paymentElement.on('loaderror', function (e) {\n parent.postMessage({\n type: 'stripe:loaderror',\n error: { message: e.error.message, type: e.error.type }\n }, parentOrigin);\n });\n\n paymentElement.mount('#stripe-root');\n\n new ResizeObserver(function () {\n parent.postMessage({\n type: 'stripe:resize',\n height: document.documentElement.scrollHeight\n }, parentOrigin);\n }).observe(document.documentElement);\n }\n\n if (event.data.type === 'stripe:submit') {\n if (!elements || !parentOrigin || event.origin !== parentOrigin) return;\n const submitEmail = 'email' in event.data ? event.data.email : email;\n const submitName = 'name' in event.data ? event.data.name : name;\n elements.submit().then(function (submitResult) {\n if (submitResult.error) {\n parent.postMessage({\n type: 'stripe:submit:error',\n error: {\n message: submitResult.error.message,\n type: submitResult.error.type,\n code: submitResult.error.code\n }\n }, parentOrigin);\n return;\n }\n const billingDetails = {};\n if (countryCode) billingDetails.address = { country: countryCode };\n if (submitEmail) billingDetails.email = submitEmail;\n if (submitName) billingDetails.name = submitName;\n const tokenParams = Object.keys(billingDetails).length\n ? { payment_method_data: { billing_details: billingDetails } }\n : {};\n stripe.createConfirmationToken({ elements: elements, params: tokenParams }).then(function (tokenResult) {\n if (tokenResult.error) {\n parent.postMessage({\n type: 'stripe:submit:error',\n error: {\n message: tokenResult.error.message,\n type: tokenResult.error.type,\n code: tokenResult.error.code\n }\n }, parentOrigin);\n return;\n }\n parent.postMessage({\n type: 'stripe:submit:success',\n confirmationTokenId: tokenResult.confirmationToken.id\n }, parentOrigin);\n });\n });\n }\n });\n})();\n<\/script>\n</body>\n</html>`,u=["src","height"],p=e.defineComponent({__name:"PaymentIntegrationFormStripeFrame",props:{publicKey:{type:String},options:{type:Object},countryCode:{type:String},email:{type:String},name:{type:String}},emits:["ready","change","loaderror","submit-success","submit-error"],setup(n,{expose:a,emit:o}){const r=n,i=o;a({triggerSubmit:function(){var e,t;null==(t=null==(e=s.value)?void 0:e.contentWindow)||t.postMessage({type:"stripe:submit",email:r.email,name:r.name},"*")}});const s=e.ref(),c=e.ref(0),d=e.ref();function p(){var e,t;null==(t=null==(e=s.value)?void 0:e.contentWindow)||t.postMessage({type:"stripe:init",publicKey:r.publicKey,options:r.options,countryCode:r.countryCode,email:r.email,name:r.name},"*")}function l(e){return"object"==typeof e&&null!==e}function y(e){if(!s.value||e.source!==s.value.contentWindow)return;if(!l(e.data))return;const t=e.data,n=t.type;if("string"==typeof n&&n.startsWith("stripe:"))switch(n){case"stripe:ready":i("ready");break;case"stripe:change":i("change","string"==typeof t.paymentMethodType?t.paymentMethodType:"card");break;case"stripe:loaderror":{const e=l(t.error)?t.error:{};i("loaderror",{message:"string"==typeof e.message?e.message:void 0,type:"string"==typeof e.type?e.type:void 0});break}case"stripe:resize":"number"==typeof t.height&&(c.value=t.height);break;case"stripe:submit:success":"string"==typeof t.confirmationTokenId&&i("submit-success",t.confirmationTokenId);break;case"stripe:submit:error":{const e=l(t.error)?t.error:{};i("submit-error",{message:"string"==typeof e.message?e.message:void 0,type:"string"==typeof e.type?e.type:void 0,code:"string"==typeof e.code?e.code:void 0});break}}}return e.onMounted(()=>{const e=new Blob([m],{type:"text/html"});d.value=URL.createObjectURL(e),window.addEventListener("message",y)}),e.onBeforeUnmount(()=>{window.removeEventListener("message",y),d.value&&URL.revokeObjectURL(d.value)}),e.watch(()=>r.options,(e,n)=>{t.isEqual(e,n)||p()},{deep:!0}),(t,n)=>(e.openBlock(),e.createElementBlock("iframe",{ref_key:"iframeRef",ref:s,src:d.value,height:c.value||void 0,frameborder:"0",style:{width:"100%",display:"block",border:"none"},title:"Payment form",onLoad:p},null,40,u))}}),l={link:"never"},y={variables:{borderRadius:"4px",colorBackground:"rgba(243, 244, 246, 0.5)"},rules:{".TermsText":{fontSize:"14px"},".Input":{backgroundColor:"rgba(243, 244, 246, 0.5)",fontSize:"14px",borderColor:"rgb(229, 231, 235)"}}};const h=e.defineComponent({__name:"PaymentCompletedCard",props:{amount:{type:Object},variant:{type:String}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>"AUTHORIZE"===o.variant?r({defaultMessage:"Payment successful",description:"The title for when a payment has been successful",id:"payment_completed_card.title.authorize"}):r({defaultMessage:"Your payment method is added",description:"The title for when a payment method was successfully added",id:"payment_completed_card.title.tokenize"}));return(o,s)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"success",title:i.value},{default:e.withCtx(()=>[a.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$14),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(a.amount)),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"You are being redirected...",description:"The text shown after a successful message before a redirect",id:"payment_completed_card.redirect_message"})),1)]),_:1})]),_:1},8,["title"]))}}),f={UNKNOWN_ERROR:{title:"Something went wrong",message:"An unknown error has occurred",isReloadButtonVisible:!0},AUTHORIZATION_FAILED:{title:"Payment failed",message:"The payment failed"},PAYMENT_DETAILS_CALL_FAILED:{title:"Payment details call failed",message:"There was a problem getting the payment details"},PAYMENT_METHOD_STORAGE_FAILED:{title:"Failed storing payment method",message:"Something went wrong with storing the payment method"},REDIRECT_RESULT_PAYMENT_ACCEPTOR_MISSING:{title:"Missing payment acceptor",message:"A redirect result is set, but a payment acceptor is missing in the url"},TOKENIZE_FAILED:{title:"Tokenization failed",message:"The tokenization of the payment method has failed"},PAYMENT_INTEGRATION_INITIALIZATION_FAILED:{title:"Failed loading payment methods",message:"Failed loading payment integration",isReloadButtonVisible:!0},RESOURCE_REVOKED:{title:"Resource revoked",message:"The resource has been revoked",isReloadButtonVisible:!0}},_={class:"flex flex-col items-center gap-6"},g=e.defineComponent({__name:"PaymentErrorCard",props:{error:{type:Object}},setup(a){const o=a,{$t:r}=t.useIntl(),i=e.computed(()=>f[o.error.code]),s=()=>{window.location.reload()};return(a,o)=>(e.openBlock(),e.createBlock(n._sfc_main,{status:"error",title:i.value.title},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$3),{variant:"body-xs",shade:"lighter",class:"mt-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.message),1)]),_:1}),i.value.isReloadButtonVisible?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,type:"button",color:"gray",variant:"outline",onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Try again",description:"Retry button text when an error has happened during a payment",id:"payments.retry_button.label"})),1)]),_:1})):e.createCommentVNode("",!0)])]),_:1},8,["title"]))}}),v="STRIPE",E=e.defineComponent({__name:"PaymentIntegrationFormStripe",props:{countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},context:{type:Object},email:{type:String},name:{type:String},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(t,{expose:i,emit:s}){const c=t,m=s;i({submit:function(){(async function(){var e;if(!(await c.validateOnSubmit()))return;null==(e=_.value)||e.triggerSubmit()})().catch(e=>{R.error("STRIPE_SUBMIT_FAILED","Unexpected error during Stripe submission",{},e)})}});const u=e.ref(!1),f=e.ref(),_=e.ref(),E=e.computed(()=>function({amount:e,email:t,name:a,variant:o}){const r=e.currency.toLowerCase(),i=function(e,t){return{billingDetails:{address:{country:"never"},...e?{email:"never"}:{},...t?{name:"never"}:{}}}}(t,a);return"TOKENIZE"===o?{mode:"setup",currency:r,setup_future_usage:"off_session",wallets:l,fields:i,appearance:y}:{mode:"payment",currency:r,amount:n.toMinorUnitAmount(e).value,setup_future_usage:"off_session",wallets:l,fields:i,appearance:y}}({amount:c.amount,email:c.email,name:c.name,variant:c.variant})),b=e.ref(null),R=r.useLogger(),{authorizePayment:I}=a.createPaymentsService(),{tokenizePaymentMethod:k}=o.createPaymentMethodsService(),O=e.computed(()=>{var e,t;return null==(t=null==(e=c.paymentMethodOptionResponseEntry.integration.payment_gateway)?void 0:e.stripe)?void 0:t.public_key});async function T(){if(b.value)return b.value;const e=O.value;if(!e)throw new Error("Missing Stripe public key");const t=await function(e){return new Promise((t,n)=>{if(window.Stripe)return void t(window.Stripe(e));const a=document.createElement("script");a.src=d,a.onload=()=>{window.Stripe?t(window.Stripe(e)):n(new Error("Stripe not available after script load"))},a.onerror=()=>n(new Error("Failed to load Stripe.js")),document.head.appendChild(a)})}(e);return b.value=t,t}async function A(e){const t=c.paymentMethodOptionResponseEntry.payment_acceptor.id,a=n.createReturnUrl({paymentAcceptorId:t,redirectUrl:window.location.href});if("AUTHORIZE"!==c.variant){if("TOKENIZE"===c.variant){if(!c.customerId)return void R.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${t}`);try{const n=await k({customer_id:c.customerId,payment_acceptor_id:t,payment_gateway_variant:v,stripe:{confirmation_token_id:e},return_url:a});await N(n)}catch(o){R.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${t}`,{error:o}),S({code:"UNKNOWN_ERROR",message:"Tokenization failed",error:o})}}}else try{const n=await I({payment_acceptor_id:t,...c.customerId?{customer_id:c.customerId}:{},payment_gateway_variant:v,stripe:{confirmation_token_id:e},amount:c.amount,...c.context&&"CHARGE_ON_DEMAND"!==c.context.type?{context:c.context}:{},return_url:a});await N(n)}catch(o){R.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${t}`,{error:o}),S({code:"UNKNOWN_ERROR",message:"Payment authorization failed",error:o})}}async function N(e){var t;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===v){const a=e.action.client_secret||(null==(t=e.action.data)?void 0:t.client_secret);if(!a)return R.error("STRIPE_ACTION_FAILED","Missing client_secret in Stripe ACTION_REQUIRED response"),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:e});let o;try{o=await T()}catch(n){return R.error("STRIPE_ACTION_FAILED","Failed to load Stripe.js",{error:n}),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:n})}const{error:r}=await o.handleNextAction({clientSecret:a});return r?(R.error("STRIPE_ACTION_FAILED","Stripe handleNextAction failed",{error:r}),void S({code:"UNKNOWN_ERROR",message:"Payment action failed",error:r})):(u.value=!0,void m("payment-success"))}if("SUCCESS"===e.status)return u.value=!0,void m("payment-success");R.error("STRIPE_ACTION_FAILED","Unexpected payment result status",{error:e}),S({code:"UNKNOWN_ERROR",message:"Payment failed",error:e})}function P(){m("select",{paymentMethodType:"card",paymentGatewayVariant:v}),m("ready")}function w(e){S({code:"UNKNOWN_ERROR",message:e.message??"Failed to load payment form",error:e})}function S(e){f.value=e,m("payment-failed",e)}return e.onMounted(()=>{(async function(){const e=c.paymentMethodOptionResponseEntry.payment_acceptor.id;if(n.getQueryParam(n.PAYMENT_ACCEPTOR_ID_QUERY_STRING)!==e)return;const t=n.getQueryParam("redirect_status"),a=n.getQueryParam("payment_intent_client_secret"),o=n.getQueryParam("setup_intent_client_secret");if(t&&(a||o)){if("succeeded"===t)return u.value=!0,void m("payment-success");R.error("STRIPE_REDIRECT_RETURN_FAILED","Stripe redirect returned non-succeeded status",{redirectStatus:t}),S({code:"UNKNOWN_ERROR",message:"Payment failed",error:new globalThis.Error(`Stripe redirect returned status: ${t}`)})}})().catch(e=>{R.error("STRIPE_REDIRECT_RETURN_FAILED","handleRedirectReturn threw unexpectedly",{error:e})})}),e.onBeforeUnmount(()=>{b.value=null}),(n,a)=>u.value?(e.openBlock(),e.createBlock(h,{key:0,variant:t.variant},null,8,["variant"])):f.value?(e.openBlock(),e.createBlock(g,{key:1,error:f.value},null,8,["error"])):O.value?(e.openBlock(),e.createBlock(p,{key:2,ref_key:"frameRef",ref:_,"public-key":O.value,options:E.value,"country-code":t.countryCode,email:t.email,name:t.name,onReady:P,onChange:a[0]||(a[0]=e=>m("select",{paymentMethodType:e,paymentGatewayVariant:v})),onLoaderror:w,onSubmitSuccess:A,onSubmitError:a[1]||(a[1]=t=>e.unref(R).error("STRIPE_CONFIRMATION_TOKEN_FAILED","Stripe submission failed",{error:t}))},null,8,["public-key","options","country-code","email","name"])):e.createCommentVNode("",!0)}}),b=e=>{let t={};return"TOKENIZE"===e&&(t={"en-US":{payButton:"Add payment method",confirmPurchase:"Add payment method"},"fr-FR":{payButton:"Ajouter un moyen de paiement",confirmPurchase:"Ajouter un moyen de paiement"},"de-DE":{payButton:"Zahlungsmethode hinzufügen",confirmPurchase:"Zahlungsmethode hinzufügen"},"it-IT":{payButton:"Aggiungi metodo di pagamento",confirmPurchase:"Aggiungi metodo di pagamento"},"es-ES":{payButton:"Añadir método de pago",confirmPurchase:"Añadir método de pago"},"nl-NL":{payButton:"Betaalmethode toevoegen",confirmPurchase:"Betaalmethode toevoegen"},"pt-BR":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pt-PT":{payButton:"Adicionar método de pagamento",confirmPurchase:"Adicionar método de pagamento"},"pl-PL":{payButton:"Dodaj metodę płatności",confirmPurchase:"Dodaj metodę płatności"},"ru-RU":{payButton:"Добавить способ оплаты",confirmPurchase:"Добавить способ оплаты"},"sv-SE":{payButton:"Lägg till betalningsmetod",confirmPurchase:"Lägg till betalningsmetod"},"da-DK":{payButton:"Tilføj betalingsmetode",confirmPurchase:"Tilføj betalingsmetode"},"fi-FI":{payButton:"Lisää maksutapa",confirmPurchase:"Lisää maksutapa"},"no-NO":{payButton:"Legg til betalingsmetode",confirmPurchase:"Legg til betalingsmetode"},"cs-CZ":{payButton:"Přidat platební metodu",confirmPurchase:"Přidat platební metodu"},"hu-HU":{payButton:"Fizetési mód hozzáadása",confirmPurchase:"Fizetési mód hozzáadása"},"ro-RO":{payButton:"Adăugați metodă de plată",confirmPurchase:"Adăugați metodă de plată"},"ja-JP":{payButton:"支払い方法を追加",confirmPurchase:"支払い方法を追加"},"ko-KR":{payButton:"결제 수단 추가",confirmPurchase:"결제 수단 추가"},"zh-CN":{payButton:"添加支付方式",confirmPurchase:"添加支付方式"},"zh-TW":{payButton:"新增付款方式",confirmPurchase:"新增付款方式"},ar:{payButton:"إضافة وسيلة دفع",confirmPurchase:"إضافة وسيلة دفع"},"hr-HR":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"el-GR":{payButton:"Προσθήκη μεθόδου πληρωμής",confirmPurchase:"Προσθήκη μεθόδου πληρωμής"},"sk-SK":{payButton:"Pridať spôsob platby",confirmPurchase:"Pridať spôsob platby"},"sl-SI":{payButton:"Dodajte način plačanja",confirmPurchase:"Dodajte način plačanja"},"bg-BG":{payButton:"Добавяне на начин на плащане",confirmPurchase:"Добавяне на начин на плащане"},"ca-ES":{payButton:"Afegir mètode de pagament",confirmPurchase:"Afegir mètode de pagament"},"et-EE":{payButton:"Lisa makseviis",confirmPurchase:"Lisa makseviis"},"lv-LV":{payButton:"Pievienot maksājuma veidu",confirmPurchase:"Pievienot maksājuma veidu"},"lt-LT":{payButton:"Pridėti mokėjimo metodą",confirmPurchase:"Pridėti mokėjimo metodą"}}),t},R=["applepay"];const I="ADYEN",k=e.defineComponent({__name:"PaymentIntegrationFormAdyen",props:{countryCode:{type:String},customerId:{type:String},invoiceId:{type:String},paymentMethodOptionResponseEntry:{type:Object},variant:{type:String},selected:{type:Boolean},amount:{type:Object},validateOnSubmit:{type:Function,default:()=>Promise.resolve(!0)},context:{type:Object},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(i,{expose:s,emit:c}){let d=null,m=null;const u=i,p=c;s({submit:function(){try{null==d||d.submit()}catch(e){_.error("ADYEN_SUBMIT_FAILED","Failed to submit Adyen drop-in",{},e)}}});const l=e.ref(),y=e.ref(!1),f=e.ref(),_=r.useLogger(),{locale:v}=t.useIntl(),{authorizePayment:E,getPaymentDetails:k}=a.createPaymentsService(),{tokenizePaymentMethod:O}=o.createPaymentMethodsService(),T=e.inject(r.EXPERIMENTAL_FEATURE_INJECTION_KEY);async function A(){var e;const t=n.toMinorUnitAmount(u.amount),a=(null==(e=null==T?void 0:T.value)?void 0:e["express-checkout"])?function(e){return e.filter(e=>!R.some(t=>{var n;return t===(null==(n=e.type)?void 0:n.toLowerCase())}))}(n.mapAdyenPaymentMethods(u.paymentMethodOptionResponseEntry)):n.mapAdyenPaymentMethods(u.paymentMethodOptionResponseEntry);return{checkoutConfig:{amount:t,clientKey:n.getAdyenClientKeyFromPaymentMethodOptionsResponse(u.paymentMethodOptionResponseEntry),environment:n.getAdyenEnvironmentFromPaymentMethodOptionsResponse(u.paymentMethodOptionResponseEntry,_),locale:v,translations:b(u.variant),countryCode:u.countryCode,analytics:{enabled:!1},paymentMethodsResponse:{paymentMethods:a},onSubmit:w,onAdditionalDetails:C,onPaymentCompleted:B,onPaymentFailed:M,onError:x,showPayButton:!1},dropInConfig:{disableFinalAnimation:!0,paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,enableStoreDetails:!u.forceStorePaymentMethod&&"AUTHORIZE"===u.variant},paypal:{intent:t.value>0?"authorize":"tokenize",showPayButton:!0}},openFirstPaymentMethod:u.selected,onSelect:({props:{type:e}})=>{e&&p("select",{paymentMethodType:e,paymentGatewayVariant:"ADYEN"})},onReady:()=>p("ready")}}}async function N(){if(l.value)try{await P();const[e,{default:t}]=await Promise.all([Promise.resolve().then(()=>require("./index-DIFK3mcJ.js")),Promise.resolve().then(()=>require("./adyen-DZsyEXkw.js"))]),{AdyenCheckout:n,Dropin:a,Card:o,Bancontact:r,Ach:i,AmazonPay:s,ApplePay:c,BcmcMobile:p,BacsDirectDebit:y,CashAppPay:h,EPS:f,GooglePay:_,Klarna:g,PayByBank:v,PayPal:E,SepaDirectDebit:b,Trustly:R,Twint:I,PayByBankUS:k,Redirect:O}=e,{checkoutConfig:T,dropInConfig:N}=await A();m=await n(T),d=new a(m,{...N,paymentMethodComponents:[o,r,i,s,c,p,y,h,f,_,g,v,E,b,R,I,k,O]}).mount(l.value),function(e){var t;const n=null==(t=l.value)?void 0:t.getRootNode();if(n instanceof ShadowRoot){const t=document.createElement("style");t.textContent=e,n.appendChild(t);const a=document.createElement("style");a.textContent="\n :host {\n --adyen-sdk-color-background-secondary: transparent;\n --adyen-sdk-color-background-primary: rgb(243 244 246 / 0.5);\n --adyen-sdk-color-outline-secondary: #e5e7eb;\n --adyen-sdk-color-outline-primary: transparent;\n --adyen-sdk-color-background-always-dark: var(--color-primary-500);\n --adyen-sdk-color-background-inverse-primary-hover: var(--color-primary-600);\n }\n\n .adyen-checkout__payment-method__image__wrapper {\n width: 32px;\n height: 32px;\n }\n\n .adyen-checkout__payment-method__image {\n height: 32px;\n }\n\n .adyen-checkout__input-wrapper,\n .adyen-checkout__input {\n border-color: rgb(229, 231, 235);\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__button,\n .adyen-checkout__payment-method {\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method {\n border-color: rgb(229, 231, 235);\n box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n transition: box-shadow 0.2s ease-in-out;\n }\n\n .adyen-checkout__payment-method--selected {\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n }\n\n .adyen-checkout__payment-method:after {\n transform: scale(0%);\n }\n\n .adyen-checkout__paypal__button {\n display: block !important;\n }\n\n .adyen-checkout__payment-methods-list {\n gap: 4px;\n }\n\n .adyen-checkout__dropdown__list {\n background-color: white;\n border-radius: var(--adyen-sdk-border-radius-s, 4px);\n }\n\n .adyen-checkout__payment-method.adyen-checkout__payment-method--selected:after {\n content: '✓';\n width: 20px;\n height: 20px;\n border-radius: 10px;\n background-color: var(--color-primary-600);\n position: absolute;\n top: 14px;\n right: 14px;\n text-align: center;\n line-height: 20px;\n color: white;\n transform: scale(100%);\n font-size: 12px;\n }\n\n .adyen-checkout__payment-method__header {\n padding: 8px 16px !important;\n }\n\n .adyen-checkout__payment-method__brands {\n align-items: center;\n }\n .adyen-checkout__payment-method__brand-number {\n line-height: 1;\n }\n .adyen-checkout__button__text {\n font-size: 14px;\n }\n .adyen-checkout__store-details {\n background: transparent;\n padding: 0;\n }\n .adyen-checkout__checkbox__input + .adyen-checkout__checkbox__label:after {\n border-color: rgb(229, 231, 235);\n }\n ","AUTHORIZE"===u.variant&&(a.textContent+="\n .adyen-checkout__payment-method--cashapp .adyen-checkout-pm-details-wrapper {\n display: none;\n }\n "),n.appendChild(a)}}(t)}catch(e){_.error("PAYMENT_INTEGRATION_INITIALIZATION_FAILED","Failed to mount Adyen web drop-in",{error:e})}}async function P(){d&&(d.unmount(),d=null),l.value&&(l.value.innerHTML="")}function w(...e){const[t,a,o]=e;u.validateOnSubmit().then(e=>{if(!e)return;const a=u.paymentMethodOptionResponseEntry.payment_acceptor.id,r={risk_data:n.transformObjectToAdyenObject(t.data.riskData),payment_method:n.transformObjectToAdyenObject(t.data.paymentMethod),browser_info:n.transformObjectToAdyenObject(t.data.browserInfo)};if("AUTHORIZE"===u.variant){const e=n.createReturnUrl({paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});return void E({payment_acceptor_id:a,...u.customerId?{customer_id:u.customerId}:{},payment_gateway_variant:I,adyen:{...r,store_payment_method:u.forceStorePaymentMethod||t.data.storePaymentMethod},amount:u.amount,...u.context?{context:u.context}:{},return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===I){const t=S(e,n);return t?(d.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void _.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e})}if("AUTHORIZED"===e.payment.result)return y.value=!0,void o.resolve({resultCode:"Authorised"});_.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})}).catch(e=>{_.error("PAYMENT_AUTHORIZATION_FAILED",`Failed payment authorization for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}if("TOKENIZE"===u.variant){const e=n.createReturnUrl({paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id,redirectUrl:window.location.href});if(!u.customerId)return void _.error("TOKENIZATION_FAILED",`Missing customer id for payment acceptor with id ${a}`);O({customer_id:u.customerId,payment_acceptor_id:a,payment_gateway_variant:I,adyen:r,return_url:e}).then(e=>{const n=t.data.paymentMethod.type;if("ACTION_REQUIRED"===e.status&&e.action.payment_gateway_variant===I){const t=S(e,n);return t?(d.handleAction(t),void o.resolve({resultCode:e.action.adyen.result_code,action:t})):void _.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e})}if("AUTHORIZED"===e.payment.result)return y.value=!0,void o.resolve({resultCode:"Authorised"});_.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})}).catch(e=>{_.error("TOKENIZATION_FAILED",`Tokenization failed for payment acceptor with id ${a}`,{error:e}),o.resolve({resultCode:"Error"})})}}).catch(e=>{_.error("INTEGRATION_ERROR","Unhandled error in payment submission flow",{},e)})}function S(e,t){if("ACTION_REQUIRED"!==e.status)return;const n=e.action;if("ADYEN"!=n.payment_gateway_variant)return;const a=n.adyen;return{paymentMethodType:(null==a?void 0:a.payment_method_type)??t,method:n.method,url:n.url,data:n.data,type:null==a?void 0:a.action_type,paymentData:null==a?void 0:a.payment_data,sdkData:null==a?void 0:a.sdk_data}}function C(...e){const[t]=e,n=t.data.details,a=t.data.paymentData;if(u.paymentMethodOptionResponseEntry.payment_acceptor.id)return void D({detailsResult:n?(o=n,Object.fromEntries(Object.entries(o).filter(([,e])=>null!=e))):void 0,paymentDataResult:a,paymentAcceptorId:u.paymentMethodOptionResponseEntry.payment_acceptor.id});var o;const r={code:"UNKNOWN_ERROR",message:"Payment failed",error:e};p("payment-failed",r),f.value=r}function M(...e){const[t]=e,n={code:"UNKNOWN_ERROR",message:"Payment failed",error:t};p("payment-failed",n),f.value=n}function B(...e){const[,t]=e;null==t||t.unmount(),p("payment-success")}function x(...e){const[t,n]=e;if("CANCEL"===t.name)return;const a={code:"UNKNOWN_ERROR",message:"Something went wrong",error:t};_.error("INTEGRATION_ERROR","Something went wrong",{error:t}),f.value=a,null==n||n.unmount()}function D({detailsResult:e,threeDSResult:t,redirectResult:n,paymentDataResult:a,paymentAcceptorId:o}){k({paymentAcceptorId:o,paymentGatewayVariant:I,adyen:{...e?{details:e}:{},...n?{redirect_result:n}:{},...t?{threeds_result:t}:{},...a?{payment_data:a}:{}}}).then(e=>{"FAILURE"!==e.payment_status?"SUCCESS"!==e.payment_status||p("payment-success"):p("payment-failed",{code:"UNKNOWN_ERROR",message:"Failed getting payment details",error:e})}).catch(e=>{_.error("PAYMENT_DETAILS_CALL_FAILED","Failed fetching payment details",{error:e})})}return e.onMounted(()=>{N(),function(){const e=n.getQueryParam(n.REDIRECT_RESULT_QUERY_STRING),t=n.getQueryParam(n.PAYMENT_ACCEPTOR_ID_QUERY_STRING);e&&(t?D({paymentAcceptorId:t,detailsResult:{redirectResult:decodeURI(e)}}):_.error("INVALID_REDIRECT_RESULT","Redirect result is set but payment acceptor id is missing",{context:{redirectResult:e}}))}()}),e.onBeforeUnmount(()=>{P()}),e.watch(()=>u.paymentMethodOptionResponseEntry,(e,n)=>{t.isEqual(e,n)||N()},{deep:!0}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y.value?(e.openBlock(),e.createBlock(h,{key:0,variant:i.variant},null,8,["variant"])):f.value?(e.openBlock(),e.createBlock(g,{key:1,error:f.value},null,8,["error"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"dropInContainerRef",ref:l},null,512)],64))}}),O=e.defineComponent({__name:"PaymentIntegrationForm",props:{customerId:{type:String},variant:{type:String},context:{type:Object},paymentMethodOptions:{type:Array},countryCode:{type:String},invoiceId:{type:String},amount:{type:Object},selectedOption:{type:String},email:{type:String},name:{type:String},validateOnSubmit:{type:Function},forceStorePaymentMethod:{type:Boolean}},emits:["select","payment-failed","payment-success","ready"],setup(n,{expose:a,emit:o}){const r=n,d=o;a({submit:function(){var e,t;p.value||(y.value=!0,null==(e=r.validateOnSubmit)||e.call(r));null==(t=l.value.get(p.value))||t.submit()}});const{$t:m}=t.useIntl(),u=e.ref(),p=e.computed(()=>{var e,t;return u.value??(null==(t=null==(e=r.paymentMethodOptions[0])?void 0:e.integration.payment_gateway)?void 0:t.variant)}),l=e.ref(new Map),y=e.ref(!1),h=({paymentGatewayVariant:e,paymentMethodType:t})=>{y.value=!1,u.value=e,d("select",{paymentGatewayVariant:e,paymentMethodType:t})},f=e=>t=>{var n;return l.value.set(null==(n=e.integration.payment_gateway)?void 0:n.variant,t)};return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.paymentMethodOptions,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.integration.id},[e.unref(i)(t)?(e.openBlock(),e.createBlock(k,{key:0,ref_for:!0,ref:f(t),context:n.context,"payment-method-option-response-entry":t,"country-code":n.countryCode,"customer-id":n.customerId,variant:n.variant,amount:n.amount,"invoice-id":n.invoiceId,selected:e.unref(c)({selectedIntegration:p.value,paymentMethodOption:t}),"validate-on-submit":n.validateOnSubmit,"force-store-payment-method":n.forceStorePaymentMethod,onSelect:h,onPaymentFailed:o[0]||(o[0]=e=>a.$emit("payment-failed",e)),onPaymentSuccess:o[1]||(o[1]=e=>a.$emit("payment-success")),onReady:o[2]||(o[2]=e=>a.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","validate-on-submit","force-store-payment-method"])):e.unref(s)(t)?(e.openBlock(),e.createBlock(E,{key:1,ref_for:!0,ref:f(t),context:n.context,"payment-method-option-response-entry":t,"country-code":n.countryCode,"customer-id":n.customerId,variant:n.variant,amount:n.amount,"invoice-id":n.invoiceId,selected:e.unref(c)({selectedIntegration:p.value,paymentMethodOption:t}),email:n.email,name:n.name,"validate-on-submit":n.validateOnSubmit,"force-store-payment-method":n.forceStorePaymentMethod,onSelect:h,onPaymentFailed:o[3]||(o[3]=e=>a.$emit("payment-failed",e)),onPaymentSuccess:o[4]||(o[4]=e=>a.$emit("payment-success")),onReady:o[5]||(o[5]=e=>a.$emit("ready"))},null,8,["context","payment-method-option-response-entry","country-code","customer-id","variant","amount","invoice-id","selected","email","name","validate-on-submit","force-store-payment-method"])):e.createCommentVNode("",!0)],64))),128)),y.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$26),{key:0,variant:"error",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)({defaultMessage:"Select a payment method",id:"payment_integration_form.select_payment_method_error",description:"Error shown when no payment method is selected"})),1)]),_:1})):e.createCommentVNode("",!0)],64))}});exports._sfc_main=O;