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

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 (116) hide show
  1. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js → BillingInformation.vue_vue_type_script_setup_true_lang-0_VYW5Wu.js} +1 -1
  2. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-D8ZeVBWO.mjs} +2 -2
  3. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DEqfojR8.mjs} +2 -2
  4. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-zdBaVj-K.js +1 -0
  5. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CFLR4ptB.js +1 -0
  6. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-COnrD4ew.mjs} +1 -1
  7. package/dist/{PaymentHistoryBlock-D_B099M7.mjs → PaymentHistoryBlock-BTRFc4ki.mjs} +1 -1
  8. package/dist/{PaymentHistoryBlock-BiiFJkpT.js → PaymentHistoryBlock-DUeSRR3k.js} +1 -1
  9. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-GeyErAW6.mjs} +1 -1
  10. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-TgZYSSQe.js +1 -0
  11. package/dist/{PaymentIntegrationForm-bfGmfwQT.js → PaymentIntegrationForm-CQntx0TH.js} +1 -1
  12. package/dist/{PaymentIntegrationForm-CkXYj9xs.mjs → PaymentIntegrationForm-DX6kv0_v.mjs} +1 -1
  13. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BhGQB-c9.js +1 -0
  14. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BnMmcoAu.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dkd-Cp8c.mjs} +5 -5
  15. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BuJGxitV.js +1 -0
  16. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-D-BFQZiM.mjs +169 -0
  17. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-B7IOIy-v.mjs} +48 -23
  18. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D-hpJL8I.js +1 -0
  19. package/dist/adyen-BvNyYAg-.js +1 -0
  20. package/dist/{adyen-Bwewy3HC.mjs → adyen-D0yvZvq5.mjs} +1 -1
  21. package/dist/component-By_A1VHh.js +1 -0
  22. package/dist/component-CGfjV_7z.mjs +889 -0
  23. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  24. package/dist/components/BillingInformation/BillingInformation.es.js +4 -4
  25. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  26. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +3 -3
  27. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  28. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +4 -4
  29. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  30. package/dist/components/Invoice/Invoice.es.js +6 -6
  31. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  32. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  33. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  34. package/dist/components/InvoicesList/InvoicesList.es.js +3 -3
  35. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  36. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  37. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  38. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +6 -6
  39. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  40. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +5 -5
  41. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  42. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +5 -5
  43. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  44. package/dist/components/WalletBalances/WalletBalances.es.js +3 -3
  45. package/dist/core/action-request.types.d.ts +10 -1
  46. package/dist/core/index.cjs.js +1 -1
  47. package/dist/core/index.es.js +1 -1
  48. package/dist/{customer-B31QzznT.mjs → customer-Bn6GdxP8.mjs} +1 -1
  49. package/dist/{customer-hDxW1Dbp.js → customer-CGyZojAB.js} +1 -1
  50. package/dist/{en-US-N3CUCsVy.mjs → en-US-BKhsdJQ2.mjs} +15 -7
  51. package/dist/en-US-G2HBHqjq.js +1 -0
  52. package/dist/index.cjs.js +1 -1
  53. package/dist/index.es.js +1 -1
  54. package/dist/invoices-DDeL8tvI.js +1 -0
  55. package/dist/{invoices-DIYPN2j_.mjs → invoices-Rs-QBUGS.mjs} +22 -3
  56. package/dist/{nl-NL-B8U9b85I.mjs → nl-NL-BdeAy1tY.mjs} +25 -13
  57. package/dist/nl-NL-DvVsMfhA.js +1 -0
  58. package/dist/{paymentMethods-C_sdTkSF.js → paymentMethods-BR9w3qy8.js} +1 -1
  59. package/dist/{paymentMethods-67b3UlTZ.mjs → paymentMethods-DOH9-6M1.mjs} +2 -2
  60. package/dist/{payments-DkHhTHto.js → payments-C0vYbn5Q.js} +1 -1
  61. package/dist/{payments-Dq6R37Fz.mjs → payments-DGPENXiS.mjs} +1 -1
  62. package/dist/{registry-Df_26rJy.mjs → registry-7UKVW93Q.mjs} +1 -1
  63. package/dist/{registry-BkViv4tv.js → registry-DrV0jFnM.js} +1 -1
  64. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  65. package/dist/screens/Checkout/Checkout.es.js +265 -376
  66. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  67. package/dist/screens/CustomerOverview/CustomerOverview.es.js +12 -12
  68. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
  69. package/dist/screens/PayInvoice/PayInvoice.es.js +8 -8
  70. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  71. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +758 -717
  72. package/dist/{subscriptions-ClGIr_aS.mjs → subscriptions-BIGqt2N0.mjs} +2 -2
  73. package/dist/{subscriptions-jelITJcX.js → subscriptions-CcpEwubd.js} +1 -1
  74. package/dist/{useActionDispatchProvider-BC57-Ufn.mjs → useActionDispatchProvider-Ca1YbU61.mjs} +1 -1
  75. package/dist/{useActionDispatchProvider-rw9kWeE0.js → useActionDispatchProvider-aqYyqIdb.js} +1 -1
  76. package/dist/{useCustomer-CUcaeQn_.js → useCustomer-D9ZrqMFY.js} +1 -1
  77. package/dist/{useCustomer-Ba9WRtuT.mjs → useCustomer-DUA8Y-2I.mjs} +2 -2
  78. package/dist/{useIncrementalLoading-Cnzh2mAz.mjs → useIncrementalLoading-C1LKdVP8.mjs} +1 -1
  79. package/dist/{useIncrementalLoading-DoTTXM2Y.js → useIncrementalLoading-FNH4k4a3.js} +1 -1
  80. package/dist/{useInvoiceData-BJwwDur7.mjs → useInvoiceData-Bz4a2Mfa.mjs} +3 -3
  81. package/dist/{useInvoiceData-D2jkdmlA.js → useInvoiceData-HNnt3703.js} +1 -1
  82. package/dist/useInvoicesList-DXBTGdcI.js +1 -0
  83. package/dist/{useInvoicesList-CFzAxyae.mjs → useInvoicesList-b2_fiHsc.mjs} +4 -4
  84. package/dist/{useLoadInitialData-5sgImpzc.mjs → useLoadInitialData-Cyp1xpuv.mjs} +1 -1
  85. package/dist/{useLoadInitialData-DjwRHcAH.js → useLoadInitialData-D0t-Lk3k.js} +1 -1
  86. package/dist/{usePaymentMethodOptions-DYO6xr3-.js → usePaymentMethodOptions-DgGDcVeE.js} +1 -1
  87. package/dist/{usePaymentMethodOptions-C2k4npCQ.mjs → usePaymentMethodOptions-r0Opz7BC.mjs} +2 -2
  88. package/dist/{usePaymentMethods-ryN_YohI.js → usePaymentMethods-BHLXXaCa.js} +1 -1
  89. package/dist/{usePaymentMethods-CRWbH48K.mjs → usePaymentMethods-C-NCtOom.mjs} +2 -2
  90. package/dist/{usePayments-Cw5PPEJa.mjs → usePayments-BtByiIMy.mjs} +3 -3
  91. package/dist/{usePayments-DWXPGFvp.js → usePayments-DADpdoI7.js} +1 -1
  92. package/dist/{usePortal-cmE08vYs.mjs → usePortal-CpW3EDD-.mjs} +1 -1
  93. package/dist/{usePortal-CxX4nrE4.js → usePortal-DhaZBAGi.js} +1 -1
  94. package/dist/{useService-BsSEI8DZ.mjs → useService-BcYQRxPS.mjs} +1 -1
  95. package/dist/{useService-Bb9r_sOQ.js → useService-C0h9UlQW.js} +1 -1
  96. package/dist/{useWalletBalanceItems-CpZ1NWPr.js → useWalletBalanceItems-COzKSpmt.js} +1 -1
  97. package/dist/{useWalletBalanceItems-CkDqmk36.mjs → useWalletBalanceItems-DKz-2vUy.mjs} +3 -3
  98. package/dist/{useWatchDebounced-2ZLnfgvG.js → useWatchDebounced-C_YxgoQ6.js} +1 -1
  99. package/dist/{useWatchDebounced-D1xuIX6_.mjs → useWatchDebounced-Zmxd6InB.mjs} +8 -4
  100. package/dist/{vendor-ui-5pJF5KBP.js → vendor-ui-1SHma7t1.js} +1 -1
  101. package/dist/{vendor-ui-C0K3osvz.mjs → vendor-ui-CdOX_IS-.mjs} +42 -42
  102. package/package.json +1 -1
  103. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +0 -1
  104. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +0 -1
  105. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +0 -1
  106. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CiyyUp4z.js +0 -1
  107. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs +0 -50
  108. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +0 -1
  109. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +0 -1
  110. package/dist/adyen-R6aSZ0Yf.js +0 -1
  111. package/dist/component-BOqPDAVk.js +0 -1
  112. package/dist/component-Djrf1L-Z.mjs +0 -889
  113. package/dist/en-US-CgPY97Vq.js +0 -1
  114. package/dist/invoices-DzkA1jDc.js +0 -1
  115. package/dist/nl-NL-qMRaTRrM.js +0 -1
  116. package/dist/useInvoicesList-CaBCGs4h.js +0 -1
