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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +124 -0
  2. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  3. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CX8vlY2Z.mjs} +6 -6
  5. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-DGisvmez.js +1 -0
  6. package/dist/ContentWithAsideLayout-B5B8Kwaw.js +1 -0
  7. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-DhfUkZZg.mjs} +10 -16
  8. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Bus-5gC3.mjs} +21 -13
  9. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CkRsyMlJ.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Bc2hkpTb.mjs} +19 -9
  11. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-D0vVUHuY.js +1 -0
  12. package/dist/PaymentHistoryBlock-BiiFJkpT.js +1 -0
  13. package/dist/PaymentHistoryBlock-D_B099M7.mjs +4 -0
  14. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CaMDtHrL.mjs} +16 -13
  15. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DWTEfLrE.js +1 -0
  16. package/dist/PaymentIntegrationForm-D1oJA9mC.js +1 -0
  17. package/dist/PaymentIntegrationForm-DNkjhqMF.mjs +4 -0
  18. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D37gDtY7.mjs} +95 -199
  19. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-D5bxFJ-p.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BChVMzCj.mjs} +5 -31
  21. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-Br3bEUlP.js +1 -0
  22. package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-DXJcL7x6.mjs → Skeleton.vue_vue_type_script_setup_true_lang-DGMxHc20.mjs} +9 -6
  23. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DfMgIsGm.js +1 -0
  24. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-AHw3iTfi.js +1 -0
  25. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BkzLj8n2.mjs} +28 -22
  26. package/dist/adyen-B_QrYdaC.mjs +4 -0
  27. package/dist/adyen-Bwewy3HC.mjs +172 -0
  28. package/dist/adyen-R6aSZ0Yf.js +1 -0
  29. package/dist/adyen-mQEEOjgl.js +1 -0
  30. package/dist/adyen.css +1 -0
  31. package/dist/component-BOqPDAVk.js +1 -0
  32. package/dist/component-Djrf1L-Z.mjs +889 -0
  33. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  34. package/dist/components/BillingInformation/BillingInformation.es.js +8 -9
  35. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  36. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +14 -18
  37. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  38. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +10 -10
  39. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  40. package/dist/components/Invoice/Invoice.es.js +70 -2673
  41. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  42. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +10 -10
  43. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  44. package/dist/components/InvoicesList/InvoicesList.es.js +7 -8
  45. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  46. package/dist/components/PaymentHistory/PaymentHistory.es.js +10 -10
  47. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  48. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +16 -38
  49. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  50. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +17 -4826
  51. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  52. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +11 -11
  53. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  54. package/dist/components/WalletBalances/WalletBalances.es.js +9 -9
  55. package/dist/core/index.cjs.js +1 -1
  56. package/dist/core/index.d.ts +1 -0
  57. package/dist/core/index.es.js +1 -1
  58. package/dist/core/types.d.ts +6 -2
  59. package/dist/{customer-CJrpbGX4.mjs → customer-B31QzznT.mjs} +1 -1
  60. package/dist/{customer-CcQR-JIm.js → customer-hDxW1Dbp.js} +1 -1
  61. package/dist/en-US-CgPY97Vq.js +1 -0
  62. package/dist/en-US-N3CUCsVy.mjs +179 -0
  63. package/dist/index-CzL1ZcGi.mjs +85 -0
  64. package/dist/index-DIFK3mcJ.js +6 -0
  65. package/dist/index-DRdBmZ2-.js +1 -0
  66. package/dist/index-DyvRdSR7.mjs +9673 -0
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.es.js +4 -1
  70. package/dist/{invoices-CNK1Ushv.mjs → invoices-DIYPN2j_.mjs} +2 -15
  71. package/dist/invoices-DzkA1jDc.js +1 -0
  72. package/dist/nl-NL-B8U9b85I.mjs +197 -0
  73. package/dist/nl-NL-qMRaTRrM.js +1 -0
  74. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-67b3UlTZ.mjs} +2 -2
  75. package/dist/paymentMethods-C_sdTkSF.js +1 -0
  76. package/dist/{payments-CLt0SExf.js → payments-DkHhTHto.js} +1 -1
  77. package/dist/{payments-CE9U7aKK.mjs → payments-Dq6R37Fz.mjs} +1 -1
  78. package/dist/registry-BkViv4tv.js +1 -0
  79. package/dist/{registry-B99ZnfEn.mjs → registry-Df_26rJy.mjs} +6 -4
  80. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  81. package/dist/screens/Checkout/Checkout.es.js +632 -2538
  82. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  83. package/dist/screens/CustomerOverview/CustomerOverview.es.js +23 -17
  84. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  85. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  86. package/dist/screens/PayInvoice/PayInvoice.es.js +458 -0
  87. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  88. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +147 -99
  89. package/dist/solvimon-web.css +1 -1
  90. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-ClGIr_aS.mjs} +2 -2
  91. package/dist/subscriptions-jelITJcX.js +1 -0
  92. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-BC57-Ufn.mjs} +1 -1
  93. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-rw9kWeE0.js} +1 -1
  94. package/dist/{useCustomer--jycAz--.mjs → useCustomer-Ba9WRtuT.mjs} +2 -2
  95. package/dist/{useCustomer-PthyTFLl.js → useCustomer-CUcaeQn_.js} +1 -1
  96. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-Cnzh2mAz.mjs} +3 -8
  97. package/dist/useIncrementalLoading-DoTTXM2Y.js +1 -0
  98. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-BJwwDur7.mjs} +6 -12
  99. package/dist/useInvoiceData-D2jkdmlA.js +1 -0
  100. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-CFzAxyae.mjs} +34 -267
  101. package/dist/useInvoicesList-CaBCGs4h.js +1 -0
  102. package/dist/{useLoadInitialData-Dm48tlSO.mjs → useLoadInitialData-5sgImpzc.mjs} +5 -0
  103. package/dist/useLoadInitialData-DjwRHcAH.js +1 -0
  104. package/dist/usePaymentMethodOptions-C2k4npCQ.mjs +26 -0
  105. package/dist/usePaymentMethodOptions-DYO6xr3-.js +1 -0
  106. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-CRWbH48K.mjs} +2 -2
  107. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-ryN_YohI.js} +1 -1
  108. package/dist/usePayments-Cw5PPEJa.mjs +36 -0
  109. package/dist/usePayments-DWXPGFvp.js +1 -0
  110. package/dist/usePortal-CxX4nrE4.js +1 -0
  111. package/dist/usePortal-cmE08vYs.mjs +12 -0
  112. package/dist/useService-Bb9r_sOQ.js +1 -0
  113. package/dist/useService-BsSEI8DZ.mjs +53 -0
  114. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  115. package/dist/useViewport-CKRY1CKR.js +1 -0
  116. package/dist/useWalletBalanceItems-CkDqmk36.mjs +109 -0
  117. package/dist/useWalletBalanceItems-CpZ1NWPr.js +1 -0
  118. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  119. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  120. package/dist/vendor-ui-5pJF5KBP.js +1 -0
  121. package/dist/vendor-ui-C0K3osvz.mjs +27645 -0
  122. package/package.json +20 -12
  123. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  124. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  125. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  126. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  127. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  128. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  129. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  130. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  131. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  132. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  133. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  134. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  135. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  136. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  137. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  138. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  139. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  140. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  141. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  142. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  143. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  144. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  145. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  146. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  147. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  148. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  149. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  150. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  151. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  152. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  153. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  154. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  155. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  156. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  157. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  158. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  159. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  160. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D1Xzfc70.js +0 -1
  161. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  162. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  163. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  164. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  165. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  166. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  167. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  168. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  169. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  170. package/dist/adyen-51SvcyqV.mjs +0 -4
  171. package/dist/adyen-DZsyEXkw.js +0 -1
  172. package/dist/api.es-B4qAAJKr.js +0 -1
  173. package/dist/api.es-UkfpLiLL.mjs +0 -83
  174. package/dist/auto-DzZuCneB.mjs +0 -14387
  175. package/dist/auto-PpnAChnH.js +0 -6
  176. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  177. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  178. package/dist/cn.es-C7xoIs3C.js +0 -1
  179. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  180. package/dist/component-ZRZIt3ZW.js +0 -1
  181. package/dist/component-dpA83LIN.mjs +0 -6569
  182. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  183. package/dist/countryData.es-D3MFzU92.js +0 -1
  184. package/dist/customer.es-D42Md24r.js +0 -1
  185. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  186. package/dist/formatting.es-9hM8aHSg.js +0 -1
  187. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  188. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  189. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  190. package/dist/index-2jo9BSPM.js +0 -1
  191. package/dist/index-BFZ0dPh9.mjs +0 -179
  192. package/dist/index-CI71bVGE.mjs +0 -2521
  193. package/dist/index-CWSXne1Q.js +0 -1
  194. package/dist/index-D3v7hAtc.mjs +0 -253
  195. package/dist/index-WLSPwi90.js +0 -1
  196. package/dist/index.es-BBJF2O2l.js +0 -1
  197. package/dist/index.es-LCAKs4tH.mjs +0 -438
  198. package/dist/invoices-3kVHsAXr.js +0 -1
  199. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  200. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  201. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  202. package/dist/pick.es-BgDAfhAl.js +0 -1
  203. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  204. package/dist/registry-ClZ43bQn.js +0 -1
  205. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  206. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  207. package/dist/subscriptions-CS8HTxzC.js +0 -1
  208. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  209. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  210. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  211. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  212. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  213. package/dist/useLoadInitialData-BRg7IWqW.js +0 -1
  214. package/dist/useService-B67YWAcN.js +0 -1
  215. package/dist/useService-DG_zedHV.mjs +0 -282
  216. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  217. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1,759 +0,0 @@
