@solvimon/solvimon-web 0.1.0-alpha.8 → 0.1.0-alpha.9
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.
- package/README.md +124 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +6 -4
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
- package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
- package/dist/{ContentWithAsideLayout-BTdixy3L.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +8 -5
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +21 -10
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
- package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +19 -8
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
- package/dist/{PaymentHistoryBlock-DHM-3fh-.js → PaymentHistoryBlock-BiiFJkpT.js} +1 -1
- package/dist/{PaymentHistoryBlock-YzJ6bxKr.mjs → PaymentHistoryBlock-D_B099M7.mjs} +1 -1
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +16 -9
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
- package/dist/{PaymentIntegrationForm-Cl5ua8v8.js → PaymentIntegrationForm-D1oJA9mC.js} +1 -1
- package/dist/{PaymentIntegrationForm-ID4QnvA3.mjs → PaymentIntegrationForm-DNkjhqMF.mjs} +1 -1
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs} +70 -17
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js +1 -0
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs} +1 -1
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js → PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js} +1 -1
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +9 -6
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +28 -19
- package/dist/adyen-B_QrYdaC.mjs +4 -0
- package/dist/{adyenLoader-gsbzSjYV.mjs → adyen-Bwewy3HC.mjs} +8 -13
- package/dist/adyen-R6aSZ0Yf.js +1 -0
- package/dist/adyen-mQEEOjgl.js +1 -0
- package/dist/adyen.css +1 -0
- package/dist/component-BOqPDAVk.js +1 -0
- package/dist/{component-CM9g6tbD.mjs → component-Djrf1L-Z.mjs} +294 -209
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +8 -5
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +8 -4
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +10 -6
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +36 -22
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +10 -6
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +7 -4
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +10 -6
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +15 -11
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +15 -8
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +11 -7
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +8 -4
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +4 -2
- package/dist/{customer-TIi7iZFw.mjs → customer-B31QzznT.mjs} +1 -1
- package/dist/{customer-C_Hz_npf.js → customer-hDxW1Dbp.js} +1 -1
- package/dist/en-US-CgPY97Vq.js +1 -0
- package/dist/{en-US-CBoPxQwX.mjs → en-US-N3CUCsVy.mjs} +5 -25
- package/dist/index-DIFK3mcJ.js +6 -0
- package/dist/index-DyvRdSR7.mjs +9673 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{invoices-BuVOuTOm.mjs → invoices-DIYPN2j_.mjs} +2 -2
- package/dist/{invoices-DbvwXAsm.js → invoices-DzkA1jDc.js} +1 -1
- package/dist/{nl-NL-BB7KbK-h.mjs → nl-NL-B8U9b85I.mjs} +18 -2
- package/dist/nl-NL-qMRaTRrM.js +1 -0
- package/dist/{paymentMethods-Di32oJ39.mjs → paymentMethods-67b3UlTZ.mjs} +2 -2
- package/dist/{paymentMethods-B4AYGf0K.js → paymentMethods-C_sdTkSF.js} +1 -1
- package/dist/{payments-DeutKq9x.js → payments-DkHhTHto.js} +1 -1
- package/dist/{payments-C5fD1PXB.mjs → payments-Dq6R37Fz.mjs} +1 -1
- package/dist/{registry-CMSmkLcy.js → registry-BkViv4tv.js} +1 -1
- package/dist/{registry-BLwMl1bK.mjs → registry-Df_26rJy.mjs} +1 -1
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +276 -214
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +22 -15
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -1
- package/dist/screens/PayInvoice/PayInvoice.es.js +12 -10
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +83 -53
- package/dist/solvimon-web.css +1 -1
- package/dist/{subscriptions-mOgjjzUi.mjs → subscriptions-ClGIr_aS.mjs} +2 -2
- package/dist/{subscriptions-wdMADcQZ.js → subscriptions-jelITJcX.js} +1 -1
- package/dist/{useActionDispatchProvider-B4gszz0Q.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
- package/dist/{useActionDispatchProvider-DfS2P0bd.js → useActionDispatchProvider-rw9kWeE0.js} +1 -1
- package/dist/{useCustomer-cbhDyWJL.mjs → useCustomer-Ba9WRtuT.mjs} +2 -2
- package/dist/{useCustomer-DanZzn-l.js → useCustomer-CUcaeQn_.js} +1 -1
- package/dist/{useIncrementalLoading-RRicokf1.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +1 -1
- package/dist/{useIncrementalLoading-DFe5Yh8M.js → useIncrementalLoading-DoTTXM2Y.js} +1 -1
- package/dist/{useInvoiceData-fS6G_244.mjs → useInvoiceData-BJwwDur7.mjs} +2 -2
- package/dist/{useInvoiceData-CxxHa5R2.js → useInvoiceData-D2jkdmlA.js} +1 -1
- package/dist/{useInvoicesList-BQQxcPdz.mjs → useInvoicesList-CFzAxyae.mjs} +22 -18
- package/dist/useInvoicesList-CaBCGs4h.js +1 -0
- package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
- package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
- package/dist/{usePaymentMethodOptions-2MloZ9bY.mjs → usePaymentMethodOptions-C2k4npCQ.mjs} +2 -2
- package/dist/{usePaymentMethodOptions-D01YWW3G.js → usePaymentMethodOptions-DYO6xr3-.js} +1 -1
- package/dist/{usePaymentMethods-DZvfWSlx.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
- package/dist/{usePaymentMethods-Cm9WdSW0.js → usePaymentMethods-ryN_YohI.js} +1 -1
- package/dist/{usePayments-D4uGKBsV.mjs → usePayments-Cw5PPEJa.mjs} +3 -3
- package/dist/{usePayments-B13S_yai.js → usePayments-DWXPGFvp.js} +1 -1
- package/dist/{usePortal-DWJEVkTj.js → usePortal-CxX4nrE4.js} +1 -1
- package/dist/{usePortal-DJDJNLbo.mjs → usePortal-cmE08vYs.mjs} +1 -1
- package/dist/useService-Bb9r_sOQ.js +1 -0
- package/dist/{useService-BuWWE5ND.mjs → useService-BsSEI8DZ.mjs} +1 -16
- package/dist/{useWalletBalanceItems-B53Gkjro.mjs → useWalletBalanceItems-CkDqmk36.mjs} +8 -5
- package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
- package/dist/vendor-ui-5pJF5KBP.js +1 -0
- package/dist/{vendor-ui-BwxuPDg8.mjs → vendor-ui-C0K3osvz.mjs} +13272 -14225
- package/package.json +4 -3
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +0 -1
- package/dist/ContentWithAsideLayout-oAYVrLvL.js +0 -1
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +0 -1
- package/dist/adyen-51SvcyqV.mjs +0 -4
- package/dist/adyen-DZsyEXkw.js +0 -1
- package/dist/adyenLoader-CEH4A2b2.js +0 -1
- package/dist/auto-DzZuCneB.mjs +0 -14387
- package/dist/auto-PpnAChnH.js +0 -6
- package/dist/component-C2Gc-wsE.js +0 -1
- package/dist/en-US-DJq-9dD8.js +0 -1
- package/dist/nl-NL-CtU1Lg2F.js +0 -1
- package/dist/source-DKDKBlUm.mjs +0 -179
- package/dist/source-dkMNFWDc.js +0 -1
- package/dist/useInvoicesList-CtJqmblZ.js +0 -1
- package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
- package/dist/useService-9fCKPTmu.js +0 -1
- package/dist/useWalletBalanceItems-BMaVT4TW.js +0 -1
- package/dist/vendor-ui-Ce_Yp7xA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),
|
|
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"),d=require("../../useService-Bb9r_sOQ.js"),v=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}=d.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=v.useCustomerWalletBalances({customerId:f}),C=v.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(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}))}}),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,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
|
|
2
2
|
import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
|
|
3
|
-
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
4
|
-
import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-
|
|
5
|
-
import { u as usePortal } from "../../usePortal-
|
|
6
|
-
import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
8
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
9
|
-
import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
11
|
-
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { c as createPaymentMethodsService } from "../../paymentMethods-
|
|
13
|
-
import { u as useService } from "../../useService-
|
|
14
|
-
import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-
|
|
15
|
-
import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
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";
|
|
16
16
|
function useCustomerPaymentMethodOptions({
|
|
17
17
|
customerId,
|
|
18
18
|
amount
|
|
@@ -53,10 +53,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
53
53
|
customerWalletBalances.fetch()
|
|
54
54
|
);
|
|
55
55
|
return (_ctx, _cache) => {
|
|
56
|
-
return openBlock(), createBlock(unref(ContentWithAsideLayout),
|
|
56
|
+
return openBlock(), createBlock(unref(ContentWithAsideLayout), { class: "sv-customer-overview sv-root sv-screen" }, {
|
|
57
57
|
header: withCtx(() => [
|
|
58
58
|
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
59
59
|
key: 0,
|
|
60
|
+
class: "sv-customer-overview__subscriptions",
|
|
60
61
|
customer: unref(customer).customer.value,
|
|
61
62
|
subscriptions: unref(subscriptions).items.value,
|
|
62
63
|
"payment-methods": unref(paymentMethods).items.value,
|
|
@@ -66,6 +67,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
66
67
|
]),
|
|
67
68
|
content: withCtx(() => [
|
|
68
69
|
createVNode(_sfc_main$5, {
|
|
70
|
+
class: "sv-customer-overview__invoices",
|
|
69
71
|
invoices: unref(invoices).items.value,
|
|
70
72
|
"has-more-items": unref(invoices).hasNextBatch.value,
|
|
71
73
|
"is-loading": unref(isLoading),
|
|
@@ -74,16 +76,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
74
76
|
]),
|
|
75
77
|
aside: withCtx(() => [
|
|
76
78
|
createVNode(_sfc_main$2, {
|
|
79
|
+
class: "sv-customer-overview__wallet-balances",
|
|
77
80
|
"has-error": unref(customerWalletBalances).apiStatus.value === unref(ApiStatus).Failed,
|
|
78
81
|
"is-loading": unref(isLoading),
|
|
79
82
|
"wallet-balances": unref(walletBalanceItems)
|
|
80
83
|
}, null, 8, ["has-error", "is-loading", "wallet-balances"]),
|
|
81
84
|
createVNode(_sfc_main$3, {
|
|
85
|
+
class: "sv-customer-overview__payment-methods",
|
|
82
86
|
"is-loading": unref(isLoading),
|
|
83
87
|
"payment-methods": unref(paymentMethods).items.value
|
|
84
88
|
}, null, 8, ["is-loading", "payment-methods"]),
|
|
85
89
|
unref(customer).customer.value ? (openBlock(), createBlock(_sfc_main$4, {
|
|
86
90
|
key: 0,
|
|
91
|
+
class: "sv-customer-overview__billing-information",
|
|
87
92
|
"is-loading": unref(isLoading),
|
|
88
93
|
customer: unref(customer).customer.value
|
|
89
94
|
}, null, 8, ["is-loading", "customer"])) : createCommentVNode("", true)
|
|
@@ -108,6 +113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
108
113
|
onLog: { type: Function },
|
|
109
114
|
allowedPortalTypes: { type: Array },
|
|
110
115
|
portalObject: { type: Object },
|
|
116
|
+
cssOverrides: { type: [String, Array] },
|
|
111
117
|
branding: { type: Object },
|
|
112
118
|
configuration: { type: Object }
|
|
113
119
|
},
|
|
@@ -125,13 +131,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
125
131
|
"experimental-features": __props.experimentalFeatures,
|
|
126
132
|
"log-level": __props.logLevel,
|
|
127
133
|
"on-log": __props.onLog,
|
|
134
|
+
"css-overrides": __props.cssOverrides,
|
|
128
135
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
129
136
|
}, {
|
|
130
137
|
default: withCtx(() => [
|
|
131
138
|
createVNode(_sfc_main$1)
|
|
132
139
|
]),
|
|
133
140
|
_: 1
|
|
134
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
141
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
135
142
|
};
|
|
136
143
|
}
|
|
137
144
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-C2Gc-wsE.js"),n=require("../../vendor-ui-Ce_Yp7xA.js"),o=require("../../ContentWithAsideLayout-oAYVrLvL.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js"),i=require("../../Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js"),r=require("../../adyenLoader-CEH4A2b2.js"),c=require("../../useLoadInitialData-BRg7IWqW.js"),l=require("../../usePayments-B13S_yai.js"),s=require("../../usePaymentMethodOptions-D01YWW3G.js"),u=require("../../usePaymentMethods-Cm9WdSW0.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(),i=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})),r=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:r.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:r.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(i.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},d=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 d(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const y=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(i._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(i._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(r._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$11),{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(r._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:y,onSelect:f[0]||(f[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(i._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:d},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},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:i,downloadInvoicePdf:r}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:m}=l.usePayments(),{fetchInitial:d}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:f}=s.usePaymentMethodOptions(),{isLoading:v}=c.useLoadInitialData((async()=>{const e=await i();await f({customerId:e.customer.id,amount:e.open_invoice_amount})})(),d(),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(v),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(r)})}}}),f=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},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var i,r,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==(r=null==(i=n.branding)?void 0:i.colors)?void 0:r.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:i,paymentMethodOptions:r,paymentAttempts:c,downloadService:l})=>[e.createVNode(d,{"is-loading":o,invoice:t,amount:a,"country-code":i,"payment-method-options":r,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"])}}),v=t.defineCustomElement(f),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=v,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,v)};
|
|
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-D5bxFJ-p.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,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-
|
|
3
|
-
import { u as useIntl,
|
|
4
|
-
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-
|
|
5
|
-
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { _ as _sfc_main$7 } from "../../
|
|
8
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
9
|
-
import { u as useInvoice, a as usePayments } from "../../usePayments-
|
|
10
|
-
import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-
|
|
11
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
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";
|
|
4
|
+
import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-DhfUkZZg.mjs";
|
|
5
|
+
import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs";
|
|
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";
|
|
12
12
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
13
13
|
__name: "PayButton",
|
|
14
14
|
props: {
|
|
@@ -331,6 +331,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
331
331
|
onLog: { type: Function },
|
|
332
332
|
allowedPortalTypes: { type: Array },
|
|
333
333
|
portalObject: { type: Object },
|
|
334
|
+
cssOverrides: { type: [String, Array] },
|
|
334
335
|
branding: { type: Object },
|
|
335
336
|
configuration: { type: Object }
|
|
336
337
|
},
|
|
@@ -393,6 +394,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
393
394
|
onLog: { type: Function },
|
|
394
395
|
allowedPortalTypes: { type: Array },
|
|
395
396
|
portalObject: { type: Object },
|
|
397
|
+
cssOverrides: { type: [String, Array] },
|
|
396
398
|
branding: { type: Object },
|
|
397
399
|
configuration: { type: Object }
|
|
398
400
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-Ce_Yp7xA.js"),n=require("../../PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js"),a=require("../../paymentMethods-B4AYGf0K.js"),i=require("../../ContentWithAsideLayout-oAYVrLvL.js"),r=require("../../useActionDispatchProvider-DfS2P0bd.js"),o=require("../../usePortal-DWJEVkTj.js"),l=require("../../component-C2Gc-wsE.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:[]}]}}]},s=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}))}))}]}},u=e=>(e.items??[]).filter(s).map(d),p=e=>({display_order:e.display_order,product_category:e.product_category,pricings:(e.pricings??[]).flatMap(u),pricing_groups:(e.pricing_groups??[]).map(e=>({id:e.id,name:e.name,pricings:(e.pricings??[]).flatMap(u)})).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(s).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],l=(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(l)]})),g=e=>({quantity:e.toFixed(2),currency:"EUR"}),_={id:"paya_NwDeeN0vgXgeP1AyNx14",object_type:"PAYMENT_ACCEPTOR",status:"ACTIVE",reference:"mock-payment-acceptor",name:"Mock payment acceptor",type:"PAYMENT_GATEWAY"},f={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:"mb-3 flex flex-col gap-2"},v={class:"flex flex-col gap-1 border-t pt-3"},h={class:"flex items-center justify-between"},b={class:"flex items-center justify-between"},k={class:"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,l)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),null,{default:e.withCtx(()=>{var a;return[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2",class:"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"},{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:"flex items-center justify-between"},[e.createElementVNode("div",null,[e.createVNode(e.unref(t._sfc_main),{variant:"body-sm"},{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"},{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"},{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",v,[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:l}=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)??"—"}),s=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(()=>s.value?`${t.formatAmount(s.value)} ${l({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(l)({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(l)({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:"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:"flex flex-col gap-2"},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{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,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:"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,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:"flex flex-col gap-4"},C={key:0,class:"flex flex-col gap-2"},E={class:"flex flex-col gap-1"},S={key:1,class:"flex flex-col gap-2"},T={class:"flex flex-col gap-1"},A={class:"flex items-center gap-3"},I={key:0,class:"flex h-9 w-9 shrink-0 items-center gap-0.5"},D=["src","alt"],M={key:1,class:"flex h-9 w-9 shrink-0 items-center justify-center overflow-clip rounded"},P=["src","alt"],O={key:2,class:"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:l}=t.useIntl(),{getPaymentMethods:c}=a.createPaymentMethodsService(),s=e.ref([]),d=e.ref([]),u=e.ref(!1),p=e.computed(()=>d.value.flatMap(e=>e.options??[])),m=e=>`https://checkoutshopper-live.adyen.com/checkoutshopper/images/logos/small/${e}.svg`,g=["visa","mc","amex","maestro"],y=e=>{if(!e)return[];return[...g.filter(t=>e.includes(t)),...e.filter(e=>!g.includes(e))].slice(0,4)};return e.onMounted(async()=>{u.value=!0;try{const e=await c({customerId:r.customerId,pagination:{page:1,pageSize:50}});s.value=e.data,d.value=[{payment_acceptor:_,integration:f,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{u.value=!1}}),(a,i)=>(e.openBlock(),e.createElementBlock("div",V,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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(s.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([{"!bg-white":n.selectedId===a.id},"cursor-pointer"]),onClick:e=>o("select",a.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$5),{"payment-method":a},null,8,["payment-method"])]),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),p.value.length>0?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)({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(p.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([{"!bg-white":n.selectedId===a.adyen.type},"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"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1024)])];var n}),_:2},1032,["content-background","class","onClick"]))),128))])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",O,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1),e.createElementVNode("div",{class:"h-[52px] animate-pulse rounded-md bg-gray-100"},null,-1)])])):e.createCommentVNode("",!0)]))}}),L={class:"flex gap-1"},$=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$11),{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 F={key:0,class:"flex h-full items-center justify-center p-8"},q={class:"flex flex-col items-center py-10"},z=e.defineComponent({__name:"UpgradeSubscription",props:{configuration:{type:Object}},setup(n){const a=n,{$t:s}=t.useIntl(),{dispatchAction:d}=r.useActionDispatchProvider(),{chargeOnDemandPricingItems:u}=function(){const e=l.createRequestService(),t=l.useConfig();return{chargeOnDemandPricingItems:function({scheduleId:n,pricingPlanVersionId:a,pricingItemIds:i,startAt:r,finalizeImmediately:o=!0,paymentMethodId:l}){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,...l?{payment_method_id:l}:{}}})}}}(),_=o.usePortal(),f=e.computed(()=>_.value.customer_id),y=e.ref([]),v=e.ref(void 0),h=e.ref(!1),b=e.ref(!1),k=e.ref(void 0),N=e.ref(!1),w=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(p).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)),V=e.computed(()=>w.value.pricing_categories),C=e.computed(()=>V.value.flatMap(e=>[...e.pricings??[],...(e.pricing_groups??[]).flatMap(e=>e.pricings??[])])),E=e.computed(()=>C.value.filter(e=>y.value.includes(e.id)));let S;e.watch(y,e=>{if(clearTimeout(S),0===e.length)return k.value=void 0,void(N.value=!1);N.value=!0,S=setTimeout(()=>{k.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:g(t),tax_amount:g(n),total_amount:g(a),country_code:"NL"}},first_invoice:{},invoice_infos:[]}})(e).invoice,N.value=!1},400)});const T=e=>{y.value.includes(e)?y.value=y.value.filter(t=>t!==e):y.value=[...y.value,e]},A=e.computed(()=>y.value.length>0&&!!v.value),I=e.ref(void 0),D=async()=>{if(A.value){h.value=!0,I.value=void 0;try{const e=E.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=v.value&&v.value.startsWith("pmet_")?v.value:void 0,n=await u({scheduleId:w.value.pricing_plan_schedule_id,pricingPlanVersionId:w.value.pricing_plan_version_id,pricingItemIds:e,finalizeImmediately:!0,paymentMethodId:t});t?b.value=!0:d({action:"pay-invoice",data:{invoiceId:n.id}})}catch{I.value=s({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{h.value=!1}}};return(a,r)=>b.value?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(t._sfc_main$1),null,{default:e.withCtx(()=>[e.createElementVNode("div",q,[e.createVNode(e.unref(t._sfc_main$11),{icon:"check_circle",class:"text-green-400",size:"lg"}),e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"span",class:"mt-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({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:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({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},{content:e.withCtx(()=>[V.value.length>0?(e.openBlock(),e.createBlock(B,{key:0,categories:V.value,"selected-pricing-ids":y.value,onToggle:T},null,8,["categories","selected-pricing-ids"])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1,variant:"body-sm",shade:"lighter",class:"p-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({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$25),{spacing:"sm"}),e.createVNode(j,{"customer-id":f.value,"subscription-id":n.configuration.subscriptionId,"selected-id":v.value,onSelect:r[0]||(r[0]=e=>v.value=e)},null,8,["customer-id","subscription-id","selected-id"])]),aside:e.withCtx(()=>[e.createVNode(x,{"selected-pricings":E.value,invoice:k.value,"is-pending":N.value},null,8,["selected-pricings","invoice","is-pending"]),I.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,title:I.value},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{size:"lg",class:"full-width",type:"button",disabled:!A.value||h.value,loading:h.value,onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)({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:"flex grow justify-center"},{default:e.withCtx(()=>[e.createVNode($,{icon:"lock",kpi:e.unref(s)({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}))}}),R=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},branding:{type:Object},configuration:{type:Object}},setup:t=>(n,a)=>{var i,r,o,c;return e.openBlock(),e.createBlock(l._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==(r=null==(i=t.branding)?void 0:i.colors)?void 0:r.primary,"secondary-color":null==(c=null==(o=t.branding)?void 0:o.colors)?void 0:c.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:a[0]||(a[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(z,{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"])}}),U=l.defineCustomElement(R),Y=l.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-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)};
|