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

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 (179) hide show
  1. package/dist/Alert.vue.es-DMPvSykx.js +1 -0
  2. package/dist/Alert.vue.es-DsJ1ckRU.mjs +172 -0
  3. package/dist/Amount.vue.es-C6JE5rL8.mjs +23 -0
  4. package/dist/Amount.vue.es-h8wulbBG.js +1 -0
  5. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +93 -0
  6. package/dist/Avatar.vue.es-BbyE0AjW.js +1 -0
  7. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +1 -0
  8. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DZ1XkSJ3.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs} +6 -4
  9. package/dist/Button.vue.es-6sBk5tBL.mjs +408 -0
  10. package/dist/Button.vue.es-BC4_TItq.js +1 -0
  11. package/dist/CardContent.vue.es-ChEMrFCc.mjs +115 -0
  12. package/dist/CardContent.vue.es-i9ivuGKG.js +1 -0
  13. package/dist/Chip.vue.es-D0fkSe8a.js +1 -0
  14. package/dist/Chip.vue.es-DcW2CjUA.mjs +1576 -0
  15. package/dist/Comparators.vue.es-BdxDqU8o.js +1 -0
  16. package/dist/Comparators.vue.es-DdTKGB80.mjs +406 -0
  17. package/dist/{ContentWithAsideLayout-D_T137tN.mjs → ContentWithAsideLayout-Ct24RV-2.mjs} +1 -1
  18. package/dist/{ContentWithAsideLayout-BZJPhvLh.js → ContentWithAsideLayout-UHovpjZu.js} +1 -1
  19. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +1 -0
  20. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +175 -0
  21. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +1 -0
  22. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DK6tiecN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs} +14 -11
  23. package/dist/Divider.vue.es-ClFG8QtG.js +1 -0
  24. package/dist/Divider.vue.es-wKkIVBgb.mjs +24 -0
  25. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +72 -0
  26. package/dist/DividerText.vue.es-yiFdPQvo.js +1 -0
  27. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +30 -0
  28. package/dist/ErrorNotification.vue.es-FpRyg0De.js +1 -0
  29. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +46 -0
  30. package/dist/FormMessage.vue.es-LeWoj774.js +1 -0
  31. package/dist/IconButton.vue.es-DNCwwH_j.mjs +825 -0
  32. package/dist/IconButton.vue.es-DiSiGPWO.js +1 -0
  33. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +1 -0
  34. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BWXmZmGZ.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs} +3 -2
  35. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +1 -0
  36. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BSn_Zy0Y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs} +9 -5
  37. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs +1067 -0
  38. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +1 -0
  39. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +1 -0
  40. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +1255 -0
  41. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-X7-dfeZP.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs} +6 -5
  42. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +1 -0
  43. package/dist/Section.vue.es-3-H1pUTB.mjs +79 -0
  44. package/dist/Section.vue.es-BuzTXRLP.js +1 -0
  45. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-AxYjVFUM.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs} +23 -20
  46. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +1 -0
  47. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +136 -0
  48. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +1 -0
  49. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +759 -0
  50. package/dist/TrialChip.vue.es-C6Xg_5rR.js +1 -0
  51. package/dist/_flatRest.es-BHFPCqZh.mjs +642 -0
  52. package/dist/_flatRest.es-dFffnTpX.js +1 -0
  53. package/dist/adyen-51SvcyqV.mjs +4 -0
  54. package/dist/adyen-DZsyEXkw.js +1 -0
  55. package/dist/api.es-B4qAAJKr.js +1 -0
  56. package/dist/api.es-UkfpLiLL.mjs +83 -0
  57. package/dist/{cloneDeep-DranHQkY.js → cloneDeep-Hs8Pp07F.js} +1 -1
  58. package/dist/cn.es-C7xoIs3C.js +1 -0
  59. package/dist/cn.es-tfxVlz02.mjs +3191 -0
  60. package/dist/component-ZRZIt3ZW.js +1 -0
  61. package/dist/component-dpA83LIN.mjs +6569 -0
  62. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
  63. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  64. package/dist/components/BillingInformation/BillingInformation.es.js +14 -10
  65. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
  66. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  67. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +27 -23
  68. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
  69. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  70. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
  71. package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
  72. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  73. package/dist/components/Invoice/Invoice.es.js +2612 -28
  74. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
  75. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  76. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  77. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
  78. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  79. package/dist/components/InvoicesList/InvoicesList.es.js +2 -2
  80. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
  81. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  82. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  83. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
  84. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  85. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +10 -8
  86. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
  87. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  88. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +4820 -7
  89. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
  90. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  91. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
  92. package/dist/components/WalletBalances/WalletBalances.ce.d.ts +1 -1
  93. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  94. package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
  95. package/dist/core/index.cjs.js +1 -1
  96. package/dist/core/index.es.js +1 -1
  97. package/dist/countryData.es--zJAd6LA.mjs +252 -0
  98. package/dist/countryData.es-D3MFzU92.js +1 -0
  99. package/dist/customer-CJrpbGX4.mjs +32 -0
  100. package/dist/customer-CcQR-JIm.js +1 -0
  101. package/dist/customer.es-D42Md24r.js +1 -0
  102. package/dist/customer.es-LIW2YmLL.mjs +30 -0
  103. package/dist/formatting.es-9hM8aHSg.js +1 -0
  104. package/dist/formatting.es-D5H_ySFv.mjs +68 -0
  105. package/dist/getCountryNameByCode.es-fP52nO_7.js +1 -0
  106. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +8 -0
  107. package/dist/index-CI71bVGE.mjs +2521 -0
  108. package/dist/index-WLSPwi90.js +1 -0
  109. package/dist/index.cjs.js +1 -1
  110. package/dist/index.es-BBJF2O2l.js +1 -0
  111. package/dist/index.es-LCAKs4tH.mjs +438 -0
  112. package/dist/index.es.js +1 -1
  113. package/dist/invoices-3kVHsAXr.js +1 -0
  114. package/dist/{invoices-C7BHqB0g.mjs → invoices-CNK1Ushv.mjs} +15 -1
  115. package/dist/isEmpty.es-Bp1SbWFu.mjs +131 -0
  116. package/dist/isEmpty.es-Dycf-CD_.js +1 -0
  117. package/dist/{paymentMethods-BA7Kt8ti.mjs → paymentMethods-C-ApE-G4.mjs} +2 -1
  118. package/dist/paymentMethods-DZRf0WRl.js +1 -0
  119. package/dist/{payments-NTHUh5je.mjs → payments-CE9U7aKK.mjs} +1 -1
  120. package/dist/{payments-B8W0W6wZ.js → payments-CLt0SExf.js} +1 -1
  121. package/dist/pick.es-BgDAfhAl.js +1 -0
  122. package/dist/pick.es-DdVOyp0Q.mjs +45 -0
  123. package/dist/{registry-DgRnFEVF.mjs → registry-B99ZnfEn.mjs} +1 -2
  124. package/dist/registry-ClZ43bQn.js +1 -0
  125. package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
  126. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  127. package/dist/screens/Checkout/Checkout.es.js +1862 -162
  128. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
  129. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  130. package/dist/screens/CustomerOverview/CustomerOverview.es.js +11 -11
  131. package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +1 -1
  132. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  133. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +46 -40
  134. package/dist/solvimon-web.css +1 -1
  135. package/dist/subscriptions-CS8HTxzC.js +1 -0
  136. package/dist/{subscriptions-BEoXaAHw.mjs → subscriptions-CoeCrY1I.mjs} +2 -1
  137. package/dist/typeGuards.es-C4nR5FkL.js +1 -0
  138. package/dist/typeGuards.es-fwUoeMCe.mjs +12 -0
  139. package/dist/{useActionDispatchProvider-DmTJ_bqE.js → useActionDispatchProvider-CWVV_xsi.js} +1 -1
  140. package/dist/{useActionDispatchProvider-zSXRlc2S.mjs → useActionDispatchProvider-eO2qFPGv.mjs} +1 -1
  141. package/dist/useCustomer--jycAz--.mjs +25 -0
  142. package/dist/useCustomer-PthyTFLl.js +1 -0
  143. package/dist/useIncrementalLoading-CAdNW-Bf.js +1 -0
  144. package/dist/{useIncrementalLoading-Bgs0mqyb.mjs → useIncrementalLoading-CcnL3flF.mjs} +5 -1
  145. package/dist/{useInvoiceData-B6P2VShe.mjs → useInvoiceData-BiMMoVoW.mjs} +2 -2
  146. package/dist/{useInvoiceData-CS7hLTea.js → useInvoiceData-DvQO_nKz.js} +1 -1
  147. package/dist/useInvoicesList-CHkwSNO9.js +1 -0
  148. package/dist/{useInvoicesList-23Ra-23Z.mjs → useInvoicesList-DFhF_gp7.mjs} +260 -23
  149. package/dist/{usePaymentMethods-BK4unvj2.js → usePaymentMethods-BRQ7-dUr.js} +1 -1
  150. package/dist/{usePaymentMethods-B8Nft16c.mjs → usePaymentMethods-BX2RnHZN.mjs} +2 -2
  151. package/dist/{useService-D-CUtlp3.js → useService-B67YWAcN.js} +1 -1
  152. package/dist/{useService-B4qv5N2D.mjs → useService-DG_zedHV.mjs} +1 -0
  153. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +308 -0
  154. package/dist/useWalletBalanceItems-BY3gq0fc.js +1 -0
  155. package/package.json +14 -8
  156. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-eRGZRjmq.js +0 -1
  157. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BvmKLc2H.js +0 -1
  158. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DNWspHtC.js +0 -1
  159. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Cx4c8E4i.js +0 -1
  160. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ct26TY0a.js +0 -1
  161. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-WRXecMCj.mjs +0 -6568
  162. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-KnhKv07X.js +0 -1
  163. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D9_G7CyE.js +0 -1
  164. package/dist/component-DI3AxwdD.mjs +0 -58733
  165. package/dist/component-yWF07boR.js +0 -1
  166. package/dist/index-CzL1ZcGi.mjs +0 -85
  167. package/dist/index-DRdBmZ2-.js +0 -1
  168. package/dist/invoices-CjBHfDXp.js +0 -1
  169. package/dist/paymentMethods-A-5SBmy1.js +0 -1
  170. package/dist/registry-SwmYGFn7.js +0 -1
  171. package/dist/subscriptions-DSi93KpN.js +0 -1
  172. package/dist/useCustomer-DkrBNt5f.mjs +0 -45
  173. package/dist/useCustomer-fK-w7ifj.js +0 -1
  174. package/dist/useIncrementalLoading-BK6N8sYW.js +0 -1
  175. package/dist/useInvoicesList-CIFGVsDj.js +0 -1
  176. package/dist/useWalletBalanceItems-DreHuOra.mjs +0 -105
  177. package/dist/useWalletBalanceItems-NlFk6jPD.js +0 -1
  178. /package/dist/{sprite-DZD704h3-CCc3Mz1x.js → sprite.svg.es-CCc3Mz1x.js} +0 -0
  179. /package/dist/{sprite-DZD704h3-DZD704h3.mjs → sprite.svg.es-DZD704h3.mjs} +0 -0
@@ -1,12 +1,2596 @@
1
- import { defineComponent, renderSlot, unref, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, withKeys, normalizeClass, createCommentVNode, createBlock, normalizeProps, guardReactiveProps } from "vue";
1
+ import { ref, defineComponent, useAttrs, computed, toRefs, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementVNode, normalizeClass, unref, renderSlot, createCommentVNode, mergeDefaults, createPropsRestProxy, createSlots, createElementBlock, createTextVNode, toDisplayString, Fragment, renderList, createVNode, withKeys, normalizeProps, guardReactiveProps, isRef } from "vue";
2
2
  import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
3
- import { c as createInvoicesService } from "../../invoices-C7BHqB0g.mjs";
4
- import { u as useService } from "../../useService-B4qv5N2D.mjs";
5
- import { c as createPaymentsService } from "../../payments-NTHUh5je.mjs";
6
- import { b as useIntl, Q as useToggleList, R as _sfc_main$2q, _ as _sfc_main$2$1, S as InvoiceTable, U as _sfc_main$t, V as _sfc_main$u, m as _sfc_main$4$1, d as _sfc_main$1g, W as _sfc_main$1J, X as _sfc_main$e, Y as _sfc_main$w, k as _sfc_main$z, o as _sfc_main$7, p as defineCustomElement, n as getComponentName } from "../../component-DI3AxwdD.mjs";
3
+ import { c as createInvoicesService } from "../../invoices-CNK1Ushv.mjs";
4
+ import { u as useService } from "../../useService-DG_zedHV.mjs";
5
+ import { c as createPaymentsService } from "../../payments-CE9U7aKK.mjs";
6
+ import { a as useIntl, _ as _sfc_main$A, f as formatTimezone, b as _sfc_main$G, d as defineCustomElement, g as getComponentName } from "../../component-dpA83LIN.mjs";
7
+ import { _ as _sfc_main$F } from "../../CustomerBillingInformation.vue.es-DBMl01Es.mjs";
8
+ import { _ as _sfc_main$u, u as useToggleList, a as _sfc_main$z } from "../../Comparators.vue.es-DdTKGB80.mjs";
9
+ import { b as _export_sfc, _ as _sfc_main$w } from "../../Chip.vue.es-DcW2CjUA.mjs";
10
+ import { u as useBreakpoints, b as breakpointsTailwind } from "../../index.es-LCAKs4tH.mjs";
11
+ import { u as useButtonClasses, a as _sfc_main$r, b as buttonPropsDefault, _ as _sfc_main$s } from "../../Button.vue.es-6sBk5tBL.mjs";
12
+ import { _ as _sfc_main$t } from "../../FormMessage.vue.es-DFQXxiSC.mjs";
13
+ import { _ as _sfc_main$C } from "../../Section.vue.es-3-H1pUTB.mjs";
14
+ import { _ as _sfc_main$v } from "../../Amount.vue.es-C6JE5rL8.mjs";
15
+ import { g as getCustomerName } from "../../customer.es-LIW2YmLL.mjs";
16
+ import { g as getComposedString } from "../../Avatar.vue.es-Ba8ZGfm4.mjs";
17
+ import { a as formatAmount, f as formatEnum } from "../../formatting.es-D5H_ySFv.mjs";
18
+ import { _ as _sfc_main$x, T as TooltipContent, a as _sfc_main$y } from "../../TooltipParagraph.vue.es-DVJLF9Kv.mjs";
19
+ import { _ as _sfc_main$B } from "../../DividerText.vue.es-B7oa5Xpn.mjs";
20
+ import { i as isEmpty } from "../../isEmpty.es-Bp1SbWFu.mjs";
7
21
  import { u as useWindowSize } from "../../index-D3v7hAtc.mjs";