1
- import { a as useIntl, _ as _sfc_main$9 } from "./component-dpA83LIN.mjs";
2
- import { i as isEqual, u as uniqueId, g as getRootTestId, _ as _sfc_main$6, a as _sfc_main$7 } from "./IconButton.vue.es-DNCwwH_j.mjs";
3
- import { a as formatAmount } from "./formatting.es-D5H_ySFv.mjs";
4
- import { computed, defineComponent, openBlock, createBlock, Transition, withCtx, renderSlot, ref, onMounted, watch, createElementBlock, useModel, useTemplateRef, toRefs, nextTick, Fragment, createElementVNode, mergeProps, unref, createSlots, createTextVNode, toDisplayString, createCommentVNode, normalizeClass, withDirectives, vModelText, createVNode, mergeModels } from "vue";
5
- import { _ as _sfc_main$8 } from "./FormMessage.vue.es-DFQXxiSC.mjs";
6
- import { i as isEmpty } from "./isEmpty.es-Bp1SbWFu.mjs";
7
- import { _ as _sfc_main$a } from "./Chip.vue.es-DcW2CjUA.mjs";
8
- function useTimePeriod() {
9
- const { $t } = useIntl();
10
- const map = computed(() => ({
11
- DAY: {
12
- literal: {
13
- singular: $t({
14
- defaultMessage: "day",
15
- id: "time_period.day.singular",
16
- description: "The singular form of the day time period"
17
- }),
18
- plural: $t({
19
- defaultMessage: "days",
20
- id: "time_period.day.plural",
21
- description: "The plural form of the day time period"
22
- })
23
- },
24
- full: $t({
25
- defaultMessage: "daily",
26
- id: "time_period.day.full",
27
- description: "The full form of the day time period"
28
- })
29
- },
30
- WEEK: {
31
- literal: {
32
- singular: $t({
33
- defaultMessage: "week",
34
- id: "time_period.week.singular",
35
- description: "The singular form of the week time period"
36
- }),
37
- plural: $t({
38
- defaultMessage: "weeks",
39
- id: "time_period.week.plural",
40
- description: "The plural form of the week time period"
41
- })
42
- },
43
- full: $t({
44
- defaultMessage: "weekly",
45
- id: "time_period.week.full",
46
- description: "The full form of the week time period"
47
- })
48
- },
49
- MONTH: {
50
- literal: {
51
- singular: $t({
52
- defaultMessage: "month",
53
- id: "time_period.month.singular",
54
- description: "The singular form of the month time period"
55
- }),
56
- plural: $t({
57
- defaultMessage: "months",
58
- id: "time_period.month.plural",
59
- description: "The plural form of the month time period"
60
- })
61
- },
62
- full: $t({
63
- defaultMessage: "monthly",
64
- id: "time_period.month.full",
65
- description: "The full form of the month time period"
66
- })
67
- },
68
- YEAR: {
69
- literal: {
70
- singular: $t({
71
- defaultMessage: "year",
72
- id: "time_period.year.singular",
73
- description: "The singular form of the year time period"
74
- }),
75
- plural: $t({
76
- defaultMessage: "years",
77
- id: "time_period.year.plural",
78
- description: "The plural form of the year time period"
79
- })
80
- },
81
- full: $t({
82
- defaultMessage: "yearly",
83
- id: "time_period.year.full",
84
- description: "The full form of the year time period"
85
- })
86
- }
87
- }));
88
- const formatTimePeriodLiteral = (timePeriodType, options = { singular: false }) => {
89
- return map.value[timePeriodType].literal[options.singular ? "singular" : "plural"];
90
- };
91
- const formatTimePeriod = (timePeriod, options = {
92
- short: false,
93
- hideValueForExactPeriods: false,
94
- singular: false
95
- }) => {
96
- const billingValue = timePeriod.value ?? 1;
97
- const billingType = map.value[timePeriod.type].literal[options.singular || +billingValue === 1 ? "singular" : "plural"].toLowerCase();
98
- return `${options.prefix && !options.short ? `${options.prefix} ` : ""}${options.hideValueForExactPeriods && billingValue === 1 ? billingType : `${billingValue} ${billingType}`}`;
99
- };
100
- return { map, formatTimePeriod, formatTimePeriodLiteral };
101
- }
102
- function getConfigFromPricingItem({
103
- pricingItem,
104
- currency,
105
- billingPeriod
106
- }) {
107
- var _a, _b, _c, _d, _e, _f;
108
- if ((_a = pricingItem.pricing_currency_configs) == null ? void 0 : _a.length) {
109
- const currencyConfig = getCurrencyConfigByCurrency(
110
- pricingItem.pricing_currency_configs,
111
- currency
112
- );
113
- if (((_b = currencyConfig == null ? void 0 : currencyConfig.billing_period_configs) == null ? void 0 : _b.length) && billingPeriod) {
114
- const billingPeriodConfig = getConfigFromPricingItemBillingPeriodConfigs(
115
- currencyConfig.billing_period_configs,
116
- billingPeriod
117
- );
118
- if (billingPeriodConfig) {
119
- return billingPeriodConfig;
120
- }
121
- }
122
- if (currencyConfig) {
123
- const fallbackCurrency = currencyConfig.fallback_currency;
124
- if (fallbackCurrency) {
125
- const fallbackCurrencyConfig = getConfigFromPricingItemCurrencyConfigs(
126
- pricingItem.pricing_currency_configs,
127
- fallbackCurrency
128
- );
129
- if (fallbackCurrencyConfig) {
130
- return fallbackCurrencyConfig;
131
- }
132
- }
133
- if ((_c = currencyConfig.configs) == null ? void 0 : _c.length) {
134
- return currencyConfig.configs[0];
135
- }
136
- }
137
- }
138
- if ((_d = pricingItem.billing_period_configs) == null ? void 0 : _d.length) {
139
- const billingPeriodConfig = getConfigFromPricingItemBillingPeriodConfigs(
140
- pricingItem.billing_period_configs,
141
- billingPeriod
142
- );
143
- if (billingPeriodConfig) {
144
- return billingPeriodConfig;
145
- }
146
- }
147
- if ((_e = pricingItem.configs) == null ? void 0 : _e.length) {
148
- return (_f = pricingItem.configs) == null ? void 0 : _f[0];
149
- }
150
- return void 0;
151
- }
152
- const getCurrencyConfigByCurrency = (pricingCurrencyConfigs, currency) => {
153
- return pricingCurrencyConfigs.find((config) => config.currency === currency);
154
- };
155
- const getConfigFromPricingItemCurrencyConfigs = (pricingCurrencyConfigs, currency) => {
156
- var _a, _b;
157
- return (_b = (_a = pricingCurrencyConfigs.find((config) => config.currency === currency)) == null ? void 0 : _a.configs) == null ? void 0 : _b[0];
158
- };
159
- const getConfigFromPricingItemBillingPeriodConfigs = (billingPeriodConfigs, billingPeriod) => {
160
- var _a, _b;
161
- return (_b = (_a = billingPeriodConfigs.find((config) => isEqual(config.billing_period, billingPeriod))) == null ? void 0 : _a.configs) == null ? void 0 : _b[0];
162
- };
163
- function usePricingItem({
164
- currency,
165
- billingPeriod
166
- } = {}) {
167
- const { $t } = useIntl();
168
- const { formatTimePeriod } = useTimePeriod();
169
- const renderPricingForPricingItem = ({ pricingItem }) => {
170
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
171
- const productItem = (_a = pricingItem.product_items) == null ? void 0 : _a[0];
172
- const config = getConfigFromPricingItem({
173
- pricingItem,
174
- currency: currency == null ? void 0 : currency.value,
175
- billingPeriod: billingPeriod == null ? void 0 : billingPeriod.value
176
- });
177
- if (!config) {
178
- return $t({
179
- defaultMessage: "Unsupported pricing",
180
- id: "pricing_item_pricing.unsupported_pricing_error",
181
- description: "Text displayed when the pricing item pricing is unsupported"
182
- });
183
- }
184
- if ((productItem == null ? void 0 : productItem.model_type) === "PER_SEAT") {
185
- return $t({
186
- defaultMessage: "Per seat",
187
- id: "pricing_item_pricing.per_seat",
188
- description: "The pricing item pricing for a per seat pricing item"
189
- });
190
- }
191
- if ((productItem == null ? void 0 : productItem.model_type) === "ONE_OFF" && ((_c = (_b = config.bands) == null ? void 0 : _b[0]) == null ? void 0 : _c.fixed_amount)) {
192
- return formatAmount((_e = (_d = config.bands) == null ? void 0 : _d[0]) == null ? void 0 : _e.fixed_amount);
193
- }
194
- if (config.type === "FLAT" && ((_g = (_f = config.bands) == null ? void 0 : _f[0]) == null ? void 0 : _g.amount)) {
195
- return $t(
196
- {
197
- defaultMessage: "{pricing} per {billing_period}",
198
- id: "pricing_item_pricing",
199
- description: "The pricing item pricing"
200
- },
201
- {
202
- pricing: formatAmount(config.bands[0].amount),
203
- billing_period: formatTimePeriod(
204
- (config == null ? void 0 : config.billing_period) ?? { type: "MONTH", value: 1 },
205
- {
206
- short: true,
207
- hideValueForExactPeriods: true
208
- }
209
- )
210
- }
211
- );
212
- }
213
- if (config.type === "FIXED" && ((_i = (_h = config.bands) == null ? void 0 : _h[0]) == null ? void 0 : _i.fixed_amount)) {
214
- return $t(
215
- {
216
- defaultMessage: "{pricing} per {billing_period}",
217
- id: "pricing_item_pricing",
218
- description: "The pricing item pricing"
219
- },
220
- {
221
- pricing: formatAmount((_k = (_j = config.bands) == null ? void 0 : _j[0]) == null ? void 0 : _k.fixed_amount),
222
- billing_period: formatTimePeriod(
223
- (config == null ? void 0 : config.billing_period) ?? { type: "MONTH", value: 1 },
224
- {
225
- short: true,
226
- hideValueForExactPeriods: true
227
- }
228
- )
229
- }
230
- );
231
- }
232
- if (config.type === "TIERED") {
233
- return $t({
234
- defaultMessage: "Tiered pricing",
235
- id: "pricing_item_pricing.tiered",
236
- description: "The pricing item pricing for a tiered pricing item"
237
- });
238
- }
239
- if (config.type === "TOP_TIERED") {
240
- return $t({
241
- defaultMessage: "Top tiered pricing",
242
- id: "pricing_item_pricing.top_tiered",
243
- description: "The pricing item pricing for a top tiered pricing item"
244
- });
245
- }
246
- if (config.type === "STAIR_STEP") {
247
- return $t({
248
- defaultMessage: "Stair step pricing",
249
- id: "pricing_item_pricing.stair_step",
250
- description: "The pricing item pricing for a stair step pricing item"
251
- });
252
- }
253
- if (config.type === "PASS_THROUGH") {
254
- return $t({
255
- defaultMessage: "Pass through pricing",
256
- id: "pricing_item_pricing.pass_through",
257
- description: "The pricing item pricing for a pass through pricing item"
258
- });
259
- }
260
- if (config.type === "NONE") {
261
- return $t({
262
- defaultMessage: "Not billed",
263
- id: "pricing_item_pricing.none",
264
- description: "The pricing item pricing for a not billed pricing item"
265
- });
266
- }
267
- if (config.type === "FLAT_TOP_UP") {
268
- return $t({
269
- defaultMessage: "Flat top up pricing",
270
- id: "pricing_item_pricing.flat_top_up",
271
- description: "The pricing item pricing for a flat top up pricing item"
272
- });
273
- }
274
- if (config.type === "TIERED_TOP_UP") {
275
- return $t({
276
- defaultMessage: "Tiered top up pricing",
277
- id: "pricing_item_pricing.tiered_top_up",
278
- description: "The pricing item pricing for a tiered top up pricing item"
279
- });
280
- }
281
- return $t({
282
- defaultMessage: "Unsupported pricing",
283
- id: "pricing_item_pricing.unsupported_pricing_error",
284
- description: "Text displayed when the pricing item pricing is unsupported"
285
- });
286
- };
287
- return { renderPricingForPricingItem };
288
- }
289
- const convertDateRangeToTimePeriod = (startDate, endDate) => {
290
- const start = new Date(startDate);
291
- const end = new Date(endDate);
292
- const yearDiff = end.getFullYear() - start.getFullYear();
293
- const testYearDate = new Date(start);
294
- testYearDate.setFullYear(testYearDate.getFullYear() + yearDiff);
295
- if (yearDiff > 0 && testYearDate.getTime() === end.getTime()) {
296
- return { type: "YEAR", value: yearDiff };
297
- }
298
- const monthDiff = (end.getFullYear() - start.getFullYear()) * 12 + (end.getMonth() - start.getMonth());
299
- const testMonthDate = new Date(start);
300
- testMonthDate.setMonth(testMonthDate.getMonth() + monthDiff);
301
- if (monthDiff > 0 && testMonthDate.getTime() === end.getTime()) {
302
- return { type: "MONTH", value: monthDiff };
303
- }
304
- const dayDiff = Math.round((end.getTime() - start.getTime()) / (1e3 * 60 * 60 * 24));
305
- if (dayDiff > 0 && dayDiff % 7 === 0) {
306
- return { type: "WEEK", value: dayDiff / 7 };
307
- }
308
- return { type: "DAY", value: dayDiff };
309
- };
310
- const MARKER = "data-expand-transition-style";
311
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
312
- __name: "Expand",
313
- setup(__props) {
314
- const injectStylesIfNeeded = (element) => {
315
- const root = element.getRootNode();
316
- if (root instanceof ShadowRoot) {
317
- const existing = root.querySelector(`style[${MARKER}]`);
318
- if (existing) return;
319
- const style = document.createElement("style");
320
- style.setAttribute(MARKER, "true");
321
- style.textContent = `
322
- .expand-enter-active,
323
- .expand-leave-active {
324
- transition: height 300ms ease-in-out;
325
- overflow: hidden;
326
- }
327
-
328
- .expand-enter,
329
- .expand-leave-to {
330
- height: 0;
331
- }
332
- `;
333
- root.appendChild(style);
334
- }
335
- };
336
- const handleEnter = (element) => {
337
- injectStylesIfNeeded(element);
338
- const htmlElement = element;
339
- const width = getComputedStyle(htmlElement).width;
340
- htmlElement.style.width = width;
341
- htmlElement.style.position = "absolute";
342
- htmlElement.style.visibility = "hidden";
343
- htmlElement.style.height = "auto";
344
- const height = getComputedStyle(htmlElement).height;
345
- htmlElement.style.width = "";
346
- htmlElement.style.position = "";
347
- htmlElement.style.visibility = "";
348
- htmlElement.style.height = "0";
349
- requestAnimationFrame(() => {
350
- htmlElement.style.height = height;
351
- });
352
- };
353
- const handleAfterEnter = (element) => {
354
- const htmlElement = element;
355
- htmlElement.style.height = "auto";
356
- };
357
- const handleLeave = (element) => {
358
- injectStylesIfNeeded(element);
359
- const htmlElement = element;
360
- const height = getComputedStyle(htmlElement).height;
361
- htmlElement.style.height = height;
362
- requestAnimationFrame(() => {
363
- htmlElement.style.height = "0";
364
- });
365
- };
366
- return (_ctx, _cache) => {
367
- return openBlock(), createBlock(Transition, {
368
- name: "expand",
369
- onEnter: handleEnter,
370
- onLeave: handleLeave,
371
- onAfterEnter: handleAfterEnter
372
- }, {
373
- default: withCtx(() => [
374
- renderSlot(_ctx.$slots, "default")
375
- ]),
376
- _: 3
377
- });
378
- };
379
- }
380
- });
381
- const rangeDefaultClasses = "w-full appearance-none cursor-pointer";
382
- const rangeSizeClasses = {
383
- sm: "range-sm",
384
- md: "range-md",
385
- lg: "range-lg",
386
- xl: "range-xl"
387
- };
388
- function useRangeClasses(props) {
389
- const rangeClasses = computed(
390
- () => `${rangeDefaultClasses} ${rangeSizeClasses[props.size.value]}`
391
- );
392
- return { rangeClasses };
393
- }
394
- const rangeInputStyles = "/* Base - transparent background so track styles show through */\ninput[type='range'] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n width: 100%;\n background: transparent;\n margin: 0.5rem 0;\n}\n\n/* Thumb - white with explicit border (required for Firefox) */\ninput[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 1rem;\n height: 1rem;\n border: 2px solid rgb(229 231 235);\n border-radius: 50%;\n background: #ffffff;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);\n cursor: pointer;\n transition: all 0.1s ease-in-out;\n}\n\ninput[type='range']:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n}\n\ninput[type='range']::-moz-range-thumb {\n -moz-appearance: none;\n appearance: none;\n width: 1rem;\n height: 1rem;\n border: 2px solid rgb(229 231 235);\n border-radius: 50%;\n background: #ffffff;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);\n cursor: pointer;\n transition: all 0.1s ease-in-out;\n}\n\ninput[type='range']:disabled::-moz-range-thumb {\n cursor: not-allowed;\n}\n\ninput[type='range']:not(:disabled):hover::-webkit-slider-thumb {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-primary-200) 50%, transparent);\n}\n\ninput[type='range']:not(:disabled):hover::-moz-range-thumb {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-primary-200) 50%, transparent);\n}\n\ninput[type='range']:not(:disabled):active::-webkit-slider-thumb {\n box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary-200) 50%, transparent);\n}\n\ninput[type='range']:not(:disabled):active::-moz-range-thumb {\n box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary-200) 50%, transparent);\n}\n\n/* Track - WebKit */\ninput[type='range']::-webkit-slider-runnable-track {\n width: 100%;\n height: 0.5rem;\n cursor: pointer;\n background: linear-gradient(\n to right,\n var(--color-primary-600) var(--range-percentage, 0%),\n #e0e5eb var(--range-percentage, 0%)\n );\n border-radius: 0.25rem;\n}\n\ninput[type='range']:disabled::-webkit-slider-runnable-track {\n background: #e0e5eb;\n cursor: not-allowed;\n}\n\n/* Track - Mozilla */\ninput[type='range']::-moz-range-track {\n width: 100%;\n height: 0.5rem;\n cursor: pointer;\n background: linear-gradient(\n to right,\n var(--color-primary-600) var(--range-percentage, 0%),\n #e0e5eb var(--range-percentage, 0%)\n );\n border-radius: 0.25rem;\n}\n\ninput[type='range']:disabled::-moz-range-track {\n background: #e0e5eb;\n cursor: not-allowed;\n}\n\n/* Size: sm */\ninput[type='range'].range-sm::-webkit-slider-thumb {\n width: 0.8rem;\n height: 0.8rem;\n margin-top: -0.2rem;\n}\n\ninput[type='range'].range-sm::-moz-range-thumb {\n width: 0.8rem;\n height: 0.8rem;\n}\n\ninput[type='range'].range-sm::-webkit-slider-runnable-track {\n height: 0.4rem;\n border-radius: 0.2rem;\n}\n\ninput[type='range'].range-sm::-moz-range-track {\n height: 0.4rem;\n border-radius: 0.2rem;\n}\n\n/* Size: md */\ninput[type='range'].range-md::-webkit-slider-thumb {\n width: 1rem;\n height: 1rem;\n margin-top: -0.25rem;\n}\n\ninput[type='range'].range-md::-moz-range-thumb {\n width: 1rem;\n height: 1rem;\n}\n\ninput[type='range'].range-md::-webkit-slider-runnable-track {\n height: 0.5rem;\n border-radius: 0.25rem;\n}\n\ninput[type='range'].range-md::-moz-range-track {\n height: 0.5rem;\n border-radius: 0.25rem;\n}\n\n/* Size: lg */\ninput[type='range'].range-lg::-webkit-slider-thumb {\n width: 1.4rem;\n height: 1.4rem;\n margin-top: -0.35rem;\n}\n\ninput[type='range'].range-lg::-moz-range-thumb {\n width: 1.4rem;\n height: 1.4rem;\n}\n\ninput[type='range'].range-lg::-webkit-slider-runnable-track {\n height: 0.7rem;\n border-radius: 0.35rem;\n}\n\ninput[type='range'].range-lg::-moz-range-track {\n height: 0.7rem;\n border-radius: 0.35rem;\n}\n\n/* Size: xl */\ninput[type='range'].range-xl::-webkit-slider-thumb {\n width: 1.8rem;\n height: 1.8rem;\n margin-top: -0.5rem;\n}\n\ninput[type='range'].range-xl::-moz-range-thumb {\n width: 1.8rem;\n height: 1.8rem;\n}\n\ninput[type='range'].range-xl::-webkit-slider-runnable-track {\n height: 0.9rem;\n border-radius: 0.45rem;\n}\n\ninput[type='range'].range-xl::-moz-range-track {\n height: 0.9rem;\n border-radius: 0.45rem;\n}\n";
395
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
396
- __name: "CustomStyles",
397
- props: {
398
- css: {},
399
- marker: {}
400
- },
401
- setup(__props) {
402
- const props = __props;
403
- const containerRef = ref();
404
- function injectStyles(css) {
405
- if (!css || !containerRef.value) return;
406
- const root = containerRef.value.getRootNode();
407
- if (!(root instanceof ShadowRoot)) {
408
- return;
409
- }
410
- const existing = root.querySelector(`style[${props.marker}]`);
411
- if (existing) return;
412
- const style = document.createElement("style");
413
- style.setAttribute(props.marker, "true");
414
- style.textContent = css;
415
- root.appendChild(style);
416
- }
417
- onMounted(() => {
418
- if (props.css) injectStyles(props.css);
419
- });
420
- watch(
421
- () => props.css,
422
- (css) => {
423
- if (!css || !containerRef.value) return;
424
- const root = containerRef.value.getRootNode();
425
- if (!(root instanceof ShadowRoot)) return;
426
- const style = root.querySelector(`style[${props.marker}]`);
427
- if (style) style.textContent = css;
428
- else injectStyles(css);
429
- }
430
- );
431
- return (_ctx, _cache) => {
432
- return openBlock(), createElementBlock("div", {
433
- ref_key: "containerRef",
434
- ref: containerRef
435
- }, [
436
- renderSlot(_ctx.$slots, "default")
437
- ], 512);
438
- };
439
- }
440
- });
441
- const _hoisted_1 = ["data-testid"];
442
- const _hoisted_2 = ["step", "min", "max", "name", "disabled"];
443
- const _hoisted_3 = {
444
- key: 0,
445
- class: "mt-2 text-sm text-gray-500"
446
- };
447
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
448
- __name: "RangeInput",
449
- props: /* @__PURE__ */ mergeModels({
450
- disabled: { type: Boolean, default: false },
451
- label: { default: void 0 },
452
- labelAfter: { type: Boolean, default: false },
453
- max: { default: 100 },
454
- min: { default: 0 },
455
- name: {},
456
- required: { type: Boolean, default: false },
457
- rootClass: { default: "" },
458
- size: { default: "md" },
459
- steps: { default: 1 },
460
- variant: { default: "default" },
461
- error: {},
462
- inputWrapperClass: {}
463
- }, {
464
- "modelValue": { required: true },
465
- "modelModifiers": {}
466
- }),
467
- emits: ["update:modelValue"],
468
- setup(__props) {
469
- const props = __props;
470
- const model = useModel(__props, "modelValue");
471
- const inputRef = useTemplateRef("inputRef");
472
- function setRangeBackground() {
473
- const el = inputRef.value;
474
- if (!el) return;
475
- const value = model.value ?? props.min;
476
- const percentage = (Number(value) - props.min) / (props.max - props.min) * 100;
477
- el.style.setProperty("--range-percentage", `${percentage}%`);
478
- }
479
- const { rangeClasses } = useRangeClasses(toRefs(props));
480
- const stepButtonSize = computed(() => {
481
- switch (props.size) {
482
- case "xl":
483
- return "lg";
484
- case "lg":
485
- return "md";
486
- case "md":
487
- return "sm";
488
- default:
489
- return props.size;
490
- }
491
- });
492
- const name = props.name ?? uniqueId("range-input-");
493
- const onPrevious = computed(
494
- () => model.value != null && model.value > props.min ? () => {
495
- model.value = (model.value ?? 0) - props.steps;
496
- } : void 0
497
- );
498
- const onNext = computed(
499
- () => model.value != null && model.value < props.max ? () => {
500
- model.value = (model.value ?? 0) + props.steps;
501
- } : void 0
502
- );
503
- const showStepButtons = computed(
504
- () => ["stepped", "stepped-contained", "stepped-ghost"].includes(props.variant)
505
- );
506
- const isContained = computed(() => props.variant === "stepped-contained");
507
- const buttonVariant = computed(
508
- () => isContained.value || props.variant === "stepped-ghost" ? "ghost" : "outline"
509
- );
510
- watch([model, inputRef], () => nextTick(setRangeBackground), { immediate: true });
511
- return (_ctx, _cache) => {
512
- return openBlock(), createElementBlock(Fragment, null, [
513
- createElementVNode("div", mergeProps(_ctx.$attrs, {
514
- class: ["flex flex-col gap-2", { rootClass: __props.rootClass, "flex-col-reverse": __props.labelAfter }],
515
- "data-testid": unref(getRootTestId)(unref(name))
516
- }), [
517
- __props.label ? (openBlock(), createBlock(_sfc_main$6, {
518
- key: 0,
519
- for: unref(name),
520
- required: __props.required
521
- }, createSlots({
522
- suffix: withCtx(() => [
523
- renderSlot(_ctx.$slots, "label-suffix")
524
- ]),
525
- default: withCtx(() => [
526
- createTextVNode(toDisplayString(__props.label) + " ", 1)
527
- ]),
528
- _: 2
529
- }, [
530
- _ctx.$slots.tooltip ? {
531
- name: "tooltip",
532
- fn: withCtx(() => [
533
- renderSlot(_ctx.$slots, "tooltip")
534
- ]),
535
- key: "0"
536
- } : void 0
537
- ]), 1032, ["for", "required"])) : createCommentVNode("", true),
538
- createElementVNode("div", {
539
- class: normalizeClass({ flex: showStepButtons.value, "border rounded bg-white": isContained.value })
540
- }, [
541
- showStepButtons.value ? (openBlock(), createBlock(unref(_sfc_main$7), {
542
- key: 0,
543
- size: stepButtonSize.value,
544
- variant: buttonVariant.value,
545
- icon: "remove",
546
- square: "",
547
- color: "gray",
548
- disabled: !onPrevious.value || __props.disabled,
549
- onMousedown: _cache[0] || (_cache[0] = ($event) => {
550
- var _a;
551
- return (_a = onPrevious.value) == null ? void 0 : _a.call(onPrevious);
552
- })
553
- }, null, 8, ["size", "variant", "disabled"])) : createCommentVNode("", true),
554
- createElementVNode("div", {
555
- class: normalizeClass([
556
- {
557
- "flex grow px-3 items-center": showStepButtons.value,
558
- "border-x": isContained.value
559
- },
560
- __props.inputWrapperClass
561
- ])
562
- }, [
563
- withDirectives(createElementVNode("input", {
564
- ref_key: "inputRef",
565
- ref: inputRef,
566
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => model.value = $event),
567
- step: __props.steps,
568
- min: __props.min,
569
- max: __props.max,
570
- name: unref(name),
571
- disabled: __props.disabled,
572
- type: "range",
573
- class: normalizeClass(unref(rangeClasses)),
574
- onInput: setRangeBackground
575
- }, null, 42, _hoisted_2), [
576
- [vModelText, model.value]
577
- ])
578
- ], 2),
579
- showStepButtons.value ? (openBlock(), createBlock(unref(_sfc_main$7), {
580
- key: 1,
581
- size: stepButtonSize.value,
582
- variant: buttonVariant.value,
583
- icon: "add",
584
- square: "",
585
- color: "gray",
586
- disabled: !onNext.value || __props.disabled,
587
- onMousedown: _cache[2] || (_cache[2] = ($event) => {
588
- var _a;
589
- return (_a = onNext.value) == null ? void 0 : _a.call(onNext);
590
- })
591
- }, null, 8, ["size", "variant", "disabled"])) : createCommentVNode("", true)
592
- ], 2)
593
- ], 16, _hoisted_1),
594
- createVNode(_sfc_main$4, {
595
- marker: "range-input-styles",
596
- css: unref(rangeInputStyles)
597
- }, null, 8, ["css"]),
598
- !unref(isEmpty)(__props.error) || _ctx.$slots.helper ? (openBlock(), createElementBlock("div", _hoisted_3, [
599
- !unref(isEmpty)(__props.error) ? (openBlock(), createBlock(_sfc_main$8, {
600
- key: 0,
601
- message: __props.error
602
- }, null, 8, ["message"])) : _ctx.$slots.helper ? renderSlot(_ctx.$slots, "helper", { key: 1 }) : createCommentVNode("", true)
603
- ])) : createCommentVNode("", true)
604
- ], 64);
605
- };
606
- }
607
- });
608
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
609
- __name: "RangeInputExtended",
610
- props: /* @__PURE__ */ mergeModels({
611
- options: { default: () => [] },
612
- label: {},
613
- name: {},
614
- required: { type: Boolean, default: false },
615
- rootClass: {},
616
- size: { default: "md" },
617
- variant: {},
618
- error: {},
619
- disabled: { type: Boolean },
620
- labelAfter: { type: Boolean },
621
- inputWrapperClass: {}
622
- }, {
623
- "modelValue": { required: true },
624
- "modelModifiers": {}
625
- }),
626
- emits: ["update:modelValue"],
627
- setup(__props) {
628
- const props = __props;
629
- const model = useModel(__props, "modelValue");
630
- const derivedModel = computed({
631
- get: () => {
632
- const index = model.value ? props.options.findIndex((option) => option === model.value) : 0;
633
- return index >= 0 ? index : 0;
634
- },
635
- set: (value) => {
636
- model.value = props.options[value];
637
- return props.options.findIndex((option) => option === model.value);
638
- }
639
- });
640
- const optionsCount = computed(() => props.options.length ?? 1);
641
- return (_ctx, _cache) => {
642
- return openBlock(), createBlock(_sfc_main$3, mergeProps({
643
- modelValue: derivedModel.value,
644
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => derivedModel.value = $event)
645
- }, _ctx.$attrs, {
646
- variant: __props.variant,
647
- "label-after": __props.labelAfter,
648
- min: 0,
649
- max: optionsCount.value - 1,
650
- steps: 1,
651
- label: __props.label,
652
- name: __props.name,
653
- required: __props.required,
654
- "root-class": __props.rootClass,
655
- size: __props.size,
656
- "input-wrapper-class": __props.inputWrapperClass
657
- }), {
658
- "label-suffix": withCtx(() => [
659
- renderSlot(_ctx.$slots, "label-suffix")
660
- ]),
661
- _: 3
662
- }, 16, ["modelValue", "variant", "label-after", "max", "label", "name", "required", "root-class", "size", "input-wrapper-class"]);
663
- };
664
- }
665
- });
666
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
667
- __name: "PricingGroupRangeInput",
668
- props: /* @__PURE__ */ mergeModels({
669
- modelValue: {},
670
- options: {},
671
- name: {},
672
- variant: { default: "stepped-contained" },
673
- size: {}
674
- }, {
675
- "modelValue": {},
676
- "modelModifiers": {}
677
- }),
678
- emits: ["update:modelValue"],
679
- setup(__props) {
680
- const props = __props;
681
- const model = useModel(__props, "modelValue");
682
- const label = computed(() => {
683
- var _a;
684
- return (_a = props.options.find((option) => option.value === model.value)) == null ? void 0 : _a.label;
685
- });
686
- const rangeOptions = computed(() => props.options.map((option) => option.value));
687
- const pricing = computed(
688
- () => {
689
- var _a;
690
- return (_a = props.options.find((option) => option.value === model.value)) == null ? void 0 : _a.description;
691
- }
692
- );
693
- return (_ctx, _cache) => {
694
- return openBlock(), createBlock(unref(_sfc_main$2), mergeProps({
695
- modelValue: model.value,
696
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event)
697
- }, _ctx.$attrs, {
698
- label: label.value,
699
- "label-after": "",
700
- variant: __props.variant,
701
- name: __props.name,
702
- options: rangeOptions.value,
703
- size: __props.size,
704
- "input-wrapper-class": "border-l border-r",
705
- required: ""
706
- }), {
707
- "label-suffix": withCtx(() => [
708
- createVNode(unref(_sfc_main$9), {
709
- tag: "span",
710
- variant: "body-xs",
711
- shade: "lighter"
712
- }, {
713
- default: withCtx(() => [
714
- createTextVNode(toDisplayString(pricing.value), 1)
715
- ]),
716
- _: 1
717
- })
718
- ]),
719
- _: 1
720
- }, 16, ["modelValue", "label", "variant", "name", "options", "size"]);
721
- };
722
- }
723
- });
724
- const _sfc_main = /* @__PURE__ */ defineComponent({
725
- __name: "TrialChip",
726
- props: {
727
- trialPeriod: {},
728
- size: { default: "sm" }
729
- },
730
- setup(__props) {
731
- const props = __props;
732
- const { formatTimePeriod } = useTimePeriod();
733
- const label = computed(() => {
734
- if (typeof props.trialPeriod === "string") {
735
- return props.trialPeriod;
736
- }
737
- return `${formatTimePeriod(props.trialPeriod, { short: true, singular: true })} trial`;
738
- });
739
- return (_ctx, _cache) => {
740
- return openBlock(), createBlock(unref(_sfc_main$a), {
741
- color: "primary",
742
- size: __props.size
743
- }, {
744
- default: withCtx(() => [
745
- createTextVNode(toDisplayString(label.value), 1)
746
- ]),
747
- _: 1
748
- }, 8, ["size"]);
749
- };
750
- }
751
- });
752
- export {
753
- _sfc_main$5 as _,
754
- _sfc_main as a,
755
- usePricingItem as b,
756
- convertDateRangeToTimePeriod as c,
757
- _sfc_main$1 as d,
758
- useTimePeriod as u
759
- };