@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
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./Button.vue.es-BC4_TItq.js"),o=require("./Avatar.vue.es-BbyE0AjW.js"),r=require("./component-ZRZIt3ZW.js"),a=require("./formatting.es-9hM8aHSg.js"),n={equals:"equals",notEquals:"does not equal",in:"equals one of",inOutput:"equals",notIn:"does not equal one of",notInOutput:"does not equal",greaterThan:"greater than",greaterThanOrEquals:"greater than or equal to",lessThan:"less than",lessThanOrEquals:"less than or equal to",empty:"is empty",notEmpty:"is not empty",contains:"contains",notContains:"does not contain",or:"or",unsupported:"unsupported",unknown:"Unknown"},s=(e=n)=>({propertyName:t,comparator:o,value:r,values:a},{hasFormatting:s}={})=>{const l=((e=n)=>[{comparator:"CONTAINS",forType:["STRING"],requiresInput:!0,symbol:"CONTAINS",label:{input:e.contains,output:e.contains}},{comparator:"NOT_CONTAINS",forType:["STRING"],requiresInput:!0,symbol:"NOT CONTAINS",label:{input:e.notContains,output:e.notContains}},{comparator:"EMPTY",forType:["STRING"],requiresInput:!1,symbol:"EMPTY",label:{input:e.empty,output:e.empty}},{comparator:"NOT_EMPTY",forType:["STRING"],requiresInput:!1,symbol:"NOT EMPTY",label:{input:e.notEmpty,output:e.notEmpty}},{comparator:"EQUALS",forType:["NUMBER","STRING","ENUM"],requiresInput:!0,symbol:"=",label:{input:e.equals,output:e.equals}},{comparator:"NOT_EQUALS",forType:["NUMBER","STRING","ENUM"],requiresInput:!0,symbol:"!=",label:{input:e.notEquals,output:e.notEquals}},{comparator:"IN",forType:["NUMBER","STRING","ENUM"],requiresInput:!0,symbol:"IN ()",label:{input:e.in,output:e.inOutput}},{comparator:"NOT_IN",forType:["NUMBER","STRING","ENUM"],requiresInput:!0,symbol:"NOT IN()",label:{input:e.notIn,output:e.notInOutput}},{comparator:"GREATER_THAN",forType:["NUMBER"],requiresInput:!0,symbol:">",label:{input:e.greaterThan,output:e.greaterThan}},{comparator:"GREATER_THAN_OR_EQUALS",forType:["NUMBER"],requiresInput:!0,symbol:">=",label:{input:e.greaterThanOrEquals,output:e.greaterThanOrEquals}},{comparator:"LESS_THAN",forType:["NUMBER"],requiresInput:!0,symbol:"<",label:{input:e.lessThan,output:e.lessThan}},{comparator:"LESS_THAN_OR_EQUALS",forType:["NUMBER"],requiresInput:!0,symbol:"<=",label:{input:e.lessThanOrEquals,output:e.lessThanOrEquals}}])(e).find(e=>e.comparator===o),p=null==a?void 0:a.reduce((t,o,r,a)=>{const n=s?`<strong class="font-semibold">${o}</strong>`:o;return r===a.length-1?`${t} ${(null==e?void 0:e.or)??"or"} ${n}`:0===r?n:[t,n].join(", ")},"");return l?["IN","NOT_IN"].includes(l.comparator)&&a?s?`<strong>${t}</strong> ${l.label.output} <strong>${p}</strong>`:`${t} ${l.label.output} ${p}`:s?`<strong class="font-semibold">${t}</strong> ${l.label.output} <strong class="font-semibold">${r}</strong>`:`${t} ${l.label.output} ${r}`:(null==e?void 0:e.unsupported)??"Unsupported comparator"},l=t=>t.every(t=>t.type===e.Comment||(t.type===e.Text&&"string"==typeof t.children&&!t.children.trim()||!(t.type!==e.Fragment||!l(t.children)))),p={class:"grow text-ellipsis overflow-hidden"},u=e.defineComponent({__name:"IconTitle",props:{title:{},subTitle:{},icon:{},variant:{default:"default"},suffix:{},size:{default:"md"},avatar:{type:Boolean,default:!1},uppercase:{type:Boolean,default:!0},resourceId:{}},setup(a){const n=a,s=e.computed(()=>{switch(n.variant){case"transparent":return"";case"warning":return"bg-gradient-to-br backdrop-blur-sm from-orange-600/20 to-yellow-200/20";case"neutral":return"bg-neutral-100";default:return"bg-gradient-to-br backdrop-blur-sm from-peach-100/20 to-mint-100/20"}});return(n,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center",{"gap-4":["md","lg"].includes(a.size),"gap-3":"sm"===a.size,"gap-2":"xs"===a.size&&"transparent"!==a.variant,"gap-1":"xs"===a.size&&"transparent"===a.variant}])},[a.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{[s.value]:!0,"w-9 h-9":["md","lg"].includes(a.size),"w-8 h-8":"sm"===a.size,"w-6 h-6":"xs"===a.size},"rounded-md flex items-center justify-center shrink-0"])},[a.icon?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{key:0,size:["sm","xs"].includes(a.size)?"xs":"md",icon:a.icon},null,8,["size","icon"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),a.avatar&&a.title?(e.openBlock(),e.createBlock(e.unref(o._sfc_main),{key:1,initials:a.title.slice(0,1),"color-hash":a.title,size:["sm","xs"].includes(a.size)?"lg":"xl"},null,8,["initials","color-hash","size"])):e.createCommentVNode("",!0),e.createElementVNode("div",p,[a.title||n.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([{"text-3xl":"lg"===a.size,"text-2xl":"md"===a.size,"text-base":"sm"===a.size,"text-xs text-gray-600":"xs"===a.size,"text-gray-900":"xs"!==a.size,uppercase:"xs"===a.size&&a.uppercase},"flex font-semibold items-center"])},[e.renderSlot(n.$slots,"prefix"),e.renderSlot(n.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.title),1)]),e.renderSlot(n.$slots,"suffix",{},()=>[e.createTextVNode(e.toDisplayString(a.suffix),1)])],2)):e.createCommentVNode("",!0),a.subTitle||n.$slots.subTitle&&!e.unref(l)(n.$slots.subTitle({}))?(e.openBlock(),e.createBlock(e.unref(r._sfc_main),{key:1,variant:"body-sm",shade:"lighter"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(a.subTitle),1)])]),_:3})):e.createCommentVNode("",!0)])],2))}}),i=["innerHTML"],m=e.defineComponent({__name:"Comparator",props:{propertyName:{},comparator:{},value:{},values:{},hasFormatting:{type:Boolean,default:!0},i18n:{}},setup(t){const o=t,r=e.computed(()=>({propertyName:o.propertyName,comparator:o.comparator,value:o.value??"",values:o.values??[""]}));return(o,a)=>(e.openBlock(),e.createElementBlock("span",{class:"py-0.25 px-0.5",innerHTML:e.unref(s)(t.i18n)(r.value,{hasFormatting:t.hasFormatting})},null,8,i))}}),c=e.defineComponent({__name:"Comparators",props:{comparators:{},expressionComparators:{},i18n:{},display:{default:"block"},rootClass:{}},setup:t=>(o,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.comparators?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.comparators,({meter_property:o,comparator:r,value:a,values:n},s)=>{var l,p;return e.openBlock(),e.createElementBlock("span",{key:null==o?void 0:o.id,class:e.normalizeClass({block:"block"===t.display,inline:"inline"===t.display})},[e.createVNode(m,{"property-name":(null==o?void 0:o.name)??(null==(l=t.i18n)?void 0:l.unknown)??"Unknown",comparator:r,value:a,values:n},null,8,["property-name","comparator","value","values"]),s<t.comparators.length-1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(" ")+e.toDisplayString((null==(p=t.i18n)?void 0:p.and)??"and")+e.toDisplayString(" "),1)],64)):e.createCommentVNode("",!0)],2)}),128)):e.createCommentVNode("",!0),t.expressionComparators?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.expressionComparators.operands,(o,r)=>{var n,s;return e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass(["bg-blue-400/25 rounded-sm px-2 mr-1",t.rootClass])},[o.meter_property?(e.openBlock(),e.createBlock(m,{key:0,"property-name":(null==(n=o.meter_property.meter_property)?void 0:n.name)??(null==(s=t.i18n)?void 0:s.unknown)??"Unknown",comparator:o.meter_property.comparator,value:o.meter_property.value,values:o.meter_property.values},null,8,["property-name","comparator","value","values"])):e.createCommentVNode("",!0),o.expression?(e.openBlock(),e.createBlock(c,{key:1,"expression-comparators":o.expression,display:t.display,i18n:t.i18n,"root-class":t.rootClass},null,8,["expression-comparators","display","i18n","root-class"])):e.createCommentVNode("",!0),r<t.expressionComparators.operands.length-1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(" ")+e.toDisplayString(e.unref(a.formatEnum)(t.expressionComparators.operator).toLocaleLowerCase())+e.toDisplayString(" "),1)],64)):e.createCommentVNode("",!0)],2)}),128)):e.createCommentVNode("",!0)],64))});exports._sfc_main=c,exports._sfc_main$1=u,exports.comparatorI18nDefaults=n,exports.getFormattedComparatorList=(e=n)=>(t,o)=>t.map(t=>s(e)(t,o)).join(" and "),exports.isVnodeEmpty=l,exports.useToggleList=t=>{const o=(null==t?void 0:t.initialToggledItems)??[],r=(null==t?void 0:t.closeOthers)??!1,a=e.ref(o??[]);return{toggledItems:a,toggle:e=>((e,t=!1)=>{const o=a.value.find(t=>t===e);a.value=t?e===o?[]:[e]:o?a.value.filter(t=>t!==e):[...a.value,e]})(e,r),getIsOpen:e=>a.value.includes(e),toggleAll:e=>{0!==e.length&&(a.value.length===e.length?a.value=[]:a.value=e)}}};
@@ -0,0 +1,406 @@
1
+ import { ref, Comment, Text, Fragment, defineComponent, computed, openBlock, createElementBlock, normalizeClass, createBlock, unref, createCommentVNode, createElementVNode, renderSlot, createTextVNode, toDisplayString, withCtx, renderList, createVNode } from "vue";
2
+ import { a as _sfc_main$3 } from "./Button.vue.es-6sBk5tBL.mjs";
3
+ import { _ as _sfc_main$4 } from "./Avatar.vue.es-Ba8ZGfm4.mjs";
4
+ import { _ as _sfc_main$5 } from "./component-dpA83LIN.mjs";
5
+ import { f as formatEnum } from "./formatting.es-D5H_ySFv.mjs";
6
+ const useToggleList = (params) => {
7
+ const initialToggledItems = (params == null ? void 0 : params.initialToggledItems) ?? [];
8
+ const closeOthers = (params == null ? void 0 : params.closeOthers) ?? false;
9
+ const toggledItems = ref(initialToggledItems ?? []);
10
+ const _toggle = (index, closeOthers2 = false) => {
11
+ const match = toggledItems.value.find((groupIndex) => groupIndex === index);
12
+ if (closeOthers2) {
13
+ toggledItems.value = index === match ? [] : [index];
14
+ } else if (match) {
15
+ toggledItems.value = toggledItems.value.filter((groupIndex) => groupIndex !== index);
16
+ } else {
17
+ toggledItems.value = [...toggledItems.value, index];
18
+ }
19
+ };
20
+ const toggle = (index) => _toggle(index, closeOthers);
21
+ const toggleAll = (allItems) => {
22
+ if (allItems.length === 0) {
23
+ return;
24
+ }
25
+ if (toggledItems.value.length === allItems.length) {
26
+ toggledItems.value = [];
27
+ } else {
28
+ toggledItems.value = allItems;
29
+ }
30
+ };
31
+ const getIsOpen = (index) => toggledItems.value.includes(index);
32
+ return { toggledItems, toggle, getIsOpen, toggleAll };
33
+ };
34
+ const comparatorI18nDefaults = {
35
+ equals: "equals",
36
+ notEquals: "does not equal",
37
+ in: "equals one of",
38
+ inOutput: "equals",
39
+ notIn: "does not equal one of",
40
+ notInOutput: "does not equal",
41
+ greaterThan: "greater than",
42
+ greaterThanOrEquals: "greater than or equal to",
43
+ lessThan: "less than",
44
+ lessThanOrEquals: "less than or equal to",
45
+ empty: "is empty",
46
+ notEmpty: "is not empty",
47
+ contains: "contains",
48
+ notContains: "does not contain",
49
+ or: "or",
50
+ unsupported: "unsupported",
51
+ unknown: "Unknown"
52
+ };
53
+ const getComparatorMap = (i18n = comparatorI18nDefaults) => [
54
+ {
55
+ comparator: "CONTAINS",
56
+ forType: ["STRING"],
57
+ requiresInput: true,
58
+ symbol: "CONTAINS",
59
+ label: {
60
+ input: i18n.contains,
61
+ output: i18n.contains
62
+ }
63
+ },
64
+ {
65
+ comparator: "NOT_CONTAINS",
66
+ forType: ["STRING"],
67
+ requiresInput: true,
68
+ symbol: "NOT CONTAINS",
69
+ label: {
70
+ input: i18n.notContains,
71
+ output: i18n.notContains
72
+ }
73
+ },
74
+ {
75
+ comparator: "EMPTY",
76
+ forType: ["STRING"],
77
+ requiresInput: false,
78
+ symbol: "EMPTY",
79
+ label: {
80
+ input: i18n.empty,
81
+ output: i18n.empty
82
+ }
83
+ },
84
+ {
85
+ comparator: "NOT_EMPTY",
86
+ forType: ["STRING"],
87
+ requiresInput: false,
88
+ symbol: "NOT EMPTY",
89
+ label: {
90
+ input: i18n.notEmpty,
91
+ output: i18n.notEmpty
92
+ }
93
+ },
94
+ {
95
+ comparator: "EQUALS",
96
+ forType: ["NUMBER", "STRING", "ENUM"],
97
+ requiresInput: true,
98
+ symbol: "=",
99
+ label: {
100
+ input: i18n.equals,
101
+ output: i18n.equals
102
+ }
103
+ },
104
+ {
105
+ comparator: "NOT_EQUALS",
106
+ forType: ["NUMBER", "STRING", "ENUM"],
107
+ requiresInput: true,
108
+ symbol: "!=",
109
+ label: {
110
+ input: i18n.notEquals,
111
+ output: i18n.notEquals
112
+ }
113
+ },
114
+ {
115
+ comparator: "IN",
116
+ forType: ["NUMBER", "STRING", "ENUM"],
117
+ requiresInput: true,
118
+ symbol: "IN ()",
119
+ label: {
120
+ input: i18n.in,
121
+ output: i18n.inOutput
122
+ }
123
+ },
124
+ {
125
+ comparator: "NOT_IN",
126
+ forType: ["NUMBER", "STRING", "ENUM"],
127
+ requiresInput: true,
128
+ symbol: "NOT IN()",
129
+ label: {
130
+ input: i18n.notIn,
131
+ output: i18n.notInOutput
132
+ }
133
+ },
134
+ {
135
+ comparator: "GREATER_THAN",
136
+ forType: ["NUMBER"],
137
+ requiresInput: true,
138
+ symbol: ">",
139
+ label: {
140
+ input: i18n.greaterThan,
141
+ output: i18n.greaterThan
142
+ }
143
+ },
144
+ {
145
+ comparator: "GREATER_THAN_OR_EQUALS",
146
+ forType: ["NUMBER"],
147
+ requiresInput: true,
148
+ symbol: ">=",
149
+ label: {
150
+ input: i18n.greaterThanOrEquals,
151
+ output: i18n.greaterThanOrEquals
152
+ }
153
+ },
154
+ {
155
+ comparator: "LESS_THAN",
156
+ forType: ["NUMBER"],
157
+ requiresInput: true,
158
+ symbol: "<",
159
+ label: {
160
+ input: i18n.lessThan,
161
+ output: i18n.lessThan
162
+ }
163
+ },
164
+ {
165
+ comparator: "LESS_THAN_OR_EQUALS",
166
+ forType: ["NUMBER"],
167
+ requiresInput: true,
168
+ symbol: "<=",
169
+ label: {
170
+ input: i18n.lessThanOrEquals,
171
+ output: i18n.lessThanOrEquals
172
+ }
173
+ }
174
+ ];
175
+ const getFormattedComparator = (i18n = comparatorI18nDefaults) => {
176
+ return ({ propertyName, comparator, value, values }, { hasFormatting } = {}) => {
177
+ const comparatorEntry = getComparatorMap(i18n).find(
178
+ (item) => item.comparator === comparator
179
+ );
180
+ const formattedList = values == null ? void 0 : values.reduce((acc, item, index, array) => {
181
+ const formattedItem = hasFormatting ? `<strong class="font-semibold">${item}</strong>` : item;
182
+ if (index === array.length - 1) {
183
+ return `${acc} ${(i18n == null ? void 0 : i18n.or) ?? "or"} ${formattedItem}`;
184
+ }
185
+ if (index === 0) {
186
+ return formattedItem;
187
+ }
188
+ return [acc, formattedItem].join(", ");
189
+ }, "");
190
+ if (!comparatorEntry) {
191
+ return (i18n == null ? void 0 : i18n.unsupported) ?? "Unsupported comparator";
192
+ }
193
+ if (["IN", "NOT_IN"].includes(comparatorEntry.comparator) && values) {
194
+ return hasFormatting ? `<strong>${propertyName}</strong> ${comparatorEntry.label.output} <strong>${formattedList}</strong>` : `${propertyName} ${comparatorEntry.label.output} ${formattedList}`;
195
+ }
196
+ return hasFormatting ? `<strong class="font-semibold">${propertyName}</strong> ${comparatorEntry.label.output} <strong class="font-semibold">${value}</strong>` : `${propertyName} ${comparatorEntry.label.output} ${value}`;
197
+ };
198
+ };
199
+ const getFormattedComparatorList = (i18n = comparatorI18nDefaults) => {
200
+ return (comparators, options) => {
201
+ return comparators.map((item) => getFormattedComparator(i18n)(item, options)).join(" and ");
202
+ };
203
+ };
204
+ const isVnodeEmpty = (vnodes) => {
205
+ return vnodes.every((node) => {
206
+ if (node.type === Comment) {
207
+ return true;
208
+ }
209
+ if (node.type === Text && typeof node.children === "string" && !node.children.trim()) {
210
+ return true;
211
+ }
212
+ if (node.type === Fragment && isVnodeEmpty(node.children)) {
213
+ return true;
214
+ }
215
+ return false;
216
+ });
217
+ };
218
+ const _hoisted_1$1 = { class: "grow text-ellipsis overflow-hidden" };
219
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
220
+ __name: "IconTitle",
221
+ props: {
222
+ title: {},
223
+ subTitle: {},
224
+ icon: {},
225
+ variant: { default: "default" },
226
+ suffix: {},
227
+ size: { default: "md" },
228
+ avatar: { type: Boolean, default: false },
229
+ uppercase: { type: Boolean, default: true },
230
+ resourceId: {}
231
+ },
232
+ setup(__props) {
233
+ const props = __props;
234
+ const gradientClasses = computed(() => {
235
+ switch (props.variant) {
236
+ case "transparent":
237
+ return "";
238
+ case "warning":
239
+ return "bg-gradient-to-br backdrop-blur-sm from-orange-600/20 to-yellow-200/20";
240
+ case "neutral":
241
+ return "bg-neutral-100";
242
+ default:
243
+ case "default":
244
+ return "bg-gradient-to-br backdrop-blur-sm from-peach-100/20 to-mint-100/20";
245
+ }
246
+ });
247
+ return (_ctx, _cache) => {
248
+ return openBlock(), createElementBlock("div", {
249
+ class: normalizeClass(["flex items-center", {
250
+ "gap-4": ["md", "lg"].includes(__props.size),
251
+ "gap-3": __props.size === "sm",
252
+ "gap-2": __props.size === "xs" && __props.variant !== "transparent",
253
+ "gap-1": __props.size === "xs" && __props.variant === "transparent"
254
+ }])
255
+ }, [
256
+ __props.icon ? (openBlock(), createElementBlock("div", {
257
+ key: 0,
258
+ class: normalizeClass([{
259
+ [gradientClasses.value]: true,
260
+ "w-9 h-9": ["md", "lg"].includes(__props.size),
261
+ "w-8 h-8": __props.size === "sm",
262
+ "w-6 h-6": __props.size === "xs"
263
+ }, "rounded-md flex items-center justify-center shrink-0"])
264
+ }, [
265
+ __props.icon ? (openBlock(), createBlock(unref(_sfc_main$3), {
266
+ key: 0,
267
+ size: ["sm", "xs"].includes(__props.size) ? "xs" : "md",
268
+ icon: __props.icon
269
+ }, null, 8, ["size", "icon"])) : createCommentVNode("", true)
270
+ ], 2)) : createCommentVNode("", true),
271
+ __props.avatar && __props.title ? (openBlock(), createBlock(unref(_sfc_main$4), {
272
+ key: 1,
273
+ initials: __props.title.slice(0, 1),
274
+ "color-hash": __props.title,
275
+ size: ["sm", "xs"].includes(__props.size) ? "lg" : "xl"
276
+ }, null, 8, ["initials", "color-hash", "size"])) : createCommentVNode("", true),
277
+ createElementVNode("div", _hoisted_1$1, [
278
+ __props.title || _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
279
+ key: 0,
280
+ class: normalizeClass([{
281
+ "text-3xl": __props.size === "lg",
282
+ "text-2xl": __props.size === "md",
283
+ "text-base": __props.size === "sm",
284
+ "text-xs text-gray-600": __props.size === "xs",
285
+ "text-gray-900": __props.size !== "xs",
286
+ uppercase: __props.size === "xs" && __props.uppercase
287
+ }, "flex font-semibold items-center"])
288
+ }, [
289
+ renderSlot(_ctx.$slots, "prefix"),
290
+ renderSlot(_ctx.$slots, "default", {}, () => [
291
+ createTextVNode(toDisplayString(__props.title), 1)
292
+ ]),
293
+ renderSlot(_ctx.$slots, "suffix", {}, () => [
294
+ createTextVNode(toDisplayString(__props.suffix), 1)
295
+ ])
296
+ ], 2)) : createCommentVNode("", true),
297
+ __props.subTitle || _ctx.$slots.subTitle && !unref(isVnodeEmpty)(_ctx.$slots.subTitle({})) ? (openBlock(), createBlock(unref(_sfc_main$5), {
298
+ key: 1,
299
+ variant: "body-sm",
300
+ shade: "lighter"
301
+ }, {
302
+ default: withCtx(() => [
303
+ renderSlot(_ctx.$slots, "subTitle", {}, () => [
304
+ createTextVNode(toDisplayString(__props.subTitle), 1)
305
+ ])
306
+ ]),
307
+ _: 3
308
+ })) : createCommentVNode("", true)
309
+ ])
310
+ ], 2);
311
+ };
312
+ }
313
+ });
314
+ const _hoisted_1 = ["innerHTML"];
315
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
316
+ __name: "Comparator",
317
+ props: {
318
+ propertyName: {},
319
+ comparator: {},
320
+ value: {},
321
+ values: {},
322
+ hasFormatting: { type: Boolean, default: true },
323
+ i18n: {}
324
+ },
325
+ setup(__props) {
326
+ const props = __props;
327
+ const item = computed(() => ({
328
+ propertyName: props.propertyName,
329
+ comparator: props.comparator,
330
+ value: props.value ?? "",
331
+ values: props.values ?? [""]
332
+ }));
333
+ return (_ctx, _cache) => {
334
+ return openBlock(), createElementBlock("span", {
335
+ class: "py-0.25 px-0.5",
336
+ innerHTML: unref(getFormattedComparator)(__props.i18n)(item.value, { hasFormatting: __props.hasFormatting })
337
+ }, null, 8, _hoisted_1);
338
+ };
339
+ }
340
+ });
341
+ const _sfc_main = /* @__PURE__ */ defineComponent({
342
+ __name: "Comparators",
343
+ props: {
344
+ comparators: {},
345
+ expressionComparators: {},
346
+ i18n: {},
347
+ display: { default: "block" },
348
+ rootClass: {}
349
+ },
350
+ setup(__props) {
351
+ return (_ctx, _cache) => {
352
+ return openBlock(), createElementBlock(Fragment, null, [
353
+ __props.comparators ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.comparators, ({ meter_property, comparator, value, values }, index) => {
354
+ var _a, _b;
355
+ return openBlock(), createElementBlock("span", {
356
+ key: meter_property == null ? void 0 : meter_property.id,
357
+ class: normalizeClass({ block: __props.display === "block", inline: __props.display === "inline" })
358
+ }, [
359
+ createVNode(_sfc_main$1, {
360
+ "property-name": (meter_property == null ? void 0 : meter_property.name) ?? ((_a = __props.i18n) == null ? void 0 : _a.unknown) ?? "Unknown",
361
+ comparator,
362
+ value,
363
+ values
364
+ }, null, 8, ["property-name", "comparator", "value", "values"]),
365
+ index < __props.comparators.length - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
366
+ createTextVNode(toDisplayString(" ") + toDisplayString(((_b = __props.i18n) == null ? void 0 : _b.and) ?? "and") + toDisplayString(" "), 1)
367
+ ], 64)) : createCommentVNode("", true)
368
+ ], 2);
369
+ }), 128)) : createCommentVNode("", true),
370
+ __props.expressionComparators ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.expressionComparators.operands, (operand, index) => {
371
+ var _a, _b;
372
+ return openBlock(), createElementBlock("span", {
373
+ key: index,
374
+ class: normalizeClass(["bg-blue-400/25 rounded-sm px-2 mr-1", __props.rootClass])
375
+ }, [
376
+ operand.meter_property ? (openBlock(), createBlock(_sfc_main$1, {
377
+ key: 0,
378
+ "property-name": ((_a = operand.meter_property.meter_property) == null ? void 0 : _a.name) ?? ((_b = __props.i18n) == null ? void 0 : _b.unknown) ?? "Unknown",
379
+ comparator: operand.meter_property.comparator,
380
+ value: operand.meter_property.value,
381
+ values: operand.meter_property.values
382
+ }, null, 8, ["property-name", "comparator", "value", "values"])) : createCommentVNode("", true),
383
+ operand.expression ? (openBlock(), createBlock(_sfc_main, {
384
+ key: 1,
385
+ "expression-comparators": operand.expression,
386
+ display: __props.display,
387
+ i18n: __props.i18n,
388
+ "root-class": __props.rootClass
389
+ }, null, 8, ["expression-comparators", "display", "i18n", "root-class"])) : createCommentVNode("", true),
390
+ index < __props.expressionComparators.operands.length - 1 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
391
+ createTextVNode(toDisplayString(" ") + toDisplayString(unref(formatEnum)(__props.expressionComparators.operator).toLocaleLowerCase()) + toDisplayString(" "), 1)
392
+ ], 64)) : createCommentVNode("", true)
393
+ ], 2);
394
+ }), 128)) : createCommentVNode("", true)
395
+ ], 64);
396
+ };
397
+ }
398
+ });
399
+ export {
400
+ _sfc_main as _,
401
+ _sfc_main$2 as a,
402
+ comparatorI18nDefaults as c,
403
+ getFormattedComparatorList as g,
404
+ isVnodeEmpty as i,
405
+ useToggleList as u
406
+ };
@@ -1,5 +1,5 @@
1
1
  import { inject, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode } from "vue";