8
- import { _ as _sfc_main$5 } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BWXmZmGZ.mjs";
9
- import { _ as _sfc_main$6 } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BSn_Zy0Y.mjs";
22
+ import { _ as _sfc_main$D } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs";
23
+ import { _ as _sfc_main$E } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs";
24
+ const useSimpleToggleList = (initialToggledItems = []) => {
25
+ const toggledItems = ref(initialToggledItems);
26
+ const toggle = (index) => {
27
+ const match = toggledItems.value.find((groupIndex) => groupIndex === index);
28
+ if (typeof match === "number") {
29
+ toggledItems.value = toggledItems.value.filter((groupIndex) => groupIndex !== index);
30
+ } else {
31
+ toggledItems.value = [...toggledItems.value, index];
32
+ }
33
+ };
34
+ return [toggledItems, toggle];
35
+ };
36
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
37
+ __name: "Link",
38
+ props: /* @__PURE__ */ mergeDefaults({
39
+ external: { type: Boolean },
40
+ showOnHover: { type: Boolean },
41
+ button: { type: Boolean },
42
+ to: {},
43
+ target: {},
44
+ custom: { type: Boolean },
45
+ activeClass: {},
46
+ exactActiveClass: {},
47
+ ariaCurrentValue: {},
48
+ viewTransition: { type: Boolean },
49
+ replace: { type: Boolean },
50
+ type: {},
51
+ variant: {},
52
+ color: {},
53
+ size: {},
54
+ pill: { type: Boolean },
55
+ square: { type: Boolean },
56
+ loading: { type: Boolean },
57
+ disabled: { type: Boolean },
58
+ iconPrefix: {},
59
+ iconSuffix: {},
60
+ tag: {}
61
+ }, {
62
+ external: false,
63
+ showOnHover: false,
64
+ button: false,
65
+ //props for button styling
66
+ ...buttonPropsDefault
67
+ }),
68
+ setup(__props) {
69
+ const props = __props;
70
+ const attrs = useAttrs();
71
+ const isExternal = ref(!!attrs.href);
72
+ const derivedTarget = computed(() => props.target === null ? "_self" : "_blank");
73
+ const currentComponent = computed(() => {
74
+ const customProps = isExternal.value ? {
75
+ rel: "noopener noreferrer",
76
+ target: derivedTarget.value
77
+ } : { to: props.to, target: props.target || null };
78
+ return {
79
+ tag: isExternal.value ? "a" : "RouterLink",
80
+ props: { ...attrs, ...customProps }
81
+ };
82
+ });
83
+ const { wrapperClasses, spanClasses } = useButtonClasses(toRefs(props));
84
+ const linkClass = computed(
85
+ () => props.button ? `inline-flex text-center hover:no-underline ${wrapperClasses.value} text-sm` : `group hover:text-blue-600 hover:underline ${props.showOnHover ? "hover:text-blue-600" : "text-blue-600"}`
86
+ );
87
+ return (_ctx, _cache) => {
88
+ return openBlock(), createBlock(resolveDynamicComponent(currentComponent.value.tag), mergeProps(currentComponent.value.props, { class: linkClass.value }), {
89
+ default: withCtx(() => [
90
+ createElementVNode("span", {
91
+ class: normalizeClass({ [`${unref(spanClasses)} flex items-center grow`]: props.button })
92
+ }, [
93
+ renderSlot(_ctx.$slots, "default"),
94
+ __props.external && !__props.button ? (openBlock(), createBlock(unref(_sfc_main$r), {
95
+ key: 0,
96
+ icon: "arrow_outward",
97
+ size: "xs",
98
+ class: normalizeClass(["ml-0.5", { "invisible group-hover:visible": props.showOnHover }])
99
+ }, null, 8, ["class"])) : createCommentVNode("", true)
100
+ ], 2)
101
+ ]),
102
+ _: 3
103
+ }, 16, ["class"]);
104
+ };
105
+ }
106
+ });
107
+ const _hoisted_1$k = {
108
+ key: 1,
109
+ class: "flex flex-col items-end gap-1"
110
+ };
111
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
112
+ __name: "DownloadButton",
113
+ props: {
114
+ downloadService: { type: Function },
115
+ mobileIconOnly: { type: Boolean, default: false },
116
+ type: {},
117
+ variant: { default: "outline" },
118
+ color: { default: "gray" },
119
+ size: { default: "md" },
120
+ pill: { type: Boolean },
121
+ square: { type: Boolean },
122
+ loading: { type: Boolean },
123
+ disabled: { type: Boolean },
124
+ iconPrefix: {},
125
+ iconSuffix: {},
126
+ tag: {}
127
+ },
128
+ setup(__props) {
129
+ const { $t } = useIntl();
130
+ const buttonProps = createPropsRestProxy(__props, ["downloadService", "size", "color", "mobileIconOnly", "variant"]);
131
+ const isFailed = ref(false);
132
+ const isLoading = ref(false);
133
+ const breakpoints = useBreakpoints(breakpointsTailwind);
134
+ const isMobile = breakpoints.smaller("md");
135
+ const isIconOnly = computed(() => __props.mobileIconOnly && isMobile.value);
136
+ const handleDownload = async () => {
137
+ isLoading.value = true;
138
+ isFailed.value = false;
139
+ try {
140
+ await __props.downloadService();
141
+ } catch {
142
+ isFailed.value = true;
143
+ } finally {
144
+ isLoading.value = false;
145
+ }
146
+ };
147
+ return (_ctx, _cache) => {
148
+ return !isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$s), mergeProps({ key: 0 }, { ...buttonProps, size: __props.size, color: __props.color }, {
149
+ disabled: isLoading.value,
150
+ loading: isLoading.value,
151
+ variant: __props.variant,
152
+ type: "button",
153
+ "icon-prefix": "download",
154
+ onClick: handleDownload
155
+ }), createSlots({ _: 2 }, [
156
+ _ctx.$slots.default && !isIconOnly.value ? {
157
+ name: "default",
158
+ fn: withCtx(() => [
159
+ !!_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)
160
+ ]),
161
+ key: "0"
162
+ } : void 0
163
+ ]), 1040, ["disabled", "loading", "variant"])) : (openBlock(), createElementBlock("div", _hoisted_1$k, [
164
+ !isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$s), mergeProps({ key: 0 }, { ...buttonProps, size: __props.size, color: __props.color }, {
165
+ disabled: isLoading.value,
166
+ loading: isLoading.value,
167
+ type: "button",
168
+ "icon-prefix": "download",
169
+ onClick: handleDownload
170
+ }), createSlots({ _: 2 }, [
171
+ _ctx.$slots.default && !isIconOnly.value ? {
172
+ name: "default",
173
+ fn: withCtx(() => [
174
+ !!_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)
175
+ ]),
176
+ key: "0"
177
+ } : void 0
178
+ ]), 1040, ["disabled", "loading"])) : createCommentVNode("", true),
179
+ isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$t), { key: 1 }, {
180
+ default: withCtx(() => [
181
+ createTextVNode(toDisplayString(unref($t)({
182
+ id: "download_button.download_failed_message",
183
+ defaultMessage: "Download failed, please try again later",
184
+ description: "Error message when a download fails"
185
+ })), 1)
186
+ ]),
187
+ _: 1
188
+ })) : createCommentVNode("", true)
189
+ ]));
190
+ };
191
+ }
192
+ });
193
+ const _hoisted_1$j = { class: "flex items-start gap-2" };
194
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
195
+ __name: "InfoBlock",
196
+ props: {
197
+ variant: { default: "default" },
198
+ hasIcon: { type: Boolean }
199
+ },
200
+ setup(__props) {
201
+ const iconMapping = {
202
+ default: "info",
203
+ warning: "error",
204
+ danger: "error"
205
+ };
206
+ return (_ctx, _cache) => {
207
+ return openBlock(), createElementBlock("div", {
208
+ class: normalizeClass(["px-4 py-3 rounded border text-sm flex justify-between items-center gap-2", {
209
+ "bg-blue-50 border-blue-100 text-blue-700": __props.variant === "default",
210
+ "bg-red-50 border-red-100 text-red-700": __props.variant === "danger",
211
+ "bg-yellow-50 border-yellow-100 text-yellow-700": __props.variant === "warning"
212
+ }])
213
+ }, [
214
+ createElementVNode("div", _hoisted_1$j, [
215
+ __props.hasIcon ? (openBlock(), createBlock(unref(_sfc_main$r), {
216
+ key: 0,
217
+ icon: iconMapping[__props.variant],
218
+ size: "xs",
219
+ class: "shrink-0"
220
+ }, null, 8, ["icon"])) : createCommentVNode("", true),
221
+ createElementVNode("div", null, [
222
+ renderSlot(_ctx.$slots, "default")
223
+ ])
224
+ ]),
225
+ createElementVNode("div", null, [
226
+ renderSlot(_ctx.$slots, "cta")
227
+ ])
228
+ ], 2);
229
+ };
230
+ }
231
+ });
232
+ const _sfc_main$n = {};
233
+ const _hoisted_1$i = { class: "w-full" };
234
+ function _sfc_render(_ctx, _cache) {
235
+ return openBlock(), createElementBlock("table", _hoisted_1$i, [
236
+ renderSlot(_ctx.$slots, "default")
237
+ ]);
238
+ }
239
+ const InvoiceTable = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render]]);
240
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
241
+ __name: "InvoiceTableData",
242
+ props: {
243
+ number: { type: Boolean, default: false },
244
+ hasPadding: { type: Boolean, default: true }
245
+ },
246
+ setup(__props) {
247
+ return (_ctx, _cache) => {
248
+ return openBlock(), createElementBlock("td", {
249
+ class: normalizeClass({
250
+ "text-right tabular-nums": __props.number,
251
+ "py-2": __props.hasPadding
252
+ })
253
+ }, [
254
+ renderSlot(_ctx.$slots, "default")
255
+ ], 2);
256
+ };
257
+ }
258
+ });
259
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
260
+ __name: "InvoiceTableHeader",
261
+ props: {
262
+ left: { type: Boolean, default: false },
263
+ right: { type: Boolean, default: false }
264
+ },
265
+ setup(__props) {
266
+ return (_ctx, _cache) => {
267
+ return openBlock(), createElementBlock("th", {
268
+ class: normalizeClass(["py-1.5 font-bold border-b text-gray-400 text-xs uppercase", { "text-left": __props.left, "text-right": __props.right }])
269
+ }, [
270
+ renderSlot(_ctx.$slots, "default")
271
+ ], 2);
272
+ };
273
+ }
274
+ });
275
+ const _hoisted_1$h = { class: "flex items-center" };
276
+ const _hoisted_2$b = {
277
+ key: 0,
278
+ class: "text-xs text-gray-400"
279
+ };
280
+ const _hoisted_3$7 = { class: "flex items-center" };
281
+ const _hoisted_4$7 = { key: 0 };
282
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
283
+ __name: "InvoiceSubLineRow",
284
+ props: {
285
+ subLines: {},
286
+ isOpen: { type: Boolean },
287
+ lineOrder: {},
288
+ periodOrder: {},
289
+ groupOrder: {},
290
+ processingOnlyCustomers: {}
291
+ },
292
+ setup(__props) {
293
+ const { formatMessage } = useIntl();
294
+ const props = __props;
295
+ const getCustomerName$1 = (customerId) => {
296
+ var _a;
297
+ const childCustomer = (_a = props.processingOnlyCustomers) == null ? void 0 : _a.find(
298
+ (childCustomer2) => childCustomer2.id === customerId
299
+ );
300
+ if (!childCustomer) {
301
+ return formatMessage({
302
+ id: "generic.not_available",
303
+ defaultMessage: "N/A",
304
+ description: "Used in scenarios where no data is available to be displayed"
305
+ });
306
+ }
307
+ return getCustomerName(childCustomer);
308
+ };
309
+ const getSubLineConditions = (subLine) => {
310
+ var _a;
311
+ return ((_a = subLine.usage_based_conversion) == null ? void 0 : _a.conditions) ?? subLine.conditions;
312
+ };
313
+ return (_ctx, _cache) => {
314
+ return __props.subLines && __props.isOpen ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
315
+ !__props.processingOnlyCustomers ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.subLines, (subLine, subLineIndex) => {
316
+ return openBlock(), createElementBlock("tr", {
317
+ key: subLineIndex,
318
+ class: normalizeClass(subLineIndex > 0 ? "border-t" : "")
319
+ }, [
320
+ createVNode(_sfc_main$m, { class: "w-1/3" }, {
321
+ default: withCtx(() => {
322
+ var _a, _b, _c, _d, _e, _f;
323
+ return [
324
+ createElementVNode("div", _hoisted_1$h, [
325
+ renderSlot(_ctx.$slots, "invoice-line-prefix", {
326
+ lineOrder: __props.lineOrder,
327
+ periodOrder: __props.periodOrder,
328
+ groupOrder: __props.groupOrder
329
+ }),
330
+ createElementVNode("div", null, [
331
+ createElementVNode("div", null, [
332
+ subLine.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
333
+ createTextVNode(toDisplayString(subLine.description), 1)
334
+ ], 64)) : subLine.details.description ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
335
+ createTextVNode(toDisplayString(subLine.details.description), 1)
336
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
337
+ createTextVNode(" N/A ")
338
+ ], 64))
339
+ ]),
340
+ ((_a = getSubLineConditions(subLine)) == null ? void 0 : _a.name) || ((_b = getSubLineConditions(subLine)) == null ? void 0 : _b.meter_properties) ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
341
+ ((_c = getSubLineConditions(subLine)) == null ? void 0 : _c.name) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
342
+ createTextVNode(toDisplayString((_d = getSubLineConditions(subLine)) == null ? void 0 : _d.name), 1)
343
+ ], 64)) : ((_e = getSubLineConditions(subLine)) == null ? void 0 : _e.meter_properties) ? (openBlock(), createBlock(unref(_sfc_main$u), {
344
+ key: 1,
345
+ comparators: (_f = getSubLineConditions(subLine)) == null ? void 0 : _f.meter_properties
346
+ }, null, 8, ["comparators"])) : createCommentVNode("", true)
347
+ ])) : createCommentVNode("", true)
348
+ ])
349
+ ])
350
+ ];
351
+ }),
352
+ _: 2
353
+ }, 1024),
354
+ createVNode(_sfc_main$m, {
355
+ number: "",
356
+ class: "w-1/7 text-right tabular-nums"
357
+ }, {
358
+ default: withCtx(() => {
359
+ var _a, _b;
360
+ return [
361
+ createTextVNode(toDisplayString(((_b = (_a = subLine.details.conversion) == null ? void 0 : _a.credits) == null ? void 0 : _b.quantity) ?? "N/A"), 1)
362
+ ];
363
+ }),
364
+ _: 2
365
+ }, 1024),
366
+ createVNode(_sfc_main$m, { class: "w-1/7 text-right tabular-nums" }, {
367
+ default: withCtx(() => {
368
+ var _a, _b;
369
+ return [
370
+ ((_a = subLine.details.band) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
371
+ key: 0,
372
+ value: subLine.details.band.amount
373
+ }, null, 8, ["value"])) : ((_b = subLine.details.band) == null ? void 0 : _b.percentage) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
374
+ createTextVNode(toDisplayString(subLine.details.band.percentage) + "% ", 1)
375
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
376
+ createTextVNode(" N/A ")
377
+ ], 64))
378
+ ];
379
+ }),
380
+ _: 2
381
+ }, 1024),
382
+ createVNode(_sfc_main$m, null, {
383
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
384
+ createTextVNode(" ", -1)
385
+ ])]),
386
+ _: 1
387
+ }),
388
+ subLine.details.amount ? (openBlock(), createBlock(_sfc_main$m, {
389
+ key: 0,
390
+ class: "w-1/7 text-right tabular-nums"
391
+ }, {
392
+ default: withCtx(() => [
393
+ createVNode(_sfc_main$v, {
394
+ value: subLine.details.amount
395
+ }, null, 8, ["value"])
396
+ ]),
397
+ _: 2
398
+ }, 1024)) : createCommentVNode("", true)
399
+ ], 2);
400
+ }), 128)) : createCommentVNode("", true),
401
+ __props.processingOnlyCustomers ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.subLines, (subLine, i) => {
402
+ return openBlock(), createElementBlock("tr", {
403
+ key: i,
404
+ tabindex: void 0,
405
+ class: normalizeClass(["group", { "border-t": i !== 0 }])
406
+ }, [
407
+ createVNode(_sfc_main$m, { class: "pl-4" }, {
408
+ default: withCtx(() => [
409
+ createElementVNode("div", _hoisted_3$7, [
410
+ subLine.processing_only_customer_resource_id ? (openBlock(), createElementBlock("div", _hoisted_4$7, toDisplayString(getCustomerName$1(
411
+ subLine.processing_only_customer_resource_id
412
+ )), 1)) : createCommentVNode("", true)
413
+ ])
414
+ ]),
415
+ _: 2
416
+ }, 1024),
417
+ renderSlot(_ctx.$slots, "subline-content", {
418
+ details: subLine.details,
419
+ hideTaxDetails: true
420
+ })
421
+ ], 2);
422
+ }), 128)) : createCommentVNode("", true)
423
+ ], 64)) : createCommentVNode("", true);
424
+ };
425
+ }
426
+ });
427
+ const _hoisted_1$g = ["tabindex", "onClick"];
428
+ const _hoisted_2$a = { class: "flex items-center" };
429
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
430
+ __name: "InvoiceCommitment",
431
+ props: {
432
+ commitments: {},
433
+ groupOrder: {},
434
+ invoicePeriodOrder: {}
435
+ },
436
+ setup(__props) {
437
+ const intl = useIntl();
438
+ const { getIsOpen, toggle } = useToggleList();
439
+ const toggleLine = (groupOrder, invoiceLineOrder) => {
440
+ toggle(formatIndex(groupOrder, invoiceLineOrder));
441
+ };
442
+ const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
443
+ return (_ctx, _cache) => {
444
+ return openBlock(), createBlock(InvoiceTable, null, {
445
+ default: withCtx(() => [
446
+ createElementVNode("tr", null, [
447
+ createVNode(_sfc_main$l, {
448
+ left: "",
449
+ colspan: "5"
450
+ }, {
451
+ default: withCtx(() => [
452
+ createTextVNode(toDisplayString(unref(intl).$t({
453
+ id: "invoice.table_header.unit",
454
+ defaultMessage: "Unit",
455
+ description: "Table header for the column containing the number of units of invoice groups"
456
+ })), 1)
457
+ ]),
458
+ _: 1
459
+ }),
460
+ createVNode(_sfc_main$l, {
461
+ right: "",
462
+ class: "w-60"
463
+ }, {
464
+ default: withCtx(() => [
465
+ createTextVNode(toDisplayString(unref(intl).$t({
466
+ id: "invoice.table_header.sub_total",
467
+ defaultMessage: "Subtotal",
468
+ description: "Table header for the column containing the subtotal for invoices"
469
+ })), 1)
470
+ ]),
471
+ _: 1
472
+ })
473
+ ]),
474
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.commitments, (line, lineIndex) => {
475
+ return openBlock(), createElementBlock(Fragment, { key: lineIndex }, [
476
+ createElementVNode("tr", {
477
+ class: normalizeClass(["border-t", { "cursor-pointer": line.sub_lines }]),
478
+ tabindex: line.sub_lines ? 0 : void 0,
479
+ onClick: ($event) => toggleLine(__props.groupOrder, line["line_order"])
480
+ }, [
481
+ createVNode(_sfc_main$m, { colspan: "2" }, {
482
+ default: withCtx(() => {
483
+ var _a, _b;
484
+ return [
485
+ line.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
486
+ key: 0,
487
+ icon: "keyboard_arrow_down",
488
+ size: "md",
489
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
490
+ "-rotate-90": !unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
491
+ }])
492
+ }, null, 8, ["class"])) : createCommentVNode("", true),
493
+ createElementVNode("div", _hoisted_2$a, [
494
+ renderSlot(_ctx.$slots, "invoice-line-prefix", {
495
+ lineOrder: line.line_order,
496
+ periodOrder: __props.invoicePeriodOrder,
497
+ groupOrder: __props.groupOrder
498
+ }),
499
+ line.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
500
+ createTextVNode(toDisplayString(line.description), 1)
501
+ ], 64)) : ((_a = line.details) == null ? void 0 : _a.description) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
502
+ createTextVNode(toDisplayString((_b = line.details) == null ? void 0 : _b.description), 1)
503
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
504
+ createTextVNode(toDisplayString(unref(intl).$t({
505
+ id: "generic.not_available",
506
+ defaultMessage: "N/A",
507
+ description: "Used in scenarios where no data is available to be displayed"
508
+ })), 1)
509
+ ], 64))
510
+ ])
511
+ ];
512
+ }),
513
+ _: 2
514
+ }, 1024),
515
+ createVNode(_sfc_main$m, { colspan: "3" }, {
516
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
517
+ createTextVNode(" ", -1)
518
+ ])]),
519
+ _: 1
520
+ }),
521
+ createVNode(_sfc_main$m, { number: "" }, {
522
+ default: withCtx(() => {
523
+ var _a, _b;
524
+ return [
525
+ ((_a = line.details) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
526
+ key: 0,
527
+ value: (_b = line.details) == null ? void 0 : _b.amount
528
+ }, null, 8, ["value"])) : createCommentVNode("", true)
529
+ ];
530
+ }),
531
+ _: 2
532
+ }, 1024)
533
+ ], 10, _hoisted_1$g),
534
+ createVNode(_sfc_main$k, {
535
+ ref_for: true,
536
+ ref: formatIndex(__props.groupOrder, line["line_order"]),
537
+ "sub-lines": line.sub_lines ?? [],
538
+ "line-order": line["line_order"],
539
+ "period-order": __props.invoicePeriodOrder,
540
+ "group-order": __props.groupOrder,
541
+ "is-open": unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
542
+ }, null, 8, ["sub-lines", "line-order", "period-order", "group-order", "is-open"])
543
+ ], 64);
544
+ }), 128))
545
+ ]),
546
+ _: 3
547
+ });
548
+ };
549
+ }
550
+ });
551
+ const _hoisted_1$f = ["tabindex", "onClick"];
552
+ const _hoisted_2$9 = { class: "flex items-center" };
553
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
554
+ __name: "InvoiceDiscountMarkup",
555
+ props: {
556
+ lines: {},
557
+ type: {},
558
+ handleToggleItems: { type: Function },
559
+ formatIndex: { type: Function },
560
+ expandedItems: {},
561
+ isExpandable: { type: Boolean },
562
+ invoicePeriodOrder: {},
563
+ groupOrder: {}
564
+ },
565
+ setup(__props) {
566
+ const intl = useIntl();
567
+ const { getIsOpen, toggle } = useToggleList();
568
+ const toggleLine = (groupOrder, invoiceLineOrder) => {
569
+ toggle(formatIndex(groupOrder, invoiceLineOrder));
570
+ };
571
+ const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
572
+ return (_ctx, _cache) => {
573
+ return openBlock(), createBlock(InvoiceTable, null, {
574
+ default: withCtx(() => [
575
+ createElementVNode("tr", null, [
576
+ createVNode(_sfc_main$l, {
577
+ left: "",
578
+ class: "w-3/5"
579
+ }, {
580
+ default: withCtx(() => [
581
+ createTextVNode(toDisplayString(unref(intl).$t({
582
+ id: "invoice.table_header.quantity",
583
+ defaultMessage: "Quantity",
584
+ description: "Table header for quantity column"
585
+ })), 1)
586
+ ]),
587
+ _: 1
588
+ }),
589
+ createVNode(_sfc_main$l, { colspan: "2" }, {
590
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
591
+ createTextVNode(" ", -1)
592
+ ])]),
593
+ _: 1
594
+ }),
595
+ createVNode(_sfc_main$l, {
596
+ left: "",
597
+ class: "w-1/5"
598
+ }, {
599
+ default: withCtx(() => [
600
+ createTextVNode(toDisplayString(__props.type === "DISCOUNT" ? unref(intl).$t({
601
+ id: "invoice.table_header.discount",
602
+ defaultMessage: "Discount",
603
+ description: "Table header for discount column"
604
+ }) : unref(intl).$t({
605
+ id: "invoice.table_header.markup",
606
+ defaultMessage: "Markup",
607
+ description: "Table header for markup column"
608
+ })), 1)
609
+ ]),
610
+ _: 1
611
+ }),
612
+ createVNode(_sfc_main$l, {
613
+ left: "",
614
+ class: "w-1/5"
615
+ }, {
616
+ default: withCtx(() => [
617
+ createTextVNode(toDisplayString(__props.type === "DISCOUNT" ? unref(intl).$t({
618
+ id: "invoice.table_header.total",
619
+ defaultMessage: "Total",
620
+ description: "Table header for total column"
621
+ }) : " "), 1)
622
+ ]),
623
+ _: 1
624
+ }),
625
+ createVNode(_sfc_main$l, {
626
+ right: "",
627
+ class: "w-1/5"
628
+ }, {
629
+ default: withCtx(() => [
630
+ createTextVNode(toDisplayString(unref(intl).$t({
631
+ id: "invoice.table_header.sub_total",
632
+ defaultMessage: "Subtotal",
633
+ description: "Table header for the column containing the subtotal for invoices"
634
+ })), 1)
635
+ ]),
636
+ _: 1
637
+ })
638
+ ]),
639
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.lines, (line, lineIndex) => {
640
+ return openBlock(), createElementBlock(Fragment, { key: lineIndex }, [
641
+ createElementVNode("tr", {
642
+ class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
643
+ tabindex: __props.isExpandable ? 0 : void 0,
644
+ onClick: ($event) => toggleLine(__props.groupOrder, line["line_order"])
645
+ }, [
646
+ createVNode(_sfc_main$m, { class: "w-3/5" }, {
647
+ default: withCtx(() => {
648
+ var _a, _b;
649
+ return [
650
+ line.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
651
+ key: 0,
652
+ icon: "keyboard_arrow_down",
653
+ size: "md",
654
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
655
+ "-rotate-90": !unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
656
+ }])
657
+ }, null, 8, ["class"])) : createCommentVNode("", true),
658
+ createElementVNode("div", _hoisted_2$9, [
659
+ renderSlot(_ctx.$slots, "invoice-line-prefix", {
660
+ lineOrder: line.line_order,
661
+ periodOrder: __props.invoicePeriodOrder,
662
+ groupOrder: __props.groupOrder
663
+ }),
664
+ line.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
665
+ createTextVNode(toDisplayString(line.description), 1)
666
+ ], 64)) : ((_a = line.details) == null ? void 0 : _a.description) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
667
+ createTextVNode(toDisplayString((_b = line.details) == null ? void 0 : _b.description), 1)
668
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
669
+ createTextVNode("N/A")
670
+ ], 64))
671
+ ])
672
+ ];
673
+ }),
674
+ _: 2
675
+ }, 1024),
676
+ createVNode(_sfc_main$m, { colspan: "2" }, {
677
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
678
+ createTextVNode(" ", -1)
679
+ ])]),
680
+ _: 1
681
+ }),
682
+ createVNode(_sfc_main$m, { class: "tabular-nums w-1/5" }, {
683
+ default: withCtx(() => {
684
+ var _a, _b, _c;
685
+ return [
686
+ createTextVNode(toDisplayString(((_b = (_a = line.details) == null ? void 0 : _a.band) == null ? void 0 : _b.percentage) ? `${(_c = line.details) == null ? void 0 : _c.band.percentage}%` : " "), 1)
687
+ ];
688
+ }),
689
+ _: 2
690
+ }, 1024),
691
+ createVNode(_sfc_main$m, { class: "w-1/5" }, {
692
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
693
+ createTextVNode(" ", -1)
694
+ ])]),
695
+ _: 1
696
+ }),
697
+ createVNode(_sfc_main$m, {
698
+ number: "",
699
+ class: "w-1/5"
700
+ }, {
701
+ default: withCtx(() => {
702
+ var _a;
703
+ return [
704
+ ((_a = line.details) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
705
+ key: 0,
706
+ value: line.details.amount
707
+ }, null, 8, ["value"])) : createCommentVNode("", true)
708
+ ];
709
+ }),
710
+ _: 2
711
+ }, 1024)
712
+ ], 10, _hoisted_1$f),
713
+ createVNode(_sfc_main$k, {
714
+ ref_for: true,
715
+ ref: formatIndex(__props.groupOrder, line["line_order"]),
716
+ "sub-lines": line.sub_lines ?? [],
717
+ "line-order": line["line_order"],
718
+ "is-open": unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"])),
719
+ "period-order": __props.invoicePeriodOrder,
720
+ "group-order": __props.groupOrder
721
+ }, null, 8, ["sub-lines", "line-order", "is-open", "period-order", "group-order"])
722
+ ], 64);
723
+ }), 128))
724
+ ]),
725
+ _: 3
726
+ });
727
+ };
728
+ }
729
+ });
730
+ const _hoisted_1$e = ["tabindex"];
731
+ const _hoisted_2$8 = { key: 0 };
732
+ const _hoisted_3$6 = {
733
+ colspan: "2",
734
+ class: "p-0"
735
+ };
736
+ const _hoisted_4$6 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
737
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
738
+ __name: "InvoiceGroupCommitment",
739
+ props: {
740
+ group: {},
741
+ expandedItems: {},
742
+ handleToggleItems: { type: Function },
743
+ formatIndex: { type: Function },
744
+ invoicePeriodOrder: {},
745
+ groupOrder: {},
746
+ isExpandable: { type: Boolean },
747
+ amountType: {},
748
+ processingOnlyCustomers: {}
749
+ },
750
+ setup(__props) {
751
+ const intl = useIntl();
752
+ return (_ctx, _cache) => {
753
+ return openBlock(), createElementBlock(Fragment, null, [
754
+ createElementVNode("tr", {
755
+ class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
756
+ tabindex: __props.isExpandable ? 0 : void 0,
757
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
758
+ onKeyup: [
759
+ _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
760
+ _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
761
+ ]
762
+ }, [
763
+ createVNode(_sfc_main$m, { class: "p-0" }, {
764
+ default: withCtx(() => [
765
+ __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
766
+ key: 0,
767
+ icon: "keyboard_arrow_down",
768
+ size: "md",
769
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
770
+ "-rotate-90": !__props.expandedItems.includes(
771
+ __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
772
+ )
773
+ }])
774
+ }, null, 8, ["class"])) : createCommentVNode("", true),
775
+ createTextVNode(" " + toDisplayString(unref(intl).$t({
776
+ id: "invoice.commitment_heading",
777
+ defaultMessage: "Commitment",
778
+ description: "Heading used for commitment in invoice tables"
779
+ })), 1)
780
+ ]),
781
+ _: 1
782
+ }),
783
+ createVNode(_sfc_main$m, { number: "" }, {
784
+ default: withCtx(() => [
785
+ __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
786
+ key: 0,
787
+ value: __props.group.amount_including_tax
788
+ }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
789
+ key: 1,
790
+ value: __props.group.amount_excluding_tax
791
+ }, null, 8, ["value"]))
792
+ ]),
793
+ _: 1
794
+ })
795
+ ], 42, _hoisted_1$e),
796
+ __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) && __props.group.lines ? (openBlock(), createElementBlock("tr", _hoisted_2$8, [
797
+ createElementVNode("td", _hoisted_3$6, [
798
+ createElementVNode("div", _hoisted_4$6, [
799
+ createVNode(_sfc_main$j, {
800
+ commitments: __props.group.lines,
801
+ "format-index": __props.formatIndex,
802
+ "handle-toggle-items": __props.handleToggleItems,
803
+ "expanded-items": __props.expandedItems,
804
+ "is-expandable": __props.isExpandable,
805
+ "invoice-period-order": __props.invoicePeriodOrder,
806
+ "group-order": __props.groupOrder
807
+ }, {
808
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
809
+ renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
810
+ ]),
811
+ _: 3
812
+ }, 8, ["commitments", "format-index", "handle-toggle-items", "expanded-items", "is-expandable", "invoice-period-order", "group-order"])
813
+ ])
814
+ ])
815
+ ])) : createCommentVNode("", true)
816
+ ], 64);
817
+ };
818
+ }
819
+ });
820
+ const _hoisted_1$d = ["tabindex"];
821
+ const _hoisted_2$7 = { key: 0 };
822
+ const _hoisted_3$5 = {
823
+ colspan: "2",
824
+ class: "p-0"
825
+ };
826
+ const _hoisted_4$5 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
827
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
828
+ __name: "InvoiceGroupDiscountMarkup",
829
+ props: {
830
+ heading: {},
831
+ group: {},
832
+ expandedItems: {},
833
+ handleToggleItems: { type: Function },
834
+ formatIndex: { type: Function },
835
+ invoicePeriodOrder: {},
836
+ groupOrder: {},
837
+ isExpandable: { type: Boolean },
838
+ amountType: {},
839
+ processingOnlyCustomers: {}
840
+ },
841
+ setup(__props) {
842
+ return (_ctx, _cache) => {
843
+ return openBlock(), createElementBlock(Fragment, null, [
844
+ createElementVNode("tr", {
845
+ class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
846
+ tabindex: __props.isExpandable ? 0 : void 0,
847
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
848
+ onKeyup: [
849
+ _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
850
+ _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
851
+ ]
852
+ }, [
853
+ createVNode(_sfc_main$m, { class: "p-0" }, {
854
+ default: withCtx(() => [
855
+ __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
856
+ key: 0,
857
+ icon: "keyboard_arrow_down",
858
+ size: "md",
859
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
860
+ "-rotate-90": !__props.expandedItems.includes(
861
+ __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
862
+ )
863
+ }])
864
+ }, null, 8, ["class"])) : createCommentVNode("", true),
865
+ createTextVNode(" " + toDisplayString(__props.heading), 1)
866
+ ]),
867
+ _: 1
868
+ }),
869
+ createVNode(_sfc_main$m, { number: "" }, {
870
+ default: withCtx(() => [
871
+ __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
872
+ key: 0,
873
+ value: __props.group.amount_including_tax
874
+ }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
875
+ key: 1,
876
+ value: __props.group.amount_excluding_tax
877
+ }, null, 8, ["value"]))
878
+ ]),
879
+ _: 1
880
+ })
881
+ ], 42, _hoisted_1$d),
882
+ __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) && __props.group.lines ? (openBlock(), createElementBlock("tr", _hoisted_2$7, [
883
+ createElementVNode("td", _hoisted_3$5, [
884
+ createElementVNode("div", _hoisted_4$5, [
885
+ createVNode(_sfc_main$i, {
886
+ type: __props.group.type,
887
+ lines: __props.group.lines,
888
+ "format-index": __props.formatIndex,
889
+ "handle-toggle-items": __props.handleToggleItems,
890
+ "expanded-items": __props.expandedItems,
891
+ "is-expandable": __props.isExpandable,
892
+ "invoice-period-order": __props.invoicePeriodOrder,
893
+ "group-order": __props.groupOrder
894
+ }, {
895
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
896
+ renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
897
+ ]),
898
+ _: 3
899
+ }, 8, ["type", "lines", "format-index", "handle-toggle-items", "expanded-items", "is-expandable", "invoice-period-order", "group-order"])
900
+ ])
901
+ ])
902
+ ])) : createCommentVNode("", true)
903
+ ], 64);
904
+ };
905
+ }
906
+ });
907
+ const _hoisted_1$c = { class: "flex gap-4" };
908
+ const _hoisted_2$6 = { class: "flex gap-2 items-center" };
909
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
910
+ __name: "PricingClauseChip",
911
+ props: {
912
+ iconName: {},
913
+ chipColor: {}
914
+ },
915
+ setup(__props) {
916
+ return (_ctx, _cache) => {
917
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
918
+ createVNode(_sfc_main$w, { color: __props.chipColor }, {
919
+ default: withCtx(() => [
920
+ createElementVNode("div", _hoisted_2$6, [
921
+ createVNode(_sfc_main$r, {
922
+ icon: __props.iconName,
923
+ size: "xs"
924
+ }, null, 8, ["icon"]),
925
+ createElementVNode("span", null, [
926
+ renderSlot(_ctx.$slots, "chip-content")
927
+ ])
928
+ ])
929
+ ]),
930
+ _: 3
931
+ }, 8, ["color"]),
932
+ renderSlot(_ctx.$slots, "chip-postfix")
933
+ ]);
934
+ };
935
+ }
936
+ });
937
+ const _hoisted_1$b = { class: "flex flex-col gap-2" };
938
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
939
+ __name: "InvoicePricingClauseChip",
940
+ props: {
941
+ clauseType: {},
942
+ priceDetailsBand: {},
943
+ invoiceLineDescription: {}
944
+ },
945
+ setup(__props) {
946
+ const intl = useIntl();
947
+ return (_ctx, _cache) => {
948
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
949
+ createElementVNode("span", null, toDisplayString(__props.invoiceLineDescription), 1),
950
+ __props.clauseType === "DISCOUNT" && __props.priceDetailsBand ? (openBlock(), createBlock(unref(_sfc_main$f), {
951
+ key: 0,
952
+ "icon-name": "south_east",
953
+ "chip-color": "yellow"
954
+ }, createSlots({ _: 2 }, [
955
+ __props.priceDetailsBand.amount ? {
956
+ name: "chip-content",
957
+ fn: withCtx(() => [
958
+ createTextVNode(toDisplayString(unref(intl).$t(
959
+ {
960
+ id: "invoice.amount_discount",
961
+ defaultMessage: "{amount} discount",
962
+ description: "Represents a certain amount of discount, where {amount} is replaced with the amount"
963
+ },
964
+ {
965
+ amount: unref(formatAmount)(__props.priceDetailsBand.amount)
966
+ }
967
+ ).toUpperCase()), 1)
968
+ ]),
969
+ key: "0"
970
+ } : __props.priceDetailsBand.percentage ? {
971
+ name: "chip-content",
972
+ fn: withCtx(() => [
973
+ createTextVNode(toDisplayString(unref(intl).$t(
974
+ {
975
+ id: "invoice.percentage_discount",
976
+ defaultMessage: "{percentage}% discount",
977
+ description: "Represents a certain percentage of discount, where {percentage} is replaced with the percentage (number only)"
978
+ },
979
+ {
980
+ percentage: __props.priceDetailsBand.percentage ?? "0"
981
+ }
982
+ ).toUpperCase()), 1)
983
+ ]),
984
+ key: "1"
985
+ } : void 0
986
+ ]), 1024)) : __props.clauseType === "ADJUSTMENT" ? (openBlock(), createBlock(unref(_sfc_main$f), {
987
+ key: 1,
988
+ "icon-name": "info",
989
+ "chip-color": "yellow"
990
+ }, {
991
+ "chip-content": withCtx(() => [
992
+ createTextVNode(toDisplayString(unref(intl).$t({
993
+ id: "invoice.adjustment_chip_body",
994
+ defaultMessage: "Adjustment",
995
+ description: "Used on invoice lines to mark as adjusted"
996
+ }).toUpperCase()), 1)
997
+ ]),
998
+ _: 1
999
+ })) : __props.clauseType === "MARKUP" ? (openBlock(), createBlock(unref(_sfc_main$f), {
1000
+ key: 2,
1001
+ "icon-name": "north_east",
1002
+ "chip-color": "teal-light"
1003
+ }, {
1004
+ "chip-content": withCtx(() => {
1005
+ var _a;
1006
+ return [
1007
+ createTextVNode(toDisplayString(unref(intl).$t(
1008
+ {
1009
+ id: "invoice.markup_percentage",
1010
+ defaultMessage: "{percentage}% markup",
1011
+ description: "Markup percentage, where {percentage} is replaced with the percentage (number only)"
1012
+ },
1013
+ { percentage: ((_a = __props.priceDetailsBand) == null ? void 0 : _a.percentage) ?? "0" }
1014
+ ).toUpperCase()), 1)
1015
+ ];
1016
+ }),
1017
+ _: 1
1018
+ })) : __props.clauseType === "COMMITMENT" ? (openBlock(), createBlock(unref(_sfc_main$f), {
1019
+ key: 3,
1020
+ "icon-name": "sell",
1021
+ "chip-color": "orange"
1022
+ }, {
1023
+ "chip-content": withCtx(() => [
1024
+ createTextVNode(toDisplayString(unref(intl).$t({
1025
+ id: "invoice.commitment",
1026
+ defaultMessage: "commitment",
1027
+ description: "Used on invoice lines to mark as commitment"
1028
+ }).toUpperCase()), 1)
1029
+ ]),
1030
+ _: 1
1031
+ })) : createCommentVNode("", true)
1032
+ ]);
1033
+ };
1034
+ }
1035
+ });
1036
+ const _hoisted_1$a = { class: "items-left flex flex-col gap-1 leading-none" };
1037
+ const _hoisted_2$5 = { class: "flex items-center" };
1038
+ const _hoisted_3$4 = {
1039
+ key: 0,
1040
+ class: "ml-1 text-xs text-gray-400"
1041
+ };
1042
+ const _hoisted_4$4 = { key: 0 };
1043
+ const _hoisted_5$4 = {
1044
+ key: 1,
1045
+ class: "text-xs text-gray-400"
1046
+ };
1047
+ const _hoisted_6$3 = {
1048
+ key: 2,
1049
+ class: "text-xs text-gray-400"
1050
+ };
1051
+ const _hoisted_7$2 = { class: "text-[9pt] text-slate-600" };
1052
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1053
+ __name: "InvoiceLineRow",
1054
+ props: {
1055
+ data: {},
1056
+ isLast: { type: Boolean },
1057
+ periodOrder: {},
1058
+ groupOrder: {},
1059
+ groupType: {},
1060
+ isExpanded: { type: Boolean }
1061
+ },
1062
+ setup(__props) {
1063
+ const { $t } = useIntl();
1064
+ const props = __props;
1065
+ const formattedTier = (band) => {
1066
+ var _a, _b;
1067
+ if (!band) return "";
1068
+ let lowerBound = "0";
1069
+ let topBound = " +";
1070
+ if (band.tier_lower_bound && "number" in band.tier_lower_bound) {
1071
+ lowerBound = ((_a = band.tier_lower_bound) == null ? void 0 : _a.number) ?? "0";
1072
+ } else if (band.tier_lower_bound && "amount" in band.tier_lower_bound) {
1073
+ const { quantity, currency } = band.tier_lower_bound.amount;
1074
+ lowerBound = `${currency} ${quantity ?? 0}`;
1075
+ }
1076
+ if (band.tier_top_bound && "number" in band.tier_top_bound) {
1077
+ topBound = ` - ${(_b = band.tier_top_bound) == null ? void 0 : _b.number}`;
1078
+ } else if (band.tier_top_bound && "amount" in band.tier_top_bound) {
1079
+ const { quantity, currency } = band.tier_top_bound.amount;
1080
+ topBound = ` - ${currency} ${quantity}`;
1081
+ }
1082
+ return lowerBound + topBound;
1083
+ };
1084
+ const includedVolumeDetails = computed(() => {
1085
+ var _a;
1086
+ return (_a = props.data.details) == null ? void 0 : _a.included_volume_details;
1087
+ });
1088
+ const invoiceLineName = computed(() => {
1089
+ var _a, _b;
1090
+ if ((_a = props.data) == null ? void 0 : _a.product_items) {
1091
+ return getComposedString(props.data.product_items.map((item) => item.name));
1092
+ }
1093
+ return ((_b = props.data) == null ? void 0 : _b.description) ?? "N/A";
1094
+ });
1095
+ return (_ctx, _cache) => {
1096
+ return openBlock(), createElementBlock(Fragment, null, [
1097
+ createVNode(_sfc_main$m, { class: "align-top" }, {
1098
+ default: withCtx(() => {
1099
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
1100
+ return [
1101
+ createElementVNode("div", _hoisted_1$a, [
1102
+ createElementVNode("div", null, [
1103
+ __props.data.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
1104
+ key: 0,
1105
+ icon: "keyboard_arrow_down",
1106
+ size: "md",
1107
+ class: normalizeClass(["absolute -translate-x-7 -translate-y-2 text-slate-400", {
1108
+ "-rotate-90": !__props.isExpanded
1109
+ }])
1110
+ }, null, 8, ["class"])) : createCommentVNode("", true),
1111
+ createElementVNode("div", _hoisted_2$5, [
1112
+ renderSlot(_ctx.$slots, "invoice-line-prefix", {
1113
+ lineOrder: __props.data.line_order,
1114
+ periodOrder: __props.periodOrder,
1115
+ groupOrder: __props.groupOrder
1116
+ }),
1117
+ ["PRICING", "REVENUE", "ONE_OFF"].includes(__props.data.type) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1118
+ createTextVNode(toDisplayString(invoiceLineName.value) + " ", 1),
1119
+ __props.data.type === "ONE_OFF" && __props.groupType !== "ONE_OFF" ? (openBlock(), createElementBlock("div", _hoisted_3$4, toDisplayString(unref(formatEnum)(__props.data.type)), 1)) : createCommentVNode("", true)
1120
+ ], 64)) : (openBlock(), createBlock(_sfc_main$e, {
1121
+ key: 1,
1122
+ "invoice-line-description": invoiceLineName.value,
1123
+ "clause-type": __props.data.type,
1124
+ "price-details-band": (_a = __props.data.details) == null ? void 0 : _a.band
1125
+ }, null, 8, ["invoice-line-description", "clause-type", "price-details-band"]))
1126
+ ])
1127
+ ]),
1128
+ ["TIERED", "STAIR_STEP", "TOP_TIERED"].includes(__props.data.pricing_type) && !includedVolumeDetails.value && ((_b = __props.data.details) == null ? void 0 : _b.band) ? (openBlock(), createElementBlock("div", _hoisted_4$4, toDisplayString(formattedTier((_c = __props.data.details) == null ? void 0 : _c.band)), 1)) : createCommentVNode("", true),
1129
+ ((_e = (_d = __props.data.details) == null ? void 0 : _d.split_pricing) == null ? void 0 : _e.meter_properties) ? (openBlock(), createElementBlock("span", _hoisted_5$4, [
1130
+ (openBlock(true), createElementBlock(Fragment, null, renderList((_g = (_f = __props.data.details) == null ? void 0 : _f.split_pricing) == null ? void 0 : _g.meter_properties, (meterProperty, index) => {
1131
+ return openBlock(), createElementBlock(Fragment, null, [
1132
+ createTextVNode(toDisplayString(meterProperty.meter_property.name) + ": " + toDisplayString(meterProperty.value), 1),
1133
+ index < __props.data.details.split_pricing.meter_properties.length - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1134
+ createTextVNode(toDisplayString(", "))
1135
+ ], 64)) : createCommentVNode("", true)
1136
+ ], 64);
1137
+ }), 256))
1138
+ ])) : createCommentVNode("", true),
1139
+ ((_h = __props.data.conditions) == null ? void 0 : _h.name) || ((_i = __props.data.conditions) == null ? void 0 : _i.meter_properties) ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
1140
+ __props.data.conditions.name ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1141
+ createTextVNode(toDisplayString(__props.data.conditions.name), 1)
1142
+ ], 64)) : __props.data.conditions.meter_properties ? (openBlock(), createBlock(unref(_sfc_main$u), {
1143
+ key: 1,
1144
+ comparators: __props.data.conditions.meter_properties
1145
+ }, null, 8, ["comparators"])) : createCommentVNode("", true)
1146
+ ])) : createCommentVNode("", true)
1147
+ ]),
1148
+ createElementVNode("span", _hoisted_7$2, [
1149
+ ((_j = __props.data.details) == null ? void 0 : _j.price_bound) === "BELOW_MINIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1150
+ createTextVNode(toDisplayString(unref($t)({
1151
+ id: "invoice.line.band_minimum_amount",
1152
+ defaultMessage: "Band minimum amount",
1153
+ description: "Minimum amount specified in a band"
1154
+ })) + " ", 1),
1155
+ ((_k = __props.data.details.band) == null ? void 0 : _k.minimum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1156
+ key: 0,
1157
+ value: __props.data.details.band.minimum_amount
1158
+ }, null, 8, ["value"])) : createCommentVNode("", true)
1159
+ ], 64)) : ((_l = __props.data.details) == null ? void 0 : _l.price_bound) === "NOT_HIT" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1160
+ createTextVNode(toDisplayString(unref($t)({
1161
+ id: "invoice.line.price_bound_within_bounds",
1162
+ defaultMessage: "Within bounds",
1163
+ description: "Label used when min and max bounds are specified but reached"
1164
+ })), 1)
1165
+ ], 64)) : ((_m = __props.data.details) == null ? void 0 : _m.price_bound) === "ABOVE_MAXIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1166
+ createTextVNode(toDisplayString(unref($t)({
1167
+ id: "invoice.line.price_bound_maximum_amount",
1168
+ defaultMessage: "Maximum amount",
1169
+ description: "Minimum amount specified in a band"
1170
+ })) + " ", 1),
1171
+ ((_n = __props.data.details.band) == null ? void 0 : _n.maximum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1172
+ key: 0,
1173
+ value: __props.data.details.band.maximum_amount
1174
+ }, null, 8, ["value"])) : createCommentVNode("", true)
1175
+ ], 64)) : ((_o = __props.data.details) == null ? void 0 : _o.price_bound) === "BELOW_MINIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1176
+ createTextVNode(toDisplayString(unref($t)({
1177
+ id: "invoice.line.band_minimum_number",
1178
+ defaultMessage: "Minimum number",
1179
+ description: "Minimum number of units specified in a band"
1180
+ })) + " " + toDisplayString((_p = __props.data.details.band) == null ? void 0 : _p.minimum_number), 1)
1181
+ ], 64)) : ((_q = __props.data.details) == null ? void 0 : _q.price_bound) === "ABOVE_MAXIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1182
+ createTextVNode(toDisplayString(unref($t)({
1183
+ id: "invoice.line.band_maximum_number",
1184
+ defaultMessage: "Maximum number",
1185
+ description: "Maximum number of units specified in a band"
1186
+ })) + " " + toDisplayString((_r = __props.data.details.band) == null ? void 0 : _r.maximum_number), 1)
1187
+ ], 64)) : createCommentVNode("", true)
1188
+ ])
1189
+ ];
1190
+ }),
1191
+ _: 3
1192
+ }),
1193
+ renderSlot(_ctx.$slots, "line-content", {
1194
+ details: __props.data.details
1195
+ })
1196
+ ], 64);
1197
+ };
1198
+ }
1199
+ });
1200
+ const _hoisted_1$9 = {
1201
+ key: 4,
1202
+ class: "text-xs text-gray-400"
1203
+ };
1204
+ const _hoisted_2$4 = {
1205
+ key: 1,
1206
+ class: "tabular-nums"
1207
+ };
1208
+ const _hoisted_3$3 = { class: "text-2xs text-gray-500" };
1209
+ const _hoisted_4$3 = {
1210
+ key: 0,
1211
+ class: "flex justify-end"
1212
+ };
1213
+ const _hoisted_5$3 = { class: "flex gap-1 items-center justify-end" };
1214
+ const _hoisted_6$2 = {
1215
+ key: 0,
1216
+ class: "text-2xs text-gray-500 tabular-nums"
1217
+ };
1218
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1219
+ __name: "InvoiceRowContent",
1220
+ props: {
1221
+ pricingType: {},
1222
+ details: {},
1223
+ taxCategories: {},
1224
+ amountType: {},
1225
+ hideTaxDetails: { type: Boolean }
1226
+ },
1227
+ setup(__props) {
1228
+ const intl = useIntl();
1229
+ const props = __props;
1230
+ const includedVolumeDetails = computed(() => {
1231
+ var _a;
1232
+ return (_a = props.details) == null ? void 0 : _a.included_volume_details;
1233
+ });
1234
+ const availableIncludedVolume = computed(
1235
+ () => {
1236
+ var _a;
1237
+ return (_a = includedVolumeDetails.value) == null ? void 0 : _a.available_included_volume;
1238
+ }
1239
+ );
1240
+ return (_ctx, _cache) => {
1241
+ return openBlock(), createElementBlock(Fragment, null, [
1242
+ createVNode(_sfc_main$m, {
1243
+ number: "",
1244
+ class: "align-top"
1245
+ }, {
1246
+ default: withCtx(() => {
1247
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
1248
+ return [
1249
+ __props.pricingType !== "PASS_THROUGH" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1250
+ ((_a = __props.details) == null ? void 0 : _a.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1251
+ ((_b = __props.details) == null ? void 0 : _b.price_bound) === "BELOW_MINIMUM_AMOUNT" || ((_c = __props.details) == null ? void 0 : _c.price_bound) === "ABOVE_MAXIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1252
+ createTextVNode(toDisplayString((_d = __props.details) == null ? void 0 : _d.meter_value.count), 1)
1253
+ ], 64)) : ((_e = __props.details) == null ? void 0 : _e.price_bound) === "NOT_HIT" && "amount" in __props.details.meter_value && ((_g = (_f = __props.details) == null ? void 0 : _f.meter_value) == null ? void 0 : _g.amount) ? (openBlock(), createBlock(_sfc_main$v, {
1254
+ key: 1,
1255
+ value: (_i = (_h = __props.details) == null ? void 0 : _h.meter_value) == null ? void 0 : _i.amount
1256
+ }, null, 8, ["value"])) : ((_j = __props.details) == null ? void 0 : _j.price_bound) === "NOT_HIT" && "number" in __props.details.meter_value && ((_l = (_k = __props.details) == null ? void 0 : _k.meter_value) == null ? void 0 : _l.number) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1257
+ createTextVNode(toDisplayString((_n = (_m = __props.details) == null ? void 0 : _m.meter_value) == null ? void 0 : _n.number), 1)
1258
+ ], 64)) : ((_o = __props.details) == null ? void 0 : _o.price_bound) === "RATIO" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1259
+ createTextVNode(toDisplayString((_p = __props.details) == null ? void 0 : _p.meter_value.number), 1)
1260
+ ], 64)) : ((_q = __props.details) == null ? void 0 : _q.price_bound) === "BELOW_MINIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1261
+ createTextVNode(toDisplayString((_s = (_r = __props.details) == null ? void 0 : _r.band) == null ? void 0 : _s.minimum_number), 1)
1262
+ ], 64)) : ((_t = __props.details) == null ? void 0 : _t.price_bound) === "ABOVE_MAXIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [
1263
+ createTextVNode(toDisplayString((_v = (_u = __props.details) == null ? void 0 : _u.band) == null ? void 0 : _v.maximum_number), 1)
1264
+ ], 64)) : createCommentVNode("", true)
1265
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1266
+ ((_w = __props.details) == null ? void 0 : _w.meter_value) && "number" in __props.details.meter_value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1267
+ createTextVNode(toDisplayString(__props.details.meter_value.number), 1)
1268
+ ], 64)) : ((_x = __props.details) == null ? void 0 : _x.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1269
+ createTextVNode(toDisplayString(__props.details.total_count), 1)
1270
+ ], 64)) : ((_y = __props.details) == null ? void 0 : _y.meter_value) && "amount" in __props.details.meter_value ? (openBlock(), createBlock(_sfc_main$v, {
1271
+ key: 2,
1272
+ value: __props.details.meter_value.amount
1273
+ }, null, 8, ["value"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1274
+ createTextVNode("1")
1275
+ ], 64)),
1276
+ availableIncludedVolume.value ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
1277
+ availableIncludedVolume.value.type === "AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1278
+ createVNode(_sfc_main$v, {
1279
+ value: availableIncludedVolume.value.amount
1280
+ }, null, 8, ["value"]),
1281
+ createTextVNode(" " + toDisplayString(unref(intl).$t({
1282
+ id: "invoice.line.included",
1283
+ defaultMessage: "included",
1284
+ description: "Used to specify an included amount. Should be lowercase."
1285
+ })), 1)
1286
+ ], 64)) : availableIncludedVolume.value.type === "NUMBER" ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(availableIncludedVolume.value.number) + " " + toDisplayString(unref(intl).$t({
1287
+ id: "invoice.line.units_included",
1288
+ defaultMessage: "units included",
1289
+ description: "Used to specify an included units. Should be lowercase."
1290
+ })), 1)) : createCommentVNode("", true)
1291
+ ])) : createCommentVNode("", true)
1292
+ ], 64))
1293
+ ], 64)) : createCommentVNode("", true)
1294
+ ];
1295
+ }),
1296
+ _: 1
1297
+ }),
1298
+ __props.pricingType === "PASS_THROUGH" ? (openBlock(), createBlock(_sfc_main$m, {
1299
+ key: 0,
1300
+ class: "align-top text-right"
1301
+ }, {
1302
+ default: withCtx(() => [
1303
+ createTextVNode(toDisplayString(unref(intl).$t({
1304
+ id: "invoice.line.pass_through",
1305
+ defaultMessage: "Pass through",
1306
+ description: "Name of the pass through pricing type"
1307
+ })), 1)
1308
+ ]),
1309
+ _: 1
1310
+ })) : (openBlock(), createBlock(_sfc_main$m, {
1311
+ key: 1,
1312
+ number: "",
1313
+ class: "align-top"
1314
+ }, {
1315
+ default: withCtx(() => {
1316
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1317
+ return [
1318
+ ((_a = __props.details) == null ? void 0 : _a.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1319
+ ((_b = __props.details) == null ? void 0 : _b.price_bound) === "BELOW_MINIMUM_AMOUNT" && ((_d = (_c = __props.details) == null ? void 0 : _c.band) == null ? void 0 : _d.minimum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1320
+ key: 0,
1321
+ value: __props.details.band.minimum_amount
1322
+ }, null, 8, ["value"])) : ((_e = __props.details) == null ? void 0 : _e.price_bound) === "ABOVE_MAXIMUM_AMOUNT" && ((_g = (_f = __props.details) == null ? void 0 : _f.band) == null ? void 0 : _g.maximum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1323
+ key: 1,
1324
+ value: __props.details.band.maximum_amount
1325
+ }, null, 8, ["value"])) : ["NOT_HIT", "RATIO", "BELOW_MINIMUM_NUMBER", "ABOVE_MAXIMUM_NUMBER"].includes(
1326
+ (_h = __props.details) == null ? void 0 : _h.price_bound
1327
+ ) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1328
+ ((_i = __props.details) == null ? void 0 : _i.band) && __props.details.band.amount ? (openBlock(), createBlock(_sfc_main$v, {
1329
+ key: 0,
1330
+ value: __props.details.band.amount
1331
+ }, null, 8, ["value"])) : createCommentVNode("", true),
1332
+ ((_j = __props.details) == null ? void 0 : _j.band) && "percentage" in __props.details.band ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1333
+ createTextVNode(toDisplayString(__props.details.band.percentage) + "% ", 1)
1334
+ ], 64)) : createCommentVNode("", true)
1335
+ ], 64)) : createCommentVNode("", true)
1336
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1337
+ ((_k = __props.details) == null ? void 0 : _k.band) && __props.details.band.amount ? (openBlock(), createBlock(_sfc_main$v, {
1338
+ key: 0,
1339
+ value: __props.details.band.amount
1340
+ }, null, 8, ["value"])) : createCommentVNode("", true),
1341
+ ((_l = __props.details) == null ? void 0 : _l.band) && "percentage" in __props.details.band ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1342
+ createTextVNode(toDisplayString(__props.details.band.percentage) + "% ", 1)
1343
+ ], 64)) : createCommentVNode("", true)
1344
+ ], 64))
1345
+ ];
1346
+ }),
1347
+ _: 1
1348
+ })),
1349
+ createVNode(_sfc_main$m, {
1350
+ number: "",
1351
+ class: "align-top"
1352
+ }, {
1353
+ default: withCtx(() => [
1354
+ !__props.hideTaxDetails ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
1355
+ return openBlock(), createElementBlock("div", {
1356
+ key: taxCategoryIndex,
1357
+ class: "tabular-nums"
1358
+ }, [
1359
+ createElementVNode("div", null, toDisplayString(taxCategory.percentage) + "%", 1),
1360
+ createElementVNode("div", _hoisted_3$3, [
1361
+ createVNode(_sfc_main$v, {
1362
+ value: taxCategory.tax_amount
1363
+ }, null, 8, ["value"])
1364
+ ])
1365
+ ]);
1366
+ }), 128)) : createCommentVNode("", true)
1367
+ ]),
1368
+ _: 1
1369
+ }),
1370
+ createVNode(_sfc_main$m, {
1371
+ number: "",
1372
+ class: "align-top"
1373
+ }, {
1374
+ default: withCtx(() => {
1375
+ var _a, _b, _c, _d;
1376
+ return [
1377
+ ((_b = (_a = __props.details) == null ? void 0 : _a.amount) == null ? void 0 : _b.currency) && ((_d = (_c = __props.details) == null ? void 0 : _c.amount) == null ? void 0 : _d.quantity) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
1378
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
1379
+ var _a2;
1380
+ return openBlock(), createElementBlock("div", {
1381
+ key: taxCategoryIndex,
1382
+ class: "inline-block"
1383
+ }, [
1384
+ createElementVNode("div", _hoisted_5$3, [
1385
+ createVNode(_sfc_main$v, {
1386
+ value: __props.details.amount
1387
+ }, null, 8, ["value"]),
1388
+ ((_a2 = __props.details) == null ? void 0 : _a2.pricing_amount.quantity) !== __props.details.amount.quantity ? (openBlock(), createBlock(_sfc_main$x, {
1389
+ key: 0,
1390
+ placement: "top-end"
1391
+ }, {
1392
+ tooltip: withCtx(() => [
1393
+ createVNode(TooltipContent, null, {
1394
+ default: withCtx(() => [
1395
+ createVNode(_sfc_main$y, null, {
1396
+ default: withCtx(() => [
1397
+ createTextVNode(toDisplayString(unref(intl).$t({
1398
+ id: "invoice.line.original_currency",
1399
+ defaultMessage: "Original currency",
1400
+ description: "Original currency"
1401
+ })) + " ", 1),
1402
+ createVNode(_sfc_main$v, {
1403
+ value: __props.details.pricing_amount,
1404
+ class: "font-semibold"
1405
+ }, null, 8, ["value"])
1406
+ ]),
1407
+ _: 1
1408
+ })
1409
+ ]),
1410
+ _: 1
1411
+ })
1412
+ ]),
1413
+ default: withCtx(() => [
1414
+ createVNode(_sfc_main$r, {
1415
+ icon: "info",
1416
+ size: "2xs"
1417
+ })
1418
+ ]),
1419
+ _: 1
1420
+ })) : createCommentVNode("", true)
1421
+ ]),
1422
+ !__props.hideTaxDetails ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
1423
+ __props.amountType === "INCLUDING_TAX" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1424
+ createTextVNode(toDisplayString(unref(intl).$t({
1425
+ id: "invoice.line.excl.tax",
1426
+ defaultMessage: "Excl. tax",
1427
+ description: "Value excludes tax"
1428
+ })) + " ", 1),
1429
+ createVNode(_sfc_main$v, {
1430
+ value: taxCategory.base_amount
1431
+ }, null, 8, ["value"])
1432
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1433
+ createTextVNode(toDisplayString(unref(intl).$t({
1434
+ id: "invoice.line.incl.tax",
1435
+ defaultMessage: "Incl. tax",
1436
+ description: "Value includes tax"
1437
+ })) + " ", 1),
1438
+ createVNode(_sfc_main$v, {
1439
+ value: taxCategory.total_amount
1440
+ }, null, 8, ["value"])
1441
+ ], 64))
1442
+ ])) : createCommentVNode("", true)
1443
+ ]);
1444
+ }), 128)),
1445
+ renderSlot(_ctx.$slots, "one-off-line-context-menu")
1446
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1447
+ createTextVNode("-")
1448
+ ], 64))
1449
+ ];
1450
+ }),
1451
+ _: 3
1452
+ })
1453
+ ], 64);
1454
+ };
1455
+ }
1456
+ });
1457
+ const _hoisted_1$8 = ["tabindex", "onClick"];
1458
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
1459
+ __name: "InvoiceLineGroup",
1460
+ props: {
1461
+ group: {},
1462
+ startDate: {},
1463
+ endDate: {},
1464
+ total: {},
1465
+ amountType: {},
1466
+ invoicePeriodOrder: {},
1467
+ processingOnlyCustomers: {}
1468
+ },
1469
+ setup(__props) {
1470
+ const props = __props;
1471
+ const sortedLines = computed(
1472
+ () => {
1473
+ var _a;
1474
+ return (_a = [...props.group.lines ?? []]) == null ? void 0 : _a.sort((a, b) => a.line_order - b.line_order);
1475
+ }
1476
+ );
1477
+ const intl = useIntl();
1478
+ const { getIsOpen, toggle } = useToggleList();
1479
+ const toggleLine = (groupOrder, invoiceLineOrder) => {
1480
+ toggle(formatIndex(groupOrder, invoiceLineOrder));
1481
+ };
1482
+ const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
1483
+ return (_ctx, _cache) => {
1484
+ return openBlock(), createElementBlock("div", null, [
1485
+ createVNode(InvoiceTable, null, {
1486
+ default: withCtx(() => [
1487
+ createElementVNode("tr", null, [
1488
+ createVNode(_sfc_main$l, {
1489
+ left: "",
1490
+ class: "text-gray-400 w-1/5"
1491
+ }, {
1492
+ default: withCtx(() => [
1493
+ createTextVNode(toDisplayString(unref(intl).$t({
1494
+ id: "invoice.table_header.unit",
1495
+ defaultMessage: "Unit",
1496
+ description: "Table header for the column containing the number of units of invoice groups"
1497
+ })), 1)
1498
+ ]),
1499
+ _: 1
1500
+ }),
1501
+ createVNode(_sfc_main$l, {
1502
+ right: "",
1503
+ class: "text-gray-400 w-1/5"
1504
+ }, {
1505
+ default: withCtx(() => [
1506
+ createTextVNode(toDisplayString(unref(intl).$t({
1507
+ id: "invoice.table_header.quantity",
1508
+ defaultMessage: "Quantity",
1509
+ description: "Table header for quantity column"
1510
+ })), 1)
1511
+ ]),
1512
+ _: 1
1513
+ }),
1514
+ createVNode(_sfc_main$l, {
1515
+ right: "",
1516
+ class: "text-gray-400 w-1/5"
1517
+ }, {
1518
+ default: withCtx(() => [
1519
+ createTextVNode(toDisplayString(unref(intl).$t({
1520
+ id: "invoice.table_header.price",
1521
+ defaultMessage: "Price",
1522
+ description: "Table header for the column containing the number of units of invoice groups"
1523
+ })), 1)
1524
+ ]),
1525
+ _: 1
1526
+ }),
1527
+ createVNode(_sfc_main$l, {
1528
+ right: "",
1529
+ class: "text-gray-400 w-1/5"
1530
+ }, {
1531
+ default: withCtx(() => [
1532
+ createTextVNode(toDisplayString(unref(intl).$t({
1533
+ id: "invoice.table_header.tax_rate",
1534
+ defaultMessage: "Tax rate",
1535
+ description: "Table header for the column containing the tax percentage of invoice groups"
1536
+ })), 1)
1537
+ ]),
1538
+ _: 1
1539
+ }),
1540
+ createVNode(_sfc_main$l, {
1541
+ right: "",
1542
+ class: "text-gray-400 w-1/5"
1543
+ }, {
1544
+ default: withCtx(() => [
1545
+ createTextVNode(toDisplayString(unref(intl).$t({
1546
+ id: "invoice.table_header.sub_total",
1547
+ defaultMessage: "Subtotal",
1548
+ description: "Table header for the column containing the subtotal for invoices"
1549
+ })), 1)
1550
+ ]),
1551
+ _: 1
1552
+ })
1553
+ ]),
1554
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sortedLines.value, (line, i) => {
1555
+ return openBlock(), createElementBlock(Fragment, { key: i }, [
1556
+ createElementVNode("tr", {
1557
+ tabindex: line.sub_lines ? 0 : void 0,
1558
+ class: normalizeClass(["group", { "cursor-pointer": line.sub_lines, "border-t": i !== 0 }]),
1559
+ onClick: ($event) => toggleLine(__props.group.group_order, line["line_order"])
1560
+ }, [
1561
+ (openBlock(), createBlock(_sfc_main$d, {
1562
+ key: i,
1563
+ data: line,
1564
+ "is-first-in-group": i === 0,
1565
+ "period-order": __props.invoicePeriodOrder,
1566
+ "group-order": __props.group.group_order,
1567
+ "is-last": i === sortedLines.value.length - 1,
1568
+ "group-type": __props.group.type,
1569
+ "is-expanded": unref(getIsOpen)(formatIndex(__props.group.group_order, line["line_order"]))
1570
+ }, {
1571
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
1572
+ renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
1573
+ ]),
1574
+ "line-content": withCtx((lineContentProps) => [
1575
+ createVNode(_sfc_main$c, {
1576
+ details: lineContentProps.details,
1577
+ "pricing-type": line.pricing_type,
1578
+ "tax-categories": line.tax_categories,
1579
+ "amount-type": __props.amountType
1580
+ }, createSlots({ _: 2 }, [
1581
+ line.type === "ONE_OFF" ? {
1582
+ name: "one-off-line-context-menu",
1583
+ fn: withCtx((oneOffGroupProps) => [
1584
+ renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps({ ref_for: true }, oneOffGroupProps, {
1585
+ lineOrder: line.line_order
1586
+ }))
1587
+ ]),
1588
+ key: "0"
1589
+ } : void 0
1590
+ ]), 1032, ["details", "pricing-type", "tax-categories", "amount-type"])
1591
+ ]),
1592
+ _: 2
1593
+ }, 1032, ["data", "is-first-in-group", "period-order", "group-order", "is-last", "group-type", "is-expanded"]))
1594
+ ], 10, _hoisted_1$8),
1595
+ createVNode(_sfc_main$k, {
1596
+ ref_for: true,
1597
+ ref: formatIndex(__props.group.group_order, line["line_order"]),
1598
+ "sub-lines": line.sub_lines ?? [],
1599
+ "processing-only-customers": __props.processingOnlyCustomers,
1600
+ "line-order": line["line_order"],
1601
+ "is-open": unref(getIsOpen)(formatIndex(__props.group.group_order, line["line_order"])),
1602
+ "period-order": __props.invoicePeriodOrder,
1603
+ "group-order": __props.group.group_order
1604
+ }, {
1605
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
1606
+ renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
1607
+ ]),
1608
+ "subline-content": withCtx((sublineContentProps) => [
1609
+ createVNode(_sfc_main$c, {
1610
+ details: sublineContentProps.details,
1611
+ "hide-tax-details": sublineContentProps.hideTaxDetails,
1612
+ "pricing-type": line.pricing_type,
1613
+ "tax-categories": line.tax_categories,
1614
+ "amount-type": __props.amountType
1615
+ }, null, 8, ["details", "hide-tax-details", "pricing-type", "tax-categories", "amount-type"])
1616
+ ]),
1617
+ _: 2
1618
+ }, 1032, ["sub-lines", "processing-only-customers", "line-order", "is-open", "period-order", "group-order"])
1619
+ ], 64);
1620
+ }), 128))
1621
+ ]),
1622
+ _: 3
1623
+ })
1624
+ ]);
1625
+ };
1626
+ }
1627
+ });
1628
+ const _hoisted_1$7 = ["tabindex"];
1629
+ const _hoisted_2$3 = {
1630
+ key: 2,
1631
+ class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
1632
+ };
1633
+ const _hoisted_3$2 = { key: 0 };
1634
+ const _hoisted_4$2 = {
1635
+ colspan: "2",
1636
+ class: "p-0"
1637
+ };
1638
+ const _hoisted_5$2 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
1639
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1640
+ __name: "InvoiceGroupRevenue",
1641
+ props: {
1642
+ group: {},
1643
+ expandedItems: {},
1644
+ handleToggleItems: { type: Function },
1645
+ formatIndex: { type: Function },
1646
+ invoicePeriodOrder: {},
1647
+ groupOrder: {},
1648
+ isExpandable: { type: Boolean },
1649
+ amountType: {},
1650
+ processingOnlyCustomers: {}
1651
+ },
1652
+ setup(__props) {
1653
+ return (_ctx, _cache) => {
1654
+ return openBlock(), createElementBlock(Fragment, null, [
1655
+ createElementVNode("tr", {
1656
+ class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
1657
+ tabindex: __props.isExpandable ? 0 : void 0,
1658
+ onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
1659
+ onKeyup: [
1660
+ _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
1661
+ _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
1662
+ ]
1663
+ }, [
1664
+ createVNode(_sfc_main$m, { class: "p-0" }, {
1665
+ default: withCtx(() => {
1666
+ var _a, _b, _c, _d;
1667
+ return [
1668
+ __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
1669
+ key: 0,
1670
+ icon: "keyboard_arrow_down",
1671
+ size: "md",
1672
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
1673
+ "-rotate-90": !__props.expandedItems.includes(
1674
+ __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
1675
+ )
1676
+ }])
1677
+ }, null, 8, ["class"])) : createCommentVNode("", true),
1678
+ ((_a = __props.group.pricing) == null ? void 0 : _a.name) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1679
+ createTextVNode(toDisplayString(__props.group.pricing.name) + " ", 1),
1680
+ ((_b = __props.group.products) == null ? void 0 : _b.length) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1681
+ createTextVNode(" - ")
1682
+ ], 64)) : createCommentVNode("", true)
1683
+ ], 64)) : createCommentVNode("", true),
1684
+ createTextVNode(" " + toDisplayString(unref(getComposedString)(((_c = __props.group.products) == null ? void 0 : _c.map((item) => item.name)) ?? [])) + " ", 1),
1685
+ __props.isExpandable ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString((_d = __props.group.lines) == null ? void 0 : _d.length), 1)) : createCommentVNode("", true)
1686
+ ];
1687
+ }),
1688
+ _: 1
1689
+ }),
1690
+ createVNode(_sfc_main$m, { number: "" }, {
1691
+ default: withCtx(() => [
1692
+ __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
1693
+ key: 0,
1694
+ value: __props.group.amount_including_tax
1695
+ }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
1696
+ key: 1,
1697
+ value: __props.group.amount_excluding_tax
1698
+ }, null, 8, ["value"]))
1699
+ ]),
1700
+ _: 1
1701
+ })
1702
+ ], 42, _hoisted_1$7),
1703
+ __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) ? (openBlock(), createElementBlock("tr", _hoisted_3$2, [
1704
+ createElementVNode("td", _hoisted_4$2, [
1705
+ createElementVNode("div", _hoisted_5$2, [
1706
+ createVNode(_sfc_main$b, {
1707
+ "invoice-period-order": __props.invoicePeriodOrder,
1708
+ "start-date": __props.group.start_at,
1709
+ "end-date": __props.group.end_at,
1710
+ total: __props.group.amount_excluding_tax,
1711
+ group: __props.group,
1712
+ "amount-type": __props.amountType,
1713
+ "processing-only-customers": __props.processingOnlyCustomers
1714
+ }, {
1715
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
1716
+ renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
1717
+ ]),
1718
+ "one-off-line-context-menu": withCtx((oneOffGroupProps) => [
1719
+ renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps(oneOffGroupProps, { groupOrder: __props.groupOrder }))
1720
+ ]),
1721
+ _: 3
1722
+ }, 8, ["invoice-period-order", "start-date", "end-date", "total", "group", "amount-type", "processing-only-customers"])
1723
+ ])
1724
+ ])
1725
+ ])) : createCommentVNode("", true)
1726
+ ], 64);
1727
+ };
1728
+ }
1729
+ });
1730
+ const _hoisted_1$6 = { class: "flex items-center justify-between md:py-2" };
1731
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1732
+ __name: "InvoiceHeader",
1733
+ props: {
1734
+ invoice: {},
1735
+ paymentAttempts: {},
1736
+ downloadService: {},
1737
+ showDownloadButton: { type: Boolean },
1738
+ variant: { default: "internal" }
1739
+ },
1740
+ setup(__props) {
1741
+ const props = __props;
1742
+ const { $t, formatDate } = useIntl();
1743
+ const lastAuthorizedPaymentAttempt = computed(
1744
+ () => props.paymentAttempts.findLast((payment) => payment.result === "AUTHORIZED")
1745
+ );
1746
+ const dueDate = computed(
1747
+ () => $t(
1748
+ {
1749
+ defaultMessage: "Due on {date}",
1750
+ description: "Label for due date, where {date} gets replaced with the due date",
1751
+ id: "invoice.due_on_label"
1752
+ },
1753
+ {
1754
+ date: formatDate({
1755
+ date: props.invoice.due_date,
1756
+ format: "date",
1757
+ offsetType: "offsetted",
1758
+ timezone: props.invoice.customer.timezone
1759
+ })
1760
+ }
1761
+ )
1762
+ );
1763
+ const invoiceDate = computed(
1764
+ () => formatDate({
1765
+ date: props.invoice.invoice_date,
1766
+ format: "date",
1767
+ offsetType: "offsetted",
1768
+ timezone: props.invoice.customer.timezone
1769
+ })
1770
+ );
1771
+ const title = computed(() => {
1772
+ if (props.variant === "external") {
1773
+ return invoiceDate.value;
1774
+ }
1775
+ return props.invoice.invoice_number || "N/A";
1776
+ });
1777
+ const paidOn = computed(() => {
1778
+ if (!props.invoice.paid || !lastAuthorizedPaymentAttempt.value) {
1779
+ return void 0;
1780
+ }
1781
+ return $t(
1782
+ {
1783
+ defaultMessage: "Paid on {date}",
1784
+ description: "Label for payment date, where {date} gets replaced with the date",
1785
+ id: "invoice.paid_on_label"
1786
+ },
1787
+ {
1788
+ date: formatDate({
1789
+ date: lastAuthorizedPaymentAttempt.value.created_at,
1790
+ format: "date",
1791
+ offsetType: "offsetted",
1792
+ timezone: props.invoice.customer.timezone
1793
+ })
1794
+ }
1795
+ );
1796
+ });
1797
+ const subTitle = computed(() => {
1798
+ if (props.variant === "external") {
1799
+ return [props.invoice.invoice_number, paidOn.value || dueDate.value].join(" - ");
1800
+ }
1801
+ return paidOn.value || dueDate.value;
1802
+ });
1803
+ return (_ctx, _cache) => {
1804
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
1805
+ createVNode(_sfc_main$z, { title: title.value }, {
1806
+ suffix: withCtx(() => [
1807
+ __props.invoice.paid ? (openBlock(), createBlock(_sfc_main$w, {
1808
+ key: 0,
1809
+ color: "green",
1810
+ class: "ml-2"
1811
+ }, {
1812
+ default: withCtx(() => [
1813
+ createTextVNode(toDisplayString(unref($t)({
1814
+ defaultMessage: "Paid",
1815
+ description: "The paid chip label text for a paid invoice",
1816
+ id: "invoice.paid_chip"
1817
+ })), 1)
1818
+ ]),
1819
+ _: 1
1820
+ })) : createCommentVNode("", true)
1821
+ ]),
1822
+ subTitle: withCtx(() => [
1823
+ createVNode(_sfc_main$A, {
1824
+ variant: "body-xs",
1825
+ class: "flex gap-1"
1826
+ }, {
1827
+ default: withCtx(() => [
1828
+ createTextVNode(toDisplayString(subTitle.value), 1)
1829
+ ]),
1830
+ _: 1
1831
+ })
1832
+ ]),
1833
+ _: 1
1834
+ }, 8, ["title"]),
1835
+ __props.showDownloadButton ? (openBlock(), createBlock(_sfc_main$p, {
1836
+ key: 0,
1837
+ size: "lg",
1838
+ variant: "outline",
1839
+ "download-service": __props.downloadService,
1840
+ "mobile-icon-only": ""
1841
+ }, {
1842
+ default: withCtx(() => [
1843
+ createTextVNode(toDisplayString(unref($t)({
1844
+ defaultMessage: "Download PDF",
1845
+ description: "Title for button download pdf invoice",
1846
+ id: "invoice.download_pdf_button"
1847
+ })), 1)
1848
+ ]),
1849
+ _: 1
1850
+ }, 8, ["download-service"])) : createCommentVNode("", true)
1851
+ ]);
1852
+ };
1853
+ }
1854
+ });
1855
+ function toValue(r) {
1856
+ return typeof r === "function" ? r() : unref(r);
1857
+ }
1858
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1859
+ function useToggle(initialValue = false, options = {}) {
1860
+ const {
1861
+ truthyValue = true,
1862
+ falsyValue = false
1863
+ } = options;
1864
+ const valueIsRef = isRef(initialValue);
1865
+ const _value = ref(initialValue);
1866
+ function toggle(value) {
1867
+ if (arguments.length) {
1868
+ _value.value = value;
1869
+ return _value.value;
1870
+ } else {
1871
+ const truthy = toValue(truthyValue);
1872
+ _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
1873
+ return _value.value;
1874
+ }
1875
+ }
1876
+ if (valueIsRef)
1877
+ return toggle;
1878
+ else
1879
+ return [_value, toggle];
1880
+ }
1881
+ const _hoisted_1$5 = {
1882
+ key: 0,
1883
+ totals: "",
1884
+ class: "border-t"
1885
+ };
1886
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1887
+ __name: "InvoiceSummaryTotalExcludingTax",
1888
+ props: {
1889
+ baseAmount: {}
1890
+ },
1891
+ setup(__props) {
1892
+ const intl = useIntl();
1893
+ return (_ctx, _cache) => {
1894
+ return __props.baseAmount ? (openBlock(), createElementBlock("tr", _hoisted_1$5, [
1895
+ createVNode(_sfc_main$m, null, {
1896
+ default: withCtx(() => [
1897
+ createTextVNode(toDisplayString(unref(intl).$t({
1898
+ id: "invoice.table_header.total_excluding_taxes",
1899
+ defaultMessage: "Total excluding taxes",
1900
+ description: "Table row header for the total excluding taxes column in the invoice table"
1901
+ })), 1)
1902
+ ]),
1903
+ _: 1
1904
+ }),
1905
+ createVNode(_sfc_main$m, { number: "" }, {
1906
+ default: withCtx(() => [
1907
+ createVNode(_sfc_main$v, { value: __props.baseAmount }, null, 8, ["value"])
1908
+ ]),
1909
+ _: 1
1910
+ })
1911
+ ])) : createCommentVNode("", true);
1912
+ };
1913
+ }
1914
+ });
1915
+ const _hoisted_1$4 = {
1916
+ key: 0,
1917
+ class: "font-bold border-t"
1918
+ };
1919
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1920
+ __name: "InvoiceSummaryTotalIncludingTax",
1921
+ props: {
1922
+ totalAmount: {},
1923
+ isCustomerFacing: { type: Boolean }
1924
+ },
1925
+ setup(__props) {
1926
+ const intl = useIntl();
1927
+ return (_ctx, _cache) => {
1928
+ return __props.totalAmount ? (openBlock(), createElementBlock("tr", _hoisted_1$4, [
1929
+ createVNode(_sfc_main$m, { class: "font-bold" }, {
1930
+ default: withCtx(() => [
1931
+ createTextVNode(toDisplayString(__props.isCustomerFacing ? unref(intl).$t({
1932
+ id: "invoice.table_header.total_including_taxes_customer_facing",
1933
+ defaultMessage: "Total due today",
1934
+ description: "Table row header for the total including taxes column in the invoice table for a customer facing component"
1935
+ }) : unref(intl).$t({
1936
+ id: "invoice.table_header.total_including_taxes",
1937
+ defaultMessage: "Total including taxes",
1938
+ description: "Table row header for the total including taxes column in the invoice table"
1939
+ })), 1)
1940
+ ]),
1941
+ _: 1
1942
+ }),
1943
+ createVNode(_sfc_main$m, { number: "" }, {
1944
+ default: withCtx(() => [
1945
+ createVNode(_sfc_main$v, { value: __props.totalAmount }, null, 8, ["value"])
1946
+ ]),
1947
+ _: 1
1948
+ })
1949
+ ])) : createCommentVNode("", true);
1950
+ };
1951
+ }
1952
+ });
1953
+ const _hoisted_1$3 = {
1954
+ key: 0,
1955
+ colspan: "4",
1956
+ class: "p-0"
1957
+ };
1958
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1959
+ __name: "InvoiceTaxes",
1960
+ props: {
1961
+ taxCategories: {}
1962
+ },
1963
+ setup(__props) {
1964
+ const intl = useIntl();
1965
+ return (_ctx, _cache) => {
1966
+ return openBlock(), createBlock(InvoiceTable, { class: "table-fixed" }, {
1967
+ default: withCtx(() => [
1968
+ createElementVNode("tr", null, [
1969
+ createVNode(_sfc_main$l, { left: "" }, {
1970
+ default: withCtx(() => [
1971
+ createTextVNode(toDisplayString(unref(intl).$t({
1972
+ id: "invoice.table_header.tax type",
1973
+ defaultMessage: "Tax type",
1974
+ description: "Table header for the column containing the tax type"
1975
+ })), 1)
1976
+ ]),
1977
+ _: 1
1978
+ }),
1979
+ createVNode(_sfc_main$l, { right: "" }, {
1980
+ default: withCtx(() => [
1981
+ createTextVNode(toDisplayString(unref(intl).$t({
1982
+ id: "invoice.table_header.base amount",
1983
+ defaultMessage: "Base amount",
1984
+ description: "Table header for the column containing the base amount"
1985
+ })), 1)
1986
+ ]),
1987
+ _: 1
1988
+ }),
1989
+ createVNode(_sfc_main$l, { right: "" }, {
1990
+ default: withCtx(() => [
1991
+ createTextVNode(toDisplayString(unref(intl).$t({
1992
+ id: "invoice.table_header.tax_percentage",
1993
+ defaultMessage: "Percentage",
1994
+ description: "Table header for the column containing the tax percentage"
1995
+ })), 1)
1996
+ ]),
1997
+ _: 1
1998
+ }),
1999
+ createVNode(_sfc_main$l, { right: "" }, {
2000
+ default: withCtx(() => [
2001
+ createTextVNode(toDisplayString(unref(intl).$t({
2002
+ id: "invoice.table_header.tax amount",
2003
+ defaultMessage: "Tax amount",
2004
+ description: "Table header for the column containing the tax amount"
2005
+ })), 1)
2006
+ ]),
2007
+ _: 1
2008
+ })
2009
+ ]),
2010
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
2011
+ return openBlock(), createElementBlock("tr", { key: taxCategoryIndex }, [
2012
+ taxCategory.rates ? (openBlock(), createElementBlock("td", _hoisted_1$3, [
2013
+ createVNode(InvoiceTable, { class: "table-fixed" }, {
2014
+ default: withCtx(() => [
2015
+ (openBlock(true), createElementBlock(Fragment, null, renderList(taxCategory.rates, (rate, rateIndex) => {
2016
+ return openBlock(), createElementBlock("tr", { key: rateIndex }, [
2017
+ createVNode(_sfc_main$m, null, {
2018
+ default: withCtx(() => [
2019
+ createTextVNode(toDisplayString(rate.name) + " (" + toDisplayString(taxCategory.category) + ") ", 1)
2020
+ ]),
2021
+ _: 2
2022
+ }, 1024),
2023
+ createVNode(_sfc_main$m, { number: "" }, {
2024
+ default: withCtx(() => [
2025
+ createVNode(_sfc_main$v, {
2026
+ value: taxCategory.base_amount
2027
+ }, null, 8, ["value"])
2028
+ ]),
2029
+ _: 2
2030
+ }, 1024),
2031
+ createVNode(_sfc_main$m, { number: "" }, {
2032
+ default: withCtx(() => [
2033
+ createTextVNode(toDisplayString(rate.percentage) + "%", 1)
2034
+ ]),
2035
+ _: 2
2036
+ }, 1024),
2037
+ createVNode(_sfc_main$m, { number: "" }, {
2038
+ default: withCtx(() => [
2039
+ createVNode(_sfc_main$v, {
2040
+ value: rate.tax_amount
2041
+ }, null, 8, ["value"])
2042
+ ]),
2043
+ _: 2
2044
+ }, 1024)
2045
+ ]);
2046
+ }), 128))
2047
+ ]),
2048
+ _: 2
2049
+ }, 1024)
2050
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2051
+ createVNode(_sfc_main$m, null, {
2052
+ default: withCtx(() => [
2053
+ createTextVNode(toDisplayString(taxCategory.name) + " (" + toDisplayString(taxCategory.category) + ") ", 1)
2054
+ ]),
2055
+ _: 2
2056
+ }, 1024),
2057
+ createVNode(_sfc_main$m, { number: "" }, {
2058
+ default: withCtx(() => [
2059
+ createVNode(_sfc_main$v, {
2060
+ value: taxCategory.base_amount
2061
+ }, null, 8, ["value"])
2062
+ ]),
2063
+ _: 2
2064
+ }, 1024),
2065
+ createVNode(_sfc_main$m, { number: "" }, {
2066
+ default: withCtx(() => [
2067
+ createTextVNode(toDisplayString(taxCategory.percentage) + "%", 1)
2068
+ ]),
2069
+ _: 2
2070
+ }, 1024),
2071
+ createVNode(_sfc_main$m, { number: "" }, {
2072
+ default: withCtx(() => [
2073
+ createVNode(_sfc_main$v, {
2074
+ value: taxCategory.tax_amount
2075
+ }, null, 8, ["value"])
2076
+ ]),
2077
+ _: 2
2078
+ }, 1024)
2079
+ ], 64))
2080
+ ]);
2081
+ }), 128))
2082
+ ]),
2083
+ _: 1
2084
+ });
2085
+ };
2086
+ }
2087
+ });
2088
+ const _hoisted_1$2 = { class: "flex justify-between items-start" };
2089
+ const _hoisted_2$2 = {
2090
+ key: 0,
2091
+ class: "max-h-9"
2092
+ };
2093
+ const _hoisted_3$1 = { class: "flex flex-col gap-2" };
2094
+ const _hoisted_4$1 = { key: 0 };
2095
+ const _hoisted_5$1 = ["tabindex"];
2096
+ const _hoisted_6$1 = {
2097
+ key: 1,
2098
+ class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
2099
+ };
2100
+ const _hoisted_7$1 = { key: 3 };
2101
+ const _hoisted_8 = {
2102
+ colspan: "2",
2103
+ class: "p-0"
2104
+ };
2105
+ const _hoisted_9 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
2106
+ const _hoisted_10 = ["tabindex", "onClick", "onKeyup"];
2107
+ const _hoisted_11 = {
2108
+ key: 1,
2109
+ class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
2110
+ };
2111
+ const _hoisted_12 = { key: 0 };
2112
+ const _hoisted_13 = {
2113
+ colspan: "2",
2114
+ class: "p-0"
2115
+ };
2116
+ const _hoisted_14 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
2117
+ const _hoisted_15 = {
2118
+ key: 0,
2119
+ class: "font-bold border-t"
2120
+ };
2121
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2122
+ __name: "InvoiceSummary",
2123
+ props: {
2124
+ invoice: {},
2125
+ isExpandable: { type: Boolean, default: false },
2126
+ isInvoiceLineCreatable: { type: Boolean, default: false },
2127
+ showRenderedServicesHeader: { type: Boolean, default: true },
2128
+ isCustomerFacing: { type: Boolean }
2129
+ },
2130
+ setup(__props) {
2131
+ const intl = useIntl();
2132
+ const props = __props;
2133
+ const [expandedItems, toggleItems] = useSimpleToggleList();
2134
+ const [expandedDeductions, toggleDeductions] = useSimpleToggleList();
2135
+ const [expandedTaxes, toggleTaxes] = useToggle();
2136
+ const handleToggleItems = (...params) => {
2137
+ if (!props.isExpandable) return;
2138
+ toggleItems(...params);
2139
+ };
2140
+ const handleToggleDeductions = (index) => {
2141
+ if (!props.isExpandable) return;
2142
+ toggleDeductions(index);
2143
+ };
2144
+ const handleToggleTaxes = () => {
2145
+ if (!props.invoice.tax_categories || !props.isExpandable) return;
2146
+ toggleTaxes();
2147
+ };
2148
+ const formatIndex = (rootIndex, itemIndex) => +`${rootIndex}${itemIndex}`;
2149
+ const getTitle = (invoicePeriod) => {
2150
+ return intl.$t(
2151
+ {
2152
+ id: "invoice.service_period_heading",
2153
+ defaultMessage: "Service period - {start_at} - {end_at}",
2154
+ description: "Heading for rendered services where {start_at} is replaced for the start date and {end_at} for the end date in invoice summary"
2155
+ },
2156
+ {
2157
+ start_at: intl.formatDate({
2158
+ date: invoicePeriod.start_at,
2159
+ format: "date",
2160
+ timezone: formatTimezone(props.invoice.customer.timezone),
2161
+ offsetType: "offsetted"
2162
+ }),
2163
+ end_at: intl.formatDate({
2164
+ date: invoicePeriod.end_at,
2165
+ format: "date",
2166
+ timezone: formatTimezone(props.invoice.customer.timezone),
2167
+ offsetType: "offsetted"
2168
+ })
2169
+ }
2170
+ );
2171
+ };
2172
+ const getTableHeading = (invoiceGroupType) => {
2173
+ switch (invoiceGroupType) {
2174
+ case "PRICING":
2175
+ case "REVENUE": {
2176
+ return intl.$t({
2177
+ id: "invoice.table_heading.products",
2178
+ defaultMessage: "Products",
2179
+ description: "Table heading for the column containing the products of the invoice"
2180
+ });
2181
+ }
2182
+ case "COMMITMENT":
2183
+ return intl.$t({
2184
+ id: "invoice.table_heading.commitments",
2185
+ defaultMessage: "Commitments",
2186
+ description: "Table heading for the column containing the commitments of the invoice"
2187
+ });
2188
+ case "DISCOUNT":
2189
+ return intl.$t({
2190
+ id: "invoice.table_heading.discounts",
2191
+ defaultMessage: "Discounts",
2192
+ description: "Table heading for the column containing the discounts of the invoice"
2193
+ });
2194
+ case "MARKUP":
2195
+ return intl.$t({
2196
+ id: "invoice.table_heading.markups",
2197
+ defaultMessage: "Markups",
2198
+ description: "Table heading for the column containing the markups of the invoice"
2199
+ });
2200
+ case "ONE_OFF":
2201
+ return intl.$t({
2202
+ id: "invoice.table_heading.one_offs",
2203
+ defaultMessage: "One-off's",
2204
+ description: "Table heading for the column containing the one-offs of the invoice"
2205
+ });
2206
+ }
2207
+ };
2208
+ const getInvoiceGroupsByType = (invoicePeriod) => {
2209
+ return invoicePeriod.groups.reduce(
2210
+ (acc, invoiceGroup) => {
2211
+ if (!(invoiceGroup.type in acc)) {
2212
+ return { ...acc, [invoiceGroup.type]: [invoiceGroup] };
2213
+ }
2214
+ return {
2215
+ ...acc,
2216
+ [invoiceGroup.type]: [...acc[invoiceGroup.type], invoiceGroup]
2217
+ };
2218
+ },
2219
+ {}
2220
+ );
2221
+ };
2222
+ return (_ctx, _cache) => {
2223
+ return openBlock(), createElementBlock("div", null, [
2224
+ createElementVNode("div", _hoisted_1$2, [
2225
+ _ctx.$slots.logo ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
2226
+ renderSlot(_ctx.$slots, "logo")
2227
+ ])) : (openBlock(), createBlock(_sfc_main$z, {
2228
+ key: 1,
2229
+ title: unref(intl).$t({
2230
+ id: "invoice.title",
2231
+ defaultMessage: "Details",
2232
+ description: "Title for the invoice summary"
2233
+ }),
2234
+ variant: "neutral",
2235
+ icon: "draft"
2236
+ }, null, 8, ["title"])),
2237
+ _ctx.$slots.intro ? renderSlot(_ctx.$slots, "intro", { key: 2 }) : createCommentVNode("", true),
2238
+ createElementVNode("div", _hoisted_3$1, [
2239
+ ["ONE_OFF", "STANDARD", "ONE_OFF_CREDIT"].includes(__props.invoice.type) && ["DRAFT", "OPEN"].includes(__props.invoice.status) && __props.isInvoiceLineCreatable ? (openBlock(), createBlock(_sfc_main$q, {
2240
+ key: 0,
2241
+ to: { name: "invoice-add-line", params: { id: __props.invoice.id } },
2242
+ class: "text-sm font-semibold"
2243
+ }, {
2244
+ default: withCtx(() => [
2245
+ createVNode(_sfc_main$r, {
2246
+ icon: "add",
2247
+ size: "md",
2248
+ class: "mr-1"
2249
+ }),
2250
+ createElementVNode("span", null, toDisplayString(unref(intl).$t({
2251
+ id: "invoice.add_invoice_line",
2252
+ defaultMessage: "Add invoice line",
2253
+ description: "Label for adding lines to an invoice"
2254
+ })), 1)
2255
+ ]),
2256
+ _: 1
2257
+ }, 8, ["to"])) : createCommentVNode("", true),
2258
+ renderSlot(_ctx.$slots, "child-customers-selector")
2259
+ ])
2260
+ ]),
2261
+ _ctx.$slots.total ? renderSlot(_ctx.$slots, "total", { key: 0 }) : createCommentVNode("", true),
2262
+ renderSlot(_ctx.$slots, "notes"),
2263
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.invoice.periods, (invoicePeriod, invoicePeriodIndex) => {
2264
+ return openBlock(), createElementBlock(Fragment, { key: invoicePeriodIndex }, [
2265
+ __props.showRenderedServicesHeader ? (openBlock(), createBlock(_sfc_main$B, {
2266
+ key: 0,
2267
+ class: "mt-6"
2268
+ }, {
2269
+ default: withCtx(() => [
2270
+ createVNode(_sfc_main$A, {
2271
+ tag: "h2",
2272
+ variant: "caps-heading"
2273
+ }, {
2274
+ default: withCtx(() => [
2275
+ createTextVNode(toDisplayString(getTitle(invoicePeriod)), 1)
2276
+ ]),
2277
+ _: 2
2278
+ }, 1024)
2279
+ ]),
2280
+ _: 2
2281
+ }, 1024)) : createCommentVNode("", true),
2282
+ invoicePeriod.groups ? (openBlock(), createBlock(InvoiceTable, {
2283
+ key: 1,
2284
+ class: normalizeClass({ "mt-3": __props.showRenderedServicesHeader })
2285
+ }, {
2286
+ default: withCtx(() => [
2287
+ (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(
2288
+ getInvoiceGroupsByType(invoicePeriod)
2289
+ ), ([groupType, groups], index) => {
2290
+ return openBlock(), createElementBlock(Fragment, { key: groupType }, [
2291
+ index > 0 ? (openBlock(), createElementBlock("tr", _hoisted_4$1, [..._cache[0] || (_cache[0] = [
2292
+ createElementVNode("td", null, [
2293
+ createElementVNode("div", { class: "h-4" })
2294
+ ], -1)
2295
+ ])])) : createCommentVNode("", true),
2296
+ createElementVNode("tr", null, [
2297
+ createVNode(_sfc_main$l, {
2298
+ left: "",
2299
+ class: "text-gray-600"
2300
+ }, {
2301
+ default: withCtx(() => [
2302
+ createTextVNode(toDisplayString(getTableHeading(groupType)), 1)
2303
+ ]),
2304
+ _: 2
2305
+ }, 1024),
2306
+ createVNode(_sfc_main$l, {
2307
+ right: "",
2308
+ class: "text-gray-600"
2309
+ }, {
2310
+ default: withCtx(() => [
2311
+ createTextVNode(toDisplayString(unref(intl).$t({
2312
+ id: "invoice.amount_table_heading",
2313
+ defaultMessage: "Amount",
2314
+ description: "Table heading for the amount column in the invoice table"
2315
+ })), 1)
2316
+ ]),
2317
+ _: 1
2318
+ })
2319
+ ]),
2320
+ (openBlock(true), createElementBlock(Fragment, null, renderList(groups, (group, groupIndex) => {
2321
+ return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [
2322
+ groupType === "REVENUE" || groupType === "PRICING" || groupType === "ONE_OFF" ? (openBlock(), createBlock(_sfc_main$a, {
2323
+ key: 0,
2324
+ group,
2325
+ "expanded-items": unref(expandedItems),
2326
+ "handle-toggle-items": handleToggleItems,
2327
+ "is-expandable": __props.isExpandable,
2328
+ "format-index": formatIndex,
2329
+ "invoice-period-order": invoicePeriod.period_order,
2330
+ "group-order": group.group_order,
2331
+ "amount-type": __props.invoice.pricing_amount_type,
2332
+ "processing-only-customers": __props.invoice.processing_only_customers
2333
+ }, {
2334
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
2335
+ renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2336
+ ]),
2337
+ "one-off-line-context-menu": withCtx((oneOffGroupProps) => [
2338
+ renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps({ ref_for: true }, oneOffGroupProps, {
2339
+ periodOrder: invoicePeriod.period_order
2340
+ }))
2341
+ ]),
2342
+ _: 2
2343
+ }, 1032, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type", "processing-only-customers"])) : groupType === "DISCOUNT" || groupType === "MARKUP" ? (openBlock(), createBlock(_sfc_main$g, {
2344
+ key: 1,
2345
+ group,
2346
+ "expanded-items": unref(expandedItems),
2347
+ "handle-toggle-items": handleToggleItems,
2348
+ "is-expandable": __props.isExpandable,
2349
+ "format-index": formatIndex,
2350
+ "invoice-period-order": invoicePeriod.period_order,
2351
+ "group-order": group.group_order,
2352
+ "amount-type": __props.invoice.pricing_amount_type,
2353
+ heading: groupType === "DISCOUNT" ? unref(intl).$t({
2354
+ id: "invoice.discounts_table_heading",
2355
+ defaultMessage: "Discounts",
2356
+ description: "Heading for discounts in the invoice table"
2357
+ }) : unref(intl).$t({
2358
+ id: "invoice.markups_table_heading",
2359
+ defaultMessage: "Markups",
2360
+ description: "Heading for markups in the invoice table"
2361
+ })
2362
+ }, {
2363
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
2364
+ renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2365
+ ]),
2366
+ _: 3
2367
+ }, 8, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type", "heading"])) : groupType === "COMMITMENT" ? (openBlock(), createBlock(_sfc_main$h, {
2368
+ key: 2,
2369
+ group,
2370
+ "expanded-items": unref(expandedItems),
2371
+ "handle-toggle-items": handleToggleItems,
2372
+ "is-expandable": __props.isExpandable,
2373
+ "format-index": formatIndex,
2374
+ "invoice-period-order": invoicePeriod.period_order,
2375
+ "group-order": group.group_order,
2376
+ "amount-type": __props.invoice.pricing_amount_type
2377
+ }, {
2378
+ "invoice-line-prefix": withCtx((linePrefixProps) => [
2379
+ renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2380
+ ]),
2381
+ _: 3
2382
+ }, 8, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type"])) : createCommentVNode("", true)
2383
+ ], 64);
2384
+ }), 128))
2385
+ ], 64);
2386
+ }), 128))
2387
+ ]),
2388
+ _: 2
2389
+ }, 1032, ["class"])) : createCommentVNode("", true)
2390
+ ], 64);
2391
+ }), 128)),
2392
+ __props.invoice.tax_summary ? (openBlock(), createBlock(InvoiceTable, {
2393
+ key: 1,
2394
+ class: "mt-6"
2395
+ }, {
2396
+ default: withCtx(() => [
2397
+ createElementVNode("tr", null, [
2398
+ createVNode(_sfc_main$l, {
2399
+ left: "",
2400
+ class: "text-gray-600"
2401
+ }, {
2402
+ default: withCtx(() => [
2403
+ createTextVNode(toDisplayString(unref(intl).$t({
2404
+ id: "invoice.totals_table_heading",
2405
+ defaultMessage: "Totals",
2406
+ description: "Table heading for the totals column in the invoice table"
2407
+ })), 1)
2408
+ ]),
2409
+ _: 1
2410
+ }),
2411
+ createVNode(_sfc_main$l, {
2412
+ right: "",
2413
+ class: "text-gray-600"
2414
+ }, {
2415
+ default: withCtx(() => [
2416
+ createTextVNode(toDisplayString(unref(intl).$t({
2417
+ id: "invoice.amount_table_heading",
2418
+ defaultMessage: "Amount",
2419
+ description: "Table heading for the amount column in the invoice table"
2420
+ })), 1)
2421
+ ]),
2422
+ _: 1
2423
+ })
2424
+ ]),
2425
+ __props.invoice.pricing_amount_type === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$7, {
2426
+ key: 0,
2427
+ "total-amount": __props.invoice.tax_summary.total_amount,
2428
+ "is-customer-facing": __props.isCustomerFacing
2429
+ }, null, 8, ["total-amount", "is-customer-facing"])) : (openBlock(), createBlock(_sfc_main$8, {
2430
+ key: 1,
2431
+ "base-amount": __props.invoice.tax_summary.base_amount
2432
+ }, null, 8, ["base-amount"])),
2433
+ __props.invoice.tax_summary.tax_amount ? (openBlock(), createElementBlock("tr", {
2434
+ key: 2,
2435
+ class: normalizeClass([{ "cursor-pointer": __props.invoice.tax_categories && __props.isExpandable }, "border-t"]),
2436
+ tabindex: __props.isExpandable ? 0 : void 0,
2437
+ onClick: handleToggleTaxes,
2438
+ onKeyup: [
2439
+ withKeys(handleToggleTaxes, ["enter"]),
2440
+ withKeys(handleToggleTaxes, ["space"])
2441
+ ]
2442
+ }, [
2443
+ createVNode(_sfc_main$m, null, {
2444
+ default: withCtx(() => [
2445
+ __props.isExpandable && __props.invoice.tax_categories && __props.invoice.tax_categories.length ? (openBlock(), createBlock(_sfc_main$r, {
2446
+ key: 0,
2447
+ icon: "keyboard_arrow_down",
2448
+ size: "md",
2449
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", { "-rotate-90": !unref(expandedTaxes) }])
2450
+ }, null, 8, ["class"])) : createCommentVNode("", true),
2451
+ createTextVNode(" " + toDisplayString(unref(intl).$t({
2452
+ id: "invoice.taxes_table_heading",
2453
+ defaultMessage: "Taxes",
2454
+ description: "Table heading for the taxes column in the invoice table"
2455
+ })) + " ", 1),
2456
+ __props.isExpandable && __props.invoice.tax_categories ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(__props.invoice.tax_categories.length), 1)) : createCommentVNode("", true)
2457
+ ]),
2458
+ _: 1
2459
+ }),
2460
+ createVNode(_sfc_main$m, { number: "" }, {
2461
+ default: withCtx(() => [
2462
+ createVNode(_sfc_main$v, {
2463
+ value: __props.invoice.tax_summary.tax_amount
2464
+ }, null, 8, ["value"])
2465
+ ]),
2466
+ _: 1
2467
+ })
2468
+ ], 42, _hoisted_5$1)) : createCommentVNode("", true),
2469
+ unref(expandedTaxes) && __props.invoice.tax_categories ? (openBlock(), createElementBlock("tr", _hoisted_7$1, [
2470
+ createElementVNode("td", _hoisted_8, [
2471
+ createElementVNode("div", _hoisted_9, [
2472
+ createVNode(_sfc_main$6, {
2473
+ "tax-categories": __props.invoice.tax_categories
2474
+ }, null, 8, ["tax-categories"])
2475
+ ])
2476
+ ])
2477
+ ])) : createCommentVNode("", true),
2478
+ __props.invoice.pricing_amount_type === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$8, {
2479
+ key: 4,
2480
+ "base-amount": __props.invoice.tax_summary.base_amount
2481
+ }, null, 8, ["base-amount"])) : (openBlock(), createBlock(_sfc_main$7, {
2482
+ key: 5,
2483
+ "total-amount": __props.invoice.tax_summary.total_amount
2484
+ }, null, 8, ["total-amount"]))
2485
+ ]),
2486
+ _: 1
2487
+ })) : createCommentVNode("", true),
2488
+ !unref(isEmpty)(__props.invoice.closed_periods) ? (openBlock(), createBlock(InvoiceTable, {
2489
+ key: 2,
2490
+ class: "mt-6"
2491
+ }, {
2492
+ default: withCtx(() => [
2493
+ createElementVNode("tr", null, [
2494
+ createVNode(_sfc_main$l, {
2495
+ left: "",
2496
+ class: "text-gray-600"
2497
+ }, {
2498
+ default: withCtx(() => [
2499
+ createTextVNode(toDisplayString(unref(intl).$t({
2500
+ id: "invoice.already_deducted_table_heading",
2501
+ defaultMessage: "Already deducted",
2502
+ description: "Table heading for the already deducted rows in the invoice table"
2503
+ })), 1)
2504
+ ]),
2505
+ _: 1
2506
+ })
2507
+ ]),
2508
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.invoice.closed_periods, (rootGroup, rootGroupIndex) => {
2509
+ return openBlock(), createElementBlock(Fragment, { key: rootGroupIndex }, [
2510
+ (openBlock(true), createElementBlock(Fragment, null, renderList(rootGroup.groups, (group, groupIndex) => {
2511
+ return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [
2512
+ createElementVNode("tr", {
2513
+ class: normalizeClass(["border-t", { "pt-6": rootGroupIndex === 0, "cursor-pointer": __props.isExpandable }]),
2514
+ tabindex: __props.isExpandable ? 0 : void 0,
2515
+ onClick: ($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)),
2516
+ onKeyup: [
2517
+ withKeys(($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)), ["enter"]),
2518
+ withKeys(($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)), ["space"])
2519
+ ]
2520
+ }, [
2521
+ createVNode(_sfc_main$m, { class: "p-0" }, {
2522
+ default: withCtx(() => {
2523
+ var _a, _b;
2524
+ return [
2525
+ __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
2526
+ key: 0,
2527
+ icon: "keyboard_arrow_down",
2528
+ size: "md",
2529
+ class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
2530
+ "-rotate-90": !unref(expandedDeductions).includes(
2531
+ formatIndex(rootGroupIndex, groupIndex)
2532
+ )
2533
+ }])
2534
+ }, null, 8, ["class"])) : createCommentVNode("", true),
2535
+ createTextVNode(" " + toDisplayString(unref(getComposedString)(((_a = group.products) == null ? void 0 : _a.map((item) => item.name)) ?? [])) + " ", 1),
2536
+ __props.isExpandable ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString((_b = group.lines) == null ? void 0 : _b.length), 1)) : createCommentVNode("", true)
2537
+ ];
2538
+ }),
2539
+ _: 2
2540
+ }, 1024),
2541
+ createVNode(_sfc_main$m, { number: "" }, {
2542
+ default: withCtx(() => [
2543
+ createVNode(_sfc_main$v, {
2544
+ value: group.amount_excluding_tax
2545
+ }, null, 8, ["value"])
2546
+ ]),
2547
+ _: 2
2548
+ }, 1024)
2549
+ ], 42, _hoisted_10),
2550
+ unref(expandedDeductions).includes(formatIndex(rootGroupIndex, groupIndex)) ? (openBlock(), createElementBlock("tr", _hoisted_12, [
2551
+ createElementVNode("td", _hoisted_13, [
2552
+ createElementVNode("div", _hoisted_14, [
2553
+ createVNode(_sfc_main$b, {
2554
+ "start-date": group.start_at,
2555
+ "end-date": group.end_at,
2556
+ total: group.amount_excluding_tax,
2557
+ group,
2558
+ "amount-type": __props.invoice.pricing_amount_type
2559
+ }, null, 8, ["start-date", "end-date", "total", "group", "amount-type"])
2560
+ ])
2561
+ ])
2562
+ ])) : createCommentVNode("", true)
2563
+ ], 64);
2564
+ }), 128))
2565
+ ], 64);
2566
+ }), 128)),
2567
+ __props.invoice.open_invoice_amount && !__props.invoice.paid ? (openBlock(), createElementBlock("tr", _hoisted_15, [
2568
+ createVNode(_sfc_main$m, { class: "font-bold" }, {
2569
+ default: withCtx(() => [
2570
+ createTextVNode(toDisplayString(unref(intl).$t({
2571
+ id: "invoice.amount_due_table_heading",
2572
+ defaultMessage: "Amount due",
2573
+ description: "Table heading for the amount due row in the invoice table"
2574
+ })), 1)
2575
+ ]),
2576
+ _: 1
2577
+ }),
2578
+ createVNode(_sfc_main$m, { number: "" }, {
2579
+ default: withCtx(() => [
2580
+ createVNode(_sfc_main$v, {
2581
+ value: __props.invoice.open_invoice_amount
2582
+ }, null, 8, ["value"])
2583
+ ]),
2584
+ _: 1
2585
+ })
2586
+ ])) : createCommentVNode("", true)
2587
+ ]),
2588
+ _: 1
2589
+ })) : createCommentVNode("", true)
2590
+ ]);
2591
+ };
2592
+ }
2593
+ });
10
2594
  function useInvoice({ invoiceId }) {
11
2595
  const { getInvoice, getInvoicePdf: downloadInvoicePdf } = createInvoicesService();
12
2596
  const service = () => getInvoice(invoiceId);
@@ -205,9 +2789,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
205
2789
  return openBlock(), createElementBlock("section", {
206
2790
  key: period.id
207
2791
  }, [
208
- createVNode(unref(_sfc_main$2q), { class: "mt-4" }, {
2792
+ createVNode(unref(_sfc_main$B), { class: "mt-4" }, {
209
2793
  default: withCtx(() => [
210
- createVNode(unref(_sfc_main$2$1), {
2794
+ createVNode(unref(_sfc_main$A), {
211
2795
  tag: "h3",
212
2796
  variant: "caps-heading"
213
2797
  }, {
@@ -222,7 +2806,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
222
2806
  createVNode(unref(InvoiceTable), { class: "mt-3" }, {
223
2807
  default: withCtx(() => [
224
2808
  createElementVNode("tr", null, [
225
- createVNode(unref(_sfc_main$t), {
2809
+ createVNode(unref(_sfc_main$l), {
226
2810
  left: "",
227
2811
  class: "text-gray-600"
228
2812
  }, {
@@ -249,9 +2833,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
249
2833
  withKeys(($event) => unref(toggle)(row.id), ["space"])
250
2834
  ]
251
2835
  }, [
252
- createVNode(unref(_sfc_main$u), { class: "p-0" }, {
2836
+ createVNode(unref(_sfc_main$m), { class: "p-0" }, {
253
2837
  default: withCtx(() => [
254
- createVNode(unref(_sfc_main$4$1), {
2838
+ createVNode(unref(_sfc_main$r), {
255
2839
  icon: "keyboard_arrow_down",
256
2840
  size: "md",
257
2841
  class: normalizeClass(["absolute -translate-x-7 text-slate-400", { "-rotate-90": !unref(getIsOpen)(row.id) }])
@@ -268,7 +2852,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
268
2852
  createVNode(unref(InvoiceTable), null, {
269
2853
  default: withCtx(() => [
270
2854
  createElementVNode("tr", null, [
271
- createVNode(unref(_sfc_main$t), {
2855
+ createVNode(unref(_sfc_main$l), {
272
2856
  left: "",
273
2857
  class: "w-2/5"
274
2858
  }, {
@@ -281,7 +2865,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
281
2865
  ]),
282
2866
  _: 1
283
2867
  }),
284
- createVNode(unref(_sfc_main$t), {
2868
+ createVNode(unref(_sfc_main$l), {
285
2869
  right: "",
286
2870
  class: "w-1/5"
287
2871
  }, {
@@ -294,7 +2878,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
294
2878
  ]),
295
2879
  _: 1
296
2880
  }),
297
- createVNode(unref(_sfc_main$t), {
2881
+ createVNode(unref(_sfc_main$l), {
298
2882
  right: "",
299
2883
  class: "w-1/5"
300
2884
  }, {
@@ -307,7 +2891,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
307
2891
  ]),
308
2892
  _: 1
309
2893
  }),
310
- createVNode(unref(_sfc_main$t), {
2894
+ createVNode(unref(_sfc_main$l), {
311
2895
  right: "",
312
2896
  class: "w-1/5"
313
2897
  }, {
@@ -326,25 +2910,25 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
326
2910
  key: breakdownRow.id,
327
2911
  class: "border-t"
328
2912
  }, [
329
- createVNode(unref(_sfc_main$u), null, {
2913
+ createVNode(unref(_sfc_main$m), null, {
330
2914
  default: withCtx(() => [
331
2915
  createTextVNode(toDisplayString(breakdownRow.label), 1)
332
2916
  ]),
333
2917
  _: 2
334
2918
  }, 1024),
335
- createVNode(unref(_sfc_main$u), { number: "" }, {
2919
+ createVNode(unref(_sfc_main$m), { number: "" }, {
336
2920
  default: withCtx(() => [
337
2921
  createTextVNode(toDisplayString(breakdownRow.available), 1)
338
2922
  ]),
339
2923
  _: 2
340
2924
  }, 1024),
341
- createVNode(unref(_sfc_main$u), { number: "" }, {
2925
+ createVNode(unref(_sfc_main$m), { number: "" }, {
342
2926
  default: withCtx(() => [
343
2927
  createTextVNode(toDisplayString(breakdownRow.used), 1)
344
2928
  ]),
345
2929
  _: 2
346
2930
  }, 1024),
347
- createVNode(unref(_sfc_main$u), { number: "" }, {
2931
+ createVNode(unref(_sfc_main$m), { number: "" }, {
348
2932
  default: withCtx(() => [
349
2933
  createTextVNode(toDisplayString(breakdownRow.left), 1)
350
2934
  ]),
@@ -380,7 +2964,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
380
2964
  const { width } = useWindowSize();
381
2965
  const isSmallScreen = computed(() => width.value <= 768);
382
2966
  return (_ctx, _cache) => {
383
- return openBlock(), createBlock(unref(_sfc_main$1g), {
2967
+ return openBlock(), createBlock(unref(_sfc_main$C), {
384
2968
  title: unref($t)({
385
2969
  defaultMessage: "Invoice",
386
2970
  description: "Title for the invoice block on the invoice details page",
@@ -392,7 +2976,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
392
2976
  createElementVNode("div", {
393
2977
  class: normalizeClass({ "p-6 pt-2": !isSmallScreen.value })
394
2978
  }, [
395
- isSmallScreen.value ? (openBlock(), createBlock(unref(_sfc_main$1J), {
2979
+ isSmallScreen.value ? (openBlock(), createBlock(unref(_sfc_main$o), {
396
2980
  key: 0,
397
2981
  variant: "default",
398
2982
  "has-icon": "",
@@ -407,7 +2991,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
407
2991
  ]),
408
2992
  _: 1
409
2993
  })) : createCommentVNode("", true),
410
- createVNode(unref(_sfc_main$e), {
2994
+ createVNode(unref(_sfc_main$5), {
411
2995
  invoice: __props.invoice,
412
2996
  "is-expandable": !isSmallScreen.value
413
2997
  }, {
@@ -440,7 +3024,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
440
3024
  return (_ctx, _cache) => {
441
3025
  var _a, _b;
442
3026
  return openBlock(), createElementBlock(Fragment, null, [
443
- createVNode(unref(_sfc_main$w), {
3027
+ createVNode(unref(_sfc_main$9), {
444
3028
  class: "mb-6",
445
3029
  "payment-attempts": __props.payments ?? [],
446
3030
  invoice: __props.invoice,
@@ -454,13 +3038,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
454
3038
  invoice: __props.invoice
455
3039
  }, null, 8, ["invoice"])) : createCommentVNode("", true),
456
3040
  createElementVNode("div", _hoisted_2, [
457
- createVNode(_sfc_main$5, { invoice: __props.invoice }, null, 8, ["invoice"]),
458
- ((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$6, {
3041
+ createVNode(_sfc_main$D, { invoice: __props.invoice }, null, 8, ["invoice"]),
3042
+ ((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$E, {
459
3043
  key: 0,
460
3044
  "payment-attempts": __props.payments,
461
3045
  customer: __props.invoice.customer
462
3046
  }, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true),
463
- __props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$z), {
3047
+ __props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$F), {
464
3048
  key: 1,
465
3049
  customer: __props.invoice.customer,
466
3050
  title: unref($t)({
@@ -512,7 +3096,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
512
3096
  }));
513
3097
  return (_ctx, _cache) => {
514
3098
  var _a2, _b, _c, _d;
515
- return openBlock(), createBlock(unref(_sfc_main$7), {
3099
+ return openBlock(), createBlock(unref(_sfc_main$G), {
516
3100
  "custom-element-name": unref(COMPONENT_NAME),
517
3101
  environment: __props.environment,
518
3102
  locale: __props.locale,