@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  2. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  3. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +2 -4
  5. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
  6. package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
  7. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +2 -5
  8. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
  9. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs} +1 -2
  11. package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
  12. package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
  13. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +1 -5
  14. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
  15. package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
  16. package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
  17. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs} +32 -189
  18. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
  19. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -31
  21. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +4 -7
  22. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
  23. package/dist/adyenLoader-CEH4A2b2.js +1 -0
  24. package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
  25. package/dist/component-C2Gc-wsE.js +1 -0
  26. package/dist/component-CM9g6tbD.mjs +804 -0
  27. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  28. package/dist/components/BillingInformation/BillingInformation.es.js +3 -7
  29. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  30. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +9 -17
  31. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  32. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -7
  33. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  34. package/dist/components/Invoice/Invoice.es.js +42 -2659
  35. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  36. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -7
  37. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  38. package/dist/components/InvoicesList/InvoicesList.es.js +2 -6
  39. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  40. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -7
  41. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  42. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -33
  43. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  44. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +8 -4824
  45. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  46. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -8
  47. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  48. package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
  49. package/dist/core/index.cjs.js +1 -1
  50. package/dist/core/index.es.js +1 -1
  51. package/dist/core/types.d.ts +2 -0
  52. package/dist/{customer-CcQR-JIm.js → customer-C_Hz_npf.js} +1 -1
  53. package/dist/{customer-CJrpbGX4.mjs → customer-TIi7iZFw.mjs} +1 -1
  54. package/dist/en-US-CBoPxQwX.mjs +199 -0
  55. package/dist/en-US-DJq-9dD8.js +1 -0
  56. package/dist/index-CzL1ZcGi.mjs +85 -0
  57. package/dist/index-DRdBmZ2-.js +1 -0
  58. package/dist/index.cjs.js +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.es.js +4 -1
  61. package/dist/{invoices-CNK1Ushv.mjs → invoices-BuVOuTOm.mjs} +2 -15
  62. package/dist/invoices-DbvwXAsm.js +1 -0
  63. package/dist/nl-NL-BB7KbK-h.mjs +181 -0
  64. package/dist/nl-NL-CtU1Lg2F.js +1 -0
  65. package/dist/paymentMethods-B4AYGf0K.js +1 -0
  66. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-Di32oJ39.mjs} +2 -2
  67. package/dist/{payments-CE9U7aKK.mjs → payments-C5fD1PXB.mjs} +1 -1
  68. package/dist/{payments-CLt0SExf.js → payments-DeutKq9x.js} +1 -1
  69. package/dist/{registry-B99ZnfEn.mjs → registry-BLwMl1bK.mjs} +6 -4
  70. package/dist/registry-CMSmkLcy.js +1 -0
  71. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  72. package/dist/screens/Checkout/Checkout.es.js +420 -2388
  73. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  74. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -14
  75. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  76. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  77. package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
  78. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  79. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +79 -61
  80. package/dist/solvimon-web.css +1 -1
  81. package/dist/source-DKDKBlUm.mjs +179 -0
  82. package/dist/source-dkMNFWDc.js +1 -0
  83. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-mOgjjzUi.mjs} +2 -2
  84. package/dist/subscriptions-wdMADcQZ.js +1 -0
  85. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
  86. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
  87. package/dist/{useCustomer-PthyTFLl.js → useCustomer-DanZzn-l.js} +1 -1
  88. package/dist/{useCustomer--jycAz--.mjs → useCustomer-cbhDyWJL.mjs} +2 -2
  89. package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
  90. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -8
  91. package/dist/useInvoiceData-CxxHa5R2.js +1 -0
  92. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
  93. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-BQQxcPdz.mjs} +23 -260
  94. package/dist/useInvoicesList-CtJqmblZ.js +1 -0
  95. package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
  96. package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
  97. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
  98. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
  99. package/dist/usePayments-B13S_yai.js +1 -0
  100. package/dist/usePayments-D4uGKBsV.mjs +36 -0
  101. package/dist/usePortal-DJDJNLbo.mjs +12 -0
  102. package/dist/usePortal-DWJEVkTj.js +1 -0
  103. package/dist/useService-9fCKPTmu.js +1 -0
  104. package/dist/useService-BuWWE5ND.mjs +68 -0
  105. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  106. package/dist/useViewport-CKRY1CKR.js +1 -0
  107. package/dist/useWalletBalanceItems-B53Gkjro.mjs +106 -0
  108. package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
  109. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  110. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  111. package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
  112. package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
  113. package/package.json +17 -10
  114. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  115. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  116. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  117. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  118. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  119. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  120. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  121. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  122. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  123. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  124. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  125. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  126. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  127. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  128. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  129. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  130. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  131. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  132. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  133. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  134. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  135. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  136. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  137. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  138. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  139. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  140. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  141. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  142. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  143. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  144. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  145. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  146. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  147. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  148. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  149. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  150. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  151. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  152. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  153. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  154. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  155. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  156. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  157. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  158. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  159. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  160. package/dist/api.es-B4qAAJKr.js +0 -1
  161. package/dist/api.es-UkfpLiLL.mjs +0 -83
  162. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  163. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  164. package/dist/cn.es-C7xoIs3C.js +0 -1
  165. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  166. package/dist/component-ZRZIt3ZW.js +0 -1
  167. package/dist/component-dpA83LIN.mjs +0 -6569
  168. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  169. package/dist/countryData.es-D3MFzU92.js +0 -1
  170. package/dist/customer.es-D42Md24r.js +0 -1
  171. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  172. package/dist/formatting.es-9hM8aHSg.js +0 -1
  173. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  174. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  175. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  176. package/dist/index-2jo9BSPM.js +0 -1
  177. package/dist/index-BFZ0dPh9.mjs +0 -179
  178. package/dist/index-CI71bVGE.mjs +0 -2521
  179. package/dist/index-CWSXne1Q.js +0 -1
  180. package/dist/index-D3v7hAtc.mjs +0 -253
  181. package/dist/index-WLSPwi90.js +0 -1
  182. package/dist/index.es-BBJF2O2l.js +0 -1
  183. package/dist/index.es-LCAKs4tH.mjs +0 -438
  184. package/dist/invoices-3kVHsAXr.js +0 -1
  185. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  186. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  187. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  188. package/dist/pick.es-BgDAfhAl.js +0 -1
  189. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  190. package/dist/registry-ClZ43bQn.js +0 -1
  191. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  192. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  193. package/dist/subscriptions-CS8HTxzC.js +0 -1
  194. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  195. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  196. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  197. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  198. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  199. package/dist/useService-B67YWAcN.js +0 -1
  200. package/dist/useService-DG_zedHV.mjs +0 -282
  201. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  202. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../_Uint8Array-DxISR7XF.js"),o=require("../../ContentWithAsideLayout-UHovpjZu.js"),r=require("../../useInvoicesList-CHkwSNO9.js"),n=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js"),s=require("../../useCustomer-PthyTFLl.js"),a=require("../../usePaymentMethods-BRQ7-dUr.js"),i=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js"),u=require("../../useLoadInitialData-BRg7IWqW.js"),l=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js"),c=require("../../paymentMethods-DZRf0WRl.js"),m=require("../../useService-B67YWAcN.js"),p=require("../../useWalletBalanceItems-BY3gq0fc.js"),d=require("../../component-ZRZIt3ZW.js");const v=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(d){var v;const y=null==(v=o.usePortal().value)?void 0:v.customer_id,f=s.useCustomer({customerId:y}),g=r.useInvoicesList({customerId:y,batchSize:5}),_=n.useSubscriptionsList({customerId:y,batchSize:2}),h=a.usePaymentMethods({customerId:y}),C=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=c.createPaymentMethodsService(),{data:r,execute:n,error:s,apiStatus:a,isPending:i}=m.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:s,apiStatus:a,items:r,fetch:n,isPending:i}}({customerId:y}),S=p.useCustomerWalletBalances({customerId:y}),j=p.useWalletBalanceItems(S.walletBalances),{isLoading:b}=u.useLoadInitialData(f.get.execute(),g.fetchInitial(),_.fetchInitial(),h.fetchAll(),C.fetch(),S.fetch());return(s,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(f).customer.value?(e.openBlock(),e.createBlock(n._sfc_main,{key:0,customer:e.unref(f).customer.value,subscriptions:e.unref(_).items.value,"payment-methods":e.unref(h).items.value,"is-loading":e.unref(b),onLoadMore:e.unref(_).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{invoices:e.unref(g).items.value,"has-more-items":e.unref(g).hasNextBatch.value,"is-loading":e.unref(b),onLoadMore:e.unref(g).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(p._sfc_main,{"has-error":e.unref(S).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(b),"wallet-balances":e.unref(j)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(l._sfc_main,{"is-loading":e.unref(b),"payment-methods":e.unref(h).items.value},null,8,["is-loading","payment-methods"]),e.unref(f).customer.value?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,"is-loading":e.unref(b),customer:e.unref(f).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var n,s,a,i;return e.openBlock(),e.createBlock(d._sfc_main$1,{"custom-element-name":e.unref(g),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(n=t.branding)?void 0:n.colors)?void 0:s.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(v)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),f=d.defineCustomElement(y),g=d.getComponentName("customer-overview");exports.COMPONENT_NAME=g,exports.SolvimonCustomerOverview=f,exports.defineSolvimonCustomerOverview=()=>{customElements.get(g)||customElements.define(g,f)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../ApiStatus-oqvUEWJx.js"),o=require("../../ContentWithAsideLayout-oAYVrLvL.js"),r=require("../../useInvoicesList-CtJqmblZ.js"),n=require("../../usePortal-DWJEVkTj.js"),s=require("../../SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js"),a=require("../../useCustomer-DanZzn-l.js"),i=require("../../usePaymentMethods-Cm9WdSW0.js"),u=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js"),l=require("../../useLoadInitialData-BRg7IWqW.js"),c=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js"),m=require("../../paymentMethods-B4AYGf0K.js"),p=require("../../useService-9fCKPTmu.js"),d=require("../../useWalletBalanceItems-BMaVT4TW.js"),v=require("../../component-C2Gc-wsE.js");const f=e.defineComponent({__name:"CustomerOverview",props:{configuration:{type:Object}},setup(v){var f;const y=null==(f=n.usePortal().value)?void 0:f.customer_id,g=a.useCustomer({customerId:y}),_=r.useInvoicesList({customerId:y,batchSize:5}),h=s.useSubscriptionsList({customerId:y,batchSize:2}),j=i.usePaymentMethods({customerId:y}),C=function({customerId:e,amount:t}){const{getPaymentMethodOptions:o}=m.createPaymentMethodsService(),{data:r,execute:n,error:s,apiStatus:a,isPending:i}=p.useService({initialValue:[],service:async()=>(await o({customerId:e,amount:t})).flatMap(e=>e.options??[])});return{error:s,apiStatus:a,items:r,fetch:n,isPending:i}}({customerId:y}),S=d.useCustomerWalletBalances({customerId:y}),b=d.useWalletBalanceItems(S.walletBalances),{isLoading:L}=l.useLoadInitialData(g.get.execute(),_.fetchInitial(),h.fetchInitial(),j.fetchAll(),C.fetch(),S.fetch());return(n,a)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.unref(g).customer.value?(e.openBlock(),e.createBlock(s._sfc_main,{key:0,customer:e.unref(g).customer.value,subscriptions:e.unref(h).items.value,"payment-methods":e.unref(j).items.value,"is-loading":e.unref(L),onLoadMore:e.unref(h).fetchMore},null,8,["customer","subscriptions","payment-methods","is-loading","onLoadMore"])):e.createCommentVNode("",!0)]),content:e.withCtx(()=>[e.createVNode(r._sfc_main,{invoices:e.unref(_).items.value,"has-more-items":e.unref(_).hasNextBatch.value,"is-loading":e.unref(L),onLoadMore:e.unref(_).fetchMore},null,8,["invoices","has-more-items","is-loading","onLoadMore"])]),aside:e.withCtx(()=>[e.createVNode(d._sfc_main,{"has-error":e.unref(S).apiStatus.value===e.unref(t.ApiStatus).Failed,"is-loading":e.unref(L),"wallet-balances":e.unref(b)},null,8,["has-error","is-loading","wallet-balances"]),e.createVNode(c._sfc_main,{"is-loading":e.unref(L),"payment-methods":e.unref(j).items.value},null,8,["is-loading","payment-methods"]),e.unref(g).customer.value?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,"is-loading":e.unref(L),customer:e.unref(g).customer.value},null,8,["is-loading","customer"])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"CustomerOverview.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup:t=>(o,r)=>{var n,s,a,i;return e.openBlock(),e.createBlock(v._sfc_main,{"custom-element-name":e.unref(_),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(n=t.branding)?void 0:n.colors)?void 0:s.primary,"secondary-color":null==(i=null==(a=t.branding)?void 0:a.colors)?void 0:i.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(f)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),g=v.defineCustomElement(y),_=v.getComponentName("customer-overview");exports.COMPONENT_NAME=_,exports.SolvimonCustomerOverview=g,exports.defineSolvimonCustomerOverview=()=>{customElements.get(_)||customElements.define(_,g)};
@@ -1,17 +1,18 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, createCommentVNode } from "vue";
2
- import { A as ApiStatus } from "../../_Uint8Array-DHE03FZr.mjs";
3
- import { u as usePortal, C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-Ct24RV-2.mjs";
4
- import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-DFhF_gp7.mjs";
5
- import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs";
6
- import { u as useCustomer } from "../../useCustomer--jycAz--.mjs";
7
- import { u as usePaymentMethods } from "../../usePaymentMethods-BX2RnHZN.mjs";
8
- import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs";
2
+ import { A as ApiStatus } from "../../ApiStatus-CyNDp_op.mjs";
3
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-BTdixy3L.mjs";
4
+ import { u as useInvoicesList, _ as _sfc_main$5 } from "../../useInvoicesList-BQQxcPdz.mjs";
5
+ import { u as usePortal } from "../../usePortal-DJDJNLbo.mjs";
6
+ import { u as useSubscriptionsList, _ as _sfc_main$6 } from "../../SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs";
7
+ import { u as useCustomer } from "../../useCustomer-cbhDyWJL.mjs";
8
+ import { u as usePaymentMethods } from "../../usePaymentMethods-DZvfWSlx.mjs";
9
+ import { _ as _sfc_main$4 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs";
9
10
  import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
10
- import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs";
11
- import { c as createPaymentMethodsService } from "../../paymentMethods-C-ApE-G4.mjs";
12
- import { u as useService } from "../../useService-DG_zedHV.mjs";
13
- import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-B5FMmoU2.mjs";
14
- import { b as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-dpA83LIN.mjs";
11
+ import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs";
12
+ import { c as createPaymentMethodsService } from "../../paymentMethods-Di32oJ39.mjs";
13
+ import { u as useService } from "../../useService-BuWWE5ND.mjs";
14
+ import { u as useCustomerWalletBalances, a as useWalletBalanceItems, _ as _sfc_main$2 } from "../../useWalletBalanceItems-B53Gkjro.mjs";
15
+ import { _ as _sfc_main$7, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
15
16
  function useCustomerPaymentMethodOptions({
16
17
  customerId,
17
18
  amount
@@ -99,7 +100,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
99
100
  locale: { type: String },
100
101
  dateLocale: { type: String },
101
102
  messages: { type: Object },
102
- showTimezones: { type: Boolean },
103
103
  primaryColor: { type: String },
104
104
  secondaryColor: { type: String },
105
105
  isShadowRoot: { type: Boolean },
@@ -108,7 +108,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
108
108
  onLog: { type: Function },
109
109
  allowedPortalTypes: { type: Array },
110
110
  portalObject: { type: Object },
111
- customElementName: { type: String },
112
111
  branding: { type: Object },
113
112
  configuration: { type: Object }
114
113
  },
@@ -0,0 +1,3 @@
1
+ export declare const SolvimonPayInvoice: import('../../../../node_modules/vue/dist/vue.d.ts').VueElementConstructor<unknown>;
2
+ export declare const COMPONENT_NAME: string;
3
+ export declare const defineSolvimonPayInvoice: () => void;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-C2Gc-wsE.js"),n=require("../../vendor-ui-Ce_Yp7xA.js"),o=require("../../ContentWithAsideLayout-oAYVrLvL.js"),a=require("../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js"),i=require("../../Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js"),r=require("../../adyenLoader-CEH4A2b2.js"),c=require("../../useLoadInitialData-BRg7IWqW.js"),l=require("../../usePayments-B13S_yai.js"),s=require("../../usePaymentMethodOptions-D01YWW3G.js"),u=require("../../usePaymentMethods-Cm9WdSW0.js"),p=e.defineComponent({__name:"PayButton",props:{amount:{type:Object},paymentMethod:{type:Object},type:{type:String},variant:{type:String},color:{type:String},size:{type:String},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{type:null},iconSuffix:{type:null},tag:{type:String}},emits:["click"],setup(t){const o=t,{$t:a}=n.useIntl(),i=e.computed(()=>({color:o.color??"primary",disabled:o.disabled,iconPrefix:o.iconPrefix,iconSuffix:o.iconSuffix,loading:o.loading,pill:o.pill,size:o.size??"lg",square:o.square,tag:o.tag,type:o.type,variant:o.variant})),r=e.computed(()=>{var t,n,a;switch(null==(t=o.paymentMethod)?void 0:t.paymentMethodType){case"scheme":return"Credit Card";case"applepay":return"Apple Pay";case"googlepay":return"Google Pay";case"paypal":return"PayPal";case"ideal":return"iDeal";case"klarna":return"Klarna";case"bcmc":return"BCMC";case"sepadirectdebit":return"SEPA";case"twint":return"Twint";case"swish":return"Swish";case"vipps":return"Vipps";case"mbway":return"MBway";case"alipay":return"AliPay";case"wechatpayWeb":return"WeChatPay";case"afterpay_default":return"Afterpay";case"affirm":return"Affirm";case"ach":return"ACH";case"blik":return"Blik";case"cashapp":return"Cash App Pay";case"amazonpay":return"Amazon Pay";case"venmo":return"Venmo";case"clicktopay":return"Click to Pay";case"upi":return"UPI";case"revolutpay":return"Revolut Pay";case"ratepay":return"Ratepay";case"walley":return"Walley";case"alma":return"Alma";case"facilypay_3x":case"facilypay_4x":return"Oney";case"samsungpay":return"Samsung Pay";case"bizum":return"Bizum";case"pix":return"Pix";case"multibanco":return"Multibanco";case"openbanking_UK":return"Open Banking";default:return(null==(n=o.paymentMethod)?void 0:n.paymentMethodType)?e.capitalize(null==(a=o.paymentMethod)?void 0:a.paymentMethodType):""}}),c=e.computed(()=>o.amount&&o.paymentMethod?a({defaultMessage:"Pay {amount} with {type}",id:"pay_button.label.amount_and_payment_method",description:"The label for the pay button when both the amount and the payment method are known"},{amount:n.formatAmount(o.amount),type:r.value}):o.amount?a({defaultMessage:"Pay {amount}",id:"pay_button.label.amount_only",description:"The label for the pay button when only the amount is known"},{amount:n.formatAmount(o.amount),type:r.value}):a({defaultMessage:"Pay",id:"pay_button.label.default",description:"The default label for the pay button when no amount and payment method are known"}));return(t,o)=>(e.openBlock(),e.createBlock(e.unref(n._sfc_main$3),e.mergeProps(i.value,{class:"w-full",onClick:o[0]||(o[0]=e=>t.$emit("click",e))}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},16))}}),m={key:0},d=e.defineComponent({__name:"PayInvoice",props:{invoice:{type:Object},paymentMethodOptions:{type:Array},paymentAttempts:{default:()=>[],type:Array},countryCode:{type:String},amount:{type:Object},downloadService:{type:Function},configuration:{type:Object},isLoading:{type:Boolean},error:{type:null}},setup(t){const{$t:c}=n.useIntl(),l=t,s=e.ref(),u=e.ref();function d(){if(!u.value)throw new Error("payment integration form not found");u.value.submit()}const y=()=>{l.configuration.onPaymentSuccess&&l.configuration.onPaymentSuccess()};return(l,f)=>(e.openBlock(),e.createBlock(e.unref(o.ContentWithAsideLayout),null,{header:e.withCtx(()=>[e.createVNode(i._sfc_main,{class:"min-h-[52px] w-96"},{default:e.withCtx(()=>[t.invoice&&t.downloadService?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$13),{key:0,invoice:t.invoice,"payment-attempts":t.paymentAttempts,"download-service":()=>t.downloadService(t.invoice.id)},null,8,["invoice","payment-attempts","download-service"])):e.createCommentVNode("",!0)]),_:1})]),content:e.withCtx(()=>{var o,l;return[t.isLoading?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,variant:"section",class:"min-h-[300px]"})):e.createCommentVNode("",!0),(null==(o=t.invoice)?void 0:o.paid)?(e.openBlock(),e.createBlock(r._sfc_main,{key:1,status:"success",title:e.unref(c)({id:"pay_invoice.paid.title",defaultMessage:"Thank you for your payment!",description:"Title shown when the invoice has already been paid"}),class:"mt-8"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main$11),{icon:"check"}),e.createTextVNode(e.toDisplayString(e.unref(n.formatAmount)(t.invoice.tax_summary.total_amount)),1)]),_:1})]),_:1},8,["title"])):t.error?(e.openBlock(),e.createBlock(r._sfc_main,{key:2,status:"error",title:e.unref(c)({id:"pay_invoice.error.title",defaultMessage:"Something went wrong",description:"Title shown when the invoice payment fails to load"})},{default:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{variant:"body-sm",class:"mt-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)({id:"pay_invoice.error.description",defaultMessage:"Please try again or contact support.",description:"Body text shown when the invoice payment fails to load"})),1)]),_:1})]),_:1},8,["title"])):!t.isLoading&&t.countryCode&&t.amount&&t.invoice?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(null==(l=t.paymentMethodOptions)?void 0:l.length)?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$1),{key:0,title:e.unref(c)({id:"pay_invoice.payment_methods.title",defaultMessage:"Payment methods",description:"Section title for the payment method selector on the pay invoice screen"}),"content-background":"none","no-border":"","no-spacing":""},{default:e.withCtx(()=>[e.createVNode(a._sfc_main,{ref_key:"paymentIntegrationFormRef",ref:u,amount:t.amount,"country-code":t.countryCode,context:{type:"INVOICE",related_resource_ids:[{type:"INVOICE",id:t.invoice.id}]},"customer-id":t.invoice.customer.id,"force-store-payment-method":"","invoice-id":t.invoice.id,"payment-method-options":t.paymentMethodOptions,variant:"AUTHORIZE",onPaymentSuccess:y,onSelect:f[0]||(f[0]=e=>s.value=e)},null,8,["amount","country-code","context","customer-id","invoice-id","payment-method-options"])]),_:1},8,["title"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]}),aside:e.withCtx(()=>[e.createVNode(i._sfc_main,{variant:"section",class:"min-h-[200px]"},{default:e.withCtx(()=>[t.invoice?(e.openBlock(),e.createBlock(e.unref(n._sfc_main$12),{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0)]),_:1}),t.invoice?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(p,{disabled:!s.value,amount:t.amount,"payment-method":s.value,onClick:d},null,8,["disabled","amount","payment-method"])])):e.createCommentVNode("",!0)]),_:1}))}}),y=e.defineComponent({__name:"PayInvoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup(t){const o=t,{invoice:a,get:i,downloadInvoicePdf:r}=l.useInvoice({invoiceId:o.configuration.invoiceId}),{payments:p,get:m}=l.usePayments(),{fetchInitial:d}=u.usePaymentMethods({customerId:o.portalObject.customer_id}),{paymentMethodOptions:y,get:f}=s.usePaymentMethodOptions(),{isLoading:v}=c.useLoadInitialData((async()=>{const e=await i();await f({customerId:e.customer.id,amount:e.open_invoice_amount})})(),d(),m(o.configuration.invoiceId)),g=e.computed(()=>{var e;return(null==(e=a.value)?void 0:e.customer)?n.getCustomerCountry(a.value.customer):void 0});return(t,n)=>{var o;return e.renderSlot(t.$slots,"default",{invoice:e.unref(a),isLoading:e.unref(v),amount:null==(o=e.unref(a))?void 0:o.open_invoice_amount,countryCode:g.value,paymentMethodOptions:e.unref(y),paymentAttempts:e.unref(p),downloadService:e.unref(r)})}}}),f=e.defineComponent({__name:"PayInvoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup:n=>(o,a)=>{var i,r,c,l;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(g),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(r=null==(i=n.branding)?void 0:i.colors)?void 0:r.primary,"secondary-color":null==(l=null==(c=n.branding)?void 0:c.colors)?void 0:l.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(o.$props)),{default:e.withCtx(({invoice:t,isLoading:o,amount:a,countryCode:i,paymentMethodOptions:r,paymentAttempts:c,downloadService:l})=>[e.createVNode(d,{"is-loading":o,invoice:t,amount:a,"country-code":i,"payment-method-options":r,configuration:n.configuration,"payment-attempts":c??[],"download-service":l},null,8,["is-loading","invoice","amount","country-code","payment-method-options","configuration","payment-attempts","download-service"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=t.defineCustomElement(f),g=t.getComponentName("pay-invoice");exports.COMPONENT_NAME=g,exports.SolvimonPayInvoice=v,exports.defineSolvimonPayInvoice=()=>{customElements.get(g)||customElements.define(g,v)};
@@ -0,0 +1,456 @@
1
+ import { defineComponent, computed, capitalize, openBlock, createBlock, unref, mergeProps, withCtx, createTextVNode, toDisplayString, ref, createVNode, createCommentVNode, createElementBlock, Fragment, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
+ import { _ as _sfc_main$d, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
3
+ import { u as useIntl, v as formatAmount, e as _sfc_main$4, x as _sfc_main$6, _ as _sfc_main$8, t as _sfc_main$9, b as _sfc_main$a, y as _sfc_main$c, r as getCustomerCountry } from "../../vendor-ui-BwxuPDg8.mjs";
4
+ import { C as ContentWithAsideLayout } from "../../ContentWithAsideLayout-BTdixy3L.mjs";
5
+ import { _ as _sfc_main$b } from "../../PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs";
6
+ import { _ as _sfc_main$5 } from "../../Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs";
7
+ import { _ as _sfc_main$7 } from "../../adyenLoader-gsbzSjYV.mjs";
8
+ import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
9
+ import { u as useInvoice, a as usePayments } from "../../usePayments-D4uGKBsV.mjs";
10
+ import { u as usePaymentMethodOptions } from "../../usePaymentMethodOptions-2MloZ9bY.mjs";
11
+ import { u as usePaymentMethods } from "../../usePaymentMethods-DZvfWSlx.mjs";
12
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13
+ __name: "PayButton",
14
+ props: {
15
+ amount: { type: Object },
16
+ paymentMethod: { type: Object },
17
+ type: { type: String },
18
+ variant: { type: String },
19
+ color: { type: String },
20
+ size: { type: String },
21
+ pill: { type: Boolean },
22
+ square: { type: Boolean },
23
+ loading: { type: Boolean },
24
+ disabled: { type: Boolean },
25
+ iconPrefix: { type: null },
26
+ iconSuffix: { type: null },
27
+ tag: { type: String }
28
+ },
29
+ emits: ["click"],
30
+ setup(__props) {
31
+ const props = __props;
32
+ const { $t } = useIntl();
33
+ const buttonProps = computed(() => ({
34
+ color: props.color ?? "primary",
35
+ disabled: props.disabled,
36
+ iconPrefix: props.iconPrefix,
37
+ iconSuffix: props.iconSuffix,
38
+ loading: props.loading,
39
+ pill: props.pill,
40
+ size: props.size ?? "lg",
41
+ square: props.square,
42
+ tag: props.tag,
43
+ type: props.type,
44
+ variant: props.variant
45
+ }));
46
+ const paymentMethodTypeLabel = computed(() => {
47
+ var _a, _b, _c;
48
+ switch ((_a = props.paymentMethod) == null ? void 0 : _a.paymentMethodType) {
49
+ case "scheme":
50
+ return "Credit Card";
51
+ case "applepay":
52
+ return "Apple Pay";
53
+ case "googlepay":
54
+ return "Google Pay";
55
+ case "paypal":
56
+ return "PayPal";
57
+ case "ideal":
58
+ return "iDeal";
59
+ case "klarna":
60
+ return "Klarna";
61
+ case "bcmc":
62
+ return "BCMC";
63
+ case "sepadirectdebit":
64
+ return "SEPA";
65
+ case "twint":
66
+ return "Twint";
67
+ case "swish":
68
+ return "Swish";
69
+ case "vipps":
70
+ return "Vipps";
71
+ case "mbway":
72
+ return "MBway";
73
+ case "alipay":
74
+ return "AliPay";
75
+ case "wechatpayWeb":
76
+ return "WeChatPay";
77
+ case "afterpay_default":
78
+ return "Afterpay";
79
+ case "affirm":
80
+ return "Affirm";
81
+ case "ach":
82
+ return "ACH";
83
+ case "blik":
84
+ return "Blik";
85
+ case "cashapp":
86
+ return "Cash App Pay";
87
+ case "amazonpay":
88
+ return "Amazon Pay";
89
+ case "venmo":
90
+ return "Venmo";
91
+ case "clicktopay":
92
+ return "Click to Pay";
93
+ case "upi":
94
+ return "UPI";
95
+ case "revolutpay":
96
+ return "Revolut Pay";
97
+ case "ratepay":
98
+ return "Ratepay";
99
+ case "walley":
100
+ return "Walley";
101
+ case "alma":
102
+ return "Alma";
103
+ case "facilypay_3x":
104
+ case "facilypay_4x":
105
+ return "Oney";
106
+ case "samsungpay":
107
+ return "Samsung Pay";
108
+ case "bizum":
109
+ return "Bizum";
110
+ case "pix":
111
+ return "Pix";
112
+ case "multibanco":
113
+ return "Multibanco";
114
+ case "openbanking_UK":
115
+ return "Open Banking";
116
+ default:
117
+ return ((_b = props.paymentMethod) == null ? void 0 : _b.paymentMethodType) ? capitalize((_c = props.paymentMethod) == null ? void 0 : _c.paymentMethodType) : "";
118
+ }
119
+ });
120
+ const buttonText = computed(() => {
121
+ if (props.amount && props.paymentMethod) {
122
+ return $t(
123
+ {
124
+ defaultMessage: "Pay {amount} with {type}",
125
+ id: "pay_button.label.amount_and_payment_method",
126
+ description: "The label for the pay button when both the amount and the payment method are known"
127
+ },
128
+ {
129
+ amount: formatAmount(props.amount),
130
+ type: paymentMethodTypeLabel.value
131
+ }
132
+ );
133
+ }
134
+ if (props.amount) {
135
+ return $t(
136
+ {
137
+ defaultMessage: "Pay {amount}",
138
+ id: "pay_button.label.amount_only",
139
+ description: "The label for the pay button when only the amount is known"
140
+ },
141
+ {
142
+ amount: formatAmount(props.amount),
143
+ type: paymentMethodTypeLabel.value
144
+ }
145
+ );
146
+ }
147
+ return $t({
148
+ defaultMessage: "Pay",
149
+ id: "pay_button.label.default",
150
+ description: "The default label for the pay button when no amount and payment method are known"
151
+ });
152
+ });
153
+ return (_ctx, _cache) => {
154
+ return openBlock(), createBlock(unref(_sfc_main$4), mergeProps(buttonProps.value, {
155
+ class: "w-full",
156
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
157
+ }), {
158
+ default: withCtx(() => [
159
+ createTextVNode(toDisplayString(buttonText.value), 1)
160
+ ]),
161
+ _: 1
162
+ }, 16);
163
+ };
164
+ }
165
+ });
166
+ const _hoisted_1 = { key: 0 };
167
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
168
+ __name: "PayInvoice",
169
+ props: {
170
+ invoice: { type: Object },
171
+ paymentMethodOptions: { type: Array },
172
+ paymentAttempts: { default: () => [], type: Array },
173
+ countryCode: { type: String },
174
+ amount: { type: Object },
175
+ downloadService: { type: Function },
176
+ configuration: { type: Object },
177
+ isLoading: { type: Boolean },
178
+ error: { type: null }
179
+ },
180
+ setup(__props) {
181
+ const { $t } = useIntl();
182
+ const props = __props;
183
+ const selectedPaymentMethod = ref();
184
+ const paymentIntegrationFormRef = ref();
185
+ function handleSubmit() {
186
+ if (!paymentIntegrationFormRef.value) {
187
+ throw new Error("payment integration form not found");
188
+ }
189
+ paymentIntegrationFormRef.value.submit();
190
+ }
191
+ const handlePaymentSuccess = () => {
192
+ if (props.configuration.onPaymentSuccess) {
193
+ props.configuration.onPaymentSuccess();
194
+ }
195
+ };
196
+ return (_ctx, _cache) => {
197
+ return openBlock(), createBlock(unref(ContentWithAsideLayout), null, {
198
+ header: withCtx(() => [
199
+ createVNode(_sfc_main$5, { class: "min-h-[52px] w-96" }, {
200
+ default: withCtx(() => [
201
+ __props.invoice && __props.downloadService ? (openBlock(), createBlock(unref(_sfc_main$c), {
202
+ key: 0,
203
+ invoice: __props.invoice,
204
+ "payment-attempts": __props.paymentAttempts,
205
+ "download-service": () => __props.downloadService(__props.invoice.id)
206
+ }, null, 8, ["invoice", "payment-attempts", "download-service"])) : createCommentVNode("", true)
207
+ ]),
208
+ _: 1
209
+ })
210
+ ]),
211
+ content: withCtx(() => {
212
+ var _a, _b;
213
+ return [
214
+ __props.isLoading ? (openBlock(), createBlock(_sfc_main$5, {
215
+ key: 0,
216
+ variant: "section",
217
+ class: "min-h-[300px]"
218
+ })) : createCommentVNode("", true),
219
+ ((_a = __props.invoice) == null ? void 0 : _a.paid) ? (openBlock(), createBlock(_sfc_main$7, {
220
+ key: 1,
221
+ status: "success",
222
+ title: unref($t)({ id: "pay_invoice.paid.title", defaultMessage: "Thank you for your payment!", description: "Title shown when the invoice has already been paid" }),
223
+ class: "mt-8"
224
+ }, {
225
+ default: withCtx(() => [
226
+ createVNode(unref(_sfc_main$8), {
227
+ variant: "body-sm",
228
+ class: "mt-1"
229
+ }, {
230
+ default: withCtx(() => [
231
+ createVNode(unref(_sfc_main$9), { icon: "check" }),
232
+ createTextVNode(toDisplayString(unref(formatAmount)(__props.invoice.tax_summary.total_amount)), 1)
233
+ ]),
234
+ _: 1
235
+ })
236
+ ]),
237
+ _: 1
238
+ }, 8, ["title"])) : __props.error ? (openBlock(), createBlock(_sfc_main$7, {
239
+ key: 2,
240
+ status: "error",
241
+ title: unref($t)({ id: "pay_invoice.error.title", defaultMessage: "Something went wrong", description: "Title shown when the invoice payment fails to load" })
242
+ }, {
243
+ default: withCtx(() => [
244
+ createVNode(unref(_sfc_main$8), {
245
+ variant: "body-sm",
246
+ class: "mt-1"
247
+ }, {
248
+ default: withCtx(() => [
249
+ createTextVNode(toDisplayString(unref($t)({ id: "pay_invoice.error.description", defaultMessage: "Please try again or contact support.", description: "Body text shown when the invoice payment fails to load" })), 1)
250
+ ]),
251
+ _: 1
252
+ })
253
+ ]),
254
+ _: 1
255
+ }, 8, ["title"])) : !__props.isLoading && __props.countryCode && __props.amount && __props.invoice ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
256
+ ((_b = __props.paymentMethodOptions) == null ? void 0 : _b.length) ? (openBlock(), createBlock(unref(_sfc_main$a), {
257
+ key: 0,
258
+ title: unref($t)({ id: "pay_invoice.payment_methods.title", defaultMessage: "Payment methods", description: "Section title for the payment method selector on the pay invoice screen" }),
259
+ "content-background": "none",
260
+ "no-border": "",
261
+ "no-spacing": ""
262
+ }, {
263
+ default: withCtx(() => [
264
+ createVNode(_sfc_main$b, {
265
+ ref_key: "paymentIntegrationFormRef",
266
+ ref: paymentIntegrationFormRef,
267
+ amount: __props.amount,
268
+ "country-code": __props.countryCode,
269
+ context: {
270
+ type: "INVOICE",
271
+ related_resource_ids: [
272
+ {
273
+ type: "INVOICE",
274
+ id: __props.invoice.id
275
+ }
276
+ ]
277
+ },
278
+ "customer-id": __props.invoice.customer.id,
279
+ "force-store-payment-method": "",
280
+ "invoice-id": __props.invoice.id,
281
+ "payment-method-options": __props.paymentMethodOptions,
282
+ variant: "AUTHORIZE",
283
+ onPaymentSuccess: handlePaymentSuccess,
284
+ onSelect: _cache[0] || (_cache[0] = (payload) => selectedPaymentMethod.value = payload)
285
+ }, null, 8, ["amount", "country-code", "context", "customer-id", "invoice-id", "payment-method-options"])
286
+ ]),
287
+ _: 1
288
+ }, 8, ["title"])) : createCommentVNode("", true)
289
+ ], 64)) : createCommentVNode("", true)
290
+ ];
291
+ }),
292
+ aside: withCtx(() => [
293
+ createVNode(_sfc_main$5, {
294
+ variant: "section",
295
+ class: "min-h-[200px]"
296
+ }, {
297
+ default: withCtx(() => [
298
+ __props.invoice ? (openBlock(), createBlock(unref(_sfc_main$6), {
299
+ key: 0,
300
+ invoice: __props.invoice
301
+ }, null, 8, ["invoice"])) : createCommentVNode("", true)
302
+ ]),
303
+ _: 1
304
+ }),
305
+ __props.invoice ? (openBlock(), createElementBlock("div", _hoisted_1, [
306
+ createVNode(_sfc_main$3, {
307
+ disabled: !selectedPaymentMethod.value,
308
+ amount: __props.amount,
309
+ "payment-method": selectedPaymentMethod.value,
310
+ onClick: handleSubmit
311
+ }, null, 8, ["disabled", "amount", "payment-method"])
312
+ ])) : createCommentVNode("", true)
313
+ ]),
314
+ _: 1
315
+ });
316
+ };
317
+ }
318
+ });
319
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
320
+ __name: "PayInvoice.entry.view",
321
+ props: {
322
+ environment: { type: String },
323
+ locale: { type: String },
324
+ dateLocale: { type: String },
325
+ messages: { type: Object },
326
+ primaryColor: { type: String },
327
+ secondaryColor: { type: String },
328
+ isShadowRoot: { type: Boolean },
329
+ experimentalFeatures: { type: Array },
330
+ logLevel: { type: String },
331
+ onLog: { type: Function },
332
+ allowedPortalTypes: { type: Array },
333
+ portalObject: { type: Object },
334
+ branding: { type: Object },
335
+ configuration: { type: Object }
336
+ },
337
+ setup(__props) {
338
+ const props = __props;
339
+ const {
340
+ invoice,
341
+ get: getInvoice,
342
+ downloadInvoicePdf
343
+ } = useInvoice({ invoiceId: props.configuration.invoiceId });
344
+ const { payments, get: getPayments } = usePayments();
345
+ const { fetchInitial } = usePaymentMethods({
346
+ customerId: props.portalObject.customer_id
347
+ });
348
+ const { paymentMethodOptions, get: getPaymentMethodOptions } = usePaymentMethodOptions();
349
+ const getInvoiceAndPaymentMethodOptions = async () => {
350
+ const invoice2 = await getInvoice();
351
+ await getPaymentMethodOptions({
352
+ customerId: invoice2.customer.id,
353
+ amount: invoice2.open_invoice_amount
354
+ });
355
+ };
356
+ const { isLoading } = useLoadInitialData(
357
+ getInvoiceAndPaymentMethodOptions(),
358
+ fetchInitial(),
359
+ getPayments(props.configuration.invoiceId)
360
+ );
361
+ const countryCode = computed(
362
+ () => {
363
+ var _a;
364
+ return ((_a = invoice.value) == null ? void 0 : _a.customer) ? getCustomerCountry(invoice.value.customer) : void 0;
365
+ }
366
+ );
367
+ return (_ctx, _cache) => {
368
+ var _a;
369
+ return renderSlot(_ctx.$slots, "default", {
370
+ invoice: unref(invoice),
371
+ isLoading: unref(isLoading),
372
+ amount: (_a = unref(invoice)) == null ? void 0 : _a.open_invoice_amount,
373
+ countryCode: countryCode.value,
374
+ paymentMethodOptions: unref(paymentMethodOptions),
375
+ paymentAttempts: unref(payments),
376
+ downloadService: unref(downloadInvoicePdf)
377
+ });
378
+ };
379
+ }
380
+ });
381
+ const _sfc_main = /* @__PURE__ */ defineComponent({
382
+ __name: "PayInvoice.entry",
383
+ props: {
384
+ environment: { type: String },
385
+ locale: { type: String },
386
+ dateLocale: { type: String },
387
+ messages: { type: Object },
388
+ primaryColor: { type: String },
389
+ secondaryColor: { type: String },
390
+ isShadowRoot: { type: Boolean },
391
+ experimentalFeatures: { type: Array },
392
+ logLevel: { type: String },
393
+ onLog: { type: Function },
394
+ allowedPortalTypes: { type: Array },
395
+ portalObject: { type: Object },
396
+ branding: { type: Object },
397
+ configuration: { type: Object }
398
+ },
399
+ setup(__props) {
400
+ return (_ctx, _cache) => {
401
+ var _a, _b, _c, _d;
402
+ return openBlock(), createBlock(unref(_sfc_main$d), {
403
+ "custom-element-name": unref(COMPONENT_NAME),
404
+ environment: __props.environment,
405
+ locale: __props.locale,
406
+ "portal-object": __props.portalObject,
407
+ "allowed-portal-types": ["CUSTOMER"],
408
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
409
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
410
+ "experimental-features": __props.experimentalFeatures,
411
+ "log-level": __props.logLevel,
412
+ "on-log": __props.onLog,
413
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
414
+ }, {
415
+ default: withCtx(() => [
416
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
417
+ default: withCtx(({
418
+ invoice,
419
+ isLoading,
420
+ amount,
421
+ countryCode,
422
+ paymentMethodOptions,
423
+ paymentAttempts,
424
+ downloadService
425
+ }) => [
426
+ createVNode(_sfc_main$2, {
427
+ "is-loading": isLoading,
428
+ invoice,
429
+ amount,
430
+ "country-code": countryCode,
431
+ "payment-method-options": paymentMethodOptions,
432
+ configuration: __props.configuration,
433
+ "payment-attempts": paymentAttempts ?? [],
434
+ "download-service": downloadService
435
+ }, null, 8, ["is-loading", "invoice", "amount", "country-code", "payment-method-options", "configuration", "payment-attempts", "download-service"])
436
+ ]),
437
+ _: 1
438
+ }, 16)
439
+ ]),
440
+ _: 1
441
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
442
+ };
443
+ }
444
+ });
445
+ const SolvimonPayInvoice = defineCustomElement(_sfc_main);
446
+ const COMPONENT_NAME = getComponentName("pay-invoice");
447
+ const defineSolvimonPayInvoice = () => {
448
+ if (!customElements.get(COMPONENT_NAME)) {
449
+ customElements.define(COMPONENT_NAME, SolvimonPayInvoice);
450
+ }
451
+ };
452
+ export {
453
+ COMPONENT_NAME,
454
+ SolvimonPayInvoice,
455
+ defineSolvimonPayInvoice
456
+ };