2
- import { P as PORTAL_INJECTION_KEY } from "./component-DI3AxwdD.mjs";
2
+ import { P as PORTAL_INJECTION_KEY } from "./component-dpA83LIN.mjs";
3
3
  function usePortal() {
4
4
  const portal = inject(PORTAL_INJECTION_KEY);
5
5
  if (!portal) {
@@ -1 +1 @@
1
- const e=require("vue"),o=require("./component-yWF07boR.js");const t={class:"grid w-full grid-cols-1 gap-4"},r={key:0},s={class:"flex flex-col items-start gap-6 md:flex-row"},l={class:"grid w-full grow grid-cols-1 gap-4 md:w-auto"},n={class:"grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"};const c=((e,o)=>{const t=e.__vccOpts||e;for(const[r,s]of o)t[r]=s;return t})({},[["render",function(o,c){return e.openBlock(),e.createElementBlock("div",t,[o.$slots.header?(e.openBlock(),e.createElementBlock("div",r,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",s,[e.createElementVNode("div",l,[e.renderSlot(o.$slots,"content")]),e.createElementVNode("aside",n,[e.renderSlot(o.$slots,"aside")])])])}]]);exports.ContentWithAsideLayout=c,exports.usePortal=function(){const t=e.inject(o.PORTAL_INJECTION_KEY);if(!t)throw new Error("PortalProvider is not provided");return t};
1
+ const e=require("vue"),o=require("./component-ZRZIt3ZW.js");const t={class:"grid w-full grid-cols-1 gap-4"},r={key:0},s={class:"flex flex-col items-start gap-6 md:flex-row"},l={class:"grid w-full grow grid-cols-1 gap-4 md:w-auto"},n={class:"grid w-full grid-cols-1 gap-4 md:w-80 md:shrink-0"};const c=((e,o)=>{const t=e.__vccOpts||e;for(const[r,s]of o)t[r]=s;return t})({},[["render",function(o,c){return e.openBlock(),e.createElementBlock("div",t,[o.$slots.header?(e.openBlock(),e.createElementBlock("div",r,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",s,[e.createElementVNode("div",l,[e.renderSlot(o.$slots,"content")]),e.createElementVNode("aside",n,[e.renderSlot(o.$slots,"aside")])])])}]]);exports.ContentWithAsideLayout=c,exports.usePortal=function(){const t=e.inject(o.PORTAL_INJECTION_KEY);if(!t)throw new Error("PortalProvider is not provided");return t};
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./component-ZRZIt3ZW.js"),i=require("./Section.vue.es-BuzTXRLP.js"),n=require("./getCountryNameByCode.es-fP52nO_7.js"),o=require("./customer.es-D42Md24r.js"),a=require("./typeGuards.es-C4nR5FkL.js"),r=["US","CA"];function l(e){if(r.includes(e.country)){const t=s([e.line1,e.line2],", "),i=s([e.state,e.postal_code]," "),o=n.getCountryNameByCode(e.country);return s([t,e.city,i,o],", ")}const t=s([e.line1,e.line2]," "),i=s([e.postal_code,e.city]," "),o=n.getCountryNameByCode(e.country);return s([t,i,e.state,o],", ")}function s(e,t){return e.filter(Boolean).join(t)}const c={key:0,class:"flex flex-col gap-2"},d={key:0},u={key:1},m={key:2},f={key:3},_={key:1},g=e.defineComponent({__name:"CustomerBillingInformation",props:{customer:{},title:{},fallbackToReference:{type:Boolean,default:!0}},setup(n){const{$t:r}=t.useIntl(),s=n,g=e.computed(()=>{if(!s.customer)return;const e=o.getCustomerName(s.customer);return s.fallbackToReference&&""===e?s.customer.reference:s.fallbackToReference||""!==e?e:void 0}),p=e.computed(()=>s.title||r({defaultMessage:"Billing information",description:"Title for the billing information",id:"customer_billing_information.title"})),b=e.computed(()=>{if(s.customer)return"individual"in s.customer?s.customer.individual.residential_address:"organization"in s.customer?s.customer.organization.registered_address:void 0});return(o,s)=>(e.openBlock(),e.createBlock(i._sfc_main,{title:p.value},{right:e.withCtx(()=>[e.renderSlot(o.$slots,"settings")]),default:e.withCtx(()=>{var i;return[n.customer?(e.openBlock(),e.createElementBlock("div",c,[g.value?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Name",description:"The label for the customer name in the billing information",id:"customer_billing_information.name_label"})),1)]),_:1}),e.createVNode(t._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:1})])):e.createCommentVNode("",!0),(null==(i=b.value)?void 0:i.line1)?(e.openBlock(),e.createElementBlock("div",u,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing address",description:"The label for the customer billing address in the billing information",id:"customer_billing_information.billing_address_label"})),1)]),_:1}),e.createVNode(t._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(b.value)),1)]),_:1})])):e.createCommentVNode("",!0),n.customer.email?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Email address",description:"The label for the customer email address in the billing information",id:"customer_billing_information.email_address_label"})),1)]),_:1}),e.createVNode(t._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.customer.email),1)]),_:1})])):e.createCommentVNode("",!0),e.unref(a.isOrganization)(n.customer)?(e.openBlock(),e.createElementBlock("div",f,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"VAT number",description:"The label for the customer Vat number in the billing information",id:"customer_billing_information.vat_number_label"})),1)]),_:1}),e.createVNode(t._sfc_main,{variant:"body-xs"},{default:e.withCtx(()=>{var t,i;return[e.createTextVNode(e.toDisplayString(null==(i=null==(t=n.customer.organization.tax_ids)?void 0:t[0])?void 0:i.id),1)]}),_:1})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",_,[e.createVNode(t._sfc_main,{variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"No billing information to display.",description:"Text that is being displayed when there is no active subscription in the subscriptions block",id:"customer_overview.billing_information.no_billing_information_available"})),1)]),_:1})]))]}),_:3},8,["title"]))}});exports._sfc_main=g;
@@ -0,0 +1,175 @@
1
+ import { defineComponent, computed, openBlock, createBlock, withCtx, createElementBlock, createVNode, createTextVNode, toDisplayString, unref, createCommentVNode, renderSlot } from "vue";
2
+ import { a as useIntl, _ as _sfc_main$2 } from "./component-dpA83LIN.mjs";
3
+ import { _ as _sfc_main$1 } from "./Section.vue.es-3-H1pUTB.mjs";
4
+ import { g as getCountryNameByCode } from "./getCountryNameByCode.es-ymC9R46j.mjs";
5
+ import { g as getCustomerName } from "./customer.es-LIW2YmLL.mjs";
6
+ import { a as isOrganization } from "./typeGuards.es-fwUoeMCe.mjs";
7
+ const COUNTRIES_WITH_STATE = ["US", "CA"];
8
+ function formatAddress(address) {
9
+ const hasState = COUNTRIES_WITH_STATE.includes(address.country);
10
+ if (hasState) {
11
+ const street2 = joinParts([address.line1, address.line2], ", ");
12
+ const stateAndCode = joinParts([address.state, address.postal_code], " ");
13
+ const country2 = getCountryNameByCode(address.country);
14
+ return joinParts([street2, address.city, stateAndCode, country2], ", ");
15
+ }
16
+ const street = joinParts([address.line1, address.line2], " ");
17
+ const codeAndCity = joinParts([address.postal_code, address.city], " ");
18
+ const country = getCountryNameByCode(address.country);
19
+ return joinParts([street, codeAndCity, address.state, country], ", ");
20
+ }
21
+ function joinParts(parts, separator) {
22
+ return parts.filter(Boolean).join(separator);
23
+ }
24
+ const _hoisted_1 = {
25
+ key: 0,
26
+ class: "flex flex-col gap-2"
27
+ };
28
+ const _hoisted_2 = { key: 0 };
29
+ const _hoisted_3 = { key: 1 };
30
+ const _hoisted_4 = { key: 2 };
31
+ const _hoisted_5 = { key: 3 };
32
+ const _hoisted_6 = { key: 1 };
33
+ const _sfc_main = /* @__PURE__ */ defineComponent({
34
+ __name: "CustomerBillingInformation",
35
+ props: {
36
+ customer: {},
37
+ title: {},
38
+ fallbackToReference: { type: Boolean, default: true }
39
+ },
40
+ setup(__props) {
41
+ const { $t } = useIntl();
42
+ const props = __props;
43
+ const customerName = computed(() => {
44
+ if (!props.customer) return void 0;
45
+ const name = getCustomerName(props.customer);
46
+ if (props.fallbackToReference && name === "") {
47
+ return props.customer.reference;
48
+ }
49
+ if (!props.fallbackToReference && name === "") {
50
+ return void 0;
51
+ }
52
+ return name;
53
+ });
54
+ const titleWithFallback = computed(() => {
55
+ return props.title || $t({
56
+ defaultMessage: "Billing information",
57
+ description: "Title for the billing information",
58
+ id: "customer_billing_information.title"
59
+ });
60
+ });
61
+ const address = computed(() => {
62
+ if (!props.customer) return void 0;
63
+ if ("individual" in props.customer) return props.customer.individual.residential_address;
64
+ if ("organization" in props.customer) return props.customer.organization.registered_address;
65
+ return void 0;
66
+ });
67
+ return (_ctx, _cache) => {
68
+ return openBlock(), createBlock(_sfc_main$1, { title: titleWithFallback.value }, {
69
+ right: withCtx(() => [
70
+ renderSlot(_ctx.$slots, "settings")
71
+ ]),
72
+ default: withCtx(() => {
73
+ var _a;
74
+ return [
75
+ __props.customer ? (openBlock(), createElementBlock("div", _hoisted_1, [
76
+ customerName.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
77
+ createVNode(_sfc_main$2, { variant: "caps-heading" }, {
78
+ default: withCtx(() => [
79
+ createTextVNode(toDisplayString(unref($t)({
80
+ defaultMessage: "Name",
81
+ description: "The label for the customer name in the billing information",
82
+ id: "customer_billing_information.name_label"
83
+ })), 1)
84
+ ]),
85
+ _: 1
86
+ }),
87
+ createVNode(_sfc_main$2, { variant: "body-xs" }, {
88
+ default: withCtx(() => [
89
+ createTextVNode(toDisplayString(customerName.value), 1)
90
+ ]),
91
+ _: 1
92
+ })
93
+ ])) : createCommentVNode("", true),
94
+ ((_a = address.value) == null ? void 0 : _a.line1) ? (openBlock(), createElementBlock("div", _hoisted_3, [
95
+ createVNode(_sfc_main$2, { variant: "caps-heading" }, {
96
+ default: withCtx(() => [
97
+ createTextVNode(toDisplayString(unref($t)({
98
+ defaultMessage: "Billing address",
99
+ description: "The label for the customer billing address in the billing information",
100
+ id: "customer_billing_information.billing_address_label"
101
+ })), 1)
102
+ ]),
103
+ _: 1
104
+ }),
105
+ createVNode(_sfc_main$2, { variant: "body-xs" }, {
106
+ default: withCtx(() => [
107
+ createTextVNode(toDisplayString(unref(formatAddress)(address.value)), 1)
108
+ ]),
109
+ _: 1
110
+ })
111
+ ])) : createCommentVNode("", true),
112
+ __props.customer.email ? (openBlock(), createElementBlock("div", _hoisted_4, [
113
+ createVNode(_sfc_main$2, { variant: "caps-heading" }, {
114
+ default: withCtx(() => [
115
+ createTextVNode(toDisplayString(unref($t)({
116
+ defaultMessage: "Email address",
117
+ description: "The label for the customer email address in the billing information",
118
+ id: "customer_billing_information.email_address_label"
119
+ })), 1)
120
+ ]),
121
+ _: 1
122
+ }),
123
+ createVNode(_sfc_main$2, { variant: "body-xs" }, {
124
+ default: withCtx(() => [
125
+ createTextVNode(toDisplayString(__props.customer.email), 1)
126
+ ]),
127
+ _: 1
128
+ })
129
+ ])) : createCommentVNode("", true),
130
+ unref(isOrganization)(__props.customer) ? (openBlock(), createElementBlock("div", _hoisted_5, [
131
+ createVNode(_sfc_main$2, { variant: "caps-heading" }, {
132
+ default: withCtx(() => [
133
+ createTextVNode(toDisplayString(unref($t)({
134
+ defaultMessage: "VAT number",
135
+ description: "The label for the customer Vat number in the billing information",
136
+ id: "customer_billing_information.vat_number_label"
137
+ })), 1)
138
+ ]),
139
+ _: 1
140
+ }),
141
+ createVNode(_sfc_main$2, { variant: "body-xs" }, {
142
+ default: withCtx(() => {
143
+ var _a2, _b;
144
+ return [
145
+ createTextVNode(toDisplayString((_b = (_a2 = __props.customer.organization.tax_ids) == null ? void 0 : _a2[0]) == null ? void 0 : _b.id), 1)
146
+ ];
147
+ }),
148
+ _: 1
149
+ })
150
+ ])) : createCommentVNode("", true)
151
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
152
+ createVNode(_sfc_main$2, {
153
+ variant: "body-xs",
154
+ shade: "lighter"
155
+ }, {
156
+ default: withCtx(() => [
157
+ createTextVNode(toDisplayString(unref($t)({
158
+ defaultMessage: "No billing information to display.",
159
+ description: "Text that is being displayed when there is no active subscription in the subscriptions block",
160
+ id: "customer_overview.billing_information.no_billing_information_available"
161
+ })), 1)
162
+ ]),
163
+ _: 1
164
+ })
165
+ ]))
166
+ ];
167
+ }),
168
+ _: 3
169
+ }, 8, ["title"]);
170
+ };
171
+ }
172
+ });
173
+ export {
174
+ _sfc_main as _
175
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./Section.vue.es-BuzTXRLP.js"),o=require("./PaymentMethod.vue.es-DYlnmZh7.js"),n=require("./Button.vue.es-BC4_TItq.js"),a=require("./component-ZRZIt3ZW.js"),i=require("./Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js"),s=require("./useActionDispatchProvider-CWVV_xsi.js"),d={key:0,class:"flex flex-col gap-2"},r=e.defineComponent({__name:"CustomerPaymentMethodsBlock",props:{paymentMethods:{type:Array},limit:{default:2,type:Number},isLoading:{type:Boolean},showViewAllButton:{type:Boolean},showAddButton:{type:Boolean}},emits:["view-all-payment-methods","add-payment-method"],setup(i){const s=i,{$t:r}=a.useIntl(),l=e.computed(()=>s.paymentMethods.length>0);return(s,m)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"no-spacing":"","no-border":"",title:e.unref(r)({defaultMessage:"{count, plural, one {Payment method} other {Payment methods}}",description:"Title for the payment methods block on the customer overview page",id:"customer_overview.payment_methods.title"},{count:String(i.paymentMethods.length)})},e.createSlots({default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.paymentMethods,n=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:n.id},{default:e.withCtx(()=>[e.createVNode(e.unref(o._sfc_main),{"payment-method":n},null,8,["payment-method"])]),_:2},1024))),128))])):(e.openBlock(),e.createBlock(e.unref(t._sfc_main),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(a._sfc_main),{variant:"body-sm",shade:"lighter","no-spacing":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Add a payment method for recurring invoice payments.",description:"Helper text for adding a payment method when no payment methods are configured",id:"customer_overview.payment_methods_block.add_payment_method_helper_text"})),1)]),_:1}),i.showAddButton?(e.openBlock(),e.createBlock(e.unref(n._sfc_main),{key:0,class:"mt-4 w-full",variant:"outline",color:"gray","icon-prefix":"add",type:"button",onClick:m[1]||(m[1]=e=>s.$emit("add-payment-method"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Add payment method",description:"Text for the add payment method button that is shown when no payment methods have been configured",id:"customer_overview.payment_methods_block.add_payment_method_button_label"})),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),_:2},[i.showViewAllButton?{name:"right",fn:e.withCtx(()=>[e.createVNode(e.unref(n._sfc_main),{size:"sm",variant:"ghost",color:"gray","icon-suffix":"arrow_right_alt",type:"button",onClick:m[0]||(m[0]=e=>s.$emit("view-all-payment-methods"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"View all",id:"customer_overview.payment_methods_block.view_all_payment_methods_link_label",description:"The link text that links to the overview page of the customer invoices"})),1)]),_:1})]),key:"0"}:void 0]),1032,["title"]))}}),l=e.defineComponent({__name:"CustomerPaymentMethods",props:{isLoading:{type:Boolean},paymentMethods:{type:Array},maxPaymentMethods:{type:Number},configuration:{default:()=>({showViewAllButton:!0,showAddButton:!0}),type:Object}},setup(t){const{dispatchAction:o}=s.useActionDispatchProvider();return(n,a)=>{var s,d;return t.isLoading?(e.openBlock(),e.createBlock(i._sfc_main,{key:0,variant:"section",class:"h-72","data-testid":"customer-payment-methods-skeleton"})):(e.openBlock(),e.createBlock(r,{key:1,"is-loading":t.isLoading,"payment-methods":t.paymentMethods,"show-view-all-button":null==(s=t.configuration)?void 0:s.showViewAllButton,"show-add-button":null==(d=t.configuration)?void 0:d.showAddButton,onViewAllPaymentMethods:a[0]||(a[0]=t=>e.unref(o)({action:"view-all-payment-methods"})),onAddPaymentMethod:a[1]||(a[1]=t=>e.unref(o)({action:"add-payment-method"}))},null,8,["is-loading","payment-methods","show-view-all-button","show-add-button"]))}}});exports._sfc_main=l;