@burdenoff/microfe-billing 2026.510.114

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 (636) hide show
  1. package/README.md +12 -0
  2. package/dist/billing/BillingAdminRoutes.d.ts +6 -0
  3. package/dist/billing/BillingAdminRoutes.d.ts.map +1 -0
  4. package/dist/billing/BillingAdminRoutes.js +359 -0
  5. package/dist/billing/BillingAdminRoutes.js.map +1 -0
  6. package/dist/billing/BillingRoot.d.ts +37 -0
  7. package/dist/billing/BillingRoot.d.ts.map +1 -0
  8. package/dist/billing/BillingRoot.js +190 -0
  9. package/dist/billing/BillingRoot.js.map +1 -0
  10. package/dist/billing/BillingUserRoutes.d.ts +7 -0
  11. package/dist/billing/BillingUserRoutes.d.ts.map +1 -0
  12. package/dist/billing/BillingUserRoutes.js +479 -0
  13. package/dist/billing/BillingUserRoutes.js.map +1 -0
  14. package/dist/billing/constants/permissions.d.ts +18 -0
  15. package/dist/billing/constants/permissions.d.ts.map +1 -0
  16. package/dist/billing/hooks/useBillingAccountSelection.d.ts +36 -0
  17. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +1 -0
  18. package/dist/billing/hooks/useBillingAccountSelection.js +81 -0
  19. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -0
  20. package/dist/billing/hooks/useBillingEventEmitter.d.ts +8 -0
  21. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +1 -0
  22. package/dist/billing/hooks/useBillingEventEmitter.js +15 -0
  23. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -0
  24. package/dist/billing/hooks/useBillingNavigate.d.ts +30 -0
  25. package/dist/billing/hooks/useBillingNavigate.d.ts.map +1 -0
  26. package/dist/billing/hooks/useBillingNavigate.js +23 -0
  27. package/dist/billing/hooks/useBillingNavigate.js.map +1 -0
  28. package/dist/billing/hooks/useBillingPermissions.d.ts +94 -0
  29. package/dist/billing/hooks/useBillingPermissions.d.ts.map +1 -0
  30. package/dist/billing/hooks/useBillingPermissions.js +78 -0
  31. package/dist/billing/hooks/useBillingPermissions.js.map +1 -0
  32. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +14 -0
  33. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +1 -0
  34. package/dist/billing/hooks/useDefaultBillingCurrency.js +23 -0
  35. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -0
  36. package/dist/billing/index.d.ts +31 -0
  37. package/dist/billing/index.d.ts.map +1 -0
  38. package/dist/billing/lib/native-purchases.d.ts +51 -0
  39. package/dist/billing/lib/native-purchases.d.ts.map +1 -0
  40. package/dist/billing/lib/native-purchases.js +44 -0
  41. package/dist/billing/lib/native-purchases.js.map +1 -0
  42. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +4 -0
  43. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +1 -0
  44. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +179 -0
  45. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -0
  46. package/dist/billing/modules/addons/components/index.d.ts +5 -0
  47. package/dist/billing/modules/addons/components/index.d.ts.map +1 -0
  48. package/dist/billing/modules/addons/hooks/index.d.ts +6 -0
  49. package/dist/billing/modules/addons/hooks/index.d.ts.map +1 -0
  50. package/dist/billing/modules/addons/hooks/index.js +1 -0
  51. package/dist/billing/modules/addons/hooks/useAddons.d.ts +55 -0
  52. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +1 -0
  53. package/dist/billing/modules/addons/hooks/useAddons.js +77 -0
  54. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -0
  55. package/dist/billing/modules/addons/index.d.ts +7 -0
  56. package/dist/billing/modules/addons/index.d.ts.map +1 -0
  57. package/dist/billing/modules/addons/index.js +10 -0
  58. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +4 -0
  59. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +1 -0
  60. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +266 -0
  61. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -0
  62. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +4 -0
  63. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +1 -0
  64. package/dist/billing/modules/addons/pages/AddonCreatePage.js +369 -0
  65. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -0
  66. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +4 -0
  67. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +1 -0
  68. package/dist/billing/modules/addons/pages/AddonDetailPage.js +280 -0
  69. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -0
  70. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +4 -0
  71. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +1 -0
  72. package/dist/billing/modules/addons/pages/AddonEditPage.js +396 -0
  73. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -0
  74. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +4 -0
  75. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +1 -0
  76. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +582 -0
  77. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -0
  78. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +4 -0
  79. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +1 -0
  80. package/dist/billing/modules/addons/pages/AddonsListPage.js +744 -0
  81. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -0
  82. package/dist/billing/modules/addons/pages/index.d.ts +11 -0
  83. package/dist/billing/modules/addons/pages/index.d.ts.map +1 -0
  84. package/dist/billing/modules/addons/pages/index.js +6 -0
  85. package/dist/billing/modules/addons/store/addonCartStore.d.ts +38 -0
  86. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +1 -0
  87. package/dist/billing/modules/addons/store/addonCartStore.js +74 -0
  88. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -0
  89. package/dist/billing/modules/affiliate/api.d.ts +101 -0
  90. package/dist/billing/modules/affiliate/api.d.ts.map +1 -0
  91. package/dist/billing/modules/affiliate/api.js +38 -0
  92. package/dist/billing/modules/affiliate/api.js.map +1 -0
  93. package/dist/billing/modules/affiliate/index.d.ts +2 -0
  94. package/dist/billing/modules/affiliate/index.d.ts.map +1 -0
  95. package/dist/billing/modules/affiliate/index.js +2 -0
  96. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +4 -0
  97. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +1 -0
  98. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +464 -0
  99. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -0
  100. package/dist/billing/modules/analytics/index.d.ts +5 -0
  101. package/dist/billing/modules/analytics/index.d.ts.map +1 -0
  102. package/dist/billing/modules/analytics/index.js +3 -0
  103. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +4 -0
  104. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +1 -0
  105. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +469 -0
  106. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -0
  107. package/dist/billing/modules/analytics/pages/index.d.ts +5 -0
  108. package/dist/billing/modules/analytics/pages/index.d.ts.map +1 -0
  109. package/dist/billing/modules/analytics/pages/index.js +1 -0
  110. package/dist/billing/modules/billing/hooks/index.d.ts +10 -0
  111. package/dist/billing/modules/billing/hooks/index.d.ts.map +1 -0
  112. package/dist/billing/modules/billing/hooks/index.js +4 -0
  113. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +67 -0
  114. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +1 -0
  115. package/dist/billing/modules/billing/hooks/useInvoices.js +87 -0
  116. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -0
  117. package/dist/billing/modules/billing/hooks/usePayments.d.ts +62 -0
  118. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +1 -0
  119. package/dist/billing/modules/billing/hooks/usePayments.js +3 -0
  120. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +191 -0
  121. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +1 -0
  122. package/dist/billing/modules/billing/hooks/useRefunds.js +162 -0
  123. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -0
  124. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +41 -0
  125. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +1 -0
  126. package/dist/billing/modules/billing/hooks/useTransactions.js +55 -0
  127. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -0
  128. package/dist/billing/modules/billing/index.d.ts +7 -0
  129. package/dist/billing/modules/billing/index.d.ts.map +1 -0
  130. package/dist/billing/modules/billing/index.js +11 -0
  131. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +4 -0
  132. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +1 -0
  133. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +631 -0
  134. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -0
  135. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +4 -0
  136. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +1 -0
  137. package/dist/billing/modules/billing/pages/InvoicesListPage.js +382 -0
  138. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -0
  139. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +4 -0
  140. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +1 -0
  141. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +147 -0
  142. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -0
  143. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +4 -0
  144. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +1 -0
  145. package/dist/billing/modules/billing/pages/RefundsPage.js +1074 -0
  146. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -0
  147. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +4 -0
  148. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +1 -0
  149. package/dist/billing/modules/billing/pages/TransactionsPage.js +587 -0
  150. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -0
  151. package/dist/billing/modules/billing/pages/index.d.ts +10 -0
  152. package/dist/billing/modules/billing/pages/index.d.ts.map +1 -0
  153. package/dist/billing/modules/billing/pages/index.js +5 -0
  154. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +14 -0
  155. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +1 -0
  156. package/dist/billing/modules/checkout/components/AutoPayToggle.js +3 -0
  157. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +14 -0
  158. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +1 -0
  159. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +151 -0
  160. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -0
  161. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +14 -0
  162. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +1 -0
  163. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.js +4 -0
  164. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +14 -0
  165. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +1 -0
  166. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +130 -0
  167. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -0
  168. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +16 -0
  169. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +1 -0
  170. package/dist/billing/modules/checkout/components/CreditsPaymentOption.js +5 -0
  171. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +19 -0
  172. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +1 -0
  173. package/dist/billing/modules/checkout/components/CurrencySelector.js +5 -0
  174. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +14 -0
  175. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +1 -0
  176. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +273 -0
  177. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -0
  178. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +22 -0
  179. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +1 -0
  180. package/dist/billing/modules/checkout/components/OrderSummary.js +293 -0
  181. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -0
  182. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +19 -0
  183. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +1 -0
  184. package/dist/billing/modules/checkout/components/PaymentProviderSelector.js +3 -0
  185. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +19 -0
  186. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +1 -0
  187. package/dist/billing/modules/checkout/components/PromoCodeInput.js +102 -0
  188. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -0
  189. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +25 -0
  190. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +1 -0
  191. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +169 -0
  192. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -0
  193. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +13 -0
  194. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +1 -0
  195. package/dist/billing/modules/checkout/components/SavedCardSelector.js +4 -0
  196. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +13 -0
  197. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +1 -0
  198. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +78 -0
  199. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -0
  200. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +16 -0
  201. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +1 -0
  202. package/dist/billing/modules/checkout/components/StripePaymentForm.js +253 -0
  203. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -0
  204. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +26 -0
  205. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +1 -0
  206. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +84 -0
  207. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -0
  208. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +23 -0
  209. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +1 -0
  210. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +229 -0
  211. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -0
  212. package/dist/billing/modules/checkout/components/index.d.ts +20 -0
  213. package/dist/billing/modules/checkout/components/index.d.ts.map +1 -0
  214. package/dist/billing/modules/checkout/components/index.js +16 -0
  215. package/dist/billing/modules/checkout/graphql/index.d.ts +6 -0
  216. package/dist/billing/modules/checkout/graphql/index.d.ts.map +1 -0
  217. package/dist/billing/modules/checkout/hooks/index.d.ts +9 -0
  218. package/dist/billing/modules/checkout/hooks/index.d.ts.map +1 -0
  219. package/dist/billing/modules/checkout/hooks/index.js +4 -0
  220. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +69 -0
  221. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +1 -0
  222. package/dist/billing/modules/checkout/hooks/useCheckout.js +377 -0
  223. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -0
  224. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +26 -0
  225. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +1 -0
  226. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +88 -0
  227. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -0
  228. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +19 -0
  229. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +1 -0
  230. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +16 -0
  231. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -0
  232. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +59 -0
  233. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +1 -0
  234. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +107 -0
  235. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -0
  236. package/dist/billing/modules/checkout/index.d.ts +24 -0
  237. package/dist/billing/modules/checkout/index.d.ts.map +1 -0
  238. package/dist/billing/modules/checkout/index.js +19 -0
  239. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +4 -0
  240. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +1 -0
  241. package/dist/billing/modules/checkout/pages/CheckoutPage.js +1248 -0
  242. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -0
  243. package/dist/billing/modules/checkout/pages/index.d.ts +5 -0
  244. package/dist/billing/modules/checkout/pages/index.d.ts.map +1 -0
  245. package/dist/billing/modules/checkout/pages/index.js +1 -0
  246. package/dist/billing/modules/checkout/types/index.d.ts +270 -0
  247. package/dist/billing/modules/checkout/types/index.d.ts.map +1 -0
  248. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +20 -0
  249. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +1 -0
  250. package/dist/billing/modules/checkout/utils/storeOrder.js +27 -0
  251. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -0
  252. package/dist/billing/modules/coupons/index.d.ts +5 -0
  253. package/dist/billing/modules/coupons/index.d.ts.map +1 -0
  254. package/dist/billing/modules/coupons/index.js +6 -0
  255. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +4 -0
  256. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +1 -0
  257. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +489 -0
  258. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -0
  259. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +4 -0
  260. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +1 -0
  261. package/dist/billing/modules/coupons/pages/CouponsListPage.js +544 -0
  262. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -0
  263. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +4 -0
  264. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +1 -0
  265. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +421 -0
  266. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -0
  267. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +4 -0
  268. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +1 -0
  269. package/dist/billing/modules/coupons/pages/EditCouponPage.js +379 -0
  270. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -0
  271. package/dist/billing/modules/coupons/pages/index.d.ts +8 -0
  272. package/dist/billing/modules/coupons/pages/index.d.ts.map +1 -0
  273. package/dist/billing/modules/coupons/pages/index.js +4 -0
  274. package/dist/billing/modules/credits/hooks/index.d.ts +5 -0
  275. package/dist/billing/modules/credits/hooks/index.d.ts.map +1 -0
  276. package/dist/billing/modules/credits/hooks/index.js +1 -0
  277. package/dist/billing/modules/credits/hooks/useCredits.d.ts +75 -0
  278. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +1 -0
  279. package/dist/billing/modules/credits/hooks/useCredits.js +78 -0
  280. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -0
  281. package/dist/billing/modules/credits/index.d.ts +6 -0
  282. package/dist/billing/modules/credits/index.d.ts.map +1 -0
  283. package/dist/billing/modules/credits/index.js +8 -0
  284. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +4 -0
  285. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +1 -0
  286. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +140 -0
  287. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -0
  288. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +4 -0
  289. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +1 -0
  290. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +331 -0
  291. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -0
  292. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +4 -0
  293. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +1 -0
  294. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +770 -0
  295. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -0
  296. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +4 -0
  297. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +1 -0
  298. package/dist/billing/modules/credits/pages/CreditsPage.js +324 -0
  299. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -0
  300. package/dist/billing/modules/credits/pages/index.d.ts +8 -0
  301. package/dist/billing/modules/credits/pages/index.d.ts.map +1 -0
  302. package/dist/billing/modules/credits/pages/index.js +4 -0
  303. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +14 -0
  304. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +1 -0
  305. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +185 -0
  306. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -0
  307. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +111 -0
  308. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +1 -0
  309. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +388 -0
  310. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -0
  311. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +16 -0
  312. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +1 -0
  313. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +146 -0
  314. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -0
  315. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +13 -0
  316. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +1 -0
  317. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1044 -0
  318. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -0
  319. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +15 -0
  320. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +1 -0
  321. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +216 -0
  322. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -0
  323. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +27 -0
  324. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +1 -0
  325. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +193 -0
  326. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -0
  327. package/dist/billing/modules/dashboard/components/index.d.ts +10 -0
  328. package/dist/billing/modules/dashboard/components/index.d.ts.map +1 -0
  329. package/dist/billing/modules/dashboard/components/index.js +6 -0
  330. package/dist/billing/modules/dashboard/hooks/index.d.ts +6 -0
  331. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +1 -0
  332. package/dist/billing/modules/dashboard/hooks/index.js +2 -0
  333. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +17 -0
  334. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +1 -0
  335. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +42 -0
  336. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -0
  337. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +145 -0
  338. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +1 -0
  339. package/dist/billing/modules/dashboard/hooks/useDashboard.js +118 -0
  340. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -0
  341. package/dist/billing/modules/dashboard/index.d.ts +8 -0
  342. package/dist/billing/modules/dashboard/index.d.ts.map +1 -0
  343. package/dist/billing/modules/dashboard/index.js +12 -0
  344. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +4 -0
  345. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +1 -0
  346. package/dist/billing/modules/dashboard/pages/OverviewPage.js +478 -0
  347. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -0
  348. package/dist/billing/modules/dashboard/pages/index.d.ts +5 -0
  349. package/dist/billing/modules/dashboard/pages/index.d.ts.map +1 -0
  350. package/dist/billing/modules/dashboard/pages/index.js +1 -0
  351. package/dist/billing/modules/discounts/index.d.ts +6 -0
  352. package/dist/billing/modules/discounts/index.d.ts.map +1 -0
  353. package/dist/billing/modules/discounts/index.js +3 -0
  354. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +4 -0
  355. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +1 -0
  356. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +1009 -0
  357. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -0
  358. package/dist/billing/modules/discounts/pages/index.d.ts +6 -0
  359. package/dist/billing/modules/discounts/pages/index.d.ts.map +1 -0
  360. package/dist/billing/modules/discounts/pages/index.js +1 -0
  361. package/dist/billing/modules/earnings/api.d.ts +131 -0
  362. package/dist/billing/modules/earnings/api.d.ts.map +1 -0
  363. package/dist/billing/modules/earnings/api.js +122 -0
  364. package/dist/billing/modules/earnings/api.js.map +1 -0
  365. package/dist/billing/modules/earnings/index.d.ts +4 -0
  366. package/dist/billing/modules/earnings/index.d.ts.map +1 -0
  367. package/dist/billing/modules/earnings/index.js +4 -0
  368. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +4 -0
  369. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +1 -0
  370. package/dist/billing/modules/earnings/pages/EarningsPage.js +435 -0
  371. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -0
  372. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +4 -0
  373. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +1 -0
  374. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +273 -0
  375. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -0
  376. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +4 -0
  377. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +1 -0
  378. package/dist/billing/modules/earnings/pages/PayoutsPage.js +480 -0
  379. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -0
  380. package/dist/billing/modules/plans/hooks/index.d.ts +7 -0
  381. package/dist/billing/modules/plans/hooks/index.d.ts.map +1 -0
  382. package/dist/billing/modules/plans/hooks/index.js +2 -0
  383. package/dist/billing/modules/plans/hooks/usePlans.d.ts +46 -0
  384. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +1 -0
  385. package/dist/billing/modules/plans/hooks/usePlans.js +77 -0
  386. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -0
  387. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +27 -0
  388. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +1 -0
  389. package/dist/billing/modules/plans/hooks/useQuotas.js +21 -0
  390. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -0
  391. package/dist/billing/modules/plans/index.d.ts +7 -0
  392. package/dist/billing/modules/plans/index.d.ts.map +1 -0
  393. package/dist/billing/modules/plans/index.js +11 -0
  394. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +4 -0
  395. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +1 -0
  396. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +264 -0
  397. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -0
  398. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +4 -0
  399. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +1 -0
  400. package/dist/billing/modules/plans/pages/PlanCreatePage.js +368 -0
  401. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -0
  402. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +4 -0
  403. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +1 -0
  404. package/dist/billing/modules/plans/pages/PlanDetailPage.js +356 -0
  405. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -0
  406. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +4 -0
  407. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +1 -0
  408. package/dist/billing/modules/plans/pages/PlanEditPage.js +395 -0
  409. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -0
  410. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +4 -0
  411. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +1 -0
  412. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +314 -0
  413. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -0
  414. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +4 -0
  415. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +1 -0
  416. package/dist/billing/modules/plans/pages/PlansListPage.js +438 -0
  417. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -0
  418. package/dist/billing/modules/plans/pages/index.d.ts +11 -0
  419. package/dist/billing/modules/plans/pages/index.d.ts.map +1 -0
  420. package/dist/billing/modules/plans/pages/index.js +6 -0
  421. package/dist/billing/modules/quota/hooks/index.d.ts +6 -0
  422. package/dist/billing/modules/quota/hooks/index.d.ts.map +1 -0
  423. package/dist/billing/modules/quota/hooks/index.js +2 -0
  424. package/dist/billing/modules/quota/hooks/useQuota.d.ts +102 -0
  425. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +1 -0
  426. package/dist/billing/modules/quota/hooks/useQuota.js +63 -0
  427. package/dist/billing/modules/quota/hooks/useQuota.js.map +1 -0
  428. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +39 -0
  429. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +1 -0
  430. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +67 -0
  431. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -0
  432. package/dist/billing/modules/quota/index.d.ts +6 -0
  433. package/dist/billing/modules/quota/index.d.ts.map +1 -0
  434. package/dist/billing/modules/quota/index.js +10 -0
  435. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +4 -0
  436. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +1 -0
  437. package/dist/billing/modules/quota/pages/QuotaPage.js +337 -0
  438. package/dist/billing/modules/quota/pages/QuotaPage.js.map +1 -0
  439. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +4 -0
  440. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +1 -0
  441. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +273 -0
  442. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -0
  443. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +4 -0
  444. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +1 -0
  445. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +272 -0
  446. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -0
  447. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +4 -0
  448. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +1 -0
  449. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +316 -0
  450. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -0
  451. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +4 -0
  452. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +1 -0
  453. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +401 -0
  454. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -0
  455. package/dist/billing/modules/quota/pages/index.d.ts +9 -0
  456. package/dist/billing/modules/quota/pages/index.d.ts.map +1 -0
  457. package/dist/billing/modules/quota/pages/index.js +5 -0
  458. package/dist/billing/modules/settings/index.d.ts +5 -0
  459. package/dist/billing/modules/settings/index.d.ts.map +1 -0
  460. package/dist/billing/modules/settings/index.js +4 -0
  461. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +4 -0
  462. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +1 -0
  463. package/dist/billing/modules/settings/pages/SettingsPage.js +632 -0
  464. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -0
  465. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +4 -0
  466. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +1 -0
  467. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +270 -0
  468. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -0
  469. package/dist/billing/modules/settings/pages/index.d.ts +6 -0
  470. package/dist/billing/modules/settings/pages/index.d.ts.map +1 -0
  471. package/dist/billing/modules/settings/pages/index.js +2 -0
  472. package/dist/billing/modules/store/graphql/index.d.ts +6 -0
  473. package/dist/billing/modules/store/graphql/index.d.ts.map +1 -0
  474. package/dist/billing/modules/store/graphql/index.js +1 -0
  475. package/dist/billing/modules/store/index.d.ts +6 -0
  476. package/dist/billing/modules/store/index.d.ts.map +1 -0
  477. package/dist/billing/modules/store/index.js +3 -0
  478. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +11 -0
  479. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +1 -0
  480. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +18 -0
  481. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -0
  482. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +12 -0
  483. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +1 -0
  484. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +167 -0
  485. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -0
  486. package/dist/billing/modules/subscriptions/hooks/index.d.ts +6 -0
  487. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +1 -0
  488. package/dist/billing/modules/subscriptions/hooks/index.js +1 -0
  489. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +92 -0
  490. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +1 -0
  491. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +136 -0
  492. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -0
  493. package/dist/billing/modules/subscriptions/index.d.ts +7 -0
  494. package/dist/billing/modules/subscriptions/index.d.ts.map +1 -0
  495. package/dist/billing/modules/subscriptions/index.js +7 -0
  496. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +4 -0
  497. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +1 -0
  498. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +551 -0
  499. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -0
  500. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +4 -0
  501. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +1 -0
  502. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +529 -0
  503. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -0
  504. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +4 -0
  505. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +1 -0
  506. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +430 -0
  507. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -0
  508. package/dist/billing/modules/subscriptions/pages/index.d.ts +8 -0
  509. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +1 -0
  510. package/dist/billing/modules/subscriptions/pages/index.js +3 -0
  511. package/dist/billing/modules/usage/hooks/index.d.ts +6 -0
  512. package/dist/billing/modules/usage/hooks/index.d.ts.map +1 -0
  513. package/dist/billing/modules/usage/hooks/index.js +1 -0
  514. package/dist/billing/modules/usage/hooks/useUsage.d.ts +203 -0
  515. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +1 -0
  516. package/dist/billing/modules/usage/hooks/useUsage.js +271 -0
  517. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -0
  518. package/dist/billing/modules/usage/index.d.ts +6 -0
  519. package/dist/billing/modules/usage/index.d.ts.map +1 -0
  520. package/dist/billing/modules/usage/index.js +5 -0
  521. package/dist/billing/modules/usage/pages/UsagePage.d.ts +4 -0
  522. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +1 -0
  523. package/dist/billing/modules/usage/pages/UsagePage.js +817 -0
  524. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -0
  525. package/dist/billing/modules/usage/pages/index.d.ts +5 -0
  526. package/dist/billing/modules/usage/pages/index.d.ts.map +1 -0
  527. package/dist/billing/modules/usage/pages/index.js +1 -0
  528. package/dist/billing/providers/BillingProvider.d.ts +16 -0
  529. package/dist/billing/providers/BillingProvider.d.ts.map +1 -0
  530. package/dist/billing/providers/BillingProvider.js +40 -0
  531. package/dist/billing/providers/BillingProvider.js.map +1 -0
  532. package/dist/billing/shared/components/AccessDenied.d.ts +8 -0
  533. package/dist/billing/shared/components/AccessDenied.d.ts.map +1 -0
  534. package/dist/billing/shared/components/AccessDenied.js +44 -0
  535. package/dist/billing/shared/components/AccessDenied.js.map +1 -0
  536. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +11 -0
  537. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +1 -0
  538. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +230 -0
  539. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -0
  540. package/dist/billing/shared/components/EmptyState.d.ts +11 -0
  541. package/dist/billing/shared/components/EmptyState.d.ts.map +1 -0
  542. package/dist/billing/shared/components/EmptyState.js +27 -0
  543. package/dist/billing/shared/components/EmptyState.js.map +1 -0
  544. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +11 -0
  545. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +1 -0
  546. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  547. package/dist/billing/shared/components/PageHeader.d.ts +11 -0
  548. package/dist/billing/shared/components/PageHeader.d.ts.map +1 -0
  549. package/dist/billing/shared/components/PageHeader.js +25 -0
  550. package/dist/billing/shared/components/PageHeader.js.map +1 -0
  551. package/dist/billing/shared/components/ServerError.d.ts +11 -0
  552. package/dist/billing/shared/components/ServerError.d.ts.map +1 -0
  553. package/dist/billing/shared/components/ServerError.js +75 -0
  554. package/dist/billing/shared/components/ServerError.js.map +1 -0
  555. package/dist/billing/shared/components/StatCard.d.ts +15 -0
  556. package/dist/billing/shared/components/StatCard.d.ts.map +1 -0
  557. package/dist/billing/shared/components/StatCard.js +37 -0
  558. package/dist/billing/shared/components/StatCard.js.map +1 -0
  559. package/dist/billing/shared/components/index.d.ts +11 -0
  560. package/dist/billing/shared/components/index.d.ts.map +1 -0
  561. package/dist/billing/shared/components/index.js +7 -0
  562. package/dist/billing/shared/index.d.ts +8 -0
  563. package/dist/billing/shared/index.d.ts.map +1 -0
  564. package/dist/billing/shared/types/graphql.d.ts +926 -0
  565. package/dist/billing/shared/types/graphql.d.ts.map +1 -0
  566. package/dist/billing/shared/types/graphql.js +30 -0
  567. package/dist/billing/shared/types/graphql.js.map +1 -0
  568. package/dist/billing/shared/types/index.d.ts +96 -0
  569. package/dist/billing/shared/types/index.d.ts.map +1 -0
  570. package/dist/billing/shared/utils/directActivityGraphql.d.ts +13 -0
  571. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +1 -0
  572. package/dist/billing/shared/utils/directActivityGraphql.js +2 -0
  573. package/dist/billing/shared/utils/directBillingGraphql.d.ts +13 -0
  574. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +1 -0
  575. package/dist/billing/shared/utils/directBillingGraphql.js +22 -0
  576. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -0
  577. package/dist/billing/shared/utils/error.d.ts +30 -0
  578. package/dist/billing/shared/utils/error.d.ts.map +1 -0
  579. package/dist/billing/shared/utils/error.js +16 -0
  580. package/dist/billing/shared/utils/error.js.map +1 -0
  581. package/dist/billing/shared/utils/format.d.ts +28 -0
  582. package/dist/billing/shared/utils/format.d.ts.map +1 -0
  583. package/dist/billing/shared/utils/format.js +65 -0
  584. package/dist/billing/shared/utils/format.js.map +1 -0
  585. package/dist/billing/shared/utils/gatewayGraphql.d.ts +15 -0
  586. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +1 -0
  587. package/dist/billing/shared/utils/gatewayGraphql.js +27 -0
  588. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -0
  589. package/dist/billing/shared/utils/index.d.ts +13 -0
  590. package/dist/billing/shared/utils/index.d.ts.map +1 -0
  591. package/dist/billing/shared/utils/index.js +8 -0
  592. package/dist/billing/shared/utils/navigation.d.ts +2 -0
  593. package/dist/billing/shared/utils/navigation.d.ts.map +1 -0
  594. package/dist/billing/shared/utils/navigation.js +8 -0
  595. package/dist/billing/shared/utils/navigation.js.map +1 -0
  596. package/dist/billing/shared/utils/paymentTheme.d.ts +18 -0
  597. package/dist/billing/shared/utils/paymentTheme.d.ts.map +1 -0
  598. package/dist/billing/shared/utils/paymentTheme.js +32 -0
  599. package/dist/billing/shared/utils/paymentTheme.js.map +1 -0
  600. package/dist/billing/shared/utils/status.d.ts +28 -0
  601. package/dist/billing/shared/utils/status.d.ts.map +1 -0
  602. package/dist/billing/shared/utils/status.js +57 -0
  603. package/dist/billing/shared/utils/status.js.map +1 -0
  604. package/dist/billing/shared/utils/tokens.d.ts +156 -0
  605. package/dist/billing/shared/utils/tokens.d.ts.map +1 -0
  606. package/dist/billing/shared/utils/tokens.js +128 -0
  607. package/dist/billing/shared/utils/tokens.js.map +1 -0
  608. package/dist/billing/types/index.d.ts +268 -0
  609. package/dist/billing/types/index.d.ts.map +1 -0
  610. package/dist/billing/utils/index.d.ts +128 -0
  611. package/dist/billing/utils/index.d.ts.map +1 -0
  612. package/dist/dev/main.d.ts +2 -0
  613. package/dist/dev/main.d.ts.map +1 -0
  614. package/dist/generated/global-operations.d.ts +9544 -0
  615. package/dist/generated/global-operations.d.ts.map +1 -0
  616. package/dist/generated/global-operations.js +3542 -0
  617. package/dist/generated/global-operations.js.map +1 -0
  618. package/dist/generated/global-types.d.ts +22208 -0
  619. package/dist/generated/global-types.d.ts.map +1 -0
  620. package/dist/generated/global-types.js +12 -0
  621. package/dist/generated/global-types.js.map +1 -0
  622. package/dist/generated/wspace-operations.d.ts +61 -0
  623. package/dist/generated/wspace-operations.d.ts.map +1 -0
  624. package/dist/generated/wspace-operations.js +35 -0
  625. package/dist/generated/wspace-operations.js.map +1 -0
  626. package/dist/generated/wspace-types.d.ts +48578 -0
  627. package/dist/generated/wspace-types.d.ts.map +1 -0
  628. package/dist/index.d.ts +8 -0
  629. package/dist/index.d.ts.map +1 -0
  630. package/dist/index.js +2 -0
  631. package/dist/node_modules/@capacitor/core/dist/index.js +270 -0
  632. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -0
  633. package/dist/utils/nativeBridge.d.ts +3 -0
  634. package/dist/utils/nativeBridge.d.ts.map +1 -0
  635. package/dist/utils/nativeBridge.js +2 -0
  636. package/package.json +112 -0
@@ -0,0 +1,1248 @@
1
+ import { useBilling as e } from "../../../providers/BillingProvider.js";
2
+ import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
3
+ import { PageHeader as n } from "../../../shared/components/PageHeader.js";
4
+ import "../../../shared/components/index.js";
5
+ import { useBillingEventEmitter as r } from "../../../hooks/useBillingEventEmitter.js";
6
+ import { getStoredBillingAccountId as i } from "../../../hooks/useBillingAccountSelection.js";
7
+ import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
8
+ import { useGetActiveSubscriptionsCheckoutQuery as o, useGetBillingAccountsCheckoutQuery as ee, useGetCostOfCreditsCheckoutQuery as te, useGetPaymentMethodsCheckoutQuery as ne, useGetPlanCheckoutQuery as re, useGetSelectedAddonCheckoutQuery as ie, useGetStoreOrderCheckoutQuery as ae } from "../../../../generated/global-operations.js";
9
+ import { useAddonCartStore as oe } from "../../addons/store/addonCartStore.js";
10
+ import { useBillingNavigate as se } from "../../../hooks/useBillingNavigate.js";
11
+ import { recordAffiliateEvent as ce } from "../../affiliate/api.js";
12
+ import { useCheckout as le } from "../hooks/useCheckout.js";
13
+ import { isNativeIAPAvailable as ue } from "../../../lib/native-purchases.js";
14
+ import { useNativeCheckout as de } from "../hooks/useNativeCheckout.js";
15
+ import { usePaymentProviders as fe } from "../hooks/usePaymentProviders.js";
16
+ import { usePaymentStatusPolling as pe } from "../hooks/usePaymentStatusPolling.js";
17
+ import "../hooks/index.js";
18
+ import { NativeCheckoutView as me } from "../components/NativeCheckoutView.js";
19
+ import { BillingAccountSelector as he } from "../components/BillingAccountSelector.js";
20
+ import { OrderSummary as ge } from "../components/OrderSummary.js";
21
+ import { PromoCodeInput as _e } from "../components/PromoCodeInput.js";
22
+ import { CreditsAmountInput as ve } from "../components/CreditsAmountInput.js";
23
+ import { StripePaymentForm as ye } from "../components/StripePaymentForm.js";
24
+ import { RazorpayPaymentButton as be } from "../components/RazorpayPaymentButton.js";
25
+ import { SubscriptionSelector as xe } from "../components/SubscriptionSelector.js";
26
+ import { SimpleAutoPayToggle as Se } from "../components/SimpleAutoPayToggle.js";
27
+ import { UnifiedPaymentMethodSelector as Ce } from "../components/UnifiedPaymentMethodSelector.js";
28
+ import "../components/index.js";
29
+ import { buildStoreOrderCheckoutItems as we, normalizeStoreOrderCurrency as Te } from "../utils/storeOrder.js";
30
+ import { useCallback as s, useEffect as c, useMemo as l, useRef as Ee, useState as u } from "react";
31
+ import { ArrowLeft as De, ArrowRight as Oe, Blocks as ke, CheckCircle as Ae, Coins as je, CreditCard as Me, Loader2 as d, Package as Ne, Receipt as Pe, RefreshCw as Fe, ShoppingCart as Ie, Wallet as Le, XCircle as Re } from "lucide-react";
32
+ import { useLocation as ze, useParams as Be } from "react-router-dom";
33
+ import { useAppShell as Ve } from "@burdenoff/fe-libs/shared/providers/shell";
34
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
35
+ import { useI18n as He } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
36
+ import { getProfileScopedKey as Ue } from "@burdenoff/fe-libs/shared/utils";
37
+ //#region src/billing/modules/checkout/pages/CheckoutPage.tsx
38
+ var We = () => {
39
+ let { t: We } = He(), h = (e, t) => {
40
+ let n = We(e);
41
+ return n === e ? t : n;
42
+ }, { planId: Ge, addonId: g, storeOrderId: _ } = Be(), v = se(), y = ze(), b = y.state, Ke = a(), { emit: x } = r(), { orgId: S, stripePublishableKey: qe, razorpayKey: Je, apiGatewayUrl: Ye, authToken: Xe, currentUser: Ze } = e(), { productSlug: Qe } = Ve(), $e = Ee(null), { items: C, clearCart: et, _hasHydrated: w } = oe(), T = y.pathname.includes("/checkout/addons") && !g, E = y.pathname.includes("/checkout/store") && !!_, D = T ? "ADDON" : E ? "ORDER" : b?.purchaseType ?? (Ge ? "PLAN" : g ? "ADDON" : "CREDITS"), O = b?.itemId ?? Ge ?? g ?? _, [k, A] = u("select"), [j, M] = u(null), [tt, N] = u(null), [P, F] = u(null), [nt, rt] = u("card");
43
+ c(() => {
44
+ if (k !== "success" || !P) return;
45
+ let e = typeof window < "u" ? window.localStorage.getItem(Ue("boff-referral-attribution")) : null;
46
+ if (!e) return;
47
+ let t;
48
+ try {
49
+ t = JSON.parse(e);
50
+ } catch {
51
+ return;
52
+ }
53
+ if (!t.journeyId && !t.codeId) return;
54
+ let n = P.transactionId || j?.paymentId || j?.orderId || _ || O || D, r = `${t.journeyId ?? "journey"}:${n}`;
55
+ $e.current !== r && ($e.current = r, ce({
56
+ journeyId: t.journeyId,
57
+ codeId: t.codeId,
58
+ eventType: D === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
59
+ productSlug: Qe,
60
+ actorUserId: Ze?.id,
61
+ orderId: P.transactionId || j?.paymentId || j?.orderId,
62
+ billingAccountId: P.billingAccountId,
63
+ storeOrderId: D === "ORDER" ? _ : void 0,
64
+ valueAmount: P.total,
65
+ currency: P.currency,
66
+ mode: "billing-checkout",
67
+ metadata: {
68
+ purchaseType: D,
69
+ billingAccountName: P.billingAccountName
70
+ }
71
+ }, {
72
+ apiGatewayUrl: Ye,
73
+ authToken: Xe,
74
+ orgId: S
75
+ }).catch(() => {
76
+ $e.current = null;
77
+ }));
78
+ }, [
79
+ Ye,
80
+ Xe,
81
+ Ze?.id,
82
+ O,
83
+ k,
84
+ S,
85
+ j?.orderId,
86
+ j?.paymentId,
87
+ Qe,
88
+ P,
89
+ D,
90
+ _
91
+ ]);
92
+ let [I, L] = u(1), R = le({
93
+ defaultCurrency: "USD",
94
+ upgradeFromSubscriptionId: b?.upgradeFromSubscriptionId,
95
+ downgradeFromSubscriptionId: b?.downgradeFromSubscriptionId
96
+ }), { config: it, stripeEnabled: at, razorpayEnabled: z } = fe(), { elapsedTime: B, error: ot } = pe({
97
+ paymentId: k === "processing" ? j?.paymentId ?? null : null,
98
+ billingAccountId: R.billingAccount?.id ?? P?.billingAccountId ?? null,
99
+ paymentType: nt,
100
+ pollingInterval: 5e3,
101
+ maxPollingTime: 3e5,
102
+ onSuccess: (e) => {
103
+ e.transactionId && F((t) => t && {
104
+ ...t,
105
+ transactionId: e.transactionId
106
+ }), A("success"), T && et();
107
+ },
108
+ onFailure: (e) => {
109
+ N(e.failureReason || "Payment failed"), A("error");
110
+ },
111
+ onTimeout: () => {
112
+ N("Payment verification timed out. Please check your billing history for the payment status."), A("error");
113
+ }
114
+ }), { data: st, loading: ct } = ee({}), { data: V, loading: lt } = re({
115
+ variables: { id: O },
116
+ skip: D !== "PLAN" || !O
117
+ }), { data: H, loading: ut } = ie({
118
+ variables: { addonIDs: O ? [O] : [] },
119
+ skip: D !== "ADDON" || !O || E
120
+ }), { data: U } = ae({
121
+ variables: { id: _ },
122
+ skip: !E || !_
123
+ }), { data: dt, loading: ft } = ne({
124
+ variables: { billingAccountId: R.billingAccount?.id },
125
+ skip: !R.billingAccount?.id
126
+ }), { data: pt, loading: mt } = o({
127
+ variables: { billingAccountId: R.billingAccount?.id },
128
+ skip: !R.billingAccount?.id || D !== "ADDON" || E
129
+ }), W = l(() => pt?.getActiveSubscriptions ?? [], [pt]), G = l(() => !R.selectedSubscriptionId || W.length === 0 ? null : W.find((e) => e.id === R.selectedSubscriptionId) ?? null, [R.selectedSubscriptionId, W]), K = R.items[0]?.type === "CREDITS" ? R.items[0].quantity : 100, { data: q, loading: ht } = te({
130
+ variables: {
131
+ creditAmount: K,
132
+ currency: R.selectedCurrency || "USD"
133
+ },
134
+ skip: D !== "CREDITS"
135
+ }), J = l(() => q?.getCostOfCredits?.amount && K > 0 ? q.getCostOfCredits.amount / K : .01, [q, K]), Y = l(() => dt?.getPaymentMethods ?? [], [dt]), X = l(() => st?.getBillingAccountsByOrg ?? [], [st]), Z = l(() => {
136
+ if (!R.billingAccount) return;
137
+ let e = X.find((e) => e.id === R.billingAccount?.id)?.billingAddresses;
138
+ if (e && e.length > 0) return e[0]?.country || void 0;
139
+ }, [R.billingAccount, X]), [gt, _t] = u(null);
140
+ c(() => {
141
+ if (Z) if (Z === "IN") R.selectedCurrency !== "INR" && R.setCurrency("INR"), z && gt !== Z && R.selectedProvider !== "CREDITS" && (R.setPaymentProvider("RAZORPAY"), _t(Z));
142
+ else {
143
+ if (R.selectedCurrency === "INR") {
144
+ let e = R.billingAccount?.currency, t = e && e !== "INR" ? e : "USD";
145
+ R.setCurrency(t);
146
+ }
147
+ R.selectedProvider === "RAZORPAY" && (R.setPaymentProvider("STRIPE"), _t(Z));
148
+ }
149
+ }, [
150
+ Z,
151
+ R.selectedCurrency,
152
+ R.selectedProvider,
153
+ R.setCurrency,
154
+ R.setPaymentProvider,
155
+ R.billingAccount?.currency,
156
+ z,
157
+ gt
158
+ ]), c(() => {
159
+ if (!R.billingAccount?.currency || Z === "IN") return;
160
+ let e = R.billingAccount.currency;
161
+ e !== "INR" && R.selectedCurrency !== e && R.setCurrency(e);
162
+ }, [
163
+ R.billingAccount?.id,
164
+ R.billingAccount?.currency,
165
+ Z,
166
+ R.selectedCurrency,
167
+ R.setCurrency
168
+ ]), c(() => {
169
+ if (R.selectedProvider !== "AUTO" && R.selectedProvider !== null) return;
170
+ let e = R.availableCredits >= R.total;
171
+ if (R.canPayWithCredits && e) {
172
+ R.setPaymentProvider("CREDITS"), R.setSelectedPaymentMethodId(null);
173
+ return;
174
+ }
175
+ if (Y.length > 0 && !R.selectedPaymentMethodId) {
176
+ let e = Y.find((e) => e.isDefault && e.isVerified), t = Y.find((e) => e.isVerified), n = e || t;
177
+ if (n) {
178
+ R.setSelectedPaymentMethodId(n.id), n.razorpayPaymentMethodId ? R.setPaymentProvider("RAZORPAY") : n.stripePaymentMethodId && R.setPaymentProvider("STRIPE");
179
+ return;
180
+ }
181
+ }
182
+ }, [
183
+ Y.length,
184
+ R.canPayWithCredits,
185
+ R.availableCredits,
186
+ R.total
187
+ ]);
188
+ let [Q, $] = u(!1);
189
+ c(() => {
190
+ if (!E || Q || !U?.getStoreOrder) return;
191
+ let e = Te(U.getStoreOrder.currency);
192
+ R.selectedCurrency !== e && R.setCurrency(e);
193
+ }, [
194
+ E,
195
+ Q,
196
+ U,
197
+ R.selectedCurrency,
198
+ R.setCurrency
199
+ ]), c(() => {
200
+ if (D === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT") {
201
+ let e = V.getPlan.minSeats ?? 1;
202
+ L((t) => t < e ? e : t);
203
+ }
204
+ }, [V, D]), c(() => {
205
+ D === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
206
+ }, [I]), c(() => {
207
+ if (!Q) {
208
+ if (T && w && C.length > 0) {
209
+ R.clearItems();
210
+ for (let e of C) {
211
+ let t = e.addon, n = t.features?.map((e) => ({
212
+ id: e.quota?.id || e.id,
213
+ name: e.quota?.name || "Feature",
214
+ limits: e.quota?.limits
215
+ })) || [], r = R.selectedCurrency || "USD", i = t.currencyPrices?.[r] ?? t.price, a = {
216
+ id: t.id,
217
+ type: "ADDON",
218
+ name: t.name,
219
+ description: typeof t.context == "object" && t.context !== null ? t.context.description : typeof t.context == "string" ? t.context : void 0,
220
+ price: i,
221
+ priceUSD: t.price,
222
+ currency: r,
223
+ quantity: e.quantity,
224
+ features: n,
225
+ metadata: { addonId: t.id }
226
+ };
227
+ R.addItem(a);
228
+ }
229
+ $(!0);
230
+ return;
231
+ }
232
+ if (D === "PLAN" && V?.getPlan) {
233
+ let e = V.getPlan, t = e.features?.map((e) => ({
234
+ id: e.quota?.id || e.id,
235
+ name: e.quota?.name || "Feature",
236
+ limits: e.quota?.limits
237
+ })) || [], n = R.selectedCurrency || "USD", r = e.currencyPrices, i = e.pricingModel === "PER_SEAT", a;
238
+ if (i && e.pricePerSeat) {
239
+ let t = r?.[n];
240
+ a = (typeof t == "object" && t?.perSeat ? t.perSeat : e.pricePerSeat) * I;
241
+ } else {
242
+ let t = r?.[n];
243
+ a = typeof t == "number" ? t : e.price;
244
+ }
245
+ let o = i ? I : 1, ee = {
246
+ id: e.id,
247
+ type: "PLAN",
248
+ name: e.name,
249
+ description: typeof e.context == "object" && e.context !== null ? e.context.description : typeof e.context == "string" ? e.context : void 0,
250
+ price: a,
251
+ priceUSD: i && e.pricePerSeat ? e.pricePerSeat * o : e.price,
252
+ currency: n,
253
+ quantity: o,
254
+ features: t,
255
+ metadata: {
256
+ planId: e.id,
257
+ duration: e.duration,
258
+ seatCount: i ? o : void 0
259
+ }
260
+ };
261
+ R.addItem(ee), $(!0);
262
+ } else if (D === "ADDON" && !T && H?.getSelectedAddons?.[0]) {
263
+ let e = H.getSelectedAddons[0], t = e.features?.map((e) => ({
264
+ id: e.quota?.id || e.id,
265
+ name: e.quota?.name || "Feature",
266
+ limits: e.quota?.limits
267
+ })) || [], n = R.selectedCurrency || "USD", r = e.currencyPrices?.[n] ?? e.price, i = {
268
+ id: e.id,
269
+ type: "ADDON",
270
+ name: e.name,
271
+ description: typeof e.context == "object" && e.context !== null ? e.context.description : typeof e.context == "string" ? e.context : void 0,
272
+ price: r,
273
+ priceUSD: e.price,
274
+ currency: n,
275
+ quantity: b?.quantity ?? 1,
276
+ features: t,
277
+ metadata: { addonId: e.id }
278
+ };
279
+ R.addItem(i), $(!0);
280
+ } else if (E && U?.getStoreOrder) {
281
+ let e = U.getStoreOrder, t = we(e);
282
+ for (let e of t) R.addItem(e);
283
+ $(!0);
284
+ } else if (D === "CREDITS") {
285
+ let e = {
286
+ id: "credits-purchase",
287
+ type: "CREDITS",
288
+ name: "Credits",
289
+ description: "Purchase credits for your account",
290
+ price: J,
291
+ currency: R.selectedCurrency || "USD",
292
+ quantity: 100
293
+ };
294
+ R.addItem(e), $(!0);
295
+ }
296
+ }
297
+ }, [
298
+ D,
299
+ V,
300
+ H,
301
+ U,
302
+ R.addItem,
303
+ R.clearItems,
304
+ b?.quantity,
305
+ Q,
306
+ T,
307
+ E,
308
+ C,
309
+ w,
310
+ J,
311
+ R.selectedCurrency
312
+ ]), c(() => {
313
+ if (!(!E || !Q || R.conversionRate <= 1)) {
314
+ for (let e of R.items) if (e.type === "ORDER" && e.currency !== R.selectedCurrency) {
315
+ let t = e.price * R.conversionRate;
316
+ R.updateItemPrice(e.id, t, R.selectedCurrency);
317
+ }
318
+ }
319
+ }, [
320
+ E,
321
+ Q,
322
+ R.conversionRate,
323
+ R.selectedCurrency,
324
+ R.updateItemPrice
325
+ ]), c(() => {
326
+ if (D === "CREDITS" && Q && J > 0) {
327
+ let e = R.items.find((e) => e.id === "credits-purchase");
328
+ e && e.price !== J && R.updateItemPrice("credits-purchase", J);
329
+ }
330
+ }, [
331
+ D,
332
+ Q,
333
+ J,
334
+ R.items,
335
+ R.updateItemPrice
336
+ ]), c(() => {
337
+ if (!Q || R.items.length === 0) return;
338
+ let e = R.selectedCurrency || "USD";
339
+ for (let t of R.items) if (t.type === "PLAN" && V?.getPlan) {
340
+ let n = V.getPlan.currencyPrices?.[e] ?? V.getPlan.price;
341
+ (t.price !== n || t.currency !== e) && R.updateItemPrice(t.id, n, e);
342
+ } else if (t.type === "ADDON") {
343
+ if (!T && H?.getSelectedAddons?.[0]) {
344
+ let n = H.getSelectedAddons[0], r = n.currencyPrices?.[e] ?? n.price;
345
+ (t.price !== r || t.currency !== e) && R.updateItemPrice(t.id, r, e);
346
+ }
347
+ if (T) {
348
+ let n = C.find((e) => e.addon.id === t.id);
349
+ if (n) {
350
+ let r = n.addon.currencyPrices?.[e] ?? n.addon.price;
351
+ (t.price !== r || t.currency !== e) && R.updateItemPrice(t.id, r, e);
352
+ }
353
+ }
354
+ }
355
+ }, [
356
+ R.selectedCurrency,
357
+ Q,
358
+ R.items,
359
+ R.updateItemPrice,
360
+ V,
361
+ H,
362
+ C,
363
+ T
364
+ ]), c(() => {
365
+ if (X.length > 0 && !R.billingAccount) {
366
+ if (b?.billingAccountId) {
367
+ let e = X.find((e) => e.id === b.billingAccountId);
368
+ if (e) {
369
+ R.setBillingAccount(e);
370
+ return;
371
+ }
372
+ }
373
+ if (S) {
374
+ let e = i(S);
375
+ if (e) {
376
+ let t = X.find((t) => t.id === e);
377
+ if (t) {
378
+ R.setBillingAccount(t);
379
+ return;
380
+ }
381
+ }
382
+ }
383
+ R.setBillingAccount(X[0]);
384
+ }
385
+ }, [
386
+ X,
387
+ R.billingAccount,
388
+ R.setBillingAccount,
389
+ b?.billingAccountId,
390
+ S
391
+ ]);
392
+ let vt = !!(b?.upgradeFromSubscriptionId || b?.downgradeFromSubscriptionId);
393
+ if (c(() => {
394
+ T && w && C.length === 0 && !Q && v("/addons", { replace: !0 });
395
+ }, [
396
+ w,
397
+ C.length,
398
+ T,
399
+ Q,
400
+ v
401
+ ]), !Ke.canProcessPayment) return /* @__PURE__ */ p(t, { message: "You don't have permission to make purchases." });
402
+ let yt = de({
403
+ billingAccountId: R.billingAccount?.id,
404
+ purchaseType: D,
405
+ productId: O
406
+ });
407
+ if (ue()) return /* @__PURE__ */ p(me, {
408
+ purchaseType: D,
409
+ productId: O,
410
+ billingAccountId: R.billingAccount?.id,
411
+ nativeCheckout: yt,
412
+ onBack: () => v("dashboard")
413
+ });
414
+ let bt = ct || lt && D === "PLAN" || ut && D === "ADDON" && !T || T && !w;
415
+ if (T && w && C.length === 0 && !Q) return null;
416
+ let xt = s(async () => {
417
+ if (!R.billingAccount) return;
418
+ N(null);
419
+ let e = R.billingAccount.creditAmount ?? 0, t = [...R.items], n = R.total, r = await R.initiatePayment();
420
+ if (r.success) {
421
+ if (x("billing.checkout.initiated", {
422
+ route: "/billing/checkout",
423
+ entityId: r.paymentId ?? r.orderId,
424
+ source: "checkout",
425
+ amount: r.total || n,
426
+ currency: r.currency || R.selectedCurrency
427
+ }), R.selectedProvider === "CREDITS") {
428
+ x("billing.credits.spent", {
429
+ route: "/billing/checkout",
430
+ entityId: r.orderId,
431
+ source: "checkout",
432
+ amount: n,
433
+ currency: "CREDITS"
434
+ }), F({
435
+ items: t,
436
+ total: n,
437
+ billingAccountName: R.billingAccount.name,
438
+ billingAccountId: R.billingAccount.id,
439
+ previousBalance: e,
440
+ newBalance: e - n,
441
+ paymentMethod: "credits",
442
+ currency: "Credits",
443
+ transactionId: r.orderId
444
+ }), rt("credits"), M({ paymentId: r.orderId }), A("processing");
445
+ return;
446
+ }
447
+ F({
448
+ items: t,
449
+ total: r.total || n,
450
+ billingAccountName: R.billingAccount.name,
451
+ billingAccountId: R.billingAccount.id,
452
+ previousBalance: e,
453
+ newBalance: e,
454
+ paymentMethod: "card",
455
+ currency: r.currency || R.selectedCurrency,
456
+ transactionId: r.paymentId
457
+ }), rt("card"), M({
458
+ clientSecret: r.clientSecret,
459
+ orderId: r.orderId,
460
+ razorpayKeyId: r.razorpayKeyId,
461
+ razorpayCustomerId: r.razorpayCustomerId,
462
+ paymentId: r.paymentId,
463
+ paymentComplete: r.paymentComplete,
464
+ prefillName: r.prefillName,
465
+ prefillEmail: r.prefillEmail,
466
+ prefillContact: r.prefillContact,
467
+ total: r.total,
468
+ currency: r.currency
469
+ }), r.paymentComplete ? A("processing") : A("payment");
470
+ } else x("billing.checkout.failed", {
471
+ route: "/billing/checkout",
472
+ source: "checkout",
473
+ reason: r.error || "Payment initiation failed"
474
+ }), N(r.error || "Payment initiation failed"), A("error");
475
+ }, [R, x]), St = s((e) => {
476
+ x("billing.payment.succeeded", {
477
+ route: "/billing/checkout",
478
+ entityId: j?.paymentId ?? j?.orderId,
479
+ source: "checkout"
480
+ }), M((e) => e), A("processing");
481
+ }, [
482
+ x,
483
+ j?.orderId,
484
+ j?.paymentId
485
+ ]), Ct = s((e) => {
486
+ x("billing.payment.failed", {
487
+ route: "/billing/checkout",
488
+ entityId: j?.paymentId ?? j?.orderId,
489
+ source: "checkout",
490
+ reason: e
491
+ }), N(e), A("error");
492
+ }, [
493
+ x,
494
+ j?.orderId,
495
+ j?.paymentId
496
+ ]), wt = s((e) => {
497
+ R.updateItemQuantity("credits-purchase", e);
498
+ }, [R]), Tt = () => {
499
+ if (T) {
500
+ let e = R.items.length;
501
+ return `Purchase ${e} Add-on${e === 1 ? "" : "s"}`;
502
+ }
503
+ switch (D) {
504
+ case "CREDITS": return "Buy Credits";
505
+ case "PLAN": return "Subscribe to Plan";
506
+ case "ADDON": return "Purchase Add-on";
507
+ default: return "Checkout";
508
+ }
509
+ }, Et = () => {
510
+ switch (D) {
511
+ case "CREDITS": return /* @__PURE__ */ p(je, { className: "h-6 w-6" });
512
+ case "PLAN": return /* @__PURE__ */ p(Ne, { className: "h-6 w-6" });
513
+ case "ADDON": return /* @__PURE__ */ p(ke, { className: "h-6 w-6" });
514
+ default: return /* @__PURE__ */ p(Ie, { className: "h-6 w-6" });
515
+ }
516
+ };
517
+ if (bt) return /* @__PURE__ */ p("div", {
518
+ className: "flex items-center justify-center min-h-[400px]",
519
+ children: /* @__PURE__ */ m("div", {
520
+ className: "text-center space-y-4",
521
+ children: [/* @__PURE__ */ p(d, { className: "h-8 w-8 animate-spin mx-auto text-primary" }), /* @__PURE__ */ p("p", {
522
+ className: "text-muted-foreground",
523
+ children: h("billing.checkout.loadingCheckout", "Loading checkout...")
524
+ })]
525
+ })
526
+ });
527
+ if (k === "success") {
528
+ let e = (e) => {
529
+ if (!P) return `${e.toFixed(2)}`;
530
+ let t = P.currency;
531
+ return t === "Credits" ? `${e.toFixed(2)} Credits` : `${{
532
+ INR: "₹",
533
+ USD: "$",
534
+ EUR: "€",
535
+ GBP: "£"
536
+ }[t] || t + " "}${e.toFixed(2)}`;
537
+ }, t = (e) => `${e.toFixed(2)} Credits`;
538
+ return /* @__PURE__ */ m("div", {
539
+ className: "max-w-2xl mx-auto p-6 space-y-6",
540
+ children: [
541
+ /* @__PURE__ */ m("div", {
542
+ className: "text-center space-y-4",
543
+ children: [/* @__PURE__ */ p("div", {
544
+ className: "inline-flex p-4 rounded-full bg-status-success-bg-subtle text-status-success-text",
545
+ children: /* @__PURE__ */ p(Ae, { className: "h-12 w-12" })
546
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
547
+ className: "text-2xl font-bold text-foreground",
548
+ children: h("billing.checkout.paymentSuccessful", "Payment Successful!")
549
+ }), /* @__PURE__ */ p("p", {
550
+ className: "text-muted-foreground mt-2",
551
+ children: h("billing.checkout.purchaseCompleted", "Your purchase has been completed successfully.")
552
+ })] })]
553
+ }),
554
+ P && /* @__PURE__ */ m("div", {
555
+ className: "bg-card border border-border rounded-lg overflow-hidden",
556
+ children: [
557
+ /* @__PURE__ */ m("div", {
558
+ className: "p-4 border-b border-border",
559
+ children: [/* @__PURE__ */ m("h3", {
560
+ className: "font-semibold text-foreground mb-3 flex items-center gap-2",
561
+ children: [/* @__PURE__ */ p(Pe, { className: "h-4 w-4" }), h("billing.checkout.itemsPurchased", "Items Purchased")]
562
+ }), /* @__PURE__ */ p("div", {
563
+ className: "space-y-2",
564
+ children: P.items.map((t) => /* @__PURE__ */ m("div", {
565
+ className: "flex items-center justify-between",
566
+ children: [/* @__PURE__ */ m("div", {
567
+ className: "flex items-center gap-2",
568
+ children: [
569
+ t.type === "PLAN" && /* @__PURE__ */ p(Ne, { className: "h-4 w-4 text-accent-blue" }),
570
+ t.type === "ADDON" && /* @__PURE__ */ p(ke, { className: "h-4 w-4 text-accent-purple" }),
571
+ t.type === "CREDITS" && /* @__PURE__ */ p(je, { className: "h-4 w-4 text-status-warning-text" }),
572
+ t.type === "ORDER" && /* @__PURE__ */ p(Ie, { className: "h-4 w-4 text-status-success-text" }),
573
+ /* @__PURE__ */ p("span", {
574
+ className: "text-foreground",
575
+ children: t.name
576
+ }),
577
+ t.quantity > 1 && /* @__PURE__ */ m("span", {
578
+ className: "text-xs text-muted-foreground",
579
+ children: ["x", t.quantity]
580
+ })
581
+ ]
582
+ }), /* @__PURE__ */ p("span", {
583
+ className: "text-muted-foreground",
584
+ children: e(t.price * t.quantity)
585
+ })]
586
+ }, t.id))
587
+ })]
588
+ }),
589
+ /* @__PURE__ */ p("div", {
590
+ className: "p-4 border-b border-border bg-muted/30",
591
+ children: /* @__PURE__ */ m("div", {
592
+ className: "grid grid-cols-2 gap-4",
593
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
594
+ className: "text-xs text-muted-foreground mb-1",
595
+ children: h("billing.checkout.paymentMethod", "Payment Method")
596
+ }), /* @__PURE__ */ p("div", {
597
+ className: "flex items-center gap-2",
598
+ children: P.paymentMethod === "credits" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Le, { className: "h-4 w-4 text-status-warning-text" }), /* @__PURE__ */ p("span", {
599
+ className: "font-medium text-foreground",
600
+ children: h("billing.checkout.credits", "Credits")
601
+ })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Me, { className: "h-4 w-4 text-accent-blue" }), /* @__PURE__ */ p("span", {
602
+ className: "font-medium text-foreground",
603
+ children: h("billing.checkout.card", "Card")
604
+ })] })
605
+ })] }), /* @__PURE__ */ m("div", {
606
+ className: "text-right",
607
+ children: [/* @__PURE__ */ p("p", {
608
+ className: "text-xs text-muted-foreground mb-1",
609
+ children: h("billing.checkout.totalPaid", "Total Paid")
610
+ }), /* @__PURE__ */ p("p", {
611
+ className: "font-bold text-lg text-foreground",
612
+ children: e(P.total)
613
+ })]
614
+ })]
615
+ })
616
+ }),
617
+ P.paymentMethod === "credits" && /* @__PURE__ */ m("div", {
618
+ className: "p-4 border-b border-border",
619
+ children: [/* @__PURE__ */ m("h3", {
620
+ className: "font-semibold text-foreground mb-3 flex items-center gap-2",
621
+ children: [/* @__PURE__ */ p(Le, { className: "h-4 w-4" }), h("billing.checkout.creditBalance", "Credit Balance")]
622
+ }), /* @__PURE__ */ m("div", {
623
+ className: "flex items-center gap-4",
624
+ children: [
625
+ /* @__PURE__ */ m("div", {
626
+ className: "flex-1 text-center p-3 rounded-lg bg-muted/50",
627
+ children: [/* @__PURE__ */ p("p", {
628
+ className: "text-xs text-muted-foreground mb-1",
629
+ children: h("billing.checkout.previousBalance", "Previous Balance")
630
+ }), /* @__PURE__ */ p("p", {
631
+ className: "font-semibold text-foreground",
632
+ children: t(P.previousBalance)
633
+ })]
634
+ }),
635
+ /* @__PURE__ */ p(Oe, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
636
+ /* @__PURE__ */ m("div", {
637
+ className: "flex-1 text-center p-3 rounded-lg bg-status-success-bg-subtle",
638
+ children: [/* @__PURE__ */ p("p", {
639
+ className: "text-xs text-muted-foreground mb-1",
640
+ children: h("billing.checkout.newBalance", "New Balance")
641
+ }), /* @__PURE__ */ p("p", {
642
+ className: "font-semibold text-status-success-text",
643
+ children: t(P.newBalance)
644
+ })]
645
+ })
646
+ ]
647
+ })]
648
+ }),
649
+ /* @__PURE__ */ p("div", {
650
+ className: "p-4 bg-muted/20",
651
+ children: /* @__PURE__ */ m("div", {
652
+ className: "flex items-center justify-between",
653
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
654
+ className: "text-xs text-muted-foreground mb-1",
655
+ children: h("billing.checkout.billingAccount", "Billing Account")
656
+ }), /* @__PURE__ */ p("p", {
657
+ className: "font-medium text-foreground",
658
+ children: P.billingAccountName
659
+ })] }), P.transactionId && /* @__PURE__ */ m("div", {
660
+ className: "text-right",
661
+ children: [/* @__PURE__ */ p("p", {
662
+ className: "text-xs text-muted-foreground mb-1",
663
+ children: h("billing.checkout.transactionId", "Transaction ID")
664
+ }), /* @__PURE__ */ m("p", {
665
+ className: "font-mono text-xs text-muted-foreground",
666
+ children: [P.transactionId.slice(0, 8), "..."]
667
+ })]
668
+ })]
669
+ })
670
+ })
671
+ ]
672
+ }),
673
+ /* @__PURE__ */ m("div", {
674
+ className: "flex flex-col sm:flex-row gap-3 justify-center pt-2",
675
+ children: [/* @__PURE__ */ p("button", {
676
+ onClick: () => v("/overview"),
677
+ className: "px-6 py-3 text-sm font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",
678
+ children: h("billing.checkout.backToOverview", "Back to Overview")
679
+ }), /* @__PURE__ */ p("button", {
680
+ onClick: () => v("/subscriptions"),
681
+ className: "px-6 py-3 text-sm font-medium border border-border text-foreground rounded-lg hover:bg-muted transition-colors",
682
+ children: h("billing.checkout.viewSubscriptions", "View Subscriptions")
683
+ })]
684
+ })
685
+ ]
686
+ });
687
+ }
688
+ if (k === "error") return /* @__PURE__ */ p("div", {
689
+ className: "max-w-lg mx-auto p-6",
690
+ children: /* @__PURE__ */ m("div", {
691
+ className: "text-center space-y-6",
692
+ children: [
693
+ /* @__PURE__ */ p("div", {
694
+ className: "inline-flex p-4 rounded-full bg-destructive/10 text-destructive",
695
+ children: /* @__PURE__ */ p(Re, { className: "h-12 w-12" })
696
+ }),
697
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
698
+ className: "text-2xl font-bold text-foreground",
699
+ children: h("billing.checkout.paymentFailed", "Payment Failed")
700
+ }), /* @__PURE__ */ p("p", {
701
+ className: "text-muted-foreground mt-2",
702
+ children: tt || ot || R.error || h("billing.checkout.genericError", "Something went wrong. Please try again.")
703
+ })] }),
704
+ /* @__PURE__ */ m("div", {
705
+ className: "flex gap-3 justify-center",
706
+ children: [/* @__PURE__ */ p("button", {
707
+ onClick: () => v(-1),
708
+ className: "px-4 py-2 rounded-lg border border-border hover:bg-muted",
709
+ children: h("billing.checkout.goBack", "Go Back")
710
+ }), /* @__PURE__ */ p("button", {
711
+ onClick: () => {
712
+ A("select"), N(null), R.reset();
713
+ },
714
+ className: "px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",
715
+ children: h("billing.checkout.tryAgain", "Try Again")
716
+ })]
717
+ })
718
+ ]
719
+ })
720
+ });
721
+ if (k === "processing") return /* @__PURE__ */ p("div", {
722
+ className: "max-w-lg mx-auto p-6",
723
+ children: /* @__PURE__ */ m("div", {
724
+ className: "text-center space-y-6",
725
+ children: [
726
+ /* @__PURE__ */ p("div", {
727
+ className: "inline-flex p-4 rounded-full bg-primary/10 text-primary",
728
+ children: /* @__PURE__ */ p(d, { className: "h-12 w-12 animate-spin" })
729
+ }),
730
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
731
+ className: "text-2xl font-bold text-foreground",
732
+ children: h("billing.checkout.verifyingPayment", "Verifying Payment")
733
+ }), /* @__PURE__ */ p("p", {
734
+ className: "text-muted-foreground mt-2",
735
+ children: h("billing.checkout.verifyingPaymentDescription", "Please wait while we confirm your payment...")
736
+ })] }),
737
+ /* @__PURE__ */ m("div", {
738
+ className: "bg-muted/50 rounded-lg p-4",
739
+ children: [/* @__PURE__ */ m("p", {
740
+ className: "text-sm text-muted-foreground",
741
+ children: [
742
+ h("billing.checkout.timeElapsed", "Time elapsed:"),
743
+ " ",
744
+ /* @__PURE__ */ p("span", {
745
+ className: "font-mono font-medium text-foreground",
746
+ children: ((e) => {
747
+ let t = Math.floor(e / 1e3);
748
+ return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
749
+ })(B)
750
+ })
751
+ ]
752
+ }), /* @__PURE__ */ p("p", {
753
+ className: "text-xs text-muted-foreground mt-1",
754
+ children: h("billing.checkout.keepPageOpen", "This may take a few moments. Please don't close this page.")
755
+ })]
756
+ }),
757
+ /* @__PURE__ */ p("div", {
758
+ className: "w-full bg-muted rounded-full h-2 overflow-hidden",
759
+ children: /* @__PURE__ */ p("div", {
760
+ className: "bg-primary h-2 rounded-full transition-all duration-1000",
761
+ style: { width: `${Math.min(B / 3e5 * 100, 100)}%` }
762
+ })
763
+ }),
764
+ B > 3e4 && /* @__PURE__ */ p("button", {
765
+ onClick: () => {
766
+ A("error"), N("Payment verification was cancelled. Please check your billing history.");
767
+ },
768
+ className: "text-sm text-muted-foreground hover:text-foreground underline",
769
+ children: h("billing.checkout.cancelAndCheckHistory", "Cancel and check billing history")
770
+ })
771
+ ]
772
+ })
773
+ });
774
+ if (k === "payment" && j) {
775
+ let e = (e, t) => `${{
776
+ INR: "₹",
777
+ USD: "$",
778
+ EUR: "€",
779
+ GBP: "£"
780
+ }[t] || t + " "}${e.toFixed(2)}`, t = j.currency || R.selectedCurrency, r = j.total ?? R.total;
781
+ return /* @__PURE__ */ m("div", {
782
+ className: "max-w-2xl mx-auto p-4 sm:p-6 space-y-6",
783
+ children: [
784
+ /* @__PURE__ */ m("button", {
785
+ onClick: () => A("select"),
786
+ className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",
787
+ children: [/* @__PURE__ */ p(De, { className: "h-4 w-4" }), h("billing.checkout.backToCheckout", "Back to checkout")]
788
+ }),
789
+ /* @__PURE__ */ p(n, {
790
+ title: h("billing.checkout.completePayment", "Complete Payment"),
791
+ description: h("billing.checkout.completePaymentDescription", "Enter your payment details to complete the purchase")
792
+ }),
793
+ /* @__PURE__ */ m("div", {
794
+ className: "rounded-lg border border-border bg-card p-4 space-y-4",
795
+ children: [
796
+ /* @__PURE__ */ m("h3", {
797
+ className: "font-semibold text-foreground flex items-center gap-2",
798
+ children: [/* @__PURE__ */ p(Pe, { className: "h-4 w-4" }), h("billing.checkout.paymentSummary", "Payment Summary")]
799
+ }),
800
+ R.billingAccount && /* @__PURE__ */ m("div", {
801
+ className: "p-3 bg-muted/30 rounded-lg space-y-1",
802
+ children: [
803
+ /* @__PURE__ */ p("div", {
804
+ className: "text-xs text-muted-foreground uppercase tracking-wide",
805
+ children: h("billing.checkout.billingAccount", "Billing Account")
806
+ }),
807
+ /* @__PURE__ */ p("div", {
808
+ className: "font-medium text-foreground",
809
+ children: R.billingAccount.name
810
+ }),
811
+ /* @__PURE__ */ p("div", {
812
+ className: "text-sm text-muted-foreground",
813
+ children: R.billingAccount.email
814
+ })
815
+ ]
816
+ }),
817
+ D === "ADDON" && R.selectedSubscriptionId && G && /* @__PURE__ */ m("div", {
818
+ className: "p-3 bg-muted/30 rounded-lg space-y-1",
819
+ children: [
820
+ /* @__PURE__ */ p("div", {
821
+ className: "text-xs text-muted-foreground uppercase tracking-wide",
822
+ children: h("billing.checkout.addingToSubscription", "Adding to Subscription")
823
+ }),
824
+ /* @__PURE__ */ p("div", {
825
+ className: "font-medium text-foreground",
826
+ children: G.plan?.name || h("billing.checkout.subscription", "Subscription")
827
+ }),
828
+ G.plan?.product?.name && /* @__PURE__ */ p("div", {
829
+ className: "text-sm text-muted-foreground",
830
+ children: G.plan.product.name
831
+ })
832
+ ]
833
+ }),
834
+ /* @__PURE__ */ m("div", {
835
+ className: "space-y-2 text-sm",
836
+ children: [
837
+ (() => {
838
+ let n = R.taxRate, i = n > 0 ? r / (1 + n) : r, a = n > 0 ? r - i : 0;
839
+ return /* @__PURE__ */ m(f, { children: [
840
+ /* @__PURE__ */ m("div", {
841
+ className: "flex justify-between",
842
+ children: [/* @__PURE__ */ p("span", {
843
+ className: "text-muted-foreground",
844
+ children: h("billing.checkout.subtotal", "Subtotal")
845
+ }), /* @__PURE__ */ p("span", {
846
+ className: "text-foreground",
847
+ children: e(i, t)
848
+ })]
849
+ }),
850
+ R.discountAmount > 0 && /* @__PURE__ */ m("div", {
851
+ className: "flex justify-between text-status-success-text",
852
+ children: [/* @__PURE__ */ p("span", { children: h("billing.checkout.discount", "Discount") }), /* @__PURE__ */ m("span", { children: ["-", e(R.discountAmount, t)] })]
853
+ }),
854
+ a > 0 && /* @__PURE__ */ m("div", {
855
+ className: "flex justify-between",
856
+ children: [/* @__PURE__ */ m("span", {
857
+ className: "text-muted-foreground",
858
+ children: [
859
+ R.taxType || h("billing.checkout.tax", "Tax"),
860
+ " (",
861
+ (n * 100).toFixed(0),
862
+ "%)"
863
+ ]
864
+ }), /* @__PURE__ */ p("span", {
865
+ className: "text-foreground",
866
+ children: e(a, t)
867
+ })]
868
+ })
869
+ ] });
870
+ })(),
871
+ /* @__PURE__ */ p("div", { className: "border-t border-border my-2" }),
872
+ /* @__PURE__ */ m("div", {
873
+ className: "flex justify-between font-semibold",
874
+ children: [/* @__PURE__ */ p("span", {
875
+ className: "text-foreground",
876
+ children: h("billing.checkout.total", "Total")
877
+ }), /* @__PURE__ */ p("span", {
878
+ className: "text-lg text-foreground",
879
+ children: e(r, t)
880
+ })]
881
+ })
882
+ ]
883
+ })
884
+ ]
885
+ }),
886
+ R.selectedProvider === "STRIPE" && j.clientSecret && /* @__PURE__ */ p("div", {
887
+ className: "rounded-lg border border-border bg-card overflow-hidden",
888
+ children: /* @__PURE__ */ p("div", {
889
+ className: "p-4 space-y-4",
890
+ children: /* @__PURE__ */ p(ye, {
891
+ clientSecret: j.clientSecret,
892
+ publishableKey: qe || it?.stripePublishableKey || "",
893
+ amount: Math.round((j.total ?? R.total) * 100),
894
+ currency: j.currency || R.selectedCurrency,
895
+ onSuccess: St,
896
+ onError: Ct,
897
+ onCancel: () => A("select"),
898
+ isCompletingExistingPayment: !!R.selectedPaymentMethodId
899
+ })
900
+ })
901
+ }),
902
+ R.selectedProvider === "RAZORPAY" && j.orderId && /* @__PURE__ */ p("div", {
903
+ className: "rounded-lg border border-border bg-card overflow-hidden",
904
+ children: /* @__PURE__ */ m("div", {
905
+ className: "p-4 space-y-4",
906
+ children: [/* @__PURE__ */ m("label", {
907
+ className: "flex items-center gap-2 cursor-pointer",
908
+ children: [/* @__PURE__ */ p("input", {
909
+ type: "checkbox",
910
+ checked: R.saveCard,
911
+ onChange: (e) => R.setSaveCard(e.target.checked),
912
+ className: "h-4 w-4 rounded border-border text-primary focus:ring-primary"
913
+ }), /* @__PURE__ */ p("span", {
914
+ className: "text-sm text-muted-foreground",
915
+ children: "Save card for future purchases"
916
+ })]
917
+ }), /* @__PURE__ */ p(be, {
918
+ orderId: j.orderId,
919
+ keyId: j.razorpayKeyId || Je || "",
920
+ amount: Math.round((j.total ?? R.total) * 100),
921
+ currency: j.currency || "INR",
922
+ customerId: j.razorpayCustomerId,
923
+ prefill: {
924
+ name: j.prefillName,
925
+ email: j.prefillEmail,
926
+ contact: j.prefillContact
927
+ },
928
+ onSuccess: (e) => St(e.razorpay_payment_id),
929
+ onError: Ct,
930
+ onCancel: () => A("select")
931
+ })]
932
+ })
933
+ })
934
+ ]
935
+ });
936
+ }
937
+ return /* @__PURE__ */ m("div", {
938
+ className: "max-w-6xl mx-auto p-4 sm:p-6",
939
+ children: [
940
+ /* @__PURE__ */ m("button", {
941
+ onClick: () => v(-1),
942
+ className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-4",
943
+ children: [/* @__PURE__ */ p(De, { className: "h-4 w-4" }), "Back"]
944
+ }),
945
+ /* @__PURE__ */ m("div", {
946
+ className: "flex items-center gap-3 mb-6",
947
+ children: [/* @__PURE__ */ p("div", {
948
+ className: "p-2 rounded-lg bg-primary/10 text-primary",
949
+ children: Et()
950
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
951
+ className: "text-2xl font-bold text-foreground",
952
+ children: Tt()
953
+ }), /* @__PURE__ */ p("p", {
954
+ className: "text-sm text-muted-foreground",
955
+ children: "Complete your purchase securely"
956
+ })] })]
957
+ }),
958
+ b?.upgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
959
+ className: "mb-6 p-4 rounded-lg border border-border-subtle bg-status-info-bg-subtle",
960
+ children: /* @__PURE__ */ m("div", {
961
+ className: "flex items-center gap-3",
962
+ children: [/* @__PURE__ */ p("div", {
963
+ className: "p-2 rounded-full bg-status-info-bg-subtle",
964
+ children: /* @__PURE__ */ p(Fe, { className: "h-4 w-4 text-accent-blue" })
965
+ }), /* @__PURE__ */ m("div", {
966
+ className: "flex-1",
967
+ children: [/* @__PURE__ */ m("p", {
968
+ className: "text-sm font-medium text-status-info-text",
969
+ children: [
970
+ "Upgrading from:",
971
+ " ",
972
+ /* @__PURE__ */ p("span", {
973
+ className: "font-semibold",
974
+ children: b.currentPlanName
975
+ })
976
+ ]
977
+ }), /* @__PURE__ */ p("p", {
978
+ className: "text-xs text-status-info-text mt-0.5",
979
+ children: "Your current subscription will be marked as upgraded and quotas will transfer to the new plan."
980
+ })]
981
+ })]
982
+ })
983
+ }),
984
+ b?.downgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
985
+ className: "mb-6 p-4 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle",
986
+ children: /* @__PURE__ */ m("div", {
987
+ className: "flex items-center gap-3",
988
+ children: [/* @__PURE__ */ p("div", {
989
+ className: "p-2 rounded-full bg-status-warning-bg-subtle",
990
+ children: /* @__PURE__ */ p(Fe, { className: "h-4 w-4 text-status-warning-text" })
991
+ }), /* @__PURE__ */ m("div", {
992
+ className: "flex-1",
993
+ children: [/* @__PURE__ */ m("p", {
994
+ className: "text-sm font-medium text-status-warning-text",
995
+ children: [
996
+ "Downgrading from:",
997
+ " ",
998
+ /* @__PURE__ */ p("span", {
999
+ className: "font-semibold",
1000
+ children: b.currentPlanName
1001
+ })
1002
+ ]
1003
+ }), /* @__PURE__ */ p("p", {
1004
+ className: "text-xs text-status-warning-text mt-0.5",
1005
+ children: "Your current plan stays active until it expires — you keep all its features until then. After expiry, only the new plan applies."
1006
+ })]
1007
+ })]
1008
+ })
1009
+ }),
1010
+ /* @__PURE__ */ m("div", {
1011
+ className: "grid gap-6 lg:grid-cols-5",
1012
+ children: [/* @__PURE__ */ m("div", {
1013
+ className: "lg:col-span-3 space-y-6",
1014
+ children: [
1015
+ D === "CREDITS" && R.items[0] && /* @__PURE__ */ p("div", {
1016
+ className: "rounded-lg border border-border bg-card p-4 sm:p-6",
1017
+ children: /* @__PURE__ */ p(ve, {
1018
+ value: R.items[0].quantity,
1019
+ onChange: wt,
1020
+ costPerCredit: J,
1021
+ currency: R.selectedCurrency,
1022
+ disabled: ht
1023
+ })
1024
+ }),
1025
+ /* @__PURE__ */ m("div", {
1026
+ className: "rounded-lg border border-border bg-card p-4 sm:p-6 space-y-4",
1027
+ children: [/* @__PURE__ */ p(he, {
1028
+ accounts: X,
1029
+ selectedAccountId: R.billingAccount?.id ?? null,
1030
+ onSelect: R.setBillingAccount,
1031
+ isLoading: ct,
1032
+ disabled: vt,
1033
+ disabledMessage: vt ? "Billing account is locked for plan changes" : void 0
1034
+ }), D === "ADDON" && !E && R.billingAccount && /* @__PURE__ */ p(xe, {
1035
+ subscriptions: W,
1036
+ selectedSubscriptionId: R.selectedSubscriptionId,
1037
+ onSelect: R.setSelectedSubscriptionId,
1038
+ isLoading: mt
1039
+ })]
1040
+ }),
1041
+ /* @__PURE__ */ m("div", {
1042
+ className: "rounded-lg border border-border bg-card p-4 sm:p-6 space-y-4",
1043
+ children: [
1044
+ /* @__PURE__ */ p(Ce, {
1045
+ savedPaymentMethods: Y,
1046
+ selectedPaymentMethodId: R.selectedPaymentMethodId,
1047
+ onSelectSavedCard: R.setSelectedPaymentMethodId,
1048
+ selectedProvider: R.selectedProvider,
1049
+ onSelectProvider: R.setPaymentProvider,
1050
+ stripeEnabled: at,
1051
+ razorpayEnabled: z,
1052
+ canPayWithCredits: R.canPayWithCredits && R.hasEnoughCredits,
1053
+ availableCredits: R.availableCredits,
1054
+ totalAmount: R.subtotalUSD,
1055
+ billingCountry: Z,
1056
+ saveCard: R.saveCard,
1057
+ onSaveCardChange: R.setSaveCard,
1058
+ autoRenewEnabled: D === "PLAN" && R.autoRenew,
1059
+ isLoading: ft
1060
+ }),
1061
+ R.selectedProvider !== "CREDITS" && R.selectedProvider !== "AUTO" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "border-t border-border" }), /* @__PURE__ */ p("div", {
1062
+ className: "bg-muted/50 p-4 rounded-md",
1063
+ children: /* @__PURE__ */ m("div", {
1064
+ className: "flex items-start gap-3",
1065
+ children: [/* @__PURE__ */ p("svg", {
1066
+ className: "w-5 h-5 text-muted-foreground mt-0.5",
1067
+ fill: "none",
1068
+ stroke: "currentColor",
1069
+ viewBox: "0 0 24 24",
1070
+ children: /* @__PURE__ */ p("path", {
1071
+ strokeLinecap: "round",
1072
+ strokeLinejoin: "round",
1073
+ strokeWidth: 2,
1074
+ d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1075
+ })
1076
+ }), /* @__PURE__ */ m("div", {
1077
+ className: "flex-1 text-sm",
1078
+ children: [/* @__PURE__ */ m("p", {
1079
+ className: "font-medium text-foreground mb-1",
1080
+ children: ["Currency: ", R.selectedCurrency]
1081
+ }), /* @__PURE__ */ m("p", {
1082
+ className: "text-muted-foreground text-xs",
1083
+ children: [
1084
+ "All prices are shown in",
1085
+ " ",
1086
+ /* @__PURE__ */ p("strong", {
1087
+ className: "text-foreground",
1088
+ children: R.selectedCurrency
1089
+ }),
1090
+ " ",
1091
+ "based on your billing account settings.",
1092
+ R.selectedCurrency === "INR" && " GST will be applied at checkout."
1093
+ ]
1094
+ })]
1095
+ })]
1096
+ })
1097
+ })] }),
1098
+ D === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT" && /* @__PURE__ */ p("div", {
1099
+ className: "border-t border-border pt-4",
1100
+ children: /* @__PURE__ */ m("div", {
1101
+ className: "space-y-3",
1102
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
1103
+ className: "text-sm font-medium text-foreground",
1104
+ children: "Number of seats"
1105
+ }), V.getPlan.minSeats && /* @__PURE__ */ m("p", {
1106
+ className: "text-xs text-muted-foreground mt-0.5",
1107
+ children: [
1108
+ "Minimum ",
1109
+ V.getPlan.minSeats,
1110
+ " seat",
1111
+ V.getPlan.minSeats === 1 ? "" : "s",
1112
+ " required"
1113
+ ]
1114
+ })] }), /* @__PURE__ */ m("div", {
1115
+ className: "flex items-center gap-3",
1116
+ children: [
1117
+ /* @__PURE__ */ p("button", {
1118
+ type: "button",
1119
+ onClick: () => L((e) => Math.max(V.getPlan?.minSeats ?? 1, e - 1)),
1120
+ disabled: I <= (V.getPlan.minSeats ?? 1),
1121
+ className: "w-9 h-9 rounded-md border border-border flex items-center justify-center hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-foreground",
1122
+ children: "−"
1123
+ }),
1124
+ /* @__PURE__ */ p("input", {
1125
+ type: "number",
1126
+ value: I,
1127
+ min: V.getPlan.minSeats ?? 1,
1128
+ max: V.getPlan.maxSeats ?? 999,
1129
+ onChange: (e) => {
1130
+ let t = parseInt(e.target.value, 10);
1131
+ isNaN(t) || L(Math.max(V.getPlan?.minSeats ?? 1, t));
1132
+ },
1133
+ className: "w-20 h-9 text-center border border-border rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary"
1134
+ }),
1135
+ /* @__PURE__ */ p("button", {
1136
+ type: "button",
1137
+ onClick: () => L((e) => Math.min(V.getPlan?.maxSeats ?? 999, e + 1)),
1138
+ disabled: I >= (V.getPlan.maxSeats ?? 999),
1139
+ className: "w-9 h-9 rounded-md border border-border flex items-center justify-center hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-foreground",
1140
+ children: "+"
1141
+ }),
1142
+ V.getPlan.pricePerSeat && /* @__PURE__ */ m("span", {
1143
+ className: "text-sm text-muted-foreground",
1144
+ children: [
1145
+ "×",
1146
+ " ",
1147
+ V.getPlan.pricePerSeat.toLocaleString("en", {
1148
+ style: "currency",
1149
+ currency: V.getPlan.currency ?? "USD"
1150
+ }),
1151
+ " ",
1152
+ "=",
1153
+ " ",
1154
+ (V.getPlan.pricePerSeat * I).toLocaleString("en", {
1155
+ style: "currency",
1156
+ currency: V.getPlan.currency ?? "USD"
1157
+ }),
1158
+ "/mo"
1159
+ ]
1160
+ })
1161
+ ]
1162
+ })]
1163
+ })
1164
+ })
1165
+ ]
1166
+ })
1167
+ ]
1168
+ }), /* @__PURE__ */ p("div", {
1169
+ className: "lg:col-span-2",
1170
+ children: /* @__PURE__ */ m("div", {
1171
+ className: "lg:sticky lg:top-6 space-y-4",
1172
+ children: [
1173
+ /* @__PURE__ */ m("div", {
1174
+ className: "rounded-lg border border-border bg-card",
1175
+ children: [
1176
+ /* @__PURE__ */ p("div", {
1177
+ className: "p-4",
1178
+ children: /* @__PURE__ */ p(ge, {
1179
+ items: R.items,
1180
+ subtotal: R.subtotal,
1181
+ discountAmount: R.discountAmount,
1182
+ taxAmount: R.taxAmount,
1183
+ taxRate: R.taxRate,
1184
+ taxType: R.taxType,
1185
+ total: R.total,
1186
+ currency: R.selectedCurrency,
1187
+ isCalculatingTax: R.isCalculatingTax,
1188
+ showInCredits: R.selectedProvider === "CREDITS",
1189
+ onUpdateQuantity: D === "PLAN" ? void 0 : R.updateItemQuantity,
1190
+ onRemoveItem: R.removeItem,
1191
+ isEditable: D !== "PLAN"
1192
+ })
1193
+ }),
1194
+ /* @__PURE__ */ p("div", {
1195
+ className: "px-4 pb-4 border-t border-border pt-4",
1196
+ children: /* @__PURE__ */ p(_e, {
1197
+ value: R.promoCode,
1198
+ onChange: R.setPromoCode,
1199
+ onValidate: async () => await R.validatePromoCode(),
1200
+ onClear: R.clearPromoCode,
1201
+ isApplied: R.promoDiscount > 0,
1202
+ discountValue: R.promoDiscount,
1203
+ discountType: R.promoDiscountType,
1204
+ isValidating: R.isProcessing
1205
+ })
1206
+ }),
1207
+ D === "PLAN" && R.selectedProvider !== "CREDITS" && R.selectedProvider !== "AUTO" && (() => {
1208
+ let e = "", t = !1, n = !1;
1209
+ if (R.selectedPaymentMethodId) {
1210
+ let r = Y.find((e) => e.id === R.selectedPaymentMethodId);
1211
+ r && (e = `${r.type === "CREDIT_CARD" || r.type === "DEBIT_CARD" ? "Card" : r.type}${r.last4 ? ` •••• ${r.last4}` : ""}`, t = !0, n = !1);
1212
+ } else (R.selectedProvider === "RAZORPAY" || R.selectedProvider === "STRIPE") && (e = R.selectedProvider === "RAZORPAY" ? "new card (Razorpay)" : "new card (Stripe)", t = !0, n = !0);
1213
+ return /* @__PURE__ */ p("div", {
1214
+ className: "px-4 pb-4",
1215
+ children: /* @__PURE__ */ p(Se, {
1216
+ enabled: R.autoRenew,
1217
+ onToggle: (e) => {
1218
+ R.setAutoRenew(e), e && R.selectedPaymentMethodId && R.setAutoRenewPaymentMethodId(R.selectedPaymentMethodId);
1219
+ },
1220
+ hasPaymentMethodSelected: t,
1221
+ selectedPaymentMethodDisplay: e,
1222
+ isNewCard: n
1223
+ })
1224
+ });
1225
+ })()
1226
+ ]
1227
+ }),
1228
+ /* @__PURE__ */ p("button", {
1229
+ onClick: xt,
1230
+ disabled: R.isProcessing || !R.billingAccount || R.items.length === 0 || D === "ADDON" && !E && mt || D === "ADDON" && !E && W.length === 0 || D === "ADDON" && !E && !R.selectedSubscriptionId,
1231
+ className: "w-full px-6 py-4 rounded-lg bg-primary text-primary-foreground font-semibold\n hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed\n transition-colors flex items-center justify-center gap-2",
1232
+ children: R.isProcessing ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, { className: "h-5 w-5 animate-spin" }), "Processing..."] }) : R.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1233
+ }),
1234
+ /* @__PURE__ */ p("p", {
1235
+ className: "text-center text-xs text-muted-foreground",
1236
+ children: "🔒 Secure checkout with 256-bit SSL encryption"
1237
+ })
1238
+ ]
1239
+ })
1240
+ })]
1241
+ })
1242
+ ]
1243
+ });
1244
+ };
1245
+ //#endregion
1246
+ export { We as CheckoutPage };
1247
+
1248
+ //# sourceMappingURL=CheckoutPage.js.map