@@ -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-CaBCGs4h.js"),s=require("../../usePortal-CxX4nrE4.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js"),i=require("../../useCustomer-CUcaeQn_.js"),a=require("../../usePaymentMethods-ryN_YohI.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js"),l=require("../../useLoadInitialData-DjwRHcAH.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js"),m=require("../../paymentMethods-C_sdTkSF.js"),v=require("../../useService-Bb9r_sOQ.js"),d=require("../../useWalletBalanceItems-CpZ1NWPr.js"),p=require("../../component-BOqPDAVk.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,_=i.useCustomer({customerId:f}),g=o.useInvoicesList({customerId:f,batchSize:5}),h=n.useSubscriptionsList({customerId:f,batchSize:2}),b=a.usePaymentMethods({customerId:f}),S=function({customerId:e,amount:t}){const{getPaymentMethodOptions:r}=m.createPaymentMethodsService(),{data:o,execute:s,error:n,apiStatus:i,isPending:a}=v.useService({initialValue:[],service:async()=>(await r({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:n,apiStatus:i,items:o,fetch:s,isPending:a}}({customerId:f}),j=d.useCustomerWalletBalances({customerId:f}),C=d.useWalletBalanceItems(j.walletBalances),{isLoading:w}=l.useLoadInitialData(_.get.execute(),g.fetchInitial(),h.fetchInitial(),b.fetchAll(),S.fetch(),j.fetch());return(s,i)=>(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(d._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}))}}),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=>(r,o)=>{var s,n,i,a;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==(a=null==(i=t.branding)?void 0:i.colors)?void 0:a.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(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
+ 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,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
3
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
4
- import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-CFzAxyae.mjs";
5
- import { u as usePortal } from "../../usePortal-cmE08vYs.mjs";
6
- import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs";
7
- import { u as useCustomer } from "../../useCustomer-Ba9WRtuT.mjs";
8
- import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
9
- import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs";
10
- import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
11
- import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs";
12
- import { c as createPaymentMethodsService } from "../../paymentMethods-67b3UlTZ.mjs";
13
- import { u as useService } from "../../useService-BsSEI8DZ.mjs";
14
- import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-CkDqmk36.mjs";
15
- import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.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";
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-BOqPDAVk.js"),n=require("../../vendor-ui-5pJF5KBP.js"),o=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CiyyUp4z.js"),r=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),i=require("../../adyen-R6aSZ0Yf.js"),c=require("../../useLoadInitialData-DjwRHcAH.js"),l=require("../../usePayments-DWXPGFvp.js"),s=require("../../usePaymentMethodOptions-DYO6xr3-.js"),u=require("../../usePaymentMethods-ryN_YohI.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))}}),m={key:0},y=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 y(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const d=()=>{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$13),{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),{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),{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$1),{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:d,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$12),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:y},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),d=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:m}=l.usePayments(),{fetchInitial:y}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:d,get:v}=s.usePaymentMethodOptions(),{isLoading:f}=c.useLoadInitialData((async()=>{const e=await r();await v({customerId:e.customer.id,amount:e.open_invoice_amount})})(),y(),m(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(d),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(d,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(y,{"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-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,14 +1,14 @@
1
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-Djrf1L-Z.mjs";
3
- import { u as useIntl, x as formatAmount, e as _sfc_main$4, y as _sfc_main$6, _ as _sfc_main$8, l as _sfc_main$9, b as _sfc_main$a, z as _sfc_main$c, v as getCustomerCountry } from "../../vendor-ui-C0K3osvz.mjs";
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
4
  import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
5
- import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BnMmcoAu.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Dkd-Cp8c.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-Bwewy3HC.mjs";
8
- import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
9
- import { u as useInvoice, a as usePayments } from "../../usePayments-Cw5PPEJa.mjs";
10
- import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-C2k4npCQ.mjs";
11
- import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.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";
12
12
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
13
  __name: "PayButton",
14
14
  props: {
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-5pJF5KBP.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js"),a=require("../../paymentMethods-C_sdTkSF.js"),i=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),r=require("../../component-BOqPDAVk.js"),o=require("../../useActionDispatchProvider-rw9kWeE0.js"),s=require("../../usePortal-CxX4nrE4.js"),c={id:"ppsu_hwDeeN0vhvcVCsAIdp1G",pricing_plan_schedule_infos:[{id:"ppsc_IwDeeN0vhvcVCIAQdq1a",pricing_plan_version_id:"ppve_MwDeeN0vhvcEuaADdd1f",start_at:"2026-04-05T22:00:00Z",pricing_plan_version:{pricing_categories:[{product_category:{id:"proc_iwDeeN0vhphn6VAtBD1w",name:"Add ons"},display_order:1,pricings:[{id:"pric_ywDeeN0vhvcPguAadr1V",name:"Integration setup",products:[{name:"Integration setup"}],items:[{id:"prii_NwDeeN0vhvcPguAxds12",product_items:[{name:"Rillet integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{fixed_amount:{quantity:"5000.00",currency:"EUR"}}]}]},{id:"prii_IwDeeN0vhvcPgvAsdS1Q",product_items:[{name:"Attio integration setup",model_type:"ONE_OFF"}],configs:[{on_demand:!0,bands:[{amount:{quantity:"50000.00",currency:"EUR"}}]}]}]}],pricing_groups:[]}]}}]},l=e=>{var t,n;return((null==(t=e.configs)?void 0:t.some(e=>e.on_demand))??!1)&&((null==(n=e.product_items)?void 0:n.some(e=>"ONE_OFF"===e.model_type))??!1)},d=e=>{var t,n;return{id:e.id,name:null==(n=null==(t=e.product_items)?void 0:t[0])?void 0:n.name,items:[{id:e.id,configs:(e.configs??[]).map(e=>({bands:(e.bands??[]).map(e=>({fixed_amount:e.fixed_amount??e.amount}))}))}]}},p=e=>(e.items??[]).filter(l).map(d),u=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(p),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(p)})).filter(e=>e.pricings.length>0)}),m=Object.fromEntries(c.pricing_plan_schedule_infos.flatMap(e=>e.pricing_plan_version.pricing_categories).flatMap(e=>e.pricings).flatMap(e=>e.items).filter(l).map(e=>{var t,n,a,i,r;const o=null==(a=null==(n=null==(t=e.configs)?void 0:t[0])?void 0:n.bands)?void 0:a[0],s=(null==(i=null==o?void 0:o.fixed_amount)?void 0:i.quantity)??(null==(r=null==o?void 0:o.amount)?void 0:r.quantity)??"0";return[e.id,parseFloat(s)]})),_=e=>({quantity:e.toFixed(2),currency:"EUR"}),g={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},v={id:"intg_zwDeeN0vgXgeM6APNW1g",object_type:"INTEGRATION",reference:"mock-payment-integration",name:"Mock payment integration",description:"Mock payment integration",status:"ACTIVE",type:"PAYMENT_GATEWAY"},y={class:"sv-order-summary__items mb-3 flex flex-col gap-2"},f={class:"sv-order-summary__tax flex flex-col gap-1 border-t pt-3"},h={class:"sv-order-summary__subtotal flex items-center justify-between"},b={class:"sv-order-summary__tax-row flex items-center justify-between"},k={class:"sv-order-summary__total flex items-center justify-between border-t pt-3"},x=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},isPending:{type:Boolean}},setup(n){const a=n,{$t:i}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,n,a,i,r,o;return null==(o=null==(r=null==(i=null==(a=null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.configs)?void 0:a[0])?void 0:i.bands)?void 0:r[0])?void 0:o.fixed_amount};return(a,s)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{class:"sv-order-summary sv-upgrade-subscription__order-summary"},{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-order-summary__title mb-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"})),1)]),_:1}),r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-sm",shade:"lighter",class:"sv-order-summary__empty"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Select add-ons to see pricing.",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no add-ons are selected in the order summary"})),1)]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.selectedPricings,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"sv-order-summary__item flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"sv-order-summary__item-name"},{default:e.withCtx(()=>{var t,a;return[e.createTextVNode(e.toDisplayString(n.name??(null==(a=null==(t=n.products)?void 0:t[0])?void 0:a.name)),1)]}),_:2},1024),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs",shade:"lighter",class:"sv-order-summary__item-meta"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})]),o(n)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,variant:"body-sm",class:"sv-order-summary__item-price"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(o(n))),1)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),(null==(a=n.invoice)?void 0:a.tax_summary)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",f,[e.createElementVNode("div",h,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total excluding taxes",id:"upgrade_subscription.order_summary.subtotal_label",description:"Subtotal before tax label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.base_amount)),1)]),_:1})]),e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Taxes",id:"upgrade_subscription.order_summary.taxes_label",description:"Tax amount label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.tax_amount)),1)]),_:1})])]),e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Total due today",id:"upgrade_subscription.order_summary.total_label",description:"Total amount due today label in order summary"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t.formatAmount)(n.invoice.tax_summary.total_amount)),1)]),_:1})])],64)):e.createCommentVNode("",!0)],64))]}),_:1}))}}),N=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean}},emits:["toggle"],setup(a,{emit:i}){const r=a,o=i,{$t:s}=t.useIntl(),c=e.computed(()=>{var e,t;return r.pricing.name??(null==(t=null==(e=r.pricing.products)?void 0:e[0])?void 0:t.name)??"—"}),l=e.computed(()=>{var e,t,n,a,i,o;return null==(o=null==(i=null==(a=null==(n=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:n[0])?void 0:a.bands)?void 0:i[0])?void 0:o.fixed_amount}),d=e.computed(()=>l.value?`${t.formatAmount(l.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(i,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"content-background":a.selected?"none":"gray",class:e.normalizeClass({"!bg-white":a.selected})},{default:e.withCtx(()=>[e.createVNode(n._sfc_main,{name:c.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:1,color:"primary",size:"sm","icon-prefix":"add",onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1}))]),_:1},8,["name","description"])]),_:1},8,["content-background","class"]))}}),w={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},B=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array}},emits:["toggle"],setup(n,{emit:a}){const i=n,r=a,o=e.computed(()=>[...i.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0)));return(a,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((null==(t=a.product_category)?void 0:t.name)??a.name),1)]}),_:2},1024),e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(N,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[0]||(i[0]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(N,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:n.selectedPricingIds.includes(t.id),onToggle:i[1]||(i[1]=e=>r("toggle",e))},null,8,["pricing","selected"]))),128))],64))),128))])]))),128))}}),V={class:"sv-payment-method-picker flex flex-col gap-4"},C={key:0,class:"sv-payment-method-picker__saved flex flex-col gap-2"},E={class:"sv-payment-method-picker__options flex flex-col gap-1"},S={key:1,class:"sv-payment-method-picker__new flex flex-col gap-2"},T={class:"sv-payment-method-picker__options flex flex-col gap-1"},A={class:"sv-payment-method-picker__option-content flex items-center gap-3"},I={key:0,class:"sv-payment-method-picker__option-icon flex h-9 w-9 shrink-0 items-center gap-0.5"},D=["src","alt"],M={key:1,class:"sv-payment-method-picker__option-icon flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},P=["src","alt"],O={key:2,class:"sv-payment-method-picker__loading flex flex-col gap-1"},j=e.defineComponent({__name:"PaymentMethodPicker",props:{customerId:{type:String},subscriptionId:{type:String},selectedId:{type:String}},emits:["select"],setup(n,{emit:i}){const r=n,o=i,{$t:s}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),l=e.ref([]),d=e.ref([]),p=e.ref(!1),u=e.computed(()=>d.value.flatMap(e=>e.options??[])),m=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,_=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[..._.filter(t=>e.includes(t)),...e.filter(e=>!_.includes(e))].slice(0,4)};return e.onMounted(async()=>{p.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});l.value=e.data,d.value=[{payment_acceptor:g,integration:v,options:[{name:"iDeal",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"iDEAL | Wero",type:"ideal"}},{name:"Cards",payment_method_variant:"CARD",payment_gateway_variant:"ADYEN",adyen:{name:"Cards",type:"scheme",brands:["maestro","accel","amex","cup","diners","hipercard","jcb","mc","nyce","pulse","star","visa"]}},{name:"PayPal",payment_method_variant:"DIGITAL_WALLET",payment_gateway_variant:"ADYEN",adyen:{name:"PayPal",type:"paypal",configuration:{intent:"capture"}}},{name:"Trustly",payment_method_variant:"ONLINE_BANKING",payment_gateway_variant:"ADYEN",adyen:{name:"Trustly - Instant Bank Payment",type:"trustly"}}]}]}finally{p.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",V,[l.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-payment-method-picker__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Saved payment methods",id:"upgrade_subscription.payment_picker.saved_title",description:"Heading for the saved payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:a.id,"content-background":n.selectedId===a.id?"none":"gray",class:e.normalizeClass([{"sv-payment-method-picker__option--selected !bg-white":n.selectedId===a.id},"sv-payment-method-picker__option cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$5),{class:"sv-payment-method-picker__option-content","payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value.length>0?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"sv-payment-method-picker__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"All payment methods",id:"upgrade_subscription.payment_picker.all_title",description:"Heading for the all payment methods section in the upgrade subscription payment picker"})),1)]),_:1}),e.createElementVNode("div",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,a=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:a.adyen.type,"content-background":n.selectedId===a.adyen.type?"none":"gray",class:e.normalizeClass([{"sv-payment-method-picker__option--selected !bg-white":n.selectedId===a.adyen.type},"sv-payment-method-picker__option cursor-pointer"]),onClick:e=>o("select",a.adyen.type)},{default:e.withCtx(()=>{return[e.createElementVNode("div",A,["scheme"===a.adyen.type?(e.openBlock(),e.createElementBlock("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y(a.adyen.brands),t=>(e.openBlock(),e.createElementBlock("img",{key:t,src:m(t),alt:t,class:"h-5 w-auto rounded"},null,8,D))),128))])):(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("img",{src:(n=a.adyen.type,`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/${n}.svg`),alt:a.name,class:"h-9 w-9 object-contain"},null,8,P)])),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",class:"sv-payment-method-picker__option-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("div",O,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}}),L={class:"flex gap-1"},F=e.defineComponent({__name:"Kpi",props:{icon:{type:null},kpi:{type:String}},setup:n=>(a,i)=>(e.openBlock(),e.createElementBlock("div",L,[e.createVNode(e.unref(t._sfc_main$6),{icon:n.icon,size:"xs"},null,8,["icon"]),e.createVNode(e.unref(t._sfc_main),{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.kpi),1)]),_:1})]))});const $={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},q={class:"sv-upgrade-subscription__success-body flex flex-col items-center py-10"},R=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(n){const a=n,{$t:l}=t.useIntl(),{dispatchAction:d}=o.useActionDispatchProvider(),{chargeOnDemandPricingItems:p}=function(){const e=r.createRequestService(),t=r.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:n,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${n}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:i,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})}}}(),g=s.usePortal(),v=r.useLogger(),y=e.computed(()=>g.value.customer_id),f=e.ref([]),h=e.ref(void 0),b=e.ref(!1),k=e.ref(!1),N=e.ref(void 0),w=e.ref(!1),V=e.computed(()=>(e=>{var t;const n=Date.now(),a=c.pricing_plan_schedule_infos,i=a.find(e=>{const t=Date.parse(e.start_at);return Number.isFinite(t)&&t<=n})??a[0],r=((null==(t=null==i?void 0:i.pricing_plan_version)?void 0:t.pricing_categories)??[]).map(u).filter(e=>{var t,n;return((null==(t=e.pricings)?void 0:t.length)??0)>0||((null==(n=e.pricing_groups)?void 0:n.length)??0)>0});return{pricing_plan_subscription_id:e||c.id,pricing_plan_schedule_id:(null==i?void 0:i.id)??"",pricing_plan_version_id:(null==i?void 0:i.pricing_plan_version_id)??"",billing_period:{type:"MONTH",value:1},billing_currency:"EUR",pricing_categories:r}})(a.configuration.subscriptionId)),C=e.computed(()=>V.value.pricing_categories),E=e.computed(()=>C.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),S=e.computed(()=>E.value.filter(e=>f.value.includes(e.id)));let T;e.watch(f,e=>{if(clearTimeout(T),0===e.length)return N.value=void 0,void(w.value=!1);w.value=!0,T=setTimeout(()=>{N.value=(e=>{const t=e.reduce((e,t)=>e+(m[t]??0),0),n=Math.round(.21*t*100)/100,a=t+n;return{invoice:{tax_summary:{base_amount:_(t),tax_amount:_(n),total_amount:_(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,w.value=!1},400)});const A=e=>{f.value.includes(e)?f.value=f.value.filter(t=>t!==e):f.value=[...f.value,e]},I=e.computed(()=>f.value.length>0&&!!h.value),D=e.ref(void 0),M=async()=>{if(I.value){b.value=!0,D.value=void 0;try{const e=S.value.map(e=>{var t,n;return null==(n=null==(t=e.items)?void 0:t[0])?void 0:n.id}).filter(e=>!!e),t=h.value&&h.value.startsWith("pmet_")?h.value:void 0,n=await p({scheduleId:V.value.pricing_plan_schedule_id,pricingPlanVersionId:V.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?k.value=!0:d({action:"pay-invoice",data:{invoiceId:n.id}})}catch(e){v.error("PURCHASE_FAILED","Failed to complete upgrade subscription purchase",{},e),D.value=l({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})}finally{b.value=!1}}};return(a,r)=>k.value?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(t._sfc_main$1),{class:"sv-upgrade-subscription__success"},{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(e.unref(t._sfc_main$6),{icon:"check_circle",class:"sv-upgrade-subscription__success-icon text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"span",class:"sv-upgrade-subscription__success-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful add-on purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{variant:"body-sm",shade:"lighter",tag:"span",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Your add-ons have been activated.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful add-on purchase"})),1)]),_:1})])]),_:1})])):(e.openBlock(),e.createBlock(e.unref(i.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{content:e.withCtx(()=>[C.value.length>0?(e.openBlock(),e.createBlock(B,{key:0,class:"sv-upgrade-subscription__pricing-list",categories:C.value,"selected-pricing-ids":f.value,onToggle:A},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"No on-demand add-ons are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no on-demand add-ons available for the subscription"})),1)]),_:1})),e.createVNode(e.unref(t._sfc_main$24),{spacing:"sm"}),e.createVNode(j,{class:"sv-upgrade-subscription__payment-method-picker","customer-id":y.value,"subscription-id":n.configuration.subscriptionId,"selected-id":h.value,onSelect:r[0]||(r[0]=e=>h.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(x,{class:"sv-upgrade-subscription__order-summary","selected-pricings":S.value,invoice:N.value,"is-pending":w.value},null,8,["selected-pricings","invoice","is-pending"]),D.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,class:"sv-upgrade-subscription__error sv-error",title:D.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase full-width",type:"button",disabled:!I.value||b.value,loading:b.value,onClick:M},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(t._sfc_main),{tag:"div",variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__trust-indicator flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode(F,{icon:"lock",kpi:e.unref(l)({defaultMessage:"Secure and encrypted payments",id:"upgrade_subscription.kpi.encrypted_payments.label",description:"The encrypted payments KPI shown on the upgrade subscription page"})},null,8,["kpi"])]),_:1})]),_:1}))}}),z=e.defineComponent({__name:"UpgradeSubscription.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=>(n,a)=>{var i,o,s,c;return e.openBlock(),e.createBlock(r._sfc_main,{"custom-element-name":e.unref(Y),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(i=t.branding)?void 0:i.colors)?void 0:o.primary,"secondary-color":null==(c=null==(s=t.branding)?void 0:s.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(R,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),U=r.defineCustomElement(z),Y=r.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=Y,exports.SolvimonUpgradeSubscription=U,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(Y)||customElements.define(Y,U)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-1SHma7t1.js"),i=require("../../SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-BuJGxitV.js"),a=require("../../ContentWithAsideLayout-B5B8Kwaw.js"),n=require("../../component-By_A1VHh.js"),r=require("../../useActionDispatchProvider-aqYyqIdb.js"),o=require("../../usePortal-DhaZBAGi.js"),s=require("../../subscriptions-CcpEwubd.js"),l=require("../../customer-CGyZojAB.js"),c=require("../../paymentMethods-BR9w3qy8.js"),d=require("../../invoices-DDeL8tvI.js"),u=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BhGQB-c9.js"),p=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),m=require("../../adyen-BvNyYAg-.js"),g=require("../../useViewport-CKRY1CKR.js"),v={class:"sv-order-summary__body grid grid-cols-1 gap-1"},_={class:"flex items-center justify-center gap-2 px-3 py-5"},f={class:"flex flex-row gap-3 px-3 py-2"},y={class:"grow"},h={class:"sv-order-summary__items grid grid-cols-1 gap-1"},b={class:"flex flex-row gap-2 px-3 py-2"},w={class:"flex flex-row gap-3 px-3 py-2"},k={class:"grow"},x={class:"flex flex-row gap-2 px-3 py-2"},N=e.defineComponent({__name:"UpgradeOrderSummary",props:{selectedPricings:{type:Array},invoice:{type:Object},loading:{type:Boolean}},setup(i){const a=i,{$t:n}=t.useIntl(),r=e.computed(()=>0===a.selectedPricings.length),o=e=>{var t,i,a,n,r;const o=null==(r=null==(n=null==(a=null==(i=null==(t=e.items)?void 0:t[0])?void 0:i.configs)?void 0:a[0])?void 0:n.bands)?void 0:r[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)},s=e.computed(()=>{var e,t,i,r,o,s,c,d;const u=null==(r=null==(i=null==(t=null==(e=a.invoice)?void 0:e.periods)?void 0:t[0])?void 0:i.groups)?void 0:r[0],p=null==(o=null==u?void 0:u.products)?void 0:o[0],m=l.value.length;return{title:(null==p?void 0:p.name)??(null==(s=null==u?void 0:u.product_category)?void 0:s.name)??(null==(c=l.value[0])?void 0:c.description),subtitle:m>1?n({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.item_count",description:"Subtitle shown below the product name when multiple one-off items are selected"},{count:String(m)}):null==(d=l.value[0])?void 0:d.description}}),l=e.computed(()=>{var e;return((null==(e=a.invoice)?void 0:e.periods)??[]).flatMap((e,t)=>e.groups.flatMap((e,i)=>(e.lines??[]).map((a,n)=>{var r,o,s,l,c;return{key:`${t}-${i}-${n}`,description:a.description??(null==(o=null==(r=a.product_items)?void 0:r[0])?void 0:o.name)??(null==(l=null==(s=e.products)?void 0:s[0])?void 0:l.name)??(null==(c=e.product_category)?void 0:c.name)??"—",amount:a.amount_excluding_tax}})))}),c=e.computed(()=>a.selectedPricings.map(e=>{var t,i;return{key:e.id,description:e.name??(null==(i=null==(t=e.products)?void 0:t[0])?void 0:i.name)??"—",amount:o(e)}})),d=e.computed(()=>n({defaultMessage:"Order summary",id:"upgrade_subscription.order_summary.title",description:"Title for the order summary section on the upgrade subscription page"}));return(a,o)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{class:"sv-order-summary sv-upgrade-subscription__order-summary","no-border":"","no-spacing":"","content-background":"none",title:d.value},{default:e.withCtx(()=>[e.createElementVNode("div",v,[r.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__empty-state"},{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(t._sfc_main$6),{icon:"shopping_cart",class:"text-gray-500"}),e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",weight:"semibold",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Select your items",id:"upgrade_subscription.order_summary.empty_state",description:"Placeholder shown when no items are selected in the order summary"})),1)]),_:1})])]),_:1})):i.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value.title?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.title),1)]),_:1}),s.value.subtitle?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value.subtitle),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",h,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",b,[e.createVNode(e.unref(t._sfc_main$1),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128))]),e.createVNode(e.unref(t._sfc_main),{class:"sv-order-summary__totals"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$17),{class:"sv-order-summary__invoice-preview",variant:"without-products",invoice:i.invoice,"is-customer-facing":""},null,8,["invoice"])]),_:1})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:0,"no-spacing":"",class:"sv-order-summary__subscription"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",k,[e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",weight:"semibold","no-spacing":""},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"Selected items",id:"upgrade_subscription.order_summary.selected_items_title",description:"Temporary order summary title shown while the invoice preview is loading"}):null==(t=c.value[0])?void 0:t.description),1)]}),_:1}),e.createVNode(e.unref(t._sfc_main$1),{variant:"body-xs",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value.length>1?e.unref(n)({defaultMessage:"{count} items",id:"upgrade_subscription.order_summary.selected_item_count",description:"Temporary order summary subtitle shown while the invoice preview is loading"},{count:String(c.value.length)}):e.unref(n)({defaultMessage:"one-off",id:"upgrade_subscription.order_summary.one_off_label",description:"One-off payment label next to a line item in order summary"})),1)]),_:1})])])]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,i=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:i.key,"no-spacing":"",class:"sv-order-summary__item"},{default:e.withCtx(()=>[e.createElementVNode("div",x,[e.createVNode(e.unref(t._sfc_main$1),{tag:"span",variant:"body-xs",class:"grow"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.description),1)]),_:2},1024),i.amount?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,tag:"span",variant:"body-xs","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$11),{value:i.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1024))),128)),i.loading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,class:"sv-order-summary__totals"},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("div",{class:"grid grid-cols-1 gap-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-40 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-4 w-16 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-4 w-20 animate-pulse rounded bg-gray-100"})]),e.createElementVNode("div",{class:"border-t border-gray-200 pt-2"},[e.createElementVNode("div",{class:"flex items-center justify-between gap-4"},[e.createElementVNode("div",{class:"h-5 w-36 animate-pulse rounded bg-gray-100"}),e.createElementVNode("div",{class:"h-5 w-24 animate-pulse rounded bg-gray-100"})])])],-1)])]),_:1})):e.createCommentVNode("",!0)],64))])]),_:1},8,["title"]))}}),V=e.defineComponent({__name:"OnDemandPricingRow",props:{pricing:{type:Object},selected:{type:Boolean},loading:{type:Boolean}},emits:["toggle"],setup(a,{emit:n}){const r=a,o=n,{$t:s}=t.useIntl(),l=e.computed(()=>{var e,t,i,a,n,o;return r.pricing.name??(null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.product_items)?void 0:i[0])?void 0:a.name)??(null==(o=null==(n=r.pricing.products)?void 0:n[0])?void 0:o.name)??"—"}),c=e.computed(()=>{var e,t,i,a,n;const o=null==(n=null==(a=null==(i=null==(t=null==(e=r.pricing.items)?void 0:e[0])?void 0:t.configs)?void 0:i[0])?void 0:a.bands)?void 0:n[0];return(null==o?void 0:o.fixed_amount)??(null==o?void 0:o.amount)}),d=e.computed(()=>c.value?`${t.formatAmount(c.value)} ${s({defaultMessage:"one-off",id:"on_demand_pricing_row.one_off_label",description:"One-off label shown next to the price in an on-demand pricing row"})}`:"");return(n,r)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"content-background":a.selected?"none":"gray","content-classes":a.selected?"!border-primary-600 ring-1 ring-primary-600":void 0},{default:e.withCtx(()=>[e.createVNode(i._sfc_main,{name:l.value,description:d.value},{default:e.withCtx(()=>[a.selected?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:0,color:"gray",variant:"outline",size:"sm","icon-prefix":"remove_shopping_cart",loading:a.loading,onClick:r[0]||(r[0]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Remove",id:"on_demand_pricing_row.remove_button_label",description:"Label for the remove button in an on-demand pricing row"})),1)]),_:1},8,["loading"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$3),{key:1,color:"primary",size:"sm","icon-prefix":"add",loading:a.loading,onClick:r[1]||(r[1]=e=>o("toggle",a.pricing.id))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({defaultMessage:"Add to cart",id:"on_demand_pricing_row.add_to_cart_button_label",description:"Label for the add to cart button in an on-demand pricing row"})),1)]),_:1},8,["loading"]))]),_:1},8,["name","description"])]),_:1},8,["content-background","content-classes"]))}}),B={class:"sv-pricing-list__items grid grid-cols-1 gap-1"},C=e.defineComponent({__name:"OnDemandPricingList",props:{categories:{type:Array},selectedPricingIds:{type:Array},loadingPricingId:{type:String}},emits:["toggle"],setup(i,{emit:a}){const n=i,r=a,{$t:o}=t.useIntl(),s=e.computed(()=>[...n.categories].sort((e,t)=>(e.display_order??0)-(t.display_order??0))),l=e=>{var t;return(null==(t=e.product_category)?void 0:t.name)??e.name??o({defaultMessage:"Items",id:"on_demand_pricing_list.category_fallback_title",description:"Fallback title for the selectable pricing items when no product category name is available"})};return(a,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id??a.display_order,class:"sv-pricing-list__category flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main$1),{variant:"heading-3",tag:"h2",class:"sv-pricing-list__category-title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l(a)),1)]),_:2},1024),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[0]||(n[0]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricing_groups,a=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.id},[e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",weight:"semibold",class:"sv-pricing-list__group-title mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.pricings,t=>(e.openBlock(),e.createBlock(V,{key:t.id,class:"sv-pricing-list__row",pricing:t,selected:i.selectedPricingIds.includes(t.id),loading:i.loadingPricingId===t.id,onToggle:n[1]||(n[1]=e=>r("toggle",e))},null,8,["pricing","selected","loading"]))),128))],64))),128))])]))),128))}});const E={key:0,class:"sv-upgrade-subscription sv-root sv-screen sv-upgrade-subscription--purchased flex h-full items-center justify-center p-8"},S={class:"flex flex-col items-center text-center"},T={class:"sv-upgrade-subscription__header"},P={key:1,class:"sv-upgrade-subscription__pricing-list"},I={key:2,class:"sv-upgrade-subscription__loading p-4"},$={class:"sv-upgrade-subscription__payment-methods"},M={key:0,class:"sv-upgrade-subscription__payment-methods-body"},D={key:1,class:"sv-upgrade-subscription__payment-form"},j={class:"sv-upgrade-subscription__payment-method-picker"},O={class:"sv-upgrade-subscription__order-summary"},A={class:"flex flex-col gap-2"},F=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(v){const _=v,{$t:f}=t.useIntl(),{getSubscription:y}=s.createSubscriptionsService(),{getCustomer:h}=l.createCustomerService(),{getOnDemandPricingItems:b}=function(){const e=n.createRequestService(),t=n.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:i,pricingPlanVersionId:a,pricingItemIds:n,startAt:r,finalizeImmediately:o=!0,paymentMethodId:s}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/charge-on-demand-pricing-items`,options:{method:"POST"},data:{...a?{pricing_plan_version_id:a}:{},pricing_item_ids:n,...r?{start_at:r}:{},finalize_immediately:o,...s?{payment_method_id:s}:{}}})},getOnDemandPricingItems:function({scheduleId:i}){return e({url:`${t.apiUrls.config}/portal/pricing-plan-schedules/${i}/on-demand-pricing-items`})}}}(),{getPaymentMethodOptions:w}=c.createPaymentMethodsService(),{previewChargeOnDemandPricingItems:k}=d.createInvoicesService(),x=o.usePortal(),V=n.useLogger(),{dispatchAction:B}=r.useActionDispatchProvider(),{isMobileViewport:F}=g.useViewport(),L=e.computed(()=>x.value.customer_id),q={currency:"EUR",quantity:"0"},U=e.ref([]),R=e.ref(!1),z=e.ref([]),W=e.ref([]),H=e.ref(!1),Y=e.ref(!1),G=e.ref(!1),K=e.ref(void 0),Z=e.ref(void 0),J=e.ref(),Q=e.ref(void 0),X=e.ref(void 0),ee=e.ref(void 0),te=e.ref(!1),ie=(e,t=[])=>t.find(t=>t.id===e.id),ae=(e,t)=>(e.items??[]).map(i=>{var a,n,r,o,s,l,c;const d=null==(a=null==t?void 0:t.items)?void 0:a.find(e=>e.id===i.id),u=i.product_items??(null==d?void 0:d.product_items);return{...e,id:i.id,name:(null==(r=null==(n=i.product_items)?void 0:n[0])?void 0:r.name)??(null==(s=null==(o=null==d?void 0:d.product_items)?void 0:o[0])?void 0:s.name)??e.name??(null==t?void 0:t.name)??(null==(c=null==(l=null==t?void 0:t.products)?void 0:l[0])?void 0:c.name),products:e.products??(null==t?void 0:t.products),items:[{...i,product_items:u}]}}),ne=async()=>{var e,i,a;H.value=!0,Z.value=void 0;try{const n=await(async()=>{const e=[...(await y({id:_.configuration.subscriptionId,expanded:!0})).pricing_plan_schedule_infos??[]].sort((e,t)=>Date.parse(t.start_at)-Date.parse(e.start_at)),t=Date.now(),i=e.find(e=>{var i;const a=(null==(i=e.pricing_plan_schedule)?void 0:i.type)??e.type,n=Date.parse(e.start_at),r=e.end_at?Date.parse(e.end_at):void 0,o=Number.isFinite(n)&&n<=t,s=void 0===r||!Number.isFinite(r)||r>t;return"DEFAULT"===a&&o&&s});if(!(null==i?void 0:i.id))throw new Error("No pricing plan schedule found for subscription");return i})();Q.value=n.id;const[r,o,s]=await Promise.all([b({scheduleId:Q.value}),w({customerId:L.value}),h(L.value)]);z.value=(i=r.pricing_categories??[],a=(null==(e=n.pricing_plan_version)?void 0:e.pricing_categories)??[],i.map(e=>{const t=((e,t)=>t.find(t=>t.product_category_id===e.product_category_id||t.id===e.id))(e,a);return{...e,name:e.name??(null==t?void 0:t.name),product_category:e.product_category??(null==t?void 0:t.product_category),pricings:(e.pricings??[]).flatMap(e=>ae(e,ie(e,null==t?void 0:t.pricings))),pricing_groups:(e.pricing_groups??[]).map(e=>{var i;const a=null==(i=null==t?void 0:t.pricing_groups)?void 0:i.find(t=>t.id===e.id);return{...e,name:e.name??(null==a?void 0:a.name),pricings:(e.pricings??[]).flatMap(e=>ae(e,ie(e,null==a?void 0:a.pricings)))}})}})),W.value=o,ee.value=t.getCustomerCountry(s)}catch(n){V.error("INITIAL_DATA_LOAD_FAILED","Failed to load on-demand pricing items",{},n),Z.value=f({defaultMessage:"Unable to load items. Please try again later.",id:"upgrade_subscription.load_error",description:"Error message shown when the one-off items cannot be loaded on the upgrade subscription page"})}finally{H.value=!1}};e.onMounted(()=>{ne()});const re=e.computed(()=>z.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),oe=e.computed(()=>re.value.filter(e=>U.value.includes(e.id))),se=e.computed(()=>oe.value.flatMap(e=>e.items??[]).map(e=>e.id).filter(e=>!!e)),le=e.computed(()=>{var e,t;return null==(t=null==(e=X.value)?void 0:e.tax_summary)?void 0:t.total_amount}),ce=e.computed(()=>le.value??q);let de,ue=0;e.watch([se,Q],([e,t])=>{clearTimeout(de);const i=++ue;if(ve.value=void 0,!t||0===e.length)return X.value=void 0,Y.value=!1,void(K.value=void 0);Y.value=!0,de=setTimeout(()=>{k({pricingPlanScheduleId:t,pricingItemIds:e}).then(e=>{i===ue&&(X.value=e)}).catch(e=>{i===ue&&(V.error("INVOICE_PREVIEW_FAILED","Failed to load charge-on-demand invoice preview",{},e),ve.value=f({defaultMessage:"Unable to calculate the total. Please try again.",id:"upgrade_subscription.preview_error",description:"Error message shown when the upgrade subscription invoice preview cannot be loaded"}),X.value=void 0)}).finally(()=>{i===ue&&(Y.value=!1,K.value=void 0)})},400)});const pe=e.computed(()=>{if(!Q.value)throw new Error("Cannot create charge-on-demand authorization context without a schedule.");return{type:"CHARGE_ON_DEMAND",charge_on_demand:{pricing_plan_schedule_id:Q.value,pricing_items:se.value.map(e=>({pricing_item_id:e}))}}}),me=e=>{K.value=e,U.value.includes(e)?U.value=U.value.filter(t=>t!==e):U.value=[...U.value,e]},ge=e.computed(()=>se.value.length>0&&!!Q.value&&!!le.value&&!Y.value&&W.value.length>0),ve=e.ref(void 0),_e=async()=>{var e;ge.value&&(ve.value=void 0,te.value&&(G.value=!0),null==(e=J.value)||e.submit())},fe=async()=>ge.value,ye=()=>{te.value=!0};let he;const be=()=>{G.value=!1,R.value=!0,he=setTimeout(()=>{B({action:"navigate-to-customer-overview"})},3e3)},we=e=>{G.value=!1,ve.value=e.message||f({defaultMessage:"Something went wrong. Please try again.",id:"upgrade_subscription.purchase_error",description:"Error message shown when the purchase call fails on the upgrade subscription page"})};return e.onUnmounted(()=>{clearTimeout(de),clearTimeout(he)}),(n,r)=>R.value?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(m._sfc_main,{class:"sv-upgrade-subscription__success",status:"success",title:e.unref(f)({defaultMessage:"Payment successful",id:"upgrade_subscription.success.title",description:"Title shown after a successful upgrade purchase"})},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-message mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Your purchase has been completed.",id:"upgrade_subscription.success.subtitle",description:"Subtitle shown after a successful upgrade purchase"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main$1),{variant:"body-sm",shade:"lighter",tag:"div",class:"sv-upgrade-subscription__success-redirect mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"You will be redirected shortly…",id:"upgrade_subscription.success.redirect",description:"Shown below the success message while the redirect timer is running"})),1)]),_:1})])]),_:1},8,["title"])])):(e.openBlock(),e.createBlock(e.unref(a.ContentWithAsideLayout),{key:1,class:"sv-upgrade-subscription sv-root sv-screen"},{header:e.withCtx(()=>[e.createElementVNode("div",T,[e.createVNode(e.unref(t._sfc_main$1),{variant:"heading-2",tag:"h1",class:"sv-upgrade-subscription__title"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Upgrade subscription",id:"upgrade_subscription.title",description:"Title for the upgrade subscription page"})),1)]),_:1})])]),content:e.withCtx(()=>[e.unref(F)?(e.openBlock(),e.createBlock(N,{key:0,class:"sv-upgrade-subscription__mobile-order-summary","selected-pricings":oe.value,invoice:X.value,loading:Y.value},null,8,["selected-pricings","invoice","loading"])):e.createCommentVNode("",!0),!H.value&&!Z.value&&z.value.length>0?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(C,{categories:z.value,"selected-pricing-ids":U.value,"loading-pricing-id":K.value,onToggle:me},null,8,["categories","selected-pricing-ids","loading-pricing-id"])])):H.value?(e.openBlock(),e.createElementBlock("div",I,[...r[0]||(r[0]=[e.createElementVNode("div",{class:"sv-skeleton h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"sv-skeleton mt-2 h-[72px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):Z.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:3,class:"sv-upgrade-subscription__load-error sv-error m-4",title:Z.value},null,8,["title"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:4,variant:"body-sm",shade:"lighter",class:"sv-upgrade-subscription__empty-state p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No one-off items are available for this subscription.",id:"upgrade_subscription.empty_state",description:"Shown when there are no one-off items available for the subscription"})),1)]),_:1})),e.createElementVNode("div",$,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[130px]"},{default:e.withCtx(()=>[!H.value||H.value&&W.value.length>0?(e.openBlock(),e.createElementBlock("div",M,[e.createVNode(e.unref(t._sfc_main$1),{variant:"heading-3",tag:"h2",class:"sv-upgrade-subscription__payment-methods-title mb-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Payment method",id:"upgrade_subscription.payment_method_block.title",description:"The title of the payment method block in the upgrade subscription flow"})),1)]),_:1}),0===W.value.length?(e.openBlock(),e.createBlock(i._sfc_main$2,{key:0,class:"sv-upgrade-subscription__payment-methods-empty",icon:"credit_card_off"},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"No payment methods available",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_title",description:"The title shown when there are no available payment methods"})),1)]),message:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"There are no available payment methods. Please contact support for more information.",id:"upgrade_subscription.payment_method_block.no_payment_methods_available_message",description:"The message shown when there are no available payment methods"})),1)]),_:1})):ee.value&&Q.value?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",j,[e.createVNode(u._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:J,"customer-id":L.value,"country-code":ee.value,context:pe.value,amount:ce.value,variant:"AUTHORIZE","payment-method-options":W.value,"validate-on-submit":fe,"force-store-payment-method":"",onSelect:ye,onPaymentSuccess:be,onPaymentFailed:we},null,8,["customer-id","country-code","context","amount","payment-method-options"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])]),aside:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(p._sfc_main,{variant:"section",class:"min-h-[220px]"},{default:e.withCtx(()=>[e.createVNode(N,{"selected-pricings":oe.value,invoice:X.value,loading:Y.value},null,8,["selected-pricings","invoice","loading"])]),_:1})]),ve.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$16),{key:0,class:"sv-upgrade-subscription__error sv-error",title:ve.value},null,8,["title"])):e.createCommentVNode("",!0),e.createElementVNode("div",A,[e.createVNode(p._sfc_main,{class:"sv-upgrade-subscription__submit-skeleton min-h-[44px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$3),{size:"lg",class:"sv-action sv-action--primary sv-action--full-width sv-upgrade-subscription__purchase w-full",type:"button",disabled:!ge.value,loading:G.value,onClick:_e},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f)({defaultMessage:"Purchase",id:"upgrade_subscription.purchase_button.label",description:"Label for the purchase button on the upgrade subscription page"})),1)]),_:1},8,["disabled","loading"])]),_:1}),e.createVNode(i._sfc_main$1,{"payment-method-options":W.value},null,8,["payment-method-options"])])]),_:1}))}}),L=e.defineComponent({__name:"UpgradeSubscription.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=>(i,a)=>{var r,o,s,l;return e.openBlock(),e.createBlock(n._sfc_main,{"custom-element-name":e.unref(U),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(o=null==(r=t.branding)?void 0:r.colors)?void 0:o.primary,"secondary-color":null==(l=null==(s=t.branding)?void 0:s.colors)?void 0:l.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:a[0]||(a[0]=e=>i.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(F,{configuration:t.configuration},null,8,["configuration"])]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),q=n.defineCustomElement(L),U=n.getComponentName("upgrade-subscription");exports.COMPONENT_NAME=U,exports.SolvimonUpgradeSubscription=q,exports.defineSolvimonUpgradeSubscription=()=>{customElements.get(U)||customElements.define(U,q)};