@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("../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js"),o=require("../../useCustomer-CUcaeQn_.js"),r=require("../../useLoadInitialData-DjwRHcAH.js"),n=require("../../component-BOqPDAVk.js"),i=e.defineComponent({__name:"BillingInformation.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 n=t.portalObject.customer_id,i=o.useCustomer({customerId:n}),{isLoading:l}=r.useLoadInitialData(i.get.execute());return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(i),isLoading:e.unref(l)})}}),l=e.defineComponent({__name:"BillingInformation.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:o=>(r,l)=>{var a,p,c,m;return e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"custom-element-name":e.unref(s),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(a=o.branding)?void 0:a.colors)?void 0:p.primary,"secondary-color":null==(m=null==(c=o.branding)?void 0:c.colors)?void 0:m.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,"css-overrides":o.cssOverrides,onError:l[0]||(l[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(i,e.normalizeProps(e.guardReactiveProps(r.$props)),{default:e.withCtx(({customer:o,isLoading:r})=>[e.createVNode(t._sfc_main,{"is-loading":r,customer:o.customer.value},null,8,["is-loading","customer"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),a=n.defineCustomElement(l),s=n.getComponentName("billing-information");exports.COMPONENT_NAME=s,exports.SolvimonBillingInformation=a,exports.defineSolvimonBillingInformation=()=>{customElements.get(s)||customElements.define(s,a)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
4
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
5
|
-
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
2
|
+
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs";
|
|
3
|
+
import { u as useCustomer } from "../../useCustomer-Ba9WRtuT.mjs";
|
|
4
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
|
|
5
|
+
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
|
|
6
6
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "BillingInformation.entry.view",
|
|
8
8
|
props: {
|
|
@@ -18,6 +18,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
onLog: { type: Function },
|
|
19
19
|
allowedPortalTypes: { type: Array },
|
|
20
20
|
portalObject: { type: Object },
|
|
21
|
+
cssOverrides: { type: [String, Array] },
|
|
21
22
|
branding: { type: Object },
|
|
22
23
|
configuration: { type: Object }
|
|
23
24
|
},
|
|
@@ -49,6 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
50
|
onLog: { type: Function },
|
|
50
51
|
allowedPortalTypes: { type: Array },
|
|
51
52
|
portalObject: { type: Object },
|
|
53
|
+
cssOverrides: { type: [String, Array] },
|
|
52
54
|
branding: { type: Object },
|
|
53
55
|
configuration: { type: Object }
|
|
54
56
|
},
|
|
@@ -66,6 +68,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
68
|
"experimental-features": __props.experimentalFeatures,
|
|
67
69
|
"log-level": __props.logLevel,
|
|
68
70
|
"on-log": __props.onLog,
|
|
71
|
+
"css-overrides": __props.cssOverrides,
|
|
69
72
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
70
73
|
}, {
|
|
71
74
|
default: withCtx(() => [
|
|
@@ -80,7 +83,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
83
|
}, 16)
|
|
81
84
|
]),
|
|
82
85
|
_: 1
|
|
83
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
86
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
84
87
|
};
|
|
85
88
|
}
|
|
86
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-Ce_Yp7xA.js"),a=require("../../index-DRdBmZ2-.js"),o=require("../../useCustomer-DanZzn-l.js"),r=require("../../component-C2Gc-wsE.js"),l={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function n({initialState:o={},onSubmit:r}){const{form:n,validation:s,changes:u,hasChanges:c,updateInitialState:m,initialState:p}=(({initialState:a,validationRules:o,nullifyEmptyValues:r=!1,mode:l="shallow"})=>{const n=e.shallowRef(structuredClone(a)),i=e.shallowRef(structuredClone(a)),d=t.useValidation(o??{},i),s=e.computed(()=>t.objectDiff({from:n.value,to:i.value,mode:l,nullifyEmptyValues:r})),u=e.computed(()=>Object.entries(s.value).length>0);return{form:i,validation:d,changes:s,hasChanges:u,reset:()=>{i.value=structuredClone(a),d.value.$reset()},updateInitialState:e=>{i.value=structuredClone(e),n.value=structuredClone(e)},initialState:n}})({initialState:{...l,...o},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:n,isOrganization:t.isOrganization,validation:s,changes:u,hasChanges:c,updateInitialState:e=>{m(i(e))},submit:(e,t=n.value)=>r({customerId:e,payload:d(t)}),initialState:p}}const i=e=>{var a,o,r,l;if(t.isIndividual(e)){const t=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==t?void 0:t.country)??"",addressLine1:(null==t?void 0:t.line1)??"",addressLine2:(null==t?void 0:t.line2)??"",postalCode:(null==t?void 0:t.postal_code)??"",city:(null==t?void 0:t.city)??"",state:(null==t?void 0:t.state)??"",firstName:(null==(a=e.individual.name)?void 0:a.first_name)??"",lastName:(null==(o=e.individual.name)?void 0:o.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(l=null==(r=e.organization.tax_ids)?void 0:r[0])?void 0:l.id)??""}},d=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},s={class:"grid grid-cols-1 gap-4"},u={class:"flex grow flex-col"},c={class:"mt-6 flex items-center justify-between gap-4"},m={class:"flex flex-col gap-2"},p={key:0,class:"grid grid-cols-2 gap-2"},f={class:"grid grid-cols-3 gap-2"},h=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(a){const o=a,{$t:r}=t.useIntl(),{validation:l,form:i,updateInitialState:d,submit:h,hasChanges:g}=n({onSubmit:({customerId:e,payload:t})=>o.updateCustomer({customerId:e,payload:t})}),y=e.ref(!1),_=e.computed(()=>"ORGANIZATION"===i.value.type),v=e.computed(()=>!y.value),b=e.computed({get:()=>_.value,set:e=>i.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),V=async()=>{var e;await l.value.$validate();!l.value.$invalid&&(null==(e=o.customer)?void 0:e.id)&&await h(o.customer.id)};return e.watch(()=>o.customer,e=>{e&&!y.value&&(d(e),y.value=!0)},{immediate:!0}),(o,n)=>{var d,h,y,N,k,C,E,I,S,L,T,x,M;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(V,["prevent"])},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).email,"onUpdate:modelValue":n[0]||(n[0]=t=>e.unref(i).email=t),required:"",type:"email",label:e.unref(r)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(d=e.unref(l).email)?void 0:d.$errors)||(null==(h=a.apiError)?void 0:h.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$22),{"single-model-value":e.unref(i).country,"onUpdate:singleModelValue":n[1]||(n[1]=t=>e.unref(i).country=t),label:e.unref(r)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(y=a.apiError)?void 0:y.country},null,8,["single-model-value","label","error"]),v.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$23),{key:0,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",u,[e.createVNode(e.unref(t._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).companyVatNumber,"onUpdate:modelValue":n[3]||(n[3]=t=>e.unref(i).companyVatNumber=t),name:"vat_number",label:e.unref(r)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(N=a.apiError)?void 0:N.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).companyLegalName,"onUpdate:modelValue":n[4]||(n[4]=t=>e.unref(i).companyLegalName=t),required:"",name:"legal_name",label:e.unref(r)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(k=a.apiError)?void 0:k.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",m,[_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).firstName,"onUpdate:modelValue":n[5]||(n[5]=t=>e.unref(i).firstName=t),name:"first_name",label:e.unref(r)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(C=a.apiError)?void 0:C.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).lastName,"onUpdate:modelValue":n[6]||(n[6]=t=>e.unref(i).lastName=t),name:"last_name",label:e.unref(r)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(E=a.apiError)?void 0:E.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).addressLine1,"onUpdate:modelValue":n[7]||(n[7]=t=>e.unref(i).addressLine1=t),name:"address_line_1",label:e.unref(r)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(I=a.apiError)?void 0:I.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).addressLine2,"onUpdate:modelValue":n[8]||(n[8]=t=>e.unref(i).addressLine2=t),name:"address_line_2",placeholder:e.unref(r)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(S=a.apiError)?void 0:S.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",f,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).postalCode,"onUpdate:modelValue":n[9]||(n[9]=t=>e.unref(i).postalCode=t),name:"postal_code",placeholder:e.unref(r)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(L=a.apiError)?void 0:L.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).city,"onUpdate:modelValue":n[10]||(n[10]=t=>e.unref(i).city=t),name:"city",placeholder:e.unref(r)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(T=a.apiError)?void 0:T.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).state,"onUpdate:modelValue":n[11]||(n[11]=t=>e.unref(i).state=t),name:"state",placeholder:e.unref(r)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(x=a.apiError)?void 0:x.state},null,8,["modelValue","placeholder","error"])])]),(null==(M=a.apiError)?void 0:M._generic)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,class:"mt-4",title:a.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{type:"submit",color:"primary",disabled:!e.unref(g),loading:a.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),g=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(h,{customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),y=e.defineComponent({__name:"BillingInformationForm.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}},setup(a){const r=a.portalObject.customer_id,{customer:l,get:n,update:i}=o.useCustomer({customerId:r});return e.onMounted(async()=>{await n.execute()}),(a,o)=>e.renderSlot(a.$slots,"default",{customer:e.unref(l),isLoading:e.unref(n).isPending.value||e.unref(i).isPending.value,updateCustomer:e.unref(i),apiError:e.unref(t.getApiError)(e.unref(i).error)})}}),_=e.defineComponent({__name:"BillingInformationForm.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}},emits:["error"],setup:t=>(a,o)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(r._sfc_main),{"custom-element-name":e.unref(b),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=t.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=t.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:o[0]||(o[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(g,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=r.defineCustomElement(_),b=r.getComponentName("billing-information-form");exports.COMPONENT_NAME=b,exports.SolvimonBillingInformationForm=v,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(b)||customElements.define(b,v)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-5pJF5KBP.js"),a=require("../../index-DRdBmZ2-.js"),o=require("../../useCustomer-CUcaeQn_.js"),r=require("../../component-BOqPDAVk.js"),l={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function n({initialState:o={},onSubmit:r}){const{form:n,validation:s,changes:u,hasChanges:c,updateInitialState:m,initialState:p}=(({initialState:a,validationRules:o,nullifyEmptyValues:r=!1,mode:l="shallow"})=>{const n=e.shallowRef(structuredClone(a)),i=e.shallowRef(structuredClone(a)),d=t.useValidation(o??{},i),s=e.computed(()=>t.objectDiff({from:n.value,to:i.value,mode:l,nullifyEmptyValues:r})),u=e.computed(()=>Object.entries(s.value).length>0);return{form:i,validation:d,changes:s,hasChanges:u,reset:()=>{i.value=structuredClone(a),d.value.$reset()},updateInitialState:e=>{i.value=structuredClone(e),n.value=structuredClone(e)},initialState:n}})({initialState:{...l,...o},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:n,isOrganization:t.isOrganization,validation:s,changes:u,hasChanges:c,updateInitialState:e=>{m(i(e))},submit:(e,t=n.value)=>r({customerId:e,payload:d(t)}),initialState:p}}const i=e=>{var a,o,r,l;if(t.isIndividual(e)){const t=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==t?void 0:t.country)??"",addressLine1:(null==t?void 0:t.line1)??"",addressLine2:(null==t?void 0:t.line2)??"",postalCode:(null==t?void 0:t.postal_code)??"",city:(null==t?void 0:t.city)??"",state:(null==t?void 0:t.state)??"",firstName:(null==(a=e.individual.name)?void 0:a.first_name)??"",lastName:(null==(o=e.individual.name)?void 0:o.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(l=null==(r=e.organization.tax_ids)?void 0:r[0])?void 0:l.id)??""}},d=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},s={class:"grid grid-cols-1 gap-4"},u={class:"flex grow flex-col"},c={class:"mt-6 flex items-center justify-between gap-4"},m={class:"flex flex-col gap-2"},p={key:0,class:"grid grid-cols-2 gap-2"},f={class:"grid grid-cols-3 gap-2"},h=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(a){const o=a,{$t:r}=t.useIntl(),{validation:l,form:i,updateInitialState:d,submit:h,hasChanges:g}=n({onSubmit:({customerId:e,payload:t})=>o.updateCustomer({customerId:e,payload:t})}),y=e.ref(!1),v=e.computed(()=>"ORGANIZATION"===i.value.type),_=e.computed(()=>!y.value),b=e.computed({get:()=>v.value,set:e=>i.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),V=async()=>{var e;await l.value.$validate();!l.value.$invalid&&(null==(e=o.customer)?void 0:e.id)&&await h(o.customer.id)};return e.watch(()=>o.customer,e=>{e&&!y.value&&(d(e),y.value=!0)},{immediate:!0}),(o,n)=>{var d,h,y,N,k,C,S,E,I,L,T,x,O;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(V,["prevent"])},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).email,"onUpdate:modelValue":n[0]||(n[0]=t=>e.unref(i).email=t),required:"",type:"email",label:e.unref(r)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(d=e.unref(l).email)?void 0:d.$errors)||(null==(h=a.apiError)?void 0:h.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{"single-model-value":e.unref(i).country,"onUpdate:singleModelValue":n[1]||(n[1]=t=>e.unref(i).country=t),label:e.unref(r)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(y=a.apiError)?void 0:y.country},null,8,["single-model-value","label","error"]),_.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$22),{key:0,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",u,[e.createVNode(e.unref(t._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).companyVatNumber,"onUpdate:modelValue":n[3]||(n[3]=t=>e.unref(i).companyVatNumber=t),name:"vat_number",label:e.unref(r)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(N=a.apiError)?void 0:N.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).companyLegalName,"onUpdate:modelValue":n[4]||(n[4]=t=>e.unref(i).companyLegalName=t),required:"",name:"legal_name",label:e.unref(r)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(k=a.apiError)?void 0:k.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",m,[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).firstName,"onUpdate:modelValue":n[5]||(n[5]=t=>e.unref(i).firstName=t),name:"first_name",label:e.unref(r)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(C=a.apiError)?void 0:C.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).lastName,"onUpdate:modelValue":n[6]||(n[6]=t=>e.unref(i).lastName=t),name:"last_name",label:e.unref(r)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(S=a.apiError)?void 0:S.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).addressLine1,"onUpdate:modelValue":n[7]||(n[7]=t=>e.unref(i).addressLine1=t),name:"address_line_1",label:e.unref(r)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(E=a.apiError)?void 0:E.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).addressLine2,"onUpdate:modelValue":n[8]||(n[8]=t=>e.unref(i).addressLine2=t),name:"address_line_2",placeholder:e.unref(r)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(I=a.apiError)?void 0:I.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",f,[e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).postalCode,"onUpdate:modelValue":n[9]||(n[9]=t=>e.unref(i).postalCode=t),name:"postal_code",placeholder:e.unref(r)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(L=a.apiError)?void 0:L.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).city,"onUpdate:modelValue":n[10]||(n[10]=t=>e.unref(i).city=t),name:"city",placeholder:e.unref(r)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(T=a.apiError)?void 0:T.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$20),{modelValue:e.unref(i).state,"onUpdate:modelValue":n[11]||(n[11]=t=>e.unref(i).state=t),name:"state",placeholder:e.unref(r)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(x=a.apiError)?void 0:x.state},null,8,["modelValue","placeholder","error"])])]),(null==(O=a.apiError)?void 0:O._generic)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,class:"mt-4",title:a.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{type:"submit",color:"primary",disabled:!e.unref(g),loading:a.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),g=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(h,{class:"sv-billing-form sv-root sv-component",customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),y=e.defineComponent({__name:"BillingInformationForm.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}},setup(a){const r=a.portalObject.customer_id,{customer:l,get:n,update:i}=o.useCustomer({customerId:r});return e.onMounted(async()=>{await n.execute()}),(a,o)=>e.renderSlot(a.$slots,"default",{customer:e.unref(l),isLoading:e.unref(n).isPending.value||e.unref(i).isPending.value,updateCustomer:e.unref(i),apiError:e.unref(t.getApiError)(e.unref(i).error)})}}),v=e.defineComponent({__name:"BillingInformationForm.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}},emits:["error"],setup:t=>(a,o)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(r._sfc_main),{"custom-element-name":e.unref(b),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=t.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=t.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:o[0]||(o[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(g,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),_=r.defineCustomElement(v),b=r.getComponentName("billing-information-form");exports.COMPONENT_NAME=b,exports.SolvimonBillingInformationForm=_,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(b)||customElements.define(b,_)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { shallowRef, computed, defineComponent, ref, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode, Fragment, onMounted, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { H as useValidation, J as objectDiff, K as isOrganization, L as isIndividual, u as useIntl, _ as _sfc_main$4, M as _sfc_main$5, N as _sfc_main$6, O as _sfc_main$7,
|
|
2
|
+
import { H as useValidation, J as objectDiff, K as isOrganization, L as isIndividual, u as useIntl, _ as _sfc_main$4, M as _sfc_main$5, N as _sfc_main$6, O as _sfc_main$7, B as _sfc_main$8, e as _sfc_main$9, Q as getApiError } from "../../vendor-ui-C0K3osvz.mjs";
|
|
3
3
|
import { e as email, r as required } from "../../index-CzL1ZcGi.mjs";
|
|
4
|
-
import { u as useCustomer } from "../../useCustomer-
|
|
5
|
-
import { _ as _sfc_main$a, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
4
|
+
import { u as useCustomer } from "../../useCustomer-Ba9WRtuT.mjs";
|
|
5
|
+
import { _ as _sfc_main$a, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
|
|
6
6
|
const useForm = ({
|
|
7
7
|
initialState,
|
|
8
8
|
validationRules,
|
|
@@ -471,6 +471,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
471
471
|
setup(__props) {
|
|
472
472
|
return (_ctx, _cache) => {
|
|
473
473
|
return openBlock(), createBlock(_sfc_main$3, {
|
|
474
|
+
class: "sv-billing-form sv-root sv-component",
|
|
474
475
|
customer: __props.customer,
|
|
475
476
|
"update-customer": __props.updateCustomer,
|
|
476
477
|
"is-loading": __props.isLoading,
|
|
@@ -494,6 +495,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
494
495
|
onLog: { type: Function },
|
|
495
496
|
allowedPortalTypes: { type: Array },
|
|
496
497
|
portalObject: { type: Object },
|
|
498
|
+
cssOverrides: { type: [String, Array] },
|
|
497
499
|
branding: { type: Object }
|
|
498
500
|
},
|
|
499
501
|
setup(__props) {
|
|
@@ -528,6 +530,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
528
530
|
onLog: { type: Function },
|
|
529
531
|
allowedPortalTypes: { type: Array },
|
|
530
532
|
portalObject: { type: Object },
|
|
533
|
+
cssOverrides: { type: [String, Array] },
|
|
531
534
|
branding: { type: Object }
|
|
532
535
|
},
|
|
533
536
|
emits: ["error"],
|
|
@@ -545,6 +548,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
545
548
|
"experimental-features": __props.experimentalFeatures,
|
|
546
549
|
"log-level": __props.logLevel,
|
|
547
550
|
"on-log": __props.onLog,
|
|
551
|
+
"css-overrides": __props.cssOverrides,
|
|
548
552
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
549
553
|
}, {
|
|
550
554
|
default: withCtx(() => [
|
|
@@ -562,7 +566,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
562
566
|
}, 16)
|
|
563
567
|
]),
|
|
564
568
|
_: 1
|
|
565
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
569
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
566
570
|
};
|
|
567
571
|
}
|
|
568
572
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js"),t=require("../../component-BOqPDAVk.js"),r=require("../../useLoadInitialData-DjwRHcAH.js"),n=require("../../usePaymentMethods-ryN_YohI.js"),a=e.defineComponent({__name:"CustomerPaymentMethods.entry.view",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup(o){var a;const l=o,i=l.portalObject.customer_id,p=n.usePaymentMethods({customerId:i,pageSize:(null==(a=l.configuration)?void 0:a.maxItems)||3}),{isLoading:c}=r.useLoadInitialData(p.fetchInitial());return(r,n)=>{var a,l,i,m;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(s),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(a=o.branding)?void 0:a.colors)?void 0:l.primary,"secondary-color":null==(m=null==(i=o.branding)?void 0:i.colors)?void 0:m.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,"css-overrides":o.cssOverrides,onError:n[0]||(n[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{paymentMethods:e.unref(p).items.value,isLoading:e.unref(c)})]),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}}),l=e.defineComponent({__name:"CustomerPaymentMethods.entry",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},cssOverrides:{type:[String,Array]},branding:{type:Object},configuration:{type:Object}},setup:r=>(n,l)=>{var i,p,c,m;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(s),environment:r.environment,locale:r.locale,"portal-object":r.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(i=r.branding)?void 0:i.colors)?void 0:p.primary,"secondary-color":null==(m=null==(c=r.branding)?void 0:c.colors)?void 0:m.secondary,"experimental-features":r.experimentalFeatures,"log-level":r.logLevel,"on-log":r.onLog,"css-overrides":r.cssOverrides,onError:l[0]||(l[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({paymentMethods:t,isLoading:n})=>[e.createVNode(o._sfc_main,{configuration:r.configuration,"payment-methods":t,"is-loading":n},null,8,["configuration","payment-methods","is-loading"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}),i=t.defineCustomElement(l),s=t.getComponentName("customer-payment-methods");exports.COMPONENT_NAME=s,exports.SolvimonCustomerPaymentMethods=i,exports.defineSolvimonCustomerPaymentMethods=()=>{customElements.get(s)||customElements.define(s,i)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
4
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
5
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
2
|
+
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs";
|
|
3
|
+
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
|
|
4
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
|
|
5
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-CRWbH48K.mjs";
|
|
6
6
|
const DEFAULT_MAX_ITEMS = 3;
|
|
7
7
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "CustomerPaymentMethods.entry.view",
|
|
@@ -19,6 +19,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
logLevel: { type: String },
|
|
20
20
|
onLog: { type: Function },
|
|
21
21
|
allowedPortalTypes: { type: Array },
|
|
22
|
+
cssOverrides: { type: [String, Array] },
|
|
22
23
|
branding: { type: Object },
|
|
23
24
|
configuration: { type: Object }
|
|
24
25
|
},
|
|
@@ -44,6 +45,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
44
45
|
"experimental-features": __props.experimentalFeatures,
|
|
45
46
|
"log-level": __props.logLevel,
|
|
46
47
|
"on-log": __props.onLog,
|
|
48
|
+
"css-overrides": __props.cssOverrides,
|
|
47
49
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
48
50
|
}, {
|
|
49
51
|
default: withCtx(() => [
|
|
@@ -53,7 +55,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
53
55
|
})
|
|
54
56
|
]),
|
|
55
57
|
_: 3
|
|
56
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
58
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
});
|
|
@@ -72,6 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
72
74
|
logLevel: { type: String },
|
|
73
75
|
onLog: { type: Function },
|
|
74
76
|
allowedPortalTypes: { type: Array },
|
|
77
|
+
cssOverrides: { type: [String, Array] },
|
|
75
78
|
branding: { type: Object },
|
|
76
79
|
configuration: { type: Object }
|
|
77
80
|
},
|
|
@@ -89,6 +92,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
92
|
"experimental-features": __props.experimentalFeatures,
|
|
90
93
|
"log-level": __props.logLevel,
|
|
91
94
|
"on-log": __props.onLog,
|
|
95
|
+
"css-overrides": __props.cssOverrides,
|
|
92
96
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
93
97
|
}, {
|
|
94
98
|
default: withCtx(() => [
|
|
@@ -104,7 +108,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
104
108
|
}, 16)
|
|
105
109
|
]),
|
|
106
110
|
_: 1
|
|
107
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
111
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
108
112
|
};
|
|
109
113
|
}
|
|
110
114
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../usePayments-B13S_yai.js"),n=require("../../component-C2Gc-wsE.js"),i=require("../../vendor-ui-Ce_Yp7xA.js"),a=require("../../useViewport-CKRY1CKR.js"),l=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js"),r=e.defineComponent({__name:"Invoice.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(n){const i=n,a=o.useInvoice({invoiceId:i.configuration.invoiceId}),l=o.usePayments(),{isLoading:r}=t.useLoadInitialData(a.get(),l.get(i.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(a).invoice.value,invoiceDownloadService:e.unref(a).downloadInvoicePdf,payments:e.unref(l),isLoading:e.unref(r)})}}),c={key:0,class:"mt-8"},s={class:"flex flex-col gap-6"},d=["onClick","onKeyup"],u={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},p={key:0},m={class:"p-0"},f={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},v=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:a,formatMessage:l,formatNumber:r}=i.useIntl(),{getIsOpen:v,toggle:g}=i.useToggleList(),y=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),_=e=>l({defaultMessage:"Service period - {startAt} - {endAt}",id:"wallet_balance.service_period_heading",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),b=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=y.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:l({defaultMessage:"Credits",id:"wallet_balance.credit_type_fallback_label",description:"Fallback label for wallet balance credit types when no name is available"})},w=e=>e?r(Number(e)):l({defaultMessage:"-",id:"empty_value_placeholder",description:"Placeholder shown when a wallet balance quantity is missing"}),h=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,l,r;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(l=u.left_wallet_credits)?void 0:l.quantity),available:n(null==(r=u.available_wallet_credits)?void 0:r.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,g=s.get(m)??new Set;if(g.has(v))continue;g.add(v),s.set(m,g);const y=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};y.rows.push(f),c.set(m,y)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:_,getCreditTypeLabel:b,formatQuantity:w}));return(t,o)=>h.value.length>0?(e.openBlock(),e.createElementBlock("section",c,[e.createElementVNode("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(i._sfc_main$17),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(i.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$18),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Wallet balance",id:"wallet_balance.details.header",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(g)(t.id),onKeyup:[e.withKeys(o=>e.unref(g)(t.id),["enter"]),e.withKeys(o=>e.unref(g)(t.id),["space"])]},[e.createVNode(e.unref(i._sfc_main$19),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main$11),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(v)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",u,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,d),e.unref(v)(t.id)?(e.openBlock(),e.createElementBlock("tr",p,[e.createElementVNode("td",m,[e.createElementVNode("div",f,[e.createVNode(e.unref(i.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$18),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Credit breakdown",id:"invoice_credits.credit_breakdown.table_header",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Balance",id:"invoice_credits.balance.table_header",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Used",id:"invoice_credits.used.table_header",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Remaining",id:"invoice_credits.remaining.table_header",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(i._sfc_main$19),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),g=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=i.useIntl(),{isMobileViewport:n}=a.useViewport();return(a,l)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!e.unref(n)})},[e.unref(n)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$20),{key:0,variant:"default","has-icon":"",class:"justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(i._sfc_main$12),{invoice:t.invoice,"is-expandable":!e.unref(n)},{logo:e.withCtx(()=>[e.renderSlot(a.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(v,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),y={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},_={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},b=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(t){const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../PaymentHistoryBlock-DHM-3fh-.js"))),{$t:n}=i.useIntl();return(a,r)=>{var c,s;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(i._sfc_main$13),{class:"mb-6","payment-attempts":t.payments??[],invoice:t.invoice,"download-service":()=>t.invoiceDownloadService(t.invoice.id),"show-download-button":t.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",y,[t.invoice?(e.openBlock(),e.createBlock(g,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",_,[e.createVNode(l._sfc_main,{invoice:t.invoice},null,8,["invoice"]),(null==(c=t.configuration)?void 0:c.enablePaymentAttempts)&&(null==(s=t.payments)?void 0:s.length)?(e.openBlock(),e.createBlock(e.unref(o),{key:0,"payment-attempts":t.payments,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.configuration.enableCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$2),{key:1,customer:t.invoice.customer,title:e.unref(n)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64)}}}),w=e.defineComponent({__name:"Invoice.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){var o;const i=t;if(!(null==(o=i.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const a=e.computed(()=>({...i,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...i.configuration}}));return(o,i)=>{var l,c,s,d;return e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"custom-element-name":e.unref(x),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(l=t.branding)?void 0:l.colors)?void 0:c.primary,"secondary-color":null==(d=null==(s=t.branding)?void 0:s.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:i[0]||(i[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(r,e.normalizeProps(e.guardReactiveProps(a.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(b,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),h=n.defineCustomElement(w),x=n.getComponentName("invoice");exports.COMPONENT_NAME=x,exports.SolvimonInvoice=h,exports.defineSolvimonInvoice=()=>{customElements.get(x)||customElements.define(x,h)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-DjwRHcAH.js"),o=require("../../usePayments-DWXPGFvp.js"),n=require("../../component-BOqPDAVk.js"),i=require("../../vendor-ui-5pJF5KBP.js"),a=require("../../useViewport-CKRY1CKR.js"),r=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js"),l=e.defineComponent({__name:"Invoice.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(n){const i=n,a=o.useInvoice({invoiceId:i.configuration.invoiceId}),r=o.usePayments(),{isLoading:l}=t.useLoadInitialData(a.get(),r.get(i.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(a).invoice.value,invoiceDownloadService:e.unref(a).downloadInvoicePdf,payments:e.unref(r),isLoading:e.unref(l)})}}),c={key:0,class:"mt-8"},s={class:"flex flex-col gap-6"},d=["onClick","onKeyup"],u={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},p={key:0},m={class:"p-0"},f={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},v=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:a,formatMessage:r,formatNumber:l}=i.useIntl(),{getIsOpen:v,toggle:_}=i.useToggleList(),g=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),y=e=>r({defaultMessage:"Service period - {startAt} - {endAt}",id:"wallet_balance.service_period_heading",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),b=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=g.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:r({defaultMessage:"Credits",id:"wallet_balance.credit_type_fallback_label",description:"Fallback label for wallet balance credit types when no name is available"})},w=e=>e?l(Number(e)):r({defaultMessage:"-",id:"empty_value_placeholder",description:"Placeholder shown when a wallet balance quantity is missing"}),h=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,r,l;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(r=u.left_wallet_credits)?void 0:r.quantity),available:n(null==(l=u.available_wallet_credits)?void 0:l.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,_=s.get(m)??new Set;if(_.has(v))continue;_.add(v),s.set(m,_);const g=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};g.rows.push(f),c.set(m,g)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:y,getCreditTypeLabel:b,formatQuantity:w}));return(t,o)=>h.value.length>0?(e.openBlock(),e.createElementBlock("section",c,[e.createElementVNode("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(i._sfc_main$16),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(i.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$17),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Wallet balance",id:"wallet_balance.details.header",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(_)(t.id),onKeyup:[e.withKeys(o=>e.unref(_)(t.id),["enter"]),e.withKeys(o=>e.unref(_)(t.id),["space"])]},[e.createVNode(e.unref(i._sfc_main$18),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main$6),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(v)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",u,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,d),e.unref(v)(t.id)?(e.openBlock(),e.createElementBlock("tr",p,[e.createElementVNode("td",m,[e.createElementVNode("div",f,[e.createVNode(e.unref(i.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$17),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Credit breakdown",id:"invoice_credits.credit_breakdown.table_header",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$17),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Balance",id:"invoice_credits.balance.table_header",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$17),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Used",id:"invoice_credits.used.table_header",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$17),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Remaining",id:"invoice_credits.remaining.table_header",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(i._sfc_main$18),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$18),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$18),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$18),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),_=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=i.useIntl(),{isMobileViewport:n}=a.useViewport();return(a,r)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{class:"sv-invoice__summary grow",title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"})},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["sv-invoice__summary-body",{"p-6 pt-2":!e.unref(n)}])},[e.unref(n)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$19),{key:0,variant:"default","has-icon":"",class:"sv-invoice__download-hint justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(i._sfc_main$12),{class:"sv-invoice__summary-content",invoice:t.invoice,"is-expandable":!e.unref(n)},{logo:e.withCtx(()=>[e.renderSlot(a.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(v,{class:"sv-invoice__credits-breakdown",invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),g={class:"sv-invoice sv-root sv-component"},y={class:"sv-invoice__body flex flex-col gap-3 lg:flex-row lg:gap-6"},b={class:"sv-invoice__aside flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},w=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(t){const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../PaymentHistoryBlock-BiiFJkpT.js"))),{$t:n}=i.useIntl();return(a,l)=>{var c,s;return e.openBlock(),e.createElementBlock("div",g,[e.createVNode(e.unref(i._sfc_main$13),{class:"sv-invoice__header mb-6","payment-attempts":t.payments??[],invoice:t.invoice,"download-service":()=>t.invoiceDownloadService(t.invoice.id),"show-download-button":t.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",y,[t.invoice?(e.openBlock(),e.createBlock(_,{key:0,class:"sv-invoice__main",invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",b,[e.createVNode(r._sfc_main,{class:"sv-invoice__details",invoice:t.invoice},null,8,["invoice"]),(null==(c=t.configuration)?void 0:c.enablePaymentAttempts)&&(null==(s=t.payments)?void 0:s.length)?(e.openBlock(),e.createBlock(e.unref(o),{key:0,class:"sv-invoice__payment-history","payment-attempts":t.payments,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.configuration.enableCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$2),{key:1,class:"sv-invoice__billing-information",customer:t.invoice.customer,title:e.unref(n)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])])}}}),h=e.defineComponent({__name:"Invoice.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){var o;const i=t;if(!(null==(o=i.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const a=e.computed(()=>({...i,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...i.configuration}}));return(o,i)=>{var r,c,s,d;return e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"custom-element-name":e.unref(k),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(r=t.branding)?void 0:r.colors)?void 0:c.primary,"secondary-color":null==(d=null==(s=t.branding)?void 0:s.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,"css-overrides":t.cssOverrides,onError:i[0]||(i[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(l,e.normalizeProps(e.guardReactiveProps(a.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(w,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}}),x=n.defineCustomElement(h),k=n.getComponentName("invoice");exports.COMPONENT_NAME=k,exports.SolvimonInvoice=x,exports.defineSolvimonInvoice=()=>{customElements.get(k)||customElements.define(k,x)};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, withKeys, normalizeClass, createCommentVNode, createBlock, defineAsyncComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { u as useLoadInitialData } from "../../useLoadInitialData-
|
|
3
|
-
import { u as useInvoice, a as usePayments } from "../../usePayments-
|
|
4
|
-
import { _ as _sfc_main$g, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
5
|
-
import { u as useIntl, C as useToggleList, D as _sfc_main$5, _ as _sfc_main$6, I as InvoiceTable, E as _sfc_main$7, F as _sfc_main$8,
|
|
2
|
+
import { u as useLoadInitialData } from "../../useLoadInitialData-5sgImpzc.mjs";
|
|
3
|
+
import { u as useInvoice, a as usePayments } from "../../usePayments-Cw5PPEJa.mjs";
|
|
4
|
+
import { _ as _sfc_main$g, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
|
|
5
|
+
import { u as useIntl, C as useToggleList, D as _sfc_main$5, _ as _sfc_main$6, I as InvoiceTable, E as _sfc_main$7, F as _sfc_main$8, l as _sfc_main$9, b as _sfc_main$a, G as _sfc_main$b, y as _sfc_main$c, z as _sfc_main$d, c as _sfc_main$f } from "../../vendor-ui-C0K3osvz.mjs";
|
|
6
6
|
import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
|
|
7
|
-
import { _ as _sfc_main$e } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { _ as _sfc_main$e } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs";
|
|
8
8
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
9
9
|
__name: "Invoice.entry.view",
|
|
10
10
|
props: {
|
|
@@ -20,6 +20,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
onLog: { type: Function },
|
|
21
21
|
allowedPortalTypes: { type: Array },
|
|
22
22
|
portalObject: { type: Object },
|
|
23
|
+
cssOverrides: { type: [String, Array] },
|
|
23
24
|
branding: { type: Object },
|
|
24
25
|
configuration: { type: Object }
|
|
25
26
|
},
|
|
@@ -98,7 +99,7 @@ const _hoisted_1$1 = {
|
|
|
98
99
|
class: "mt-8"
|
|
99
100
|
};
|
|
100
101
|
const _hoisted_2$1 = { class: "flex flex-col gap-6" };
|
|
101
|
-
const _hoisted_3 = ["onClick", "onKeyup"];
|
|
102
|
+
const _hoisted_3$1 = ["onClick", "onKeyup"];
|
|
102
103
|
const _hoisted_4 = { class: "ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600" };
|
|
103
104
|
const _hoisted_5 = { key: 0 };
|
|
104
105
|
const _hoisted_6 = { class: "p-0" };
|
|
@@ -228,7 +229,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
228
229
|
]),
|
|
229
230
|
_: 2
|
|
230
231
|
}, 1024)
|
|
231
|
-
], 40, _hoisted_3),
|
|
232
|
+
], 40, _hoisted_3$1),
|
|
232
233
|
unref(getIsOpen)(row.id) ? (openBlock(), createElementBlock("tr", _hoisted_5, [
|
|
233
234
|
createElementVNode("td", _hoisted_6, [
|
|
234
235
|
createElementVNode("div", _hoisted_7, [
|
|
@@ -347,22 +348,22 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
347
348
|
const { isMobileViewport: isSmallScreen } = useViewport();
|
|
348
349
|
return (_ctx, _cache) => {
|
|
349
350
|
return openBlock(), createBlock(unref(_sfc_main$a), {
|
|
351
|
+
class: "sv-invoice__summary grow",
|
|
350
352
|
title: unref($t)({
|
|
351
353
|
defaultMessage: "Invoice",
|
|
352
354
|
description: "Title for the invoice block on the invoice details page",
|
|
353
355
|
id: "sdk.invoice_details.invoice.title"
|
|
354
|
-
})
|
|
355
|
-
class: "grow"
|
|
356
|
+
})
|
|
356
357
|
}, {
|
|
357
358
|
default: withCtx(() => [
|
|
358
359
|
createElementVNode("div", {
|
|
359
|
-
class: normalizeClass({ "p-6 pt-2": !unref(isSmallScreen) })
|
|
360
|
+
class: normalizeClass(["sv-invoice__summary-body", { "p-6 pt-2": !unref(isSmallScreen) }])
|
|
360
361
|
}, [
|
|
361
362
|
unref(isSmallScreen) ? (openBlock(), createBlock(unref(_sfc_main$b), {
|
|
362
363
|
key: 0,
|
|
363
364
|
variant: "default",
|
|
364
365
|
"has-icon": "",
|
|
365
|
-
class: "justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"
|
|
366
|
+
class: "sv-invoice__download-hint justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"
|
|
366
367
|
}, {
|
|
367
368
|
default: withCtx(() => [
|
|
368
369
|
createTextVNode(toDisplayString(unref($t)({
|
|
@@ -374,6 +375,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
374
375
|
_: 1
|
|
375
376
|
})) : createCommentVNode("", true),
|
|
376
377
|
createVNode(unref(_sfc_main$c), {
|
|
378
|
+
class: "sv-invoice__summary-content",
|
|
377
379
|
invoice: __props.invoice,
|
|
378
380
|
"is-expandable": !unref(isSmallScreen)
|
|
379
381
|
}, {
|
|
@@ -382,7 +384,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
382
384
|
]),
|
|
383
385
|
_: 3
|
|
384
386
|
}, 8, ["invoice", "is-expandable"]),
|
|
385
|
-
createVNode(_sfc_main$3, {
|
|
387
|
+
createVNode(_sfc_main$3, {
|
|
388
|
+
class: "sv-invoice__credits-breakdown",
|
|
389
|
+
invoice: __props.invoice
|
|
390
|
+
}, null, 8, ["invoice"])
|
|
386
391
|
], 2)
|
|
387
392
|
]),
|
|
388
393
|
_: 3
|
|
@@ -390,8 +395,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
390
395
|
};
|
|
391
396
|
}
|
|
392
397
|
});
|
|
393
|
-
const _hoisted_1 = { class: "
|
|
394
|
-
const _hoisted_2 = { class: "
|
|
398
|
+
const _hoisted_1 = { class: "sv-invoice sv-root sv-component" };
|
|
399
|
+
const _hoisted_2 = { class: "sv-invoice__body flex flex-col gap-3 lg:flex-row lg:gap-6" };
|
|
400
|
+
const _hoisted_3 = { class: "sv-invoice__aside flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6" };
|
|
395
401
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
396
402
|
__name: "Invoice",
|
|
397
403
|
props: {
|
|
@@ -403,34 +409,40 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
403
409
|
},
|
|
404
410
|
setup(__props) {
|
|
405
411
|
const PaymentHistoryBlock = defineAsyncComponent(
|
|
406
|
-
() => import("../../PaymentHistoryBlock-
|
|
412
|
+
() => import("../../PaymentHistoryBlock-D_B099M7.mjs")
|
|
407
413
|
);
|
|
408
414
|
const { $t } = useIntl();
|
|
409
415
|
return (_ctx, _cache) => {
|
|
410
416
|
var _a, _b;
|
|
411
|
-
return openBlock(), createElementBlock(
|
|
417
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
412
418
|
createVNode(unref(_sfc_main$d), {
|
|
413
|
-
class: "mb-6",
|
|
419
|
+
class: "sv-invoice__header mb-6",
|
|
414
420
|
"payment-attempts": __props.payments ?? [],
|
|
415
421
|
invoice: __props.invoice,
|
|
416
422
|
"download-service": () => __props.invoiceDownloadService(__props.invoice.id),
|
|
417
423
|
"show-download-button": __props.configuration.enableDownloadButton,
|
|
418
424
|
variant: "external"
|
|
419
425
|
}, null, 8, ["payment-attempts", "invoice", "download-service", "show-download-button"]),
|
|
420
|
-
createElementVNode("div",
|
|
426
|
+
createElementVNode("div", _hoisted_2, [
|
|
421
427
|
__props.invoice ? (openBlock(), createBlock(_sfc_main$2, {
|
|
422
428
|
key: 0,
|
|
429
|
+
class: "sv-invoice__main",
|
|
423
430
|
invoice: __props.invoice
|
|
424
431
|
}, null, 8, ["invoice"])) : createCommentVNode("", true),
|
|
425
|
-
createElementVNode("div",
|
|
426
|
-
createVNode(_sfc_main$e, {
|
|
432
|
+
createElementVNode("div", _hoisted_3, [
|
|
433
|
+
createVNode(_sfc_main$e, {
|
|
434
|
+
class: "sv-invoice__details",
|
|
435
|
+
invoice: __props.invoice
|
|
436
|
+
}, null, 8, ["invoice"]),
|
|
427
437
|
((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(unref(PaymentHistoryBlock), {
|
|
428
438
|
key: 0,
|
|
439
|
+
class: "sv-invoice__payment-history",
|
|
429
440
|
"payment-attempts": __props.payments,
|
|
430
441
|
customer: __props.invoice.customer
|
|
431
442
|
}, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true),
|
|
432
443
|
__props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$f), {
|
|
433
444
|
key: 1,
|
|
445
|
+
class: "sv-invoice__billing-information",
|
|
434
446
|
customer: __props.invoice.customer,
|
|
435
447
|
title: unref($t)({
|
|
436
448
|
defaultMessage: "Your billing information",
|
|
@@ -440,7 +452,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
440
452
|
}, null, 8, ["customer", "title"])) : createCommentVNode("", true)
|
|
441
453
|
])
|
|
442
454
|
])
|
|
443
|
-
]
|
|
455
|
+
]);
|
|
444
456
|
};
|
|
445
457
|
}
|
|
446
458
|
});
|
|
@@ -459,6 +471,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
459
471
|
onLog: { type: Function },
|
|
460
472
|
allowedPortalTypes: { type: Array },
|
|
461
473
|
portalObject: { type: Object },
|
|
474
|
+
cssOverrides: { type: [String, Array] },
|
|
462
475
|
branding: { type: Object },
|
|
463
476
|
configuration: { type: Object }
|
|
464
477
|
},
|
|
@@ -490,6 +503,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
490
503
|
"experimental-features": __props.experimentalFeatures,
|
|
491
504
|
"log-level": __props.logLevel,
|
|
492
505
|
"on-log": __props.onLog,
|
|
506
|
+
"css-overrides": __props.cssOverrides,
|
|
493
507
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
494
508
|
}, {
|
|
495
509
|
default: withCtx(() => [
|
|
@@ -508,7 +522,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
508
522
|
}, 16)
|
|
509
523
|
]),
|
|
510
524
|
_: 1
|
|
511
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
525
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
512
526
|
};
|
|
513
527
|
}
|
|
514
528
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js"),t=require("../../Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js"),n=require("../../useInvoiceData-D2jkdmlA.js"),i=require("../../component-BOqPDAVk.js"),r=e.defineComponent({__name:"InvoiceDetails",props:{invoice:{type:Object},isLoading:{type:Boolean},configuration:{type:Object}},setup:n=>(i,r)=>n.isLoading?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"section",class:"sv-invoice-details sv-root sv-component sv-loading min-h-[100px]","data-testid":"invoice-details-skeleton"})):(e.openBlock(),e.createBlock(o._sfc_main,{key:1,class:"sv-invoice-details sv-root sv-component",invoice:n.invoice},null,8,["invoice"]))}),a=e.defineComponent({__name:"InvoiceDetails.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(o){const t=o,i=n.useInvoiceData(t.configuration.invoiceId);return(o,t)=>{var n;return e.renderSlot(o.$slots,"default",{invoice:null==(n=e.unref(i).data.value)?void 0:n.invoice,isLoading:e.unref(i).isPending.value})}}}),l=e.defineComponent({__name:"InvoiceDetails.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(o){var t;if(!(null==(t=o.configuration)?void 0:t.invoiceId))throw new Error("Missing invoice id");return(t,n)=>{var l,s,p,v;return e.openBlock(),e.createBlock(e.unref(i._sfc_main),{"custom-element-name":e.unref(c),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(l=o.branding)?void 0:l.colors)?void 0:s.primary,"secondary-color":null==(v=null==(p=o.branding)?void 0:p.colors)?void 0:v.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,"css-overrides":o.cssOverrides,onError:n[0]||(n[0]=e=>t.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(({invoice:t,isLoading:n})=>[t?(e.openBlock(),e.createBlock(r,{key:0,"is-loading":n,invoice:t,configuration:o.configuration},null,8,["is-loading","invoice","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log","css-overrides"])}}}),s=i.defineCustomElement(l),c=i.getComponentName("invoice-details");exports.COMPONENT_NAME=c,exports.SolvimonInvoiceDetails=s,exports.defineSolvimonInvoiceDetails=()=>{customElements.get(c)||customElements.define(c,s)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, renderSlot, unref, withCtx, createVNode, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
|
|
2
|
-
import { _ as _sfc_main$4 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { _ as _sfc_main$3 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { u as useInvoiceData } from "../../useInvoiceData-
|
|
5
|
-
import { _ as _sfc_main$5, d as defineCustomElement, g as getComponentName } from "../../component-
|
|
2
|
+
import { _ as _sfc_main$4 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs";
|
|
3
|
+
import { _ as _sfc_main$3 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs";
|
|
4
|
+
import { u as useInvoiceData } from "../../useInvoiceData-BJwwDur7.mjs";
|
|
5
|
+
import { _ as _sfc_main$5, d as defineCustomElement, g as getComponentName } from "../../component-Djrf1L-Z.mjs";
|
|
6
6
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "InvoiceDetails",
|
|
8
8
|
props: {
|
|
@@ -15,10 +15,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
return __props.isLoading ? (openBlock(), createBlock(_sfc_main$3, {
|
|
16
16
|
key: 0,
|
|
17
17
|
variant: "section",
|
|
18
|
-
class: "min-h-[100px]",
|
|
18
|
+
class: "sv-invoice-details sv-root sv-component sv-loading min-h-[100px]",
|
|
19
19
|
"data-testid": "invoice-details-skeleton"
|
|
20
20
|
})) : (openBlock(), createBlock(_sfc_main$4, {
|
|
21
21
|
key: 1,
|
|
22
|
+
class: "sv-invoice-details sv-root sv-component",
|
|
22
23
|
invoice: __props.invoice
|
|
23
24
|
}, null, 8, ["invoice"]));
|
|
24
25
|
};
|
|
@@ -39,6 +40,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
39
40
|
onLog: { type: Function },
|
|
40
41
|
allowedPortalTypes: { type: Array },
|
|
41
42
|
portalObject: { type: Object },
|
|
43
|
+
cssOverrides: { type: [String, Array] },
|
|
42
44
|
branding: { type: Object },
|
|
43
45
|
configuration: { type: Object }
|
|
44
46
|
},
|
|
@@ -69,6 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
69
71
|
onLog: { type: Function },
|
|
70
72
|
allowedPortalTypes: { type: Array },
|
|
71
73
|
portalObject: { type: Object },
|
|
74
|
+
cssOverrides: { type: [String, Array] },
|
|
72
75
|
branding: { type: Object },
|
|
73
76
|
configuration: { type: Object }
|
|
74
77
|
},
|
|
@@ -91,6 +94,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
91
94
|
"experimental-features": __props.experimentalFeatures,
|
|
92
95
|
"log-level": __props.logLevel,
|
|
93
96
|
"on-log": __props.onLog,
|
|
97
|
+
"css-overrides": __props.cssOverrides,
|
|
94
98
|
onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
|
|
95
99
|
}, {
|
|
96
100
|
default: withCtx(() => [
|
|
@@ -107,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
111
|
}, 16)
|
|
108
112
|
]),
|
|
109
113
|
_: 1
|
|
110
|
-
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
|
|
114
|
+
}, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log", "css-overrides"]);
|
|
111
115
|
};
|
|
112
116
|
}
|
|
113
117
|
});
|