@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 @@
1
+ {"version":3,"file":"useBillingAccountSelection.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingAccountSelection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAQlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,EAAE,WAAW,MAAM,GAAG,IAAI,SAYhF,CAAC;AAEF,UAAU,iCAAiC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC7D,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,gCAAgC;IACxC,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,iCAAiC;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,0BAA0B,CAAC,EACzC,KAAK,EACL,eAAe,EACf,WAAmB,EACnB,YAAiC,GAClC,EAAE,iCAAiC,GAAG,gCAAgC,CA8EtE"}
@@ -0,0 +1,81 @@
1
+ import { useCallback as e, useEffect as t, useState as n } from "react";
2
+ import { useLocation as r } from "react-router-dom";
3
+ import { getProfileScopedKey as i } from "@burdenoff/fe-libs/shared/utils";
4
+ //#region src/billing/hooks/useBillingAccountSelection.ts
5
+ var a = "billing_selected_account_";
6
+ function o(e) {
7
+ if (!(typeof window > "u")) try {
8
+ let t = `${a}${e}`;
9
+ localStorage.getItem(t) && localStorage.removeItem(t);
10
+ } catch {}
11
+ }
12
+ var s = (e) => {
13
+ if (typeof window > "u") return null;
14
+ try {
15
+ let t = i(`billing-account-${e}`);
16
+ return localStorage.getItem(t);
17
+ } catch {
18
+ return null;
19
+ }
20
+ }, c = (e, t) => {
21
+ if (!(typeof window > "u")) try {
22
+ let n = i(`billing-account-${e}`);
23
+ t ? localStorage.setItem(n, t) : localStorage.removeItem(n);
24
+ } catch {}
25
+ };
26
+ function l({ orgId: i, billingAccounts: a, syncFromUrl: l = !1, urlParamName: u = "billingAccountId" }) {
27
+ let d = r();
28
+ t(() => {
29
+ o(i);
30
+ }, [i]);
31
+ let [f, p] = n(() => {
32
+ if (typeof window > "u") return null;
33
+ if (l) {
34
+ let e = new URLSearchParams(window.location.search).get(u);
35
+ if (e) return e;
36
+ }
37
+ return s(i);
38
+ }), m = e((e) => {
39
+ p(e), c(i, e);
40
+ }, [i]), h = e(() => {
41
+ p(null), c(i, null);
42
+ }, [i]);
43
+ return t(() => {
44
+ if (l) {
45
+ let e = new URLSearchParams(d.search).get(u);
46
+ if (e) {
47
+ p(e), c(i, e);
48
+ return;
49
+ }
50
+ }
51
+ let e = s(i);
52
+ e !== f && p(e);
53
+ }, [
54
+ d.pathname,
55
+ d.search,
56
+ i,
57
+ l,
58
+ u,
59
+ f
60
+ ]), t(() => {
61
+ f && a && a.length > 0 && (a.some((e) => e.id === f) || h());
62
+ }, [
63
+ f,
64
+ a,
65
+ h
66
+ ]), t(() => {
67
+ !f && a && a.length > 0 && m((a.find((e) => e.isDefault) || a[0]).id);
68
+ }, [
69
+ f,
70
+ a,
71
+ m
72
+ ]), {
73
+ selectedAccountId: f,
74
+ setSelectedAccountId: m,
75
+ clearSelection: h
76
+ };
77
+ }
78
+ //#endregion
79
+ export { s as getStoredBillingAccountId, c as setStoredBillingAccountId, l as useBillingAccountSelection };
80
+
81
+ //# sourceMappingURL=useBillingAccountSelection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingAccountSelection.js","names":[],"sources":["../../../src/billing/hooks/useBillingAccountSelection.ts"],"sourcesContent":["/**\n * Hook for managing billing account selection per org\n * Persists the selected account to localStorage and syncs across pages.\n * Keys are scoped by profile and org to support multi-user/multi-org usage.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { getProfileScopedKey } from '@burdenoff/fe-libs/shared/utils';\n\nconst LEGACY_KEY_PREFIX = 'billing_selected_account_';\n\n/**\n * Clean up legacy non-profile-scoped keys\n */\nfunction cleanupLegacyKeys(tenantId: string): void {\n if (typeof window === 'undefined') return;\n try {\n const key = `${LEGACY_KEY_PREFIX}${tenantId}`;\n if (localStorage.getItem(key)) {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore errors\n }\n}\n\n/**\n * Get stored account ID (handles finding active profile)\n */\nexport const getStoredBillingAccountId = (orgId: string): string | null => {\n if (typeof window === 'undefined') return null;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\n/**\n * Set stored account ID\n */\nexport const setStoredBillingAccountId = (orgId: string, accountId: string | null) => {\n if (typeof window === 'undefined') return;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n if (accountId) {\n localStorage.setItem(key, accountId);\n } else {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore localStorage errors\n }\n};\n\ninterface UseBillingAccountSelectionOptions {\n orgId: string;\n /** Available billing accounts to validate against */\n billingAccounts?: Array<{ id: string; isDefault?: boolean }>;\n /** Whether to sync from URL query param on navigation */\n syncFromUrl?: boolean;\n /** URL query param name (default: 'billingAccountId') */\n urlParamName?: string;\n}\n\ninterface UseBillingAccountSelectionResult {\n /** Currently selected billing account ID */\n selectedAccountId: string | null;\n /** Set the selected billing account (persists to localStorage) */\n setSelectedAccountId: (accountId: string | null) => void;\n /** Clear the stored selection */\n clearSelection: () => void;\n}\n\nexport function useBillingAccountSelection({\n orgId,\n billingAccounts,\n syncFromUrl = false,\n urlParamName = 'billingAccountId',\n}: UseBillingAccountSelectionOptions): UseBillingAccountSelectionResult {\n const location = useLocation();\n\n // Cleanup legacy keys on mount (still cleans old tenantId-based keys)\n useEffect(() => {\n cleanupLegacyKeys(orgId);\n }, [orgId]);\n\n // Initialize from URL (if syncFromUrl) or localStorage\n const [selectedAccountId, setSelectedAccountIdState] = useState<string | null>(() => {\n if (typeof window === 'undefined') return null;\n\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(window.location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) return urlAccountId;\n }\n\n return getStoredBillingAccountId(orgId);\n });\n\n // Set selected account and persist to localStorage\n const setSelectedAccountId = useCallback(\n (accountId: string | null) => {\n setSelectedAccountIdState(accountId);\n setStoredBillingAccountId(orgId, accountId);\n },\n [orgId]\n );\n\n // Clear stored selection\n const clearSelection = useCallback(() => {\n setSelectedAccountIdState(null);\n setStoredBillingAccountId(orgId, null);\n }, [orgId]);\n\n // Sync from URL/localStorage on navigation changes\n useEffect(() => {\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) {\n setSelectedAccountIdState(urlAccountId);\n setStoredBillingAccountId(orgId, urlAccountId);\n return;\n }\n }\n\n const storedId = getStoredBillingAccountId(orgId);\n if (storedId !== selectedAccountId) {\n setSelectedAccountIdState(storedId);\n }\n }, [location.pathname, location.search, orgId, syncFromUrl, urlParamName, selectedAccountId]);\n\n // Validate stored account exists - if not, clear it\n useEffect(() => {\n if (selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const accountExists = billingAccounts.some((a) => a.id === selectedAccountId);\n if (!accountExists) {\n clearSelection();\n }\n }\n }, [selectedAccountId, billingAccounts, clearSelection]);\n\n // Auto-select default account if none selected\n useEffect(() => {\n if (!selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const defaultAccount = billingAccounts.find((a) => a.isDefault);\n const accountToSelect = defaultAccount || billingAccounts[0];\n setSelectedAccountId(accountToSelect.id);\n }\n }, [selectedAccountId, billingAccounts, setSelectedAccountId]);\n\n return {\n selectedAccountId,\n setSelectedAccountId,\n clearSelection,\n };\n}\n"],"mappings":";;;;AAUA,IAAM,IAAoB;AAK1B,SAAS,EAAkB,GAAwB;AAC7C,cAAO,SAAW,KACtB,KAAI;EACF,IAAM,IAAM,GAAG,IAAoB;AACnC,EAAI,aAAa,QAAQ,EAAI,IAC3B,aAAa,WAAW,EAAI;SAExB;;AAQV,IAAa,KAA6B,MAAiC;AACzE,KAAI,OAAO,SAAW,IAAa,QAAO;AAC1C,KAAI;EACF,IAAM,IAAM,EAAoB,mBAAmB,IAAQ;AAC3D,SAAO,aAAa,QAAQ,EAAI;SAC1B;AACN,SAAO;;GAOE,KAA6B,GAAe,MAA6B;AAChF,cAAO,SAAW,KACtB,KAAI;EACF,IAAM,IAAM,EAAoB,mBAAmB,IAAQ;AAC3D,EAAI,IACF,aAAa,QAAQ,GAAK,EAAU,GAEpC,aAAa,WAAW,EAAI;SAExB;;AAwBV,SAAgB,EAA2B,EACzC,UACA,oBACA,iBAAc,IACd,kBAAe,sBACuD;CACtE,IAAM,IAAW,GAAa;AAG9B,SAAgB;AACd,IAAkB,EAAM;IACvB,CAAC,EAAM,CAAC;CAGX,IAAM,CAAC,GAAmB,KAA6B,QAA8B;AACnF,MAAI,OAAO,SAAW,IAAa,QAAO;AAE1C,MAAI,GAAa;GAEf,IAAM,IADY,IAAI,gBAAgB,OAAO,SAAS,OAAO,CAC9B,IAAI,EAAa;AAChD,OAAI,EAAc,QAAO;;AAG3B,SAAO,EAA0B,EAAM;GACvC,EAGI,IAAuB,GAC1B,MAA6B;AAE5B,EADA,EAA0B,EAAU,EACpC,EAA0B,GAAO,EAAU;IAE7C,CAAC,EAAM,CACR,EAGK,IAAiB,QAAkB;AAEvC,EADA,EAA0B,KAAK,EAC/B,EAA0B,GAAO,KAAK;IACrC,CAAC,EAAM,CAAC;AAuCX,QApCA,QAAgB;AACd,MAAI,GAAa;GAEf,IAAM,IADY,IAAI,gBAAgB,EAAS,OAAO,CACvB,IAAI,EAAa;AAChD,OAAI,GAAc;AAEhB,IADA,EAA0B,EAAa,EACvC,EAA0B,GAAO,EAAa;AAC9C;;;EAIJ,IAAM,IAAW,EAA0B,EAAM;AACjD,EAAI,MAAa,KACf,EAA0B,EAAS;IAEpC;EAAC,EAAS;EAAU,EAAS;EAAQ;EAAO;EAAa;EAAc;EAAkB,CAAC,EAG7F,QAAgB;AACd,EAAI,KAAqB,KAAmB,EAAgB,SAAS,MAC7C,EAAgB,MAAM,MAAM,EAAE,OAAO,EAAkB,IAE3E,GAAgB;IAGnB;EAAC;EAAmB;EAAiB;EAAe,CAAC,EAGxD,QAAgB;AACd,EAAI,CAAC,KAAqB,KAAmB,EAAgB,SAAS,KAGpE,GAFuB,EAAgB,MAAM,MAAM,EAAE,UAAU,IACrB,EAAgB,IACrB,GAAG;IAEzC;EAAC;EAAmB;EAAiB;EAAqB,CAAC,EAEvD;EACL;EACA;EACA;EACD"}
@@ -0,0 +1,8 @@
1
+ import { BillingLifecyclePayload } from '@burdenoff/fe-libs/shared/events';
2
+
3
+ export type BillingDomainEvent = 'billing.billing_account.viewed' | 'billing.billing_account.created' | 'billing.billing_account.updated' | 'billing.billing_account.archived' | 'billing.subscription.viewed' | 'billing.subscription.cancelled' | 'billing.plan.viewed' | 'billing.addon.viewed' | 'billing.checkout.viewed' | 'billing.checkout.initiated' | 'billing.checkout.failed' | 'billing.payment.succeeded' | 'billing.payment.failed' | 'billing.invoice.viewed' | 'billing.payment_method.viewed' | 'billing.payment_method.added' | 'billing.payment_method.default_set' | 'billing.payment_method.deleted' | 'billing.credit.viewed' | 'billing.credits.spent' | 'billing.credits.granted' | 'billing.credits.withdrawal_requested' | 'billing.quota.viewed' | 'billing.usage.viewed' | 'billing.transaction.viewed' | 'billing.affiliate.viewed' | 'billing.affiliate_code.created' | 'billing.affiliate_code.updated' | 'billing.affiliate_code.deactivated' | 'billing.affiliate_code.note_added' | 'billing.earning.viewed' | 'billing.payout.viewed' | 'billing.payout_account.added' | 'billing.payout_account.updated' | 'billing.payout_account.archived' | 'billing.payout.requested' | 'billing.payout.approved' | 'billing.payout.rejected' | 'billing.payout.processed';
4
+ export type BillingEventPayload = BillingLifecyclePayload;
5
+ export declare function useBillingEventEmitter(): {
6
+ emit: (event: BillingDomainEvent, payload?: BillingEventPayload) => void;
7
+ };
8
+ //# sourceMappingURL=useBillingEventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingEventEmitter.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingEventEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,MAAM,MAAM,kBAAkB,GAC1B,gCAAgC,GAChC,iCAAiC,GACjC,iCAAiC,GACjC,kCAAkC,GAClC,6BAA6B,GAC7B,gCAAgC,GAChC,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,GACzB,4BAA4B,GAC5B,yBAAyB,GACzB,2BAA2B,GAC3B,wBAAwB,GACxB,wBAAwB,GACxB,+BAA+B,GAC/B,8BAA8B,GAC9B,oCAAoC,GACpC,gCAAgC,GAChC,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,sCAAsC,GACtC,sBAAsB,GACtB,sBAAsB,GACtB,4BAA4B,GAC5B,0BAA0B,GAC1B,gCAAgC,GAChC,gCAAgC,GAChC,oCAAoC,GACpC,mCAAmC,GACnC,wBAAwB,GACxB,uBAAuB,GACvB,8BAA8B,GAC9B,gCAAgC,GAChC,iCAAiC,GACjC,0BAA0B,GAC1B,yBAAyB,GACzB,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,wBAAgB,sBAAsB,IAAI;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC1E,CAeA"}
@@ -0,0 +1,15 @@
1
+ import { useCallback as e } from "react";
2
+ import { useEventBus as t } from "@burdenoff/fe-libs/shared/events";
3
+ //#region src/billing/hooks/useBillingEventEmitter.ts
4
+ function n() {
5
+ let n = t();
6
+ return { emit: e((e, t = {}) => {
7
+ try {
8
+ n.emit(e, t);
9
+ } catch {}
10
+ }, [n]) };
11
+ }
12
+ //#endregion
13
+ export { n as useBillingEventEmitter };
14
+
15
+ //# sourceMappingURL=useBillingEventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingEventEmitter.js","names":[],"sources":["../../../src/billing/hooks/useBillingEventEmitter.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useEventBus, type BillingLifecyclePayload } from '@burdenoff/fe-libs/shared/events';\n\nexport type BillingDomainEvent =\n | 'billing.billing_account.viewed'\n | 'billing.billing_account.created'\n | 'billing.billing_account.updated'\n | 'billing.billing_account.archived'\n | 'billing.subscription.viewed'\n | 'billing.subscription.cancelled'\n | 'billing.plan.viewed'\n | 'billing.addon.viewed'\n | 'billing.checkout.viewed'\n | 'billing.checkout.initiated'\n | 'billing.checkout.failed'\n | 'billing.payment.succeeded'\n | 'billing.payment.failed'\n | 'billing.invoice.viewed'\n | 'billing.payment_method.viewed'\n | 'billing.payment_method.added'\n | 'billing.payment_method.default_set'\n | 'billing.payment_method.deleted'\n | 'billing.credit.viewed'\n | 'billing.credits.spent'\n | 'billing.credits.granted'\n | 'billing.credits.withdrawal_requested'\n | 'billing.quota.viewed'\n | 'billing.usage.viewed'\n | 'billing.transaction.viewed'\n | 'billing.affiliate.viewed'\n | 'billing.affiliate_code.created'\n | 'billing.affiliate_code.updated'\n | 'billing.affiliate_code.deactivated'\n | 'billing.affiliate_code.note_added'\n | 'billing.earning.viewed'\n | 'billing.payout.viewed'\n | 'billing.payout_account.added'\n | 'billing.payout_account.updated'\n | 'billing.payout_account.archived'\n | 'billing.payout.requested'\n | 'billing.payout.approved'\n | 'billing.payout.rejected'\n | 'billing.payout.processed';\n\nexport type BillingEventPayload = BillingLifecyclePayload;\n\nexport function useBillingEventEmitter(): {\n emit: (event: BillingDomainEvent, payload?: BillingEventPayload) => void;\n} {\n const bus = useEventBus();\n\n const emit = useCallback(\n (event: BillingDomainEvent, payload: BillingEventPayload = {}) => {\n try {\n bus.emit(event, payload);\n } catch {\n // Event bus failures must never break billing user journeys.\n }\n },\n [bus]\n );\n\n return { emit };\n}\n"],"mappings":";;;AA8CA,SAAgB,IAEd;CACA,IAAM,IAAM,GAAa;AAazB,QAAO,EAAE,MAXI,GACV,GAA2B,IAA+B,EAAE,KAAK;AAChE,MAAI;AACF,KAAI,KAAK,GAAO,EAAQ;UAClB;IAIV,CAAC,EAAI,CACN,EAEc"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Custom navigation hook for the Billing microfrontend.
3
+ * Properly handles basePath when navigating within billing routes.
4
+ */
5
+ export interface NavigateOptions {
6
+ replace?: boolean;
7
+ state?: unknown;
8
+ }
9
+ /**
10
+ * Hook that returns a navigation function that properly prepends the basePath.
11
+ * This ensures all navigation within the billing microfrontend works correctly
12
+ * when integrated into a shell application with a basePath (e.g., '/billing').
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const navigateTo = useBillingNavigate();
17
+ *
18
+ * // Navigate to checkout
19
+ * navigateTo('/checkout/credits');
20
+ * // When basePath is '/billing', this navigates to '/billing/checkout/credits'
21
+ *
22
+ * // Navigate with state
23
+ * navigateTo('/checkout/plan-123', { state: { fromUpgrade: true } });
24
+ *
25
+ * // Navigate back in history
26
+ * navigateTo(-1);
27
+ * ```
28
+ */
29
+ export declare function useBillingNavigate(): (pathOrDelta: string | number, options?: NavigateOptions) => void;
30
+ //# sourceMappingURL=useBillingNavigate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingNavigate.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingNavigate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,kBAKhB,MAAM,GAAG,MAAM,YAAY,eAAe,UAoC3D"}
@@ -0,0 +1,23 @@
1
+ import { useBilling as e } from "../providers/BillingProvider.js";
2
+ import { useCallback as t } from "react";
3
+ import { useNavigate as n } from "react-router-dom";
4
+ //#region src/billing/hooks/useBillingNavigate.ts
5
+ function r() {
6
+ let { navigate: r, basePath: i } = e(), a = n();
7
+ return t((e, t) => {
8
+ if (typeof e == "number") {
9
+ a(e);
10
+ return;
11
+ }
12
+ let n = e, o = n;
13
+ i && i !== "/" && (o = `${i.endsWith("/") ? i.slice(0, -1) : i}${n.startsWith("/") ? n : `/${n}`}`), t && (t.replace || t.state) ? a(o, t) : r ? r(o) : a(o);
14
+ }, [
15
+ r,
16
+ i,
17
+ a
18
+ ]);
19
+ }
20
+ //#endregion
21
+ export { r as useBillingNavigate };
22
+
23
+ //# sourceMappingURL=useBillingNavigate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingNavigate.js","names":[],"sources":["../../../src/billing/hooks/useBillingNavigate.ts"],"sourcesContent":["/**\n * Custom navigation hook for the Billing microfrontend.\n * Properly handles basePath when navigating within billing routes.\n */\n\nimport { useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useBilling } from '../providers/BillingProvider';\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: unknown;\n}\n\n/**\n * Hook that returns a navigation function that properly prepends the basePath.\n * This ensures all navigation within the billing microfrontend works correctly\n * when integrated into a shell application with a basePath (e.g., '/billing').\n *\n * @example\n * ```tsx\n * const navigateTo = useBillingNavigate();\n *\n * // Navigate to checkout\n * navigateTo('/checkout/credits');\n * // When basePath is '/billing', this navigates to '/billing/checkout/credits'\n *\n * // Navigate with state\n * navigateTo('/checkout/plan-123', { state: { fromUpgrade: true } });\n *\n * // Navigate back in history\n * navigateTo(-1);\n * ```\n */\nexport function useBillingNavigate() {\n const { navigate, basePath } = useBilling();\n const routerNavigate = useNavigate();\n\n const navigateTo = useCallback(\n (pathOrDelta: string | number, options?: NavigateOptions) => {\n // Handle numeric delta (for back/forward navigation like navigate(-1))\n if (typeof pathOrDelta === 'number') {\n routerNavigate(pathOrDelta);\n return;\n }\n\n const path = pathOrDelta;\n\n // Handle path joining to avoid double slashes (e.g., / + /plans = //plans)\n let fullPath = path;\n\n if (basePath && basePath !== '/') {\n // Remove trailing slash from basePath and ensure path has leading slash\n const base = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n const suffix = path.startsWith('/') ? path : `/${path}`;\n fullPath = `${base}${suffix}`;\n }\n\n // The shell navigate function only accepts a path (no options)\n // For navigation with options (replace, state), use the router navigate directly\n if (options && (options.replace || options.state)) {\n // Use router navigate for options support\n routerNavigate(fullPath, options);\n } else if (navigate) {\n // Use shell navigate for simple navigation\n navigate(fullPath);\n } else {\n // Fallback to router navigate\n routerNavigate(fullPath);\n }\n },\n [navigate, basePath, routerNavigate]\n );\n\n return navigateTo;\n}\n"],"mappings":";;;;AAkCA,SAAgB,IAAqB;CACnC,IAAM,EAAE,aAAU,gBAAa,GAAY,EACrC,IAAiB,GAAa;AAsCpC,QApCmB,GAChB,GAA8B,MAA8B;AAE3D,MAAI,OAAO,KAAgB,UAAU;AACnC,KAAe,EAAY;AAC3B;;EAGF,IAAM,IAAO,GAGT,IAAW;AAWf,EATI,KAAY,MAAa,QAI3B,IAAW,GAFE,EAAS,SAAS,IAAI,GAAG,EAAS,MAAM,GAAG,GAAG,GAAG,IAC/C,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI,QAM/C,MAAY,EAAQ,WAAW,EAAQ,SAEzC,EAAe,GAAU,EAAQ,GACxB,IAET,EAAS,EAAS,GAGlB,EAAe,EAAS;IAG5B;EAAC;EAAU;EAAU;EAAe,CACrC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Hook for billing-specific RBAC permissions.
3
+ *
4
+ * Permission model aligns with the `@rbac` directives on global-billing-svc:
5
+ * resource: "billing"
6
+ * actions: "read" – view billing data
7
+ * "create" – create billing accounts, initiate payments
8
+ * "update" – modify billing accounts, payment methods, usage
9
+ * "delete" – remove payment methods, cancel subscriptions
10
+ * "manage" – admin-only (plans, addons, quotas, discounts, refunds, tax rates)
11
+ *
12
+ * The RBAC service resolves these via `billingAccount.*` permission strings:
13
+ * billingAccount.read → action: "read"
14
+ * billingAccount.create → action: "create"
15
+ * billingAccount.update → action: "update"
16
+ * billingAccount.delete → action: "delete"
17
+ * billingAccount.all → action: "manage" (admin bypass)
18
+ *
19
+ */
20
+ export declare function useBillingPermissions(): {
21
+ /** @rbac(action: "read", resource: "billing") */
22
+ canViewBillingAccount: boolean;
23
+ /** @rbac(action: "create", resource: "billing") */
24
+ canCreateBillingAccount: boolean;
25
+ /** @rbac(action: "update", resource: "billing") */
26
+ canManageBillingAccount: boolean;
27
+ /** @rbac(action: "delete", resource: "billing") — archiveBillingAccount */
28
+ canArchiveBillingAccount: boolean;
29
+ /** @rbac(action: "read", resource: "billing") */
30
+ canViewSubscriptions: boolean;
31
+ /** @rbac(action: "create", resource: "billing") — initiatePayment for plans */
32
+ canCreateSubscription: boolean;
33
+ /** @rbac(action: "update", resource: "billing") */
34
+ canUpdateSubscription: boolean;
35
+ /** @rbac(action: "delete", resource: "billing") — cancelSubscription */
36
+ canCancelSubscription: boolean;
37
+ /** @rbac(action: "read", resource: "billing") */
38
+ canViewPlans: boolean;
39
+ /** @rbac(action: "manage", resource: "billing") — createPlan, updatePlan, togglePlan */
40
+ canManagePlans: boolean;
41
+ /** @rbac(action: "read", resource: "billing") */
42
+ canViewAddons: boolean;
43
+ /** @rbac(action: "manage", resource: "billing") — createAddOns, updateAddOnDetails, toggleAddOn */
44
+ canManageAddons: boolean;
45
+ /** @rbac(action: "read", resource: "billing") */
46
+ canViewQuotas: boolean;
47
+ /** @rbac(action: "manage", resource: "billing") — createQuota, updateQuota */
48
+ canManageQuotas: boolean;
49
+ /** @rbac(action: "read", resource: "billing") */
50
+ canViewInvoices: boolean;
51
+ /** @rbac(action: "update", resource: "billing") — payInvoice */
52
+ canPayInvoice: boolean;
53
+ /** @rbac(action: "manage", resource: "billing") — voidInvoice, generateInvoice */
54
+ canVoidInvoice: boolean;
55
+ /** @rbac(action: "read", resource: "billing") */
56
+ canViewPayments: boolean;
57
+ /** @rbac(action: "create", resource: "billing") — initiatePayment */
58
+ canProcessPayment: boolean;
59
+ /** @rbac(action: "read", resource: "billing") */
60
+ canViewPaymentMethods: boolean;
61
+ /** @rbac(action: "update", resource: "billing") — addPaymentMethod, updatePaymentMethod */
62
+ canManagePaymentMethods: boolean;
63
+ /** @rbac(action: "read", resource: "billing") */
64
+ canViewUsage: boolean;
65
+ /** @rbac(action: "update", resource: "billing") — addUsage, freeUpUsage */
66
+ canRecordUsage: boolean;
67
+ /** @rbac(action: "read", resource: "billing") */
68
+ canViewCredits: boolean;
69
+ /** @rbac(action: "update", resource: "billing") — spendCredits */
70
+ canIssueCredit: boolean;
71
+ /** @rbac(action: "update", resource: "billing") — requestCreditWithdrawal */
72
+ canWithdrawCredits: boolean;
73
+ /** @rbac(action: "manage", resource: "billing") — grantCredits */
74
+ canGrantCredits: boolean;
75
+ /** @rbac(action: "update", resource: "billing") — applyBillingDiscount */
76
+ canApplyDiscount: boolean;
77
+ /** @rbac(action: "manage", resource: "billing") — createDiscount, updateDiscount, deleteDiscount */
78
+ canManageDiscounts: boolean;
79
+ /** @rbac(action: "read", resource: "billing") */
80
+ canViewAnalytics: boolean;
81
+ /** @rbac(action: "manage", resource: "billing") — processRefund, skipRefund, retryRefund */
82
+ canProcessRefund: boolean;
83
+ /** @rbac(action: "manage", resource: "billing") */
84
+ canManageRecurringBilling: boolean;
85
+ /** @rbac(action: "manage", resource: "billing") — createEntitlement, updateEntitlement, deleteEntitlement */
86
+ canManageEntitlements: boolean;
87
+ /** @rbac(action: "manage", resource: "billing") — createTaxRate, updateTaxRate, deleteTaxRate */
88
+ canManageTaxRates: boolean;
89
+ /** Full billing admin (billing:manage) */
90
+ isBillingAdmin: boolean;
91
+ /** Whether permissions are still being loaded from RBAC service */
92
+ isLoading: boolean;
93
+ };
94
+ //# sourceMappingURL=useBillingPermissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingPermissions.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useBillingPermissions.ts"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB;IAuEjC,iDAAiD;;IAEjD,mDAAmD;;IAEnD,mDAAmD;;IAEnD,2EAA2E;;IAI3E,iDAAiD;;IAEjD,+EAA+E;;IAE/E,mDAAmD;;IAEnD,wEAAwE;;IAIxE,iDAAiD;;IAEjD,wFAAwF;;IAIxF,iDAAiD;;IAEjD,mGAAmG;;IAInG,iDAAiD;;IAEjD,8EAA8E;;IAI9E,iDAAiD;;IAEjD,gEAAgE;;IAEhE,kFAAkF;;IAIlF,iDAAiD;;IAEjD,qEAAqE;;IAIrE,iDAAiD;;IAEjD,2FAA2F;;IAI3F,iDAAiD;;IAEjD,2EAA2E;;IAI3E,iDAAiD;;IAEjD,kEAAkE;;IAElE,6EAA6E;;IAE7E,kEAAkE;;IAIlE,0EAA0E;;IAE1E,oGAAoG;;IAIpG,iDAAiD;;IAIjD,4FAA4F;;IAI5F,mDAAmD;;IAInD,6GAA6G;;IAI7G,iGAAiG;;IAIjG,0CAA0C;;IAI1C,mEAAmE;;EAGtE"}
@@ -0,0 +1,78 @@
1
+ import { useBilling as e } from "../providers/BillingProvider.js";
2
+ import { useBillingAccountSelection as t } from "./useBillingAccountSelection.js";
3
+ import { directBillingGraphqlRequest as n } from "../shared/utils/directBillingGraphql.js";
4
+ import "../shared/utils/index.js";
5
+ import { useMemo as r } from "react";
6
+ import { useAuth as i, usePermissions as a } from "@burdenoff/fe-libs/shared/providers/shell";
7
+ import { useQuery as o } from "@tanstack/react-query";
8
+ //#region src/billing/hooks/useBillingPermissions.ts
9
+ var s = ["billing:read", "billing.read"], c = ["billing:create", "billing.create"], l = ["billing:update", "billing.update"], u = ["billing:delete", "billing.delete"], d = ["billing:manage", "billing.manage"], f = "\n query BillingScopeMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n actorId\n scopeId\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n }\n";
10
+ function p(e) {
11
+ return e.flatMap((e) => {
12
+ let t = [];
13
+ return e.level === "ADMIN" && t.push(`${e.resourceType}:*`), t.push(...e.allowedActions.map((t) => `${e.resourceType}:${t}`)), t;
14
+ });
15
+ }
16
+ function m() {
17
+ let { isAuthenticated: m } = i(), { hasPermission: h, isLoading: g } = a(), { apiGatewayUrl: _, authToken: v, orgId: y } = e(), { selectedAccountId: b } = t({
18
+ orgId: y,
19
+ syncFromUrl: !0,
20
+ urlParamName: "billingAccountId"
21
+ }), x = b ?? void 0, S = o({
22
+ queryKey: ["billing-scope-permissions", x],
23
+ enabled: m && !!x,
24
+ staleTime: 300 * 1e3,
25
+ queryFn: async () => p((await n({
26
+ apiGatewayUrl: _,
27
+ authToken: v,
28
+ orgId: y,
29
+ query: f,
30
+ variables: { scopeId: x }
31
+ }))?.myPermissions?.permissions ?? [])
32
+ }), C = r(() => S.data ?? [], [S.data]), w = (e) => {
33
+ let [t] = e.split(/[:.]/);
34
+ return C.includes(e) || C.includes(`${t}:*`);
35
+ }, T = (e) => e.some((e) => h(e) || w(e)), E = m && T(s), D = m && T(c), O = m && T(l), k = m && T(u), A = m && T(d);
36
+ return {
37
+ canViewBillingAccount: E,
38
+ canCreateBillingAccount: D,
39
+ canManageBillingAccount: O,
40
+ canArchiveBillingAccount: k,
41
+ canViewSubscriptions: E,
42
+ canCreateSubscription: D,
43
+ canUpdateSubscription: O,
44
+ canCancelSubscription: k,
45
+ canViewPlans: E,
46
+ canManagePlans: A,
47
+ canViewAddons: E,
48
+ canManageAddons: A,
49
+ canViewQuotas: E,
50
+ canManageQuotas: A,
51
+ canViewInvoices: E,
52
+ canPayInvoice: O,
53
+ canVoidInvoice: A,
54
+ canViewPayments: E,
55
+ canProcessPayment: D,
56
+ canViewPaymentMethods: E,
57
+ canManagePaymentMethods: O,
58
+ canViewUsage: E,
59
+ canRecordUsage: O,
60
+ canViewCredits: E,
61
+ canIssueCredit: O,
62
+ canWithdrawCredits: O,
63
+ canGrantCredits: A,
64
+ canApplyDiscount: O,
65
+ canManageDiscounts: A,
66
+ canViewAnalytics: E,
67
+ canProcessRefund: A,
68
+ canManageRecurringBilling: A,
69
+ canManageEntitlements: A,
70
+ canManageTaxRates: A,
71
+ isBillingAdmin: A,
72
+ isLoading: g || !!x && S.isLoading
73
+ };
74
+ }
75
+ //#endregion
76
+ export { m as useBillingPermissions };
77
+
78
+ //# sourceMappingURL=useBillingPermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBillingPermissions.js","names":[],"sources":["../../../src/billing/hooks/useBillingPermissions.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { useMemo } from 'react';\nimport { useAuth, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useBilling } from '../providers/BillingProvider';\nimport { useBillingAccountSelection } from './useBillingAccountSelection';\nimport { directBillingGraphqlRequest } from '../shared/utils';\n\n// Permission strings emitted by global-billing-svc @rbac directives.\n// We accept both `:` and `.` separators because the RBAC service has\n// historically returned both shapes in `myPermissions.permissions[]`.\nconst BILLING_READ = ['billing:read', 'billing.read'];\nconst BILLING_CREATE = ['billing:create', 'billing.create'];\nconst BILLING_UPDATE = ['billing:update', 'billing.update'];\nconst BILLING_DELETE = ['billing:delete', 'billing.delete'];\nconst BILLING_MANAGE = ['billing:manage', 'billing.manage'];\n\nconst BILLING_SCOPE_PERMISSIONS_QUERY = `\n query BillingScopeMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n actorId\n scopeId\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n }\n`;\n\ninterface RawPerm {\n resourceType: string;\n level: string;\n allowedActions: string[];\n}\n\nfunction permsToStrings(perms: RawPerm[]): string[] {\n return perms.flatMap((p) => {\n const out: string[] = [];\n if (p.level === 'ADMIN') out.push(`${p.resourceType}:*`);\n out.push(...p.allowedActions.map((a) => `${p.resourceType}:${a}`));\n return out;\n });\n}\n\n/**\n * Hook for billing-specific RBAC permissions.\n *\n * Permission model aligns with the `@rbac` directives on global-billing-svc:\n * resource: \"billing\"\n * actions: \"read\" – view billing data\n * \"create\" – create billing accounts, initiate payments\n * \"update\" – modify billing accounts, payment methods, usage\n * \"delete\" – remove payment methods, cancel subscriptions\n * \"manage\" – admin-only (plans, addons, quotas, discounts, refunds, tax rates)\n *\n * The RBAC service resolves these via `billingAccount.*` permission strings:\n * billingAccount.read → action: \"read\"\n * billingAccount.create → action: \"create\"\n * billingAccount.update → action: \"update\"\n * billingAccount.delete → action: \"delete\"\n * billingAccount.all → action: \"manage\" (admin bypass)\n *\n */\nexport function useBillingPermissions() {\n const { isAuthenticated } = useAuth();\n // Org-scope permissions from the top-level PermissionProvider. Covers\n // Org Owner / Org Admin permissions on the `billing` resource.\n const { hasPermission: hasOrgPermission, isLoading: orgIsLoading } = usePermissions();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n\n // Billing-account-scope permissions. Covers Billing Admin / Billing Viewer\n // role assignments on the currently-active billing account. Required\n // because PermissionProvider only fetches a single scope (org), so a\n // user who is *only* a Billing Admin (not Org Owner) would otherwise see\n // empty perms on the billing pages.\n // Resolve account scope from the current URL when present, otherwise fall\n // back to the last selected billing account stored for this org. That keeps\n // route guards aligned with SPA navigation *and* with list/detail flows that\n // rely on persisted account selection.\n const { selectedAccountId } = useBillingAccountSelection({\n orgId,\n syncFromUrl: true,\n urlParamName: 'billingAccountId',\n });\n const billingAccountId = selectedAccountId ?? undefined;\n const billingScopeQuery = useQuery({\n queryKey: ['billing-scope-permissions', billingAccountId],\n enabled: isAuthenticated && Boolean(billingAccountId),\n staleTime: 5 * 60 * 1000,\n queryFn: async () => {\n const data = await directBillingGraphqlRequest<{\n myPermissions: { permissions: RawPerm[] };\n }>({\n apiGatewayUrl,\n authToken,\n orgId,\n query: BILLING_SCOPE_PERMISSIONS_QUERY,\n variables: { scopeId: billingAccountId },\n });\n return permsToStrings(data?.myPermissions?.permissions ?? []);\n },\n });\n\n const billingScopeStrings = useMemo<string[]>(\n () => billingScopeQuery.data ?? [],\n [billingScopeQuery.data]\n );\n\n const matchesBillingScope = (permission: string): boolean => {\n // Wildcard match: e.g. `billing:read` matches stored `billing:*`.\n const [resource] = permission.split(/[:.]/);\n return (\n billingScopeStrings.includes(permission) || billingScopeStrings.includes(`${resource}:*`)\n );\n };\n\n // Pure RBAC: every check goes through the gateway-evaluated permission\n // set returned by `myPermissions`. No email-domain or role-name fallback —\n // those legacy escape hatches caused divergence between UI and gateway\n // enforcement and have been removed now that billing-scope roles\n // (Billing Admin / Billing Viewer) are auto-assigned on account creation.\n const hasAnyPermission = (permissions: string[]): boolean =>\n permissions.some((p) => hasOrgPermission(p) || matchesBillingScope(p));\n\n const canRead = isAuthenticated && hasAnyPermission(BILLING_READ);\n const canCreate = isAuthenticated && hasAnyPermission(BILLING_CREATE);\n const canUpdate = isAuthenticated && hasAnyPermission(BILLING_UPDATE);\n const canDelete = isAuthenticated && hasAnyPermission(BILLING_DELETE);\n const canManage = isAuthenticated && hasAnyPermission(BILLING_MANAGE);\n\n const isLoading = orgIsLoading || (Boolean(billingAccountId) && billingScopeQuery.isLoading);\n\n return {\n // ── Billing account ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewBillingAccount: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") */\n canCreateBillingAccount: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canManageBillingAccount: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — archiveBillingAccount */\n canArchiveBillingAccount: canDelete,\n\n // ── Subscriptions ─────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewSubscriptions: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment for plans */\n canCreateSubscription: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canUpdateSubscription: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — cancelSubscription */\n canCancelSubscription: canDelete,\n\n // ── Plans (admin-only management) ─────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPlans: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createPlan, updatePlan, togglePlan */\n canManagePlans: canManage,\n\n // ── Addons (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAddons: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createAddOns, updateAddOnDetails, toggleAddOn */\n canManageAddons: canManage,\n\n // ── Quotas (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewQuotas: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createQuota, updateQuota */\n canManageQuotas: canManage,\n\n // ── Invoices ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewInvoices: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — payInvoice */\n canPayInvoice: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — voidInvoice, generateInvoice */\n canVoidInvoice: canManage,\n\n // ── Payments ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPayments: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment */\n canProcessPayment: canCreate,\n\n // ── Payment Methods ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPaymentMethods: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addPaymentMethod, updatePaymentMethod */\n canManagePaymentMethods: canUpdate,\n\n // ── Usage ─────────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewUsage: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addUsage, freeUpUsage */\n canRecordUsage: canUpdate,\n\n // ── Credits ───────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewCredits: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — spendCredits */\n canIssueCredit: canUpdate,\n /** @rbac(action: \"update\", resource: \"billing\") — requestCreditWithdrawal */\n canWithdrawCredits: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — grantCredits */\n canGrantCredits: canManage,\n\n // ── Discounts ─────────────────────────────────────────────────────\n /** @rbac(action: \"update\", resource: \"billing\") — applyBillingDiscount */\n canApplyDiscount: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — createDiscount, updateDiscount, deleteDiscount */\n canManageDiscounts: canManage,\n\n // ── Analytics ─────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAnalytics: canRead,\n\n // ── Refunds (admin-only) ──────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — processRefund, skipRefund, retryRefund */\n canProcessRefund: canManage,\n\n // ── Recurring Billing (admin/service-only) ────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") */\n canManageRecurringBilling: canManage,\n\n // ── Entitlements (admin-only) ─────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createEntitlement, updateEntitlement, deleteEntitlement */\n canManageEntitlements: canManage,\n\n // ── Tax Rates (admin-only) ────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createTaxRate, updateTaxRate, deleteTaxRate */\n canManageTaxRates: canManage,\n\n // ── Admin check ───────────────────────────────────────────────────\n /** Full billing admin (billing:manage) */\n isBillingAdmin: canManage,\n\n // ── Loading state ─────────────────────────────────────────────────\n /** Whether permissions are still being loaded from RBAC service */\n isLoading,\n };\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAe,CAAC,gBAAgB,eAAe,EAC/C,IAAiB,CAAC,kBAAkB,iBAAiB,EACrD,IAAiB,CAAC,kBAAkB,iBAAiB,EACrD,IAAiB,CAAC,kBAAkB,iBAAiB,EACrD,IAAiB,CAAC,kBAAkB,iBAAiB,EAErD,IAAkC;AAoBxC,SAAS,EAAe,GAA4B;AAClD,QAAO,EAAM,SAAS,MAAM;EAC1B,IAAM,IAAgB,EAAE;AAGxB,SAFI,EAAE,UAAU,WAAS,EAAI,KAAK,GAAG,EAAE,aAAa,IAAI,EACxD,EAAI,KAAK,GAAG,EAAE,eAAe,KAAK,MAAM,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC,EAC3D;GACP;;AAsBJ,SAAgB,IAAwB;CACtC,IAAM,EAAE,uBAAoB,GAAS,EAG/B,EAAE,eAAe,GAAkB,WAAW,MAAiB,GAAgB,EAC/E,EAAE,kBAAe,cAAW,aAAU,GAAY,EAWlD,EAAE,yBAAsB,EAA2B;EACvD;EACA,aAAa;EACb,cAAc;EACf,CAAC,EACI,IAAmB,KAAqB,KAAA,GACxC,IAAoB,EAAS;EACjC,UAAU,CAAC,6BAA6B,EAAiB;EACzD,SAAS,KAAmB,EAAQ;EACpC,WAAW,MAAS;EACpB,SAAS,YAUA,GATM,MAAM,EAEhB;GACD;GACA;GACA;GACA,OAAO;GACP,WAAW,EAAE,SAAS,GAAkB;GACzC,CAAC,GAC0B,eAAe,eAAe,EAAE,CAAC;EAEhE,CAAC,EAEI,IAAsB,QACpB,EAAkB,QAAQ,EAAE,EAClC,CAAC,EAAkB,KAAK,CACzB,EAEK,KAAuB,MAAgC;EAE3D,IAAM,CAAC,KAAY,EAAW,MAAM,OAAO;AAC3C,SACE,EAAoB,SAAS,EAAW,IAAI,EAAoB,SAAS,GAAG,EAAS,IAAI;IASvF,KAAoB,MACxB,EAAY,MAAM,MAAM,EAAiB,EAAE,IAAI,EAAoB,EAAE,CAAC,EAElE,IAAU,KAAmB,EAAiB,EAAa,EAC3D,IAAY,KAAmB,EAAiB,EAAe,EAC/D,IAAY,KAAmB,EAAiB,EAAe,EAC/D,IAAY,KAAmB,EAAiB,EAAe,EAC/D,IAAY,KAAmB,EAAiB,EAAe;AAIrE,QAAO;EAGL,uBAAuB;EAEvB,yBAAyB;EAEzB,yBAAyB;EAEzB,0BAA0B;EAI1B,sBAAsB;EAEtB,uBAAuB;EAEvB,uBAAuB;EAEvB,uBAAuB;EAIvB,cAAc;EAEd,gBAAgB;EAIhB,eAAe;EAEf,iBAAiB;EAIjB,eAAe;EAEf,iBAAiB;EAIjB,iBAAiB;EAEjB,eAAe;EAEf,gBAAgB;EAIhB,iBAAiB;EAEjB,mBAAmB;EAInB,uBAAuB;EAEvB,yBAAyB;EAIzB,cAAc;EAEd,gBAAgB;EAIhB,gBAAgB;EAEhB,gBAAgB;EAEhB,oBAAoB;EAEpB,iBAAiB;EAIjB,kBAAkB;EAElB,oBAAoB;EAIpB,kBAAkB;EAIlB,kBAAkB;EAIlB,2BAA2B;EAI3B,uBAAuB;EAIvB,mBAAmB;EAInB,gBAAgB;EAIhB,WA7GgB,KAAiB,EAAQ,KAAqB,EAAkB;EA8GjF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns the currency of the user's default billing account (e.g. "INR", "USD").
3
+ * Falls back to "USD" while loading or if no billing account exists.
4
+ */
5
+ export declare function useDefaultBillingCurrency(): string;
6
+ /**
7
+ * Given a plan/addon's base price + currency and an optional currencyPrices map,
8
+ * returns the best price/currency to display for the given target currency.
9
+ */
10
+ export declare function getDisplayPrice(basePrice: number, baseCurrency: string, currencyPrices: Record<string, number> | null | undefined, targetCurrency: string): {
11
+ price: number;
12
+ currency: string;
13
+ };
14
+ //# sourceMappingURL=useDefaultBillingCurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDefaultBillingCurrency.d.ts","sourceRoot":"","sources":["../../../src/billing/hooks/useDefaultBillingCurrency.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAGlD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EACzD,cAAc,EAAE,MAAM,GACrB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQrC"}
@@ -0,0 +1,23 @@
1
+ import { useGetDefaultBillingAccountCheckoutQuery as e } from "../../generated/global-operations.js";
2
+ //#region src/billing/hooks/useDefaultBillingCurrency.ts
3
+ function t() {
4
+ let { data: t } = e();
5
+ return t?.getDefaultBillingAccount?.currency ?? "USD";
6
+ }
7
+ function n(e, t, n, r) {
8
+ if (r && r !== t && n) {
9
+ let e = n[r];
10
+ if (e != null && e > 0) return {
11
+ price: e,
12
+ currency: r
13
+ };
14
+ }
15
+ return {
16
+ price: e,
17
+ currency: t || "USD"
18
+ };
19
+ }
20
+ //#endregion
21
+ export { n as getDisplayPrice, t as useDefaultBillingCurrency };
22
+
23
+ //# sourceMappingURL=useDefaultBillingCurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDefaultBillingCurrency.js","names":[],"sources":["../../../src/billing/hooks/useDefaultBillingCurrency.ts"],"sourcesContent":["import { useGetDefaultBillingAccountCheckoutQuery } from '../../generated/global-operations';\n\n/**\n * Returns the currency of the user's default billing account (e.g. \"INR\", \"USD\").\n * Falls back to \"USD\" while loading or if no billing account exists.\n */\nexport function useDefaultBillingCurrency(): string {\n const { data } = useGetDefaultBillingAccountCheckoutQuery();\n return data?.getDefaultBillingAccount?.currency ?? 'USD';\n}\n\n/**\n * Given a plan/addon's base price + currency and an optional currencyPrices map,\n * returns the best price/currency to display for the given target currency.\n */\nexport function getDisplayPrice(\n basePrice: number,\n baseCurrency: string,\n currencyPrices: Record<string, number> | null | undefined,\n targetCurrency: string\n): { price: number; currency: string } {\n if (targetCurrency && targetCurrency !== baseCurrency && currencyPrices) {\n const override = (currencyPrices as Record<string, number>)[targetCurrency];\n if (override != null && override > 0) {\n return { price: override, currency: targetCurrency };\n }\n }\n return { price: basePrice, currency: baseCurrency || 'USD' };\n}\n"],"mappings":";;AAMA,SAAgB,IAAoC;CAClD,IAAM,EAAE,YAAS,GAA0C;AAC3D,QAAO,GAAM,0BAA0B,YAAY;;AAOrD,SAAgB,EACd,GACA,GACA,GACA,GACqC;AACrC,KAAI,KAAkB,MAAmB,KAAgB,GAAgB;EACvE,IAAM,IAAY,EAA0C;AAC5D,MAAI,KAAY,QAAQ,IAAW,EACjC,QAAO;GAAE,OAAO;GAAU,UAAU;GAAgB;;AAGxD,QAAO;EAAE,OAAO;EAAW,UAAU,KAAgB;EAAO"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Billing Microfrontend
3
+ *
4
+ * Provides a complete billing and subscription management interface
5
+ * for managing subscriptions, payments, invoices, usage tracking, and revenue analytics.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { BillingRoot, type BillingRootProps } from '@burdenoff/microfe-billing';
10
+ *
11
+ * function App() {
12
+ * const props: BillingRootProps = {
13
+ * basePath: '/billing',
14
+ * navigate: (path) => router.push(path),
15
+ * currentUser: { id: '1', email: 'user@example.com' },
16
+ * workspaceId: 'ws-123',
17
+ * orgId: 'org-123',
18
+ * apiGatewayUrl: 'https://api.example.com/tenant/graphql',
19
+ * authToken: 'token',
20
+ * stripePublishableKey: 'pk_test_...',
21
+ * razorpayKey: 'rzp_test_...',
22
+ * };
23
+ *
24
+ * return <BillingRoot {...props} />;
25
+ * }
26
+ * ```
27
+ */
28
+ export { BillingRoot } from './BillingRoot';
29
+ export type { BillingRootProps, SubscriptionSummary, PaymentSummary, SubscriptionStatus, InvoiceStatus, PaymentStatus, PaymentMethodType, PaymentGateway, PlanInterval, PricingModel, TransactionType, UsageDimension, UsagePeriod, ViewMode, BillingAccount, Plan, PlanFeature, Subscription, Invoice, InvoiceLineItem, Payment, PaymentMethod, UsageRecord, Transaction, RevenueMetrics, } from './types';
30
+ export { useBilling } from './providers/BillingProvider';
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,OAAO,EACP,eAAe,EACf,OAAO,EACP,aAAa,EACb,WAAW,EACX,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { PURCHASE_TYPE, Product, Transaction } from '@capgo/native-purchases';
2
+
3
+ export type { Product as NativeProduct, Transaction as NativeTransaction };
4
+ export type { PURCHASE_TYPE as NativePurchaseType };
5
+ /** True when running inside a Capacitor iOS or Android app. */
6
+ export declare function isNativeIAPAvailable(): boolean;
7
+ /**
8
+ * Fetch product info from the App Store / Play Store for the given identifiers.
9
+ * Returns an empty array on web or if the store lookup fails.
10
+ */
11
+ export declare function getNativeProducts(productIdentifiers: string[], productType?: PURCHASE_TYPE): Promise<Product[]>;
12
+ /**
13
+ * Initiate a native purchase for the given product identifier.
14
+ *
15
+ * The returned Transaction contains the receipt (iOS legacy), jwsRepresentation
16
+ * (iOS StoreKit 2), or purchaseToken (Android) — send these to the backend for
17
+ * server-side validation before granting entitlements.
18
+ *
19
+ * Throws if the user cancels or the purchase fails.
20
+ */
21
+ export declare function purchaseNativeProduct(productIdentifier: string, options?: {
22
+ planIdentifier?: string;
23
+ productType?: PURCHASE_TYPE;
24
+ quantity?: number;
25
+ appAccountToken?: string;
26
+ isConsumable?: boolean;
27
+ /** Set false to defer acknowledgment until backend validation completes. */
28
+ autoAcknowledgePurchases?: boolean;
29
+ }): Promise<Transaction>;
30
+ /**
31
+ * Manually acknowledge/finish a transaction after server-side validation.
32
+ * Only needed when purchaseNativeProduct was called with autoAcknowledgePurchases: false.
33
+ *
34
+ * @param purchaseToken - purchaseToken (Android) or transactionId (iOS)
35
+ */
36
+ export declare function acknowledgeNativePurchase(purchaseToken: string): Promise<void>;
37
+ /**
38
+ * Restore previously completed purchases.
39
+ * Required by App Store guidelines to be accessible in the UI.
40
+ */
41
+ export declare function restoreNativePurchases(): Promise<void>;
42
+ /**
43
+ * Return all purchases recorded for the current user on this device.
44
+ * Useful for checking active entitlements without a backend call.
45
+ */
46
+ export declare function getNativePurchases(options?: {
47
+ productType?: PURCHASE_TYPE;
48
+ appAccountToken?: string;
49
+ onlyCurrentEntitlements?: boolean;
50
+ }): Promise<Transaction[]>;
51
+ //# sourceMappingURL=native-purchases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-purchases.d.ts","sourceRoot":"","sources":["../../../src/billing/lib/native-purchases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGnF,YAAY,EAAE,OAAO,IAAI,aAAa,EAAE,WAAW,IAAI,iBAAiB,EAAE,CAAC;AAC3E,YAAY,EAAE,aAAa,IAAI,kBAAkB,EAAE,CAAC;AAIpD,+DAA+D;AAC/D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAkBD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,CAAC,EAAE,aAAa,GAC1B,OAAO,CAAC,OAAO,EAAE,CAAC,CAKpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,GACA,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAI5D;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IACjD,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAKzB"}
@@ -0,0 +1,44 @@
1
+ import { Capacitor as e } from "../../node_modules/@capacitor/core/dist/index.js";
2
+ //#region src/billing/lib/native-purchases.ts
3
+ function t() {
4
+ return e.isNativePlatform();
5
+ }
6
+ async function n() {
7
+ if (!e.isNativePlatform()) return null;
8
+ try {
9
+ let e = await import(
10
+ /* @vite-ignore */
11
+ "@capgo/native-purchases"
12
+ );
13
+ return e.NativePurchases ?? e.default ?? null;
14
+ } catch {
15
+ return null;
16
+ }
17
+ }
18
+ async function r(e, t) {
19
+ let r = await n();
20
+ return !r || e.length === 0 ? [] : (await r.getProducts({
21
+ productIdentifiers: e,
22
+ productType: t
23
+ })).products ?? [];
24
+ }
25
+ async function i(e, t) {
26
+ let r = await n();
27
+ if (!r) throw Error("Native purchases not available on this platform");
28
+ return r.purchaseProduct({
29
+ productIdentifier: e,
30
+ ...t
31
+ });
32
+ }
33
+ async function a(e) {
34
+ let t = await n();
35
+ t && await t.acknowledgePurchase({ purchaseToken: e });
36
+ }
37
+ async function o() {
38
+ let e = await n();
39
+ e && await e.restorePurchases();
40
+ }
41
+ //#endregion
42
+ export { a as acknowledgeNativePurchase, r as getNativeProducts, t as isNativeIAPAvailable, i as purchaseNativeProduct, o as restoreNativePurchases };
43
+
44
+ //# sourceMappingURL=native-purchases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-purchases.js","names":[],"sources":["../../../src/billing/lib/native-purchases.ts"],"sourcesContent":["/**\n * Native in-app purchase bridge for Apple StoreKit and Google Play Billing.\n *\n * Uses @capgo/native-purchases (direct StoreKit 2 / Play Billing Library integration)\n * when running inside a Capacitor native app. Falls back to null on web so callers\n * can route to the normal Stripe/Razorpay checkout instead.\n *\n * After a successful purchase the frontend sends the receipt / JWS / purchase token\n * to the backend via POST /rest/billing/iap/validate, which validates with Apple/Google\n * servers and activates the subscription or credits — no RevenueCat account required.\n */\n\nimport { Capacitor } from '@capacitor/core';\nimport type { PURCHASE_TYPE, Product, Transaction } from '@capgo/native-purchases';\n\n// Re-export plugin types with billing-domain-friendly aliases\nexport type { Product as NativeProduct, Transaction as NativeTransaction };\nexport type { PURCHASE_TYPE as NativePurchaseType };\n\n// ─── Platform check ───────────────────────────────────────────────────────────\n\n/** True when running inside a Capacitor iOS or Android app. */\nexport function isNativeIAPAvailable(): boolean {\n return Capacitor.isNativePlatform();\n}\n\n// ─── Plugin loader ────────────────────────────────────────────────────────────\n\n// Dynamically imported so the web bundle doesn't fail when the native plugin\n// is absent.\nasync function getPlugin() {\n if (!Capacitor.isNativePlatform()) return null;\n try {\n const mod = await import(/* @vite-ignore */ '@capgo/native-purchases');\n return mod.NativePurchases ?? mod.default ?? null;\n } catch {\n return null;\n }\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Fetch product info from the App Store / Play Store for the given identifiers.\n * Returns an empty array on web or if the store lookup fails.\n */\nexport async function getNativeProducts(\n productIdentifiers: string[],\n productType?: PURCHASE_TYPE\n): Promise<Product[]> {\n const plugin = await getPlugin();\n if (!plugin || productIdentifiers.length === 0) return [];\n const result = await plugin.getProducts({ productIdentifiers, productType });\n return result.products ?? [];\n}\n\n/**\n * Initiate a native purchase for the given product identifier.\n *\n * The returned Transaction contains the receipt (iOS legacy), jwsRepresentation\n * (iOS StoreKit 2), or purchaseToken (Android) — send these to the backend for\n * server-side validation before granting entitlements.\n *\n * Throws if the user cancels or the purchase fails.\n */\nexport async function purchaseNativeProduct(\n productIdentifier: string,\n options?: {\n planIdentifier?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n appAccountToken?: string;\n isConsumable?: boolean;\n /** Set false to defer acknowledgment until backend validation completes. */\n autoAcknowledgePurchases?: boolean;\n }\n): Promise<Transaction> {\n const plugin = await getPlugin();\n if (!plugin) throw new Error('Native purchases not available on this platform');\n return plugin.purchaseProduct({ productIdentifier, ...options });\n}\n\n/**\n * Manually acknowledge/finish a transaction after server-side validation.\n * Only needed when purchaseNativeProduct was called with autoAcknowledgePurchases: false.\n *\n * @param purchaseToken - purchaseToken (Android) or transactionId (iOS)\n */\nexport async function acknowledgeNativePurchase(purchaseToken: string): Promise<void> {\n const plugin = await getPlugin();\n if (!plugin) return;\n await plugin.acknowledgePurchase({ purchaseToken });\n}\n\n/**\n * Restore previously completed purchases.\n * Required by App Store guidelines to be accessible in the UI.\n */\nexport async function restoreNativePurchases(): Promise<void> {\n const plugin = await getPlugin();\n if (!plugin) return;\n await plugin.restorePurchases();\n}\n\n/**\n * Return all purchases recorded for the current user on this device.\n * Useful for checking active entitlements without a backend call.\n */\nexport async function getNativePurchases(options?: {\n productType?: PURCHASE_TYPE;\n appAccountToken?: string;\n onlyCurrentEntitlements?: boolean;\n}): Promise<Transaction[]> {\n const plugin = await getPlugin();\n if (!plugin) return [];\n const result = await plugin.getPurchases(options);\n return result.purchases ?? [];\n}\n"],"mappings":";;AAsBA,SAAgB,IAAgC;AAC9C,QAAO,EAAU,kBAAkB;;AAOrC,eAAe,IAAY;AACzB,KAAI,CAAC,EAAU,kBAAkB,CAAE,QAAO;AAC1C,KAAI;EACF,IAAM,IAAM,MAAM;;GAA0B;;AAC5C,SAAO,EAAI,mBAAmB,EAAI,WAAW;SACvC;AACN,SAAO;;;AAUX,eAAsB,EACpB,GACA,GACoB;CACpB,IAAM,IAAS,MAAM,GAAW;AAGhC,QAFI,CAAC,KAAU,EAAmB,WAAW,IAAU,EAAE,IAC1C,MAAM,EAAO,YAAY;EAAE;EAAoB;EAAa,CAAC,EAC9D,YAAY,EAAE;;AAY9B,eAAsB,EACpB,GACA,GASsB;CACtB,IAAM,IAAS,MAAM,GAAW;AAChC,KAAI,CAAC,EAAQ,OAAU,MAAM,kDAAkD;AAC/E,QAAO,EAAO,gBAAgB;EAAE;EAAmB,GAAG;EAAS,CAAC;;AASlE,eAAsB,EAA0B,GAAsC;CACpF,IAAM,IAAS,MAAM,GAAW;AAC3B,MACL,MAAM,EAAO,oBAAoB,EAAE,kBAAe,CAAC;;AAOrD,eAAsB,IAAwC;CAC5D,IAAM,IAAS,MAAM,GAAW;AAC3B,MACL,MAAM,EAAO,kBAAkB"}