@burdenoff/microfe-billing 2026.1108.1 → 2026.1109.1

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 (773) hide show
  1. package/dist/billing/BillingAdminRoutes.d.ts +1 -2
  2. package/dist/billing/BillingAdminRoutes.js +11 -12
  3. package/dist/billing/BillingAdminRoutes.js.map +1 -1
  4. package/dist/billing/BillingRoot.d.ts +0 -1
  5. package/dist/billing/BillingRoot.js +10 -9
  6. package/dist/billing/BillingRoot.js.map +1 -1
  7. package/dist/billing/BillingUserRoutes.d.ts +1 -2
  8. package/dist/billing/BillingUserRoutes.js +13 -14
  9. package/dist/billing/BillingUserRoutes.js.map +1 -1
  10. package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -1
  11. package/dist/billing/hooks/useBillingAccountSelection.js +7 -5
  12. package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -1
  13. package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -1
  14. package/dist/billing/hooks/useBillingEventEmitter.js +1 -2
  15. package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -1
  16. package/dist/billing/hooks/useBillingNavigate.d.ts +0 -1
  17. package/dist/billing/hooks/useBillingNavigate.js +1 -2
  18. package/dist/billing/hooks/useBillingNavigate.js.map +1 -1
  19. package/dist/billing/hooks/useBillingPermissions.d.ts +0 -1
  20. package/dist/billing/hooks/useBillingPermissions.js +2 -3
  21. package/dist/billing/hooks/useBillingPermissions.js.map +1 -1
  22. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -1
  23. package/dist/billing/hooks/useDefaultBillingCurrency.js +1 -2
  24. package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -1
  25. package/dist/billing/hooks/useProducts.d.ts +0 -1
  26. package/dist/billing/hooks/useProducts.js +1 -2
  27. package/dist/billing/hooks/useProducts.js.map +1 -1
  28. package/dist/billing/index.d.ts +0 -1
  29. package/dist/billing/lib/native-purchases.d.ts +0 -1
  30. package/dist/billing/lib/native-purchases.js +1 -2
  31. package/dist/billing/lib/native-purchases.js.map +1 -1
  32. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -1
  33. package/dist/billing/modules/addons/components/FloatingCartDrawer.js +4 -5
  34. package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -1
  35. package/dist/billing/modules/addons/hooks/index.d.ts +0 -1
  36. package/dist/billing/modules/addons/hooks/index.js +3 -2
  37. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts +0 -1
  38. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js +1 -2
  39. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js.map +1 -1
  40. package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -1
  41. package/dist/billing/modules/addons/hooks/useAddons.js +1 -2
  42. package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -1
  43. package/dist/billing/modules/addons/index.d.ts +0 -1
  44. package/dist/billing/modules/addons/index.js +10 -10
  45. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -1
  46. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +15 -16
  47. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  48. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -1
  49. package/dist/billing/modules/addons/pages/AddonCreatePage.js +11 -12
  50. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  51. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -1
  52. package/dist/billing/modules/addons/pages/AddonDetailPage.js +16 -17
  53. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  54. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -1
  55. package/dist/billing/modules/addons/pages/AddonEditPage.js +16 -17
  56. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  57. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -1
  58. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +111 -106
  59. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  60. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -1
  61. package/dist/billing/modules/addons/pages/AddonsListPage.js +105 -100
  62. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  63. package/dist/billing/modules/addons/pages/index.d.ts +0 -1
  64. package/dist/billing/modules/addons/pages/index.js +7 -6
  65. package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -1
  66. package/dist/billing/modules/addons/store/addonCartStore.js +2 -7
  67. package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -1
  68. package/dist/billing/modules/affiliate/api.d.ts +0 -1
  69. package/dist/billing/modules/affiliate/api.js +1 -2
  70. package/dist/billing/modules/affiliate/api.js.map +1 -1
  71. package/dist/billing/modules/affiliate/index.d.ts +0 -1
  72. package/dist/billing/modules/affiliate/index.js +1 -2
  73. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -1
  74. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +29 -28
  75. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  76. package/dist/billing/modules/analytics/index.d.ts +0 -1
  77. package/dist/billing/modules/analytics/index.js +1 -2
  78. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -1
  79. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +8 -9
  80. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  81. package/dist/billing/modules/analytics/pages/index.d.ts +0 -1
  82. package/dist/billing/modules/analytics/pages/index.js +1 -1
  83. package/dist/billing/modules/billing/hooks/index.d.ts +0 -1
  84. package/dist/billing/modules/billing/hooks/index.js +5 -4
  85. package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
  86. package/dist/billing/modules/billing/hooks/useInvoices.js +1 -2
  87. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  88. package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts +0 -1
  89. package/dist/billing/modules/billing/hooks/useOrderCallbacks.js +1 -2
  90. package/dist/billing/modules/billing/hooks/useOrderCallbacks.js.map +1 -1
  91. package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -1
  92. package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -1
  93. package/dist/billing/modules/billing/hooks/useRefunds.js +1 -2
  94. package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
  95. package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -1
  96. package/dist/billing/modules/billing/hooks/useTransactions.js +30 -31
  97. package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -1
  98. package/dist/billing/modules/billing/index.d.ts +0 -1
  99. package/dist/billing/modules/billing/index.js +15 -15
  100. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts +0 -1
  101. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +11 -12
  102. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  103. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -1
  104. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +53 -59
  105. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  106. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -1
  107. package/dist/billing/modules/billing/pages/InvoicesListPage.js +81 -87
  108. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  109. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts +0 -1
  110. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +11 -12
  111. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  112. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -1
  113. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +51 -54
  114. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  115. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts +0 -1
  116. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +33 -34
  117. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
  118. package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -1
  119. package/dist/billing/modules/billing/pages/RefundsPage.js +92 -93
  120. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  121. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -1
  122. package/dist/billing/modules/billing/pages/TransactionsPage.js +38 -39
  123. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  124. package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts +0 -1
  125. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -30
  126. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  127. package/dist/billing/modules/billing/pages/index.d.ts +0 -1
  128. package/dist/billing/modules/billing/pages/index.js +10 -9
  129. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -1
  130. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -1
  131. package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -2
  132. package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
  133. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -1
  134. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts +0 -1
  135. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -2
  136. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  137. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -1
  138. package/dist/billing/modules/checkout/components/CreditsAmountInput.js +1 -2
  139. package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -1
  140. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -1
  141. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -1
  142. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -1
  143. package/dist/billing/modules/checkout/components/NativeCheckoutView.js +1 -2
  144. package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -1
  145. package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -1
  146. package/dist/billing/modules/checkout/components/OrderSummary.js +35 -32
  147. package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
  148. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -1
  149. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -1
  150. package/dist/billing/modules/checkout/components/PromoCodeInput.js +1 -2
  151. package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -1
  152. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -1
  153. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +1 -2
  154. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
  155. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -1
  156. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -1
  157. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +1 -2
  158. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -1
  159. package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts +0 -1
  160. package/dist/billing/modules/checkout/components/StoreShippingSection.js +5 -3
  161. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  162. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -1
  163. package/dist/billing/modules/checkout/components/StripePaymentForm.js +35 -41
  164. package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -1
  165. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -1
  166. package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -2
  167. package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
  168. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -1
  169. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +1 -2
  170. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -1
  171. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts +0 -1
  172. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js +5 -6
  173. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js.map +1 -1
  174. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts +0 -1
  175. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +7 -8
  176. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  177. package/dist/billing/modules/checkout/components/index.d.ts +0 -1
  178. package/dist/billing/modules/checkout/components/index.js +12 -11
  179. package/dist/billing/modules/checkout/hooks/index.d.ts +0 -1
  180. package/dist/billing/modules/checkout/hooks/index.js +5 -4
  181. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -1
  182. package/dist/billing/modules/checkout/hooks/useCheckout.js +182 -195
  183. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
  184. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -1
  185. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +33 -32
  186. package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -1
  187. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -1
  188. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +1 -2
  189. package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -1
  190. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -1
  191. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +1 -2
  192. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -1
  193. package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts +4 -8
  194. package/dist/billing/modules/checkout/hooks/useStoreShipping.js +1 -2
  195. package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
  196. package/dist/billing/modules/checkout/index.d.ts +0 -1
  197. package/dist/billing/modules/checkout/index.js +19 -19
  198. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -1
  199. package/dist/billing/modules/checkout/pages/CheckoutPage.js +730 -732
  200. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  201. package/dist/billing/modules/checkout/pages/index.d.ts +0 -1
  202. package/dist/billing/modules/checkout/pages/index.js +1 -1
  203. package/dist/billing/modules/checkout/types/index.d.ts +0 -1
  204. package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -1
  205. package/dist/billing/modules/checkout/utils/storeOrder.js +0 -1
  206. package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -1
  207. package/dist/billing/modules/coupons/index.d.ts +0 -1
  208. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -1
  209. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +5 -6
  210. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  211. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -1
  212. package/dist/billing/modules/coupons/pages/CouponsListPage.js +15 -13
  213. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  214. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -1
  215. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +12 -10
  216. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  217. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -1
  218. package/dist/billing/modules/coupons/pages/EditCouponPage.js +7 -11
  219. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  220. package/dist/billing/modules/coupons/pages/index.d.ts +0 -1
  221. package/dist/billing/modules/coupons/pages/index.js +5 -4
  222. package/dist/billing/modules/credits/hooks/index.d.ts +0 -1
  223. package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -1
  224. package/dist/billing/modules/credits/hooks/useCredits.js +20 -21
  225. package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -1
  226. package/dist/billing/modules/credits/index.d.ts +0 -1
  227. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -1
  228. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +19 -24
  229. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  230. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -1
  231. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +26 -27
  232. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  233. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -1
  234. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +54 -52
  235. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  236. package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -1
  237. package/dist/billing/modules/credits/pages/CreditsPage.js +37 -38
  238. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  239. package/dist/billing/modules/credits/pages/index.d.ts +0 -1
  240. package/dist/billing/modules/credits/pages/index.js +5 -4
  241. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -1
  242. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -3
  243. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
  244. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -1
  245. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +35 -43
  246. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
  247. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -1
  248. package/dist/billing/modules/dashboard/components/BillingAccountCard.js +1 -2
  249. package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
  250. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -1
  251. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1 -2
  252. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  253. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -1
  254. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +2 -5
  255. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
  256. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -1
  257. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -2
  258. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
  259. package/dist/billing/modules/dashboard/components/index.d.ts +0 -1
  260. package/dist/billing/modules/dashboard/components/index.js +7 -6
  261. package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -1
  262. package/dist/billing/modules/dashboard/hooks/index.js +3 -2
  263. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -1
  264. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +2 -3
  265. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -1
  266. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -1
  267. package/dist/billing/modules/dashboard/hooks/useDashboard.js +2 -3
  268. package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -1
  269. package/dist/billing/modules/dashboard/index.d.ts +0 -1
  270. package/dist/billing/modules/dashboard/index.js +11 -10
  271. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -1
  272. package/dist/billing/modules/dashboard/pages/OverviewPage.js +266 -264
  273. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  274. package/dist/billing/modules/dashboard/pages/index.d.ts +0 -1
  275. package/dist/billing/modules/dashboard/pages/index.js +1 -1
  276. package/dist/billing/modules/discounts/index.d.ts +0 -1
  277. package/dist/billing/modules/discounts/index.js +1 -2
  278. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -1
  279. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +169 -176
  280. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  281. package/dist/billing/modules/discounts/pages/index.d.ts +0 -1
  282. package/dist/billing/modules/discounts/pages/index.js +1 -1
  283. package/dist/billing/modules/earnings/api.d.ts +0 -1
  284. package/dist/billing/modules/earnings/api.js +66 -67
  285. package/dist/billing/modules/earnings/api.js.map +1 -1
  286. package/dist/billing/modules/earnings/index.d.ts +0 -1
  287. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts +0 -1
  288. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +17 -17
  289. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
  290. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts +0 -1
  291. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +188 -189
  292. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  293. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -1
  294. package/dist/billing/modules/earnings/pages/EarningsPage.js +111 -111
  295. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  296. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -1
  297. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +29 -30
  298. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  299. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -1
  300. package/dist/billing/modules/earnings/pages/PayoutsPage.js +103 -104
  301. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  302. package/dist/billing/modules/earnings/payoutAccountStatus.d.ts +0 -1
  303. package/dist/billing/modules/earnings/payoutAccountStatus.js +1 -2
  304. package/dist/billing/modules/earnings/payoutAccountStatus.js.map +1 -1
  305. package/dist/billing/modules/plans/constants/enterprise.d.ts +0 -1
  306. package/dist/billing/modules/plans/constants/enterprise.js +1 -2
  307. package/dist/billing/modules/plans/constants/enterprise.js.map +1 -1
  308. package/dist/billing/modules/plans/constants/featuredQuotas.d.ts +0 -1
  309. package/dist/billing/modules/plans/constants/featuredQuotas.js +1 -2
  310. package/dist/billing/modules/plans/constants/featuredQuotas.js.map +1 -1
  311. package/dist/billing/modules/plans/hooks/index.d.ts +0 -1
  312. package/dist/billing/modules/plans/hooks/index.js +3 -2
  313. package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -1
  314. package/dist/billing/modules/plans/hooks/usePlans.js +1 -2
  315. package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -1
  316. package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -1
  317. package/dist/billing/modules/plans/hooks/useQuotas.js +1 -2
  318. package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -1
  319. package/dist/billing/modules/plans/index.d.ts +0 -1
  320. package/dist/billing/modules/plans/index.js +11 -11
  321. package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts +0 -1
  322. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +12 -15
  323. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  324. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -1
  325. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +38 -39
  326. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  327. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -1
  328. package/dist/billing/modules/plans/pages/PlanCreatePage.js +10 -11
  329. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  330. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -1
  331. package/dist/billing/modules/plans/pages/PlanDetailPage.js +40 -41
  332. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  333. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -1
  334. package/dist/billing/modules/plans/pages/PlanEditPage.js +15 -16
  335. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  336. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -1
  337. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +18 -19
  338. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  339. package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -1
  340. package/dist/billing/modules/plans/pages/PlansListPage.js +100 -101
  341. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  342. package/dist/billing/modules/plans/pages/index.d.ts +0 -1
  343. package/dist/billing/modules/plans/pages/index.js +8 -7
  344. package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts +0 -1
  345. package/dist/billing/modules/plans/utils/currencyPriceOverrides.js +1 -2
  346. package/dist/billing/modules/plans/utils/currencyPriceOverrides.js.map +1 -1
  347. package/dist/billing/modules/plans/utils/planSelector.d.ts +0 -1
  348. package/dist/billing/modules/plans/utils/planSelector.js +1 -2
  349. package/dist/billing/modules/plans/utils/planSelector.js.map +1 -1
  350. package/dist/billing/modules/promotions/index.d.ts +0 -1
  351. package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts +0 -1
  352. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +5 -6
  353. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  354. package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts +0 -1
  355. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +5 -6
  356. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  357. package/dist/billing/modules/promotions/pages/index.d.ts +0 -1
  358. package/dist/billing/modules/promotions/pages/index.js +3 -2
  359. package/dist/billing/modules/quota/hooks/index.d.ts +0 -1
  360. package/dist/billing/modules/quota/hooks/index.js +1 -1
  361. package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -1
  362. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -1
  363. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +1 -2
  364. package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -1
  365. package/dist/billing/modules/quota/index.d.ts +0 -1
  366. package/dist/billing/modules/quota/index.js +8 -8
  367. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts +0 -1
  368. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +12 -15
  369. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js.map +1 -1
  370. package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -1
  371. package/dist/billing/modules/quota/pages/QuotaPage.js +3 -3
  372. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -1
  373. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +13 -14
  374. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  375. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -1
  376. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +9 -10
  377. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  378. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -1
  379. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +12 -13
  380. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  381. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -1
  382. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +16 -17
  383. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  384. package/dist/billing/modules/quota/pages/index.d.ts +0 -1
  385. package/dist/billing/modules/quota/pages/index.js +6 -5
  386. package/dist/billing/modules/quota/utils/quotaSelector.d.ts +0 -1
  387. package/dist/billing/modules/quota/utils/quotaSelector.js +1 -2
  388. package/dist/billing/modules/quota/utils/quotaSelector.js.map +1 -1
  389. package/dist/billing/modules/settings/index.d.ts +0 -1
  390. package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -1
  391. package/dist/billing/modules/settings/pages/SettingsPage.js +12 -13
  392. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  393. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -1
  394. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +32 -32
  395. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  396. package/dist/billing/modules/settings/pages/index.d.ts +0 -1
  397. package/dist/billing/modules/settings/pages/index.js +3 -2
  398. package/dist/billing/modules/store/graphql/index.d.ts +0 -1
  399. package/dist/billing/modules/store/index.d.ts +0 -1
  400. package/dist/billing/modules/store/index.js +1 -2
  401. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -1
  402. package/dist/billing/modules/store/pages/StoreCheckoutPage.js +1 -2
  403. package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -1
  404. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -1
  405. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +9 -11
  406. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
  407. package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -1
  408. package/dist/billing/modules/subscriptions/hooks/index.js +1 -1
  409. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -1
  410. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +1 -2
  411. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
  412. package/dist/billing/modules/subscriptions/index.d.ts +0 -1
  413. package/dist/billing/modules/subscriptions/index.js +6 -6
  414. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -1
  415. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +311 -312
  416. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  417. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -1
  418. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +61 -62
  419. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  420. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -1
  421. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +30 -31
  422. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  423. package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -1
  424. package/dist/billing/modules/subscriptions/pages/index.js +4 -3
  425. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts +0 -1
  426. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +17 -18
  427. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  428. package/dist/billing/modules/usage/hooks/index.d.ts +0 -1
  429. package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -1
  430. package/dist/billing/modules/usage/hooks/useUsage.js +72 -73
  431. package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
  432. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts +0 -1
  433. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js +12 -13
  434. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js.map +1 -1
  435. package/dist/billing/modules/usage/index.d.ts +0 -1
  436. package/dist/billing/modules/usage/index.js +1 -2
  437. package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -1
  438. package/dist/billing/modules/usage/pages/UsagePage.js +229 -227
  439. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  440. package/dist/billing/modules/usage/pages/index.d.ts +0 -1
  441. package/dist/billing/modules/usage/pages/index.js +1 -1
  442. package/dist/billing/modules/usage/utils/aiSpend.d.ts +0 -1
  443. package/dist/billing/modules/usage/utils/aiSpend.js +2 -3
  444. package/dist/billing/modules/usage/utils/aiSpend.js.map +1 -1
  445. package/dist/billing/providers/BillingProvider.d.ts +0 -1
  446. package/dist/billing/providers/BillingProvider.js +3 -4
  447. package/dist/billing/providers/BillingProvider.js.map +1 -1
  448. package/dist/billing/shared/components/AccessDenied.d.ts +0 -1
  449. package/dist/billing/shared/components/AccessDenied.js +1 -2
  450. package/dist/billing/shared/components/AccessDenied.js.map +1 -1
  451. package/dist/billing/shared/components/ActorIdentity.d.ts +0 -1
  452. package/dist/billing/shared/components/ActorIdentity.js +2 -3
  453. package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
  454. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -1
  455. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +1 -2
  456. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
  457. package/dist/billing/shared/components/EmptyState.d.ts +0 -1
  458. package/dist/billing/shared/components/EmptyState.js +1 -2
  459. package/dist/billing/shared/components/EmptyState.js.map +1 -1
  460. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -1
  461. package/dist/billing/shared/components/PageHeader.d.ts +0 -1
  462. package/dist/billing/shared/components/PageHeader.js +1 -2
  463. package/dist/billing/shared/components/PageHeader.js.map +1 -1
  464. package/dist/billing/shared/components/PushPermissionNudge.d.ts +0 -1
  465. package/dist/billing/shared/components/PushPermissionNudge.js +2 -3
  466. package/dist/billing/shared/components/PushPermissionNudge.js.map +1 -1
  467. package/dist/billing/shared/components/ServerError.d.ts +0 -1
  468. package/dist/billing/shared/components/ServerError.js +1 -2
  469. package/dist/billing/shared/components/ServerError.js.map +1 -1
  470. package/dist/billing/shared/components/StatCard.d.ts +0 -1
  471. package/dist/billing/shared/components/StatCard.js +1 -2
  472. package/dist/billing/shared/components/StatCard.js.map +1 -1
  473. package/dist/billing/shared/components/index.d.ts +0 -1
  474. package/dist/billing/shared/components/index.js +8 -7
  475. package/dist/billing/shared/hooks/index.d.ts +0 -1
  476. package/dist/billing/shared/hooks/index.js +1 -1
  477. package/dist/billing/shared/hooks/useActorProfiles.d.ts +0 -1
  478. package/dist/billing/shared/hooks/useActorProfiles.js +4 -8
  479. package/dist/billing/shared/hooks/useActorProfiles.js.map +1 -1
  480. package/dist/billing/shared/hooks/useTr.d.ts +0 -1
  481. package/dist/billing/shared/hooks/useTr.js +1 -2
  482. package/dist/billing/shared/hooks/useTr.js.map +1 -1
  483. package/dist/billing/shared/index.d.ts +0 -1
  484. package/dist/billing/shared/types/graphql.d.ts +0 -1
  485. package/dist/billing/shared/types/graphql.js +1 -2
  486. package/dist/billing/shared/types/graphql.js.map +1 -1
  487. package/dist/billing/shared/types/index.d.ts +0 -1
  488. package/dist/billing/shared/ui/Card.d.ts +1 -2
  489. package/dist/billing/shared/ui/Card.js +1 -2
  490. package/dist/billing/shared/ui/Card.js.map +1 -1
  491. package/dist/billing/shared/ui/MetricCard.d.ts +1 -2
  492. package/dist/billing/shared/ui/MetricCard.js +1 -2
  493. package/dist/billing/shared/ui/MetricCard.js.map +1 -1
  494. package/dist/billing/shared/ui/ProgressBar.d.ts +1 -2
  495. package/dist/billing/shared/ui/ProgressBar.js +1 -2
  496. package/dist/billing/shared/ui/ProgressBar.js.map +1 -1
  497. package/dist/billing/shared/ui/SectionHeader.d.ts +1 -2
  498. package/dist/billing/shared/ui/StatusPill.d.ts +1 -2
  499. package/dist/billing/shared/ui/StatusPill.js +1 -2
  500. package/dist/billing/shared/ui/StatusPill.js.map +1 -1
  501. package/dist/billing/shared/ui/index.d.ts +0 -1
  502. package/dist/billing/shared/ui/index.js +5 -4
  503. package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -1
  504. package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
  505. package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -1
  506. package/dist/billing/shared/utils/directBillingGraphql.js +3 -3
  507. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
  508. package/dist/billing/shared/utils/error.d.ts +0 -1
  509. package/dist/billing/shared/utils/error.js +1 -2
  510. package/dist/billing/shared/utils/error.js.map +1 -1
  511. package/dist/billing/shared/utils/format.d.ts +0 -1
  512. package/dist/billing/shared/utils/format.js +1 -2
  513. package/dist/billing/shared/utils/format.js.map +1 -1
  514. package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -1
  515. package/dist/billing/shared/utils/gatewayGraphql.js +4 -4
  516. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
  517. package/dist/billing/shared/utils/index.d.ts +0 -1
  518. package/dist/billing/shared/utils/index.js +9 -8
  519. package/dist/billing/shared/utils/navigation.d.ts +0 -1
  520. package/dist/billing/shared/utils/navigation.js +1 -2
  521. package/dist/billing/shared/utils/navigation.js.map +1 -1
  522. package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
  523. package/dist/billing/shared/utils/paymentTheme.js +2 -3
  524. package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
  525. package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
  526. package/dist/billing/shared/utils/pinnedRequest.js +63 -0
  527. package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
  528. package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
  529. package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
  530. package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
  531. package/dist/billing/shared/utils/status.d.ts +0 -1
  532. package/dist/billing/shared/utils/status.js +24 -25
  533. package/dist/billing/shared/utils/status.js.map +1 -1
  534. package/dist/billing/shared/utils/tokens.d.ts +0 -1
  535. package/dist/billing/shared/utils/tokens.js +1 -2
  536. package/dist/billing/shared/utils/tokens.js.map +1 -1
  537. package/dist/billing/translations/en.d.ts +0 -1
  538. package/dist/billing/types/index.d.ts +0 -1
  539. package/dist/dev/main.d.ts +0 -1
  540. package/dist/generated/global-operations.d.ts +3252 -3206
  541. package/dist/generated/global-operations.js +445 -422
  542. package/dist/generated/global-operations.js.map +1 -1
  543. package/dist/generated/global-types.d.ts +2 -22
  544. package/dist/generated/global-types.js +1 -2
  545. package/dist/generated/global-types.js.map +1 -1
  546. package/dist/generated/wspace-operations.d.ts +76 -47
  547. package/dist/generated/wspace-operations.js +2 -3
  548. package/dist/generated/wspace-operations.js.map +1 -1
  549. package/dist/generated/wspace-types.d.ts +4 -24
  550. package/dist/index.d.ts +0 -1
  551. package/dist/index.js +1 -2
  552. package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
  553. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
  554. package/dist/node_modules/sonner/dist/index.js +75 -69
  555. package/dist/node_modules/sonner/dist/index.js.map +1 -1
  556. package/dist/utils/nativeBridge.d.ts +0 -1
  557. package/dist/utils/nativeBridge.js +1 -2
  558. package/package.json +66 -55
  559. package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
  560. package/dist/billing/BillingRoot.d.ts.map +0 -1
  561. package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
  562. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
  563. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
  564. package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
  565. package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
  566. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
  567. package/dist/billing/hooks/useProducts.d.ts.map +0 -1
  568. package/dist/billing/index.d.ts.map +0 -1
  569. package/dist/billing/lib/native-purchases.d.ts.map +0 -1
  570. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
  571. package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
  572. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
  573. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
  574. package/dist/billing/modules/addons/index.d.ts.map +0 -1
  575. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
  576. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
  577. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
  578. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
  579. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
  580. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
  581. package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
  582. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
  583. package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
  584. package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
  585. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
  586. package/dist/billing/modules/analytics/index.d.ts.map +0 -1
  587. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
  588. package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
  589. package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
  590. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
  591. package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
  592. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
  593. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
  594. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
  595. package/dist/billing/modules/billing/index.d.ts.map +0 -1
  596. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
  597. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
  598. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
  599. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
  600. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
  601. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
  602. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
  603. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
  604. package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
  605. package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
  606. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
  607. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
  608. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
  609. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
  610. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
  611. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
  612. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
  613. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
  614. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
  615. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
  616. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
  617. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
  618. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
  619. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
  620. package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
  621. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
  622. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
  623. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
  624. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
  625. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
  626. package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
  627. package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
  628. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
  629. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
  630. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
  631. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
  632. package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
  633. package/dist/billing/modules/checkout/index.d.ts.map +0 -1
  634. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
  635. package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
  636. package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
  637. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
  638. package/dist/billing/modules/coupons/index.d.ts.map +0 -1
  639. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
  640. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
  641. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
  642. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
  643. package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
  644. package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
  645. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
  646. package/dist/billing/modules/credits/index.d.ts.map +0 -1
  647. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
  648. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
  649. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
  650. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
  651. package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
  652. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
  653. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
  654. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
  655. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
  656. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
  657. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
  658. package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
  659. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
  660. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
  661. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
  662. package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
  663. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
  664. package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
  665. package/dist/billing/modules/discounts/index.d.ts.map +0 -1
  666. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
  667. package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
  668. package/dist/billing/modules/earnings/api.d.ts.map +0 -1
  669. package/dist/billing/modules/earnings/index.d.ts.map +0 -1
  670. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
  671. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
  672. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
  673. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
  674. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
  675. package/dist/billing/modules/earnings/payoutAccountStatus.d.ts.map +0 -1
  676. package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
  677. package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
  678. package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
  679. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
  680. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
  681. package/dist/billing/modules/plans/index.d.ts.map +0 -1
  682. package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
  683. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
  684. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
  685. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
  686. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
  687. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
  688. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
  689. package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
  690. package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
  691. package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
  692. package/dist/billing/modules/promotions/index.d.ts.map +0 -1
  693. package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
  694. package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
  695. package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
  696. package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
  697. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
  698. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
  699. package/dist/billing/modules/quota/index.d.ts.map +0 -1
  700. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
  701. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
  702. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
  703. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
  704. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
  705. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
  706. package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
  707. package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
  708. package/dist/billing/modules/settings/index.d.ts.map +0 -1
  709. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
  710. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
  711. package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
  712. package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
  713. package/dist/billing/modules/store/index.d.ts.map +0 -1
  714. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
  715. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
  716. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
  717. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
  718. package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
  719. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
  720. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
  721. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
  722. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
  723. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
  724. package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
  725. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
  726. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
  727. package/dist/billing/modules/usage/index.d.ts.map +0 -1
  728. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
  729. package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
  730. package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
  731. package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
  732. package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
  733. package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
  734. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
  735. package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
  736. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
  737. package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
  738. package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
  739. package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
  740. package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
  741. package/dist/billing/shared/components/index.d.ts.map +0 -1
  742. package/dist/billing/shared/hooks/index.d.ts.map +0 -1
  743. package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
  744. package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
  745. package/dist/billing/shared/index.d.ts.map +0 -1
  746. package/dist/billing/shared/types/graphql.d.ts.map +0 -1
  747. package/dist/billing/shared/types/index.d.ts.map +0 -1
  748. package/dist/billing/shared/ui/Card.d.ts.map +0 -1
  749. package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
  750. package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
  751. package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
  752. package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
  753. package/dist/billing/shared/ui/index.d.ts.map +0 -1
  754. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
  755. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
  756. package/dist/billing/shared/utils/error.d.ts.map +0 -1
  757. package/dist/billing/shared/utils/format.d.ts.map +0 -1
  758. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
  759. package/dist/billing/shared/utils/index.d.ts.map +0 -1
  760. package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
  761. package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
  762. package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
  763. package/dist/billing/shared/utils/status.d.ts.map +0 -1
  764. package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
  765. package/dist/billing/translations/en.d.ts.map +0 -1
  766. package/dist/billing/types/index.d.ts.map +0 -1
  767. package/dist/dev/main.d.ts.map +0 -1
  768. package/dist/generated/global-operations.d.ts.map +0 -1
  769. package/dist/generated/global-types.d.ts.map +0 -1
  770. package/dist/generated/wspace-operations.d.ts.map +0 -1
  771. package/dist/generated/wspace-types.d.ts.map +0 -1
  772. package/dist/index.d.ts.map +0 -1
  773. package/dist/utils/nativeBridge.d.ts.map +0 -1
@@ -30,4 +30,3 @@ export declare function formatInvoiceNumber(number: string): string;
30
30
  * raw byte count — everything else falls back to a plain localized number.
31
31
  */
32
32
  export declare function formatQuotaValue(value: number, unit?: string): string;
33
- //# sourceMappingURL=format.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { CreditTransactionType as e, InvoiceStatus as t, PlanDuration as n, SubscriptionStatus as r } from "../types/graphql.js";
2
2
  import { formatBytes as i, formatBytes as a, formatCurrency as o, formatDate as s, formatDateTime as c, formatNumber as l, formatPercentage as u, formatRelativeTime as d } from "@burdenoff/fe-libs/shared/utils";
3
- //#region src/billing/shared/utils/format.ts
3
+ // src/billing/shared/utils/format.ts
4
4
  function f(e, t = "USD", n = "en-US") {
5
5
  return t.toUpperCase() === "CREDITS" ? p(e) : o(e, t, n);
6
6
  }
@@ -53,7 +53,6 @@ function y(e) {
53
53
  function b(e, t) {
54
54
  return t === "bytes" ? i(e) : e.toLocaleString();
55
55
  }
56
- //#endregion
57
56
  export { a as formatBytes, v as formatCreditTransactionType, p as formatCredits, f as formatCurrency, s as formatDate, c as formatDateTime, y as formatInvoiceNumber, h as formatInvoiceStatus, l as formatNumber, u as formatPercentage, g as formatPlanDuration, _ as formatPlanDurationLabel, b as formatQuotaValue, d as formatRelativeTime, m as formatSubscriptionStatus };
58
57
 
59
58
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../../../../src/billing/shared/utils/format.ts"],"sourcesContent":["/**\n * Formatting utilities for the billing module\n *\n * Re-exports common formatting utilities from fe-libs and adds billing-specific ones.\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n QuotaStatus,\n PlanDuration,\n PaymentMethodType,\n TransactionType,\n CreditTransactionType,\n} from '../types';\n\n// Re-export common formatting utilities from fe-libs\nexport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatDate,\n formatDateTime,\n formatRelativeTime,\n formatDuration,\n formatNumber,\n formatPercentage,\n formatBytes,\n formatCompactNumber,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// Import for internal use\nimport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatBytes,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// ============================================================================\n// Billing-specific Currency Formatting (handles CREDITS)\n// ============================================================================\n\nexport function formatCurrency(amount: number, currency = 'USD', locale = 'en-US'): string {\n // Handle CREDITS specially - credits are not a real currency\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyBase(amount, currency, locale);\n}\n\n/**\n * Format credits as \"X Credits\" or \"X.XX Credits\"\n * Credits are always displayed as a unit count, not as currency\n */\nexport function formatCredits(amount: number): string {\n // For whole numbers, show without decimals\n if (Number.isInteger(amount)) {\n return `${amount.toLocaleString()} Credits`;\n }\n // For fractional credits, show up to 2 decimals\n return `${amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })} Credits`;\n}\n\nexport function formatCurrencyCompact(amount: number, currency = 'USD'): string {\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyCompactBase(amount, currency);\n}\n\n// ============================================================================\n// Status Formatting\n// ============================================================================\n\nexport function formatSubscriptionStatus(status: SubscriptionStatus): string {\n const labels: Record<SubscriptionStatus, string> = {\n [SubscriptionStatus.ACTIVE]: 'Active',\n [SubscriptionStatus.CANCELED]: 'Canceled',\n [SubscriptionStatus.EXPIRED]: 'Expired',\n [SubscriptionStatus.UPGRADED]: 'Upgraded',\n };\n return labels[status] || status;\n}\n\nexport function formatInvoiceStatus(status: InvoiceStatus): string {\n const labels: Record<InvoiceStatus, string> = {\n [InvoiceStatus.DRAFT]: 'Draft',\n [InvoiceStatus.OPEN]: 'Open',\n [InvoiceStatus.PAID]: 'Paid',\n [InvoiceStatus.VOID]: 'Void',\n [InvoiceStatus.UNCOLLECTIBLE]: 'Uncollectible',\n };\n return labels[status] || status;\n}\n\nexport function formatPaymentStatus(status: PaymentStatus): string {\n const labels: Record<PaymentStatus, string> = {\n [PaymentStatus.PENDING]: 'Pending',\n [PaymentStatus.SUCCEEDED]: 'Succeeded',\n [PaymentStatus.FAILED]: 'Failed',\n [PaymentStatus.CANCELED]: 'Canceled',\n [PaymentStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatChargeStatus(status: ChargeStatus): string {\n const labels: Record<ChargeStatus, string> = {\n [ChargeStatus.PENDING]: 'Pending',\n [ChargeStatus.SUCCEEDED]: 'Succeeded',\n [ChargeStatus.FAILED]: 'Failed',\n [ChargeStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatQuotaStatus(status: QuotaStatus): string {\n const labels: Record<QuotaStatus, string> = {\n [QuotaStatus.HEALTHY]: 'Healthy',\n [QuotaStatus.WARNING]: 'Warning',\n [QuotaStatus.CRITICAL]: 'Critical',\n [QuotaStatus.EXHAUSTED]: 'Exhausted',\n [QuotaStatus.INACTIVE]: 'Inactive',\n };\n return labels[status] || status;\n}\n\n// ============================================================================\n// Plan & Duration Formatting\n// ============================================================================\n\nexport function formatPlanDuration(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'month',\n [PlanDuration.YEARLY]: 'year',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanDurationLabel(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'Monthly',\n [PlanDuration.YEARLY]: 'Yearly',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanPrice(price: number, currency: string, duration: PlanDuration): string {\n return `${formatCurrency(price, currency)}/${formatPlanDuration(duration)}`;\n}\n\n// ============================================================================\n// Payment Method Formatting\n// ============================================================================\n\nexport function formatPaymentMethodType(type: PaymentMethodType): string {\n const labels: Record<PaymentMethodType, string> = {\n [PaymentMethodType.CREDIT_CARD]: 'Credit Card',\n [PaymentMethodType.DEBIT_CARD]: 'Debit Card',\n [PaymentMethodType.BANK_TRANSFER]: 'Bank Transfer',\n [PaymentMethodType.PAYPAL]: 'PayPal',\n [PaymentMethodType.CRYPTO]: 'Cryptocurrency',\n [PaymentMethodType.WALLET]: 'Wallet',\n [PaymentMethodType.NETBANKING]: 'Netbanking',\n };\n return labels[type] || type;\n}\n\nexport function formatCardBrand(brand?: string): string {\n if (!brand) return 'Card';\n return brand.charAt(0).toUpperCase() + brand.slice(1).toLowerCase();\n}\n\nexport function formatCardNumber(last4?: string): string {\n if (!last4) return '****';\n return `•••• ${last4}`;\n}\n\nexport function formatCardExpiry(month?: number, year?: number): string {\n if (!month || !year) return '';\n return `${month.toString().padStart(2, '0')}/${year.toString().slice(-2)}`;\n}\n\n// ============================================================================\n// Transaction Formatting\n// ============================================================================\n\nexport function formatTransactionType(type: TransactionType): string {\n const labels: Record<TransactionType, string> = {\n [TransactionType.PAYMENT]: 'Payment',\n [TransactionType.REFUND]: 'Refund',\n [TransactionType.ADJUSTMENT]: 'Adjustment',\n };\n return labels[type] || type;\n}\n\nexport function formatCreditTransactionType(type: CreditTransactionType): string {\n const labels: Record<CreditTransactionType, string> = {\n [CreditTransactionType.PURCHASE]: 'Purchase',\n [CreditTransactionType.USAGE]: 'Usage',\n [CreditTransactionType.ADJUSTMENT]: 'Earned',\n [CreditTransactionType.GRANTED]: 'Granted',\n };\n return labels[type] || type;\n}\n\n// ============================================================================\n// Text Formatting\n// ============================================================================\n\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return `${text.slice(0, maxLength - 3)}...`;\n}\n\nexport function capitalizeFirst(text: string): string {\n if (!text) return '';\n return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();\n}\n\nexport function formatInvoiceNumber(number: string): string {\n return `#${number}`;\n}\n\n// ============================================================================\n// Quota Value Formatting\n// ============================================================================\n\n/**\n * Format a quota's total value for display, unit-aware. Byte-denominated\n * quotas (storage, upload caps) render as MB/GB via formatBytes instead of a\n * raw byte count — everything else falls back to a plain localized number.\n */\nexport function formatQuotaValue(value: number, unit?: string): string {\n if (unit === 'bytes') return formatBytes(value);\n return value.toLocaleString();\n}\n"],"mappings":";;;AA2CA,SAAgB,EAAe,GAAgB,IAAW,OAAO,IAAS,SAAiB;CAKzF,OAHI,EAAS,YAAY,MAAM,YACtB,EAAc,CAAM,IAEtB,EAAmB,GAAQ,GAAU,CAAM;AACpD;AAMA,SAAgB,EAAc,GAAwB;CAMpD,OAJI,OAAO,UAAU,CAAM,IAClB,GAAG,EAAO,eAAe,EAAE,YAG7B,GAAG,EAAO,eAAe,KAAA,GAAW;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,EAAE;AACrG;AAaA,SAAgB,EAAyB,GAAoC;CAO3E,OAAO;GALJ,EAAmB,SAAS;GAC5B,EAAmB,WAAW;GAC9B,EAAmB,UAAU;GAC7B,EAAmB,WAAW;CAE1B,EAAO,MAAW;AAC3B;AAEA,SAAgB,EAAoB,GAA+B;CAQjE,OAAO;GANJ,EAAc,QAAQ;GACtB,EAAc,OAAO;GACrB,EAAc,OAAO;GACrB,EAAc,OAAO;GACrB,EAAc,gBAAgB;CAE1B,EAAO,MAAW;AAC3B;AAsCA,SAAgB,EAAmB,GAAgC;CAKjE,OAAO;GAHJ,EAAa,UAAU;GACvB,EAAa,SAAS;CAElB,EAAO,MAAa;AAC7B;AAEA,SAAgB,EAAwB,GAAgC;CAKtE,OAAO;GAHJ,EAAa,UAAU;GACvB,EAAa,SAAS;CAElB,EAAO,MAAa;AAC7B;AAmDA,SAAgB,EAA4B,GAAqC;CAO/E,OAAO;GALJ,EAAsB,WAAW;GACjC,EAAsB,QAAQ;GAC9B,EAAsB,aAAa;GACnC,EAAsB,UAAU;CAE5B,EAAO,MAAS;AACzB;AAgBA,SAAgB,EAAoB,GAAwB;CAC1D,OAAO,IAAI;AACb;AAWA,SAAgB,EAAiB,GAAe,GAAuB;CAErE,OADI,MAAS,UAAgB,EAAY,CAAK,IACvC,EAAM,eAAe;AAC9B"}
1
+ {"version":3,"file":"format.js","names":["formatCurrency","formatCurrencyBase","formatBytes$1","formatCurrency$1","currency","formatCredits","amount","formatCurrency","locale","formatSubscriptionStatus","SubscriptionStatus","status","formatInvoiceStatus","InvoiceStatus","formatPlanDuration","PlanDuration","duration","formatPlanDurationLabel","formatCreditTransactionType","CreditTransactionType","type","formatInvoiceNumber","number","formatQuotaValue","unit","formatBytes","value","formatDate","formatDateTime","formatNumber","formatPercentage","formatRelativeTime"],"sources":["../../../../src/billing/shared/utils/format.ts"],"sourcesContent":["/**\n * Formatting utilities for the billing module\n *\n * Re-exports common formatting utilities from fe-libs and adds billing-specific ones.\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n QuotaStatus,\n PlanDuration,\n PaymentMethodType,\n TransactionType,\n CreditTransactionType,\n} from '../types';\n\n// Re-export common formatting utilities from fe-libs\nexport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatDate,\n formatDateTime,\n formatRelativeTime,\n formatDuration,\n formatNumber,\n formatPercentage,\n formatBytes,\n formatCompactNumber,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// Import for internal use\nimport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatBytes,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// ============================================================================\n// Billing-specific Currency Formatting (handles CREDITS)\n// ============================================================================\n\nexport function formatCurrency(amount: number, currency = 'USD', locale = 'en-US'): string {\n // Handle CREDITS specially - credits are not a real currency\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyBase(amount, currency, locale);\n}\n\n/**\n * Format credits as \"X Credits\" or \"X.XX Credits\"\n * Credits are always displayed as a unit count, not as currency\n */\nexport function formatCredits(amount: number): string {\n // For whole numbers, show without decimals\n if (Number.isInteger(amount)) {\n return `${amount.toLocaleString()} Credits`;\n }\n // For fractional credits, show up to 2 decimals\n return `${amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })} Credits`;\n}\n\nexport function formatCurrencyCompact(amount: number, currency = 'USD'): string {\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyCompactBase(amount, currency);\n}\n\n// ============================================================================\n// Status Formatting\n// ============================================================================\n\nexport function formatSubscriptionStatus(status: SubscriptionStatus): string {\n const labels: Record<SubscriptionStatus, string> = {\n [SubscriptionStatus.ACTIVE]: 'Active',\n [SubscriptionStatus.CANCELED]: 'Canceled',\n [SubscriptionStatus.EXPIRED]: 'Expired',\n [SubscriptionStatus.UPGRADED]: 'Upgraded',\n };\n return labels[status] || status;\n}\n\nexport function formatInvoiceStatus(status: InvoiceStatus): string {\n const labels: Record<InvoiceStatus, string> = {\n [InvoiceStatus.DRAFT]: 'Draft',\n [InvoiceStatus.OPEN]: 'Open',\n [InvoiceStatus.PAID]: 'Paid',\n [InvoiceStatus.VOID]: 'Void',\n [InvoiceStatus.UNCOLLECTIBLE]: 'Uncollectible',\n };\n return labels[status] || status;\n}\n\nexport function formatPaymentStatus(status: PaymentStatus): string {\n const labels: Record<PaymentStatus, string> = {\n [PaymentStatus.PENDING]: 'Pending',\n [PaymentStatus.SUCCEEDED]: 'Succeeded',\n [PaymentStatus.FAILED]: 'Failed',\n [PaymentStatus.CANCELED]: 'Canceled',\n [PaymentStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatChargeStatus(status: ChargeStatus): string {\n const labels: Record<ChargeStatus, string> = {\n [ChargeStatus.PENDING]: 'Pending',\n [ChargeStatus.SUCCEEDED]: 'Succeeded',\n [ChargeStatus.FAILED]: 'Failed',\n [ChargeStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatQuotaStatus(status: QuotaStatus): string {\n const labels: Record<QuotaStatus, string> = {\n [QuotaStatus.HEALTHY]: 'Healthy',\n [QuotaStatus.WARNING]: 'Warning',\n [QuotaStatus.CRITICAL]: 'Critical',\n [QuotaStatus.EXHAUSTED]: 'Exhausted',\n [QuotaStatus.INACTIVE]: 'Inactive',\n };\n return labels[status] || status;\n}\n\n// ============================================================================\n// Plan & Duration Formatting\n// ============================================================================\n\nexport function formatPlanDuration(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'month',\n [PlanDuration.YEARLY]: 'year',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanDurationLabel(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'Monthly',\n [PlanDuration.YEARLY]: 'Yearly',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanPrice(price: number, currency: string, duration: PlanDuration): string {\n return `${formatCurrency(price, currency)}/${formatPlanDuration(duration)}`;\n}\n\n// ============================================================================\n// Payment Method Formatting\n// ============================================================================\n\nexport function formatPaymentMethodType(type: PaymentMethodType): string {\n const labels: Record<PaymentMethodType, string> = {\n [PaymentMethodType.CREDIT_CARD]: 'Credit Card',\n [PaymentMethodType.DEBIT_CARD]: 'Debit Card',\n [PaymentMethodType.BANK_TRANSFER]: 'Bank Transfer',\n [PaymentMethodType.PAYPAL]: 'PayPal',\n [PaymentMethodType.CRYPTO]: 'Cryptocurrency',\n [PaymentMethodType.WALLET]: 'Wallet',\n [PaymentMethodType.NETBANKING]: 'Netbanking',\n };\n return labels[type] || type;\n}\n\nexport function formatCardBrand(brand?: string): string {\n if (!brand) return 'Card';\n return brand.charAt(0).toUpperCase() + brand.slice(1).toLowerCase();\n}\n\nexport function formatCardNumber(last4?: string): string {\n if (!last4) return '****';\n return `•••• ${last4}`;\n}\n\nexport function formatCardExpiry(month?: number, year?: number): string {\n if (!month || !year) return '';\n return `${month.toString().padStart(2, '0')}/${year.toString().slice(-2)}`;\n}\n\n// ============================================================================\n// Transaction Formatting\n// ============================================================================\n\nexport function formatTransactionType(type: TransactionType): string {\n const labels: Record<TransactionType, string> = {\n [TransactionType.PAYMENT]: 'Payment',\n [TransactionType.REFUND]: 'Refund',\n [TransactionType.ADJUSTMENT]: 'Adjustment',\n };\n return labels[type] || type;\n}\n\nexport function formatCreditTransactionType(type: CreditTransactionType): string {\n const labels: Record<CreditTransactionType, string> = {\n [CreditTransactionType.PURCHASE]: 'Purchase',\n [CreditTransactionType.USAGE]: 'Usage',\n [CreditTransactionType.ADJUSTMENT]: 'Earned',\n [CreditTransactionType.GRANTED]: 'Granted',\n };\n return labels[type] || type;\n}\n\n// ============================================================================\n// Text Formatting\n// ============================================================================\n\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return `${text.slice(0, maxLength - 3)}...`;\n}\n\nexport function capitalizeFirst(text: string): string {\n if (!text) return '';\n return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();\n}\n\nexport function formatInvoiceNumber(number: string): string {\n return `#${number}`;\n}\n\n// ============================================================================\n// Quota Value Formatting\n// ============================================================================\n\n/**\n * Format a quota's total value for display, unit-aware. Byte-denominated\n * quotas (storage, upload caps) render as MB/GB via formatBytes instead of a\n * raw byte count — everything else falls back to a plain localized number.\n */\nexport function formatQuotaValue(value: number, unit?: string): string {\n if (unit === 'bytes') return formatBytes(value);\n return value.toLocaleString();\n}\n"],"mappings":";;;AA2CA,SAAgBA,EAAe,GAAgB,IAAW,OAAO,IAAS,SAAiB;CAKzF,OAHII,EAAS,YAAY,MAAM,YACtBC,EAAcC,CAAM,IAEtBL,EAAmBK,GAAQF,GAAUI,CAAM;AACpD;AAMA,SAAgBH,EAAc,GAAwB;CAMpD,OAJI,OAAO,UAAUC,CAAM,IAClB,GAAGA,EAAO,eAAe,EAAE,YAG7B,GAAGA,EAAO,eAAe,KAAA,GAAW;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,EAAE;AACrG;AAaA,SAAgBG,EAAyB,GAAoC;CAO3E,OAAO;GALJC,EAAmB,SAAS;GAC5BA,EAAmB,WAAW;GAC9BA,EAAmB,UAAU;GAC7BA,EAAmB,WAAW;CAE1B,EAAOC,MAAWA;AAC3B;AAEA,SAAgBC,EAAoB,GAA+B;CAQjE,OAAO;GANJC,EAAc,QAAQ;GACtBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,gBAAgB;CAE1B,EAAOF,MAAWA;AAC3B;AAsCA,SAAgBG,EAAmB,GAAgC;CAKjE,OAAO;GAHJC,EAAa,UAAU;GACvBA,EAAa,SAAS;CAElB,EAAOC,MAAaA;AAC7B;AAEA,SAAgBC,EAAwB,GAAgC;CAKtE,OAAO;GAHJF,EAAa,UAAU;GACvBA,EAAa,SAAS;CAElB,EAAOC,MAAaA;AAC7B;AAmDA,SAAgBE,EAA4B,GAAqC;CAO/E,OAAO;GALJC,EAAsB,WAAW;GACjCA,EAAsB,QAAQ;GAC9BA,EAAsB,aAAa;GACnCA,EAAsB,UAAU;CAE5B,EAAOC,MAASA;AACzB;AAgBA,SAAgBC,EAAoB,GAAwB;CAC1D,OAAO,IAAIC;AACb;AAWA,SAAgBC,EAAiB,GAAe,GAAuB;CAErE,OADIC,MAAS,UAAgBC,EAAYC,CAAK,IACvCA,EAAM,eAAe;AAC9B"}
@@ -4,6 +4,8 @@ export declare function toGraphqlQuery(query: GatewayGraphqlDocument): string;
4
4
  interface GatewayGraphqlRequestOptions<TVariables> {
5
5
  apiGatewayUrl?: string;
6
6
  authToken?: string;
7
+ /** The acting user, when known. Mutations default to the token subject. */
8
+ actorId?: string;
7
9
  orgId?: string;
8
10
  query: GatewayGraphqlDocument;
9
11
  variables?: TVariables;
@@ -11,4 +13,3 @@ interface GatewayGraphqlRequestOptions<TVariables> {
11
13
  export declare function normalizeGlobalGatewayBaseUrl(apiGatewayUrl?: string, legacyDirectEndpoints?: string[]): string | undefined;
12
14
  export declare function gatewayGraphqlRequest<TData, TVariables = Record<string, unknown>>(options: GatewayGraphqlRequestOptions<TVariables>): Promise<TData>;
13
15
  export {};
14
- //# sourceMappingURL=gatewayGraphql.d.ts.map
@@ -1,19 +1,20 @@
1
- import { graphqlFetch as e } from "@burdenoff/fe-libs/shared/graphql/fetch";
1
+ import { actorBoundGraphqlFetch as e } from "./pinnedRequest.js";
2
2
  import { print as t } from "graphql";
3
- //#region src/billing/shared/utils/gatewayGraphql.ts
3
+ // src/billing/shared/utils/gatewayGraphql.ts
4
4
  function n(e) {
5
5
  return typeof e == "string" ? e : t(e);
6
6
  }
7
7
  var r = "/global/graphql";
8
8
  function i(e, t = []) {
9
9
  let n = e?.trim();
10
- if (!(!n || n.startsWith("/")) && !t.some((e) => n.includes(e))) return n.endsWith(r) ? n.slice(0, -15) || void 0 : n;
10
+ if (n && !n.startsWith("/") && !t.some((e) => n.includes(e))) return n.endsWith(r) ? n.slice(0, -15) || void 0 : n;
11
11
  }
12
12
  async function a(t) {
13
13
  let r = await e({
14
14
  gateway: "global",
15
15
  baseUrl: i(t.apiGatewayUrl),
16
16
  authToken: t.authToken,
17
+ actorId: t.actorId,
17
18
  organizationId: t.orgId,
18
19
  query: n(t.query),
19
20
  variables: t.variables
@@ -21,7 +22,6 @@ async function a(t) {
21
22
  if (r.errors?.length || !r.data) throw Error(r.errors?.[0]?.message || "Gateway GraphQL request failed");
22
23
  return r.data;
23
24
  }
24
- //#endregion
25
25
  export { a as gatewayGraphqlRequest, i as normalizeGlobalGatewayBaseUrl, n as toGraphqlQuery };
26
26
 
27
27
  //# sourceMappingURL=gatewayGraphql.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gatewayGraphql.js","names":[],"sources":["../../../../src/billing/shared/utils/gatewayGraphql.ts"],"sourcesContent":["import { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport { print, type DocumentNode } from 'graphql';\n\nexport type GatewayGraphqlDocument = string | DocumentNode;\n\nexport function toGraphqlQuery(query: GatewayGraphqlDocument): string {\n return typeof query === 'string' ? query : print(query);\n}\n\ninterface GatewayGraphqlRequestOptions<TVariables> {\n apiGatewayUrl?: string;\n authToken?: string;\n orgId?: string;\n query: GatewayGraphqlDocument;\n variables?: TVariables;\n}\n\nconst GLOBAL_GRAPHQL_PATH = '/global/graphql';\n\nexport function normalizeGlobalGatewayBaseUrl(\n apiGatewayUrl?: string,\n legacyDirectEndpoints: string[] = []\n): string | undefined {\n const trimmedUrl = apiGatewayUrl?.trim();\n\n if (!trimmedUrl || trimmedUrl.startsWith('/')) {\n return undefined;\n }\n\n if (legacyDirectEndpoints.some((endpoint) => trimmedUrl.includes(endpoint))) {\n return undefined;\n }\n\n if (trimmedUrl.endsWith(GLOBAL_GRAPHQL_PATH)) {\n return trimmedUrl.slice(0, -GLOBAL_GRAPHQL_PATH.length) || undefined;\n }\n\n return trimmedUrl;\n}\n\nexport async function gatewayGraphqlRequest<TData, TVariables = Record<string, unknown>>(\n options: GatewayGraphqlRequestOptions<TVariables>\n): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'global',\n baseUrl: normalizeGlobalGatewayBaseUrl(options.apiGatewayUrl),\n authToken: options.authToken,\n organizationId: options.orgId,\n query: toGraphqlQuery(options.query),\n variables: options.variables as Record<string, unknown> | undefined,\n });\n\n if (response.errors?.length || !response.data) {\n throw new Error(response.errors?.[0]?.message || 'Gateway GraphQL request failed');\n }\n\n return response.data;\n}\n"],"mappings":";;;AAKA,SAAgB,EAAe,GAAuC;CACpE,OAAO,OAAO,KAAU,WAAW,IAAQ,EAAM,CAAK;AACxD;AAUA,IAAM,IAAsB;AAE5B,SAAgB,EACd,GACA,IAAkC,CAAC,GACf;CACpB,IAAM,IAAa,GAAe,KAAK;CAEnC,OAAC,KAAc,EAAW,WAAW,GAAG,MAIxC,GAAsB,MAAM,MAAa,EAAW,SAAS,CAAQ,CAAC,GAQ1E,OAJI,EAAW,SAAS,CAAmB,IAClC,EAAW,MAAM,GAAG,GAA2B,KAAK,KAAA,IAGtD;AACT;AAEA,eAAsB,EACpB,GACgB;CAChB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT,SAAS,EAA8B,EAAQ,aAAa;EAC5D,WAAW,EAAQ;EACnB,gBAAgB,EAAQ;EACxB,OAAO,EAAe,EAAQ,KAAK;EACnC,WAAW,EAAQ;CACrB,CAAC;CAED,IAAI,EAAS,QAAQ,UAAU,CAAC,EAAS,MACvC,MAAU,MAAM,EAAS,SAAS,IAAI,WAAW,gCAAgC;CAGnF,OAAO,EAAS;AAClB"}
1
+ {"version":3,"file":"gatewayGraphql.js","names":["toGraphqlQuery","query","print","GLOBAL_GRAPHQL_PATH","normalizeGlobalGatewayBaseUrl","trimmedUrl","apiGatewayUrl","endpoint","gatewayGraphqlRequest","response","actorBoundGraphqlFetch","options"],"sources":["../../../../src/billing/shared/utils/gatewayGraphql.ts"],"sourcesContent":["import { print, type DocumentNode } from 'graphql';\n\nimport { actorBoundGraphqlFetch } from './pinnedRequest';\n\nexport type GatewayGraphqlDocument = string | DocumentNode;\n\nexport function toGraphqlQuery(query: GatewayGraphqlDocument): string {\n return typeof query === 'string' ? query : print(query);\n}\n\ninterface GatewayGraphqlRequestOptions<TVariables> {\n apiGatewayUrl?: string;\n authToken?: string;\n /** The acting user, when known. Mutations default to the token subject. */\n actorId?: string;\n orgId?: string;\n query: GatewayGraphqlDocument;\n variables?: TVariables;\n}\n\nconst GLOBAL_GRAPHQL_PATH = '/global/graphql';\n\nexport function normalizeGlobalGatewayBaseUrl(\n apiGatewayUrl?: string,\n legacyDirectEndpoints: string[] = []\n): string | undefined {\n const trimmedUrl = apiGatewayUrl?.trim();\n\n if (!trimmedUrl || trimmedUrl.startsWith('/')) {\n return undefined;\n }\n\n if (legacyDirectEndpoints.some((endpoint) => trimmedUrl.includes(endpoint))) {\n return undefined;\n }\n\n if (trimmedUrl.endsWith(GLOBAL_GRAPHQL_PATH)) {\n return trimmedUrl.slice(0, -GLOBAL_GRAPHQL_PATH.length) || undefined;\n }\n\n return trimmedUrl;\n}\n\nexport async function gatewayGraphqlRequest<TData, TVariables = Record<string, unknown>>(\n options: GatewayGraphqlRequestOptions<TVariables>\n): Promise<TData> {\n const response = await actorBoundGraphqlFetch<TData>({\n gateway: 'global',\n baseUrl: normalizeGlobalGatewayBaseUrl(options.apiGatewayUrl),\n authToken: options.authToken,\n actorId: options.actorId,\n organizationId: options.orgId,\n query: toGraphqlQuery(options.query),\n variables: options.variables as Record<string, unknown> | undefined,\n });\n\n if (response.errors?.length || !response.data) {\n throw new Error(response.errors?.[0]?.message || 'Gateway GraphQL request failed');\n }\n\n return response.data;\n}\n"],"mappings":";;;AAMA,SAAgBA,EAAe,GAAuC;CACpE,OAAO,OAAOC,KAAU,WAAWA,IAAQC,EAAMD,CAAK;AACxD;AAYA,IAAME,IAAsB;AAE5B,SAAgBC,EACd,GACA,IAAkC,CAAC,GACf;CACpB,IAAMC,IAAaC,GAAe,KAAK;CAEvC,IAAKD,KAAc,GAAW,WAAW,GAAG,KAIxC,GAAsB,MAAM,MAAaA,EAAW,SAASE,CAAQ,CAAC,GAQ1E,OAJIF,EAAW,SAASF,CAAmB,IAClCE,EAAW,MAAM,GAAG,GAA2B,KAAK,KAAA,IAGtDA;AACT;AAEA,eAAsBG,EACpB,GACgB;CAChB,IAAMC,IAAW,MAAMC,EAA8B;EACnD,SAAS;EACT,SAASN,EAA8BO,EAAQ,aAAa;EAC5D,WAAWA,EAAQ;EACnB,SAASA,EAAQ;EACjB,gBAAgBA,EAAQ;EACxB,OAAOX,EAAeW,EAAQ,KAAK;EACnC,WAAWA,EAAQ;CACrB,CAAC;CAED,IAAIF,EAAS,QAAQ,UAAU,CAACA,EAAS,MACvC,MAAU,MAAMA,EAAS,SAAS,EAAE,EAAE,WAAW,gCAAgC;CAGnF,OAAOA,EAAS;AAClB"}
@@ -11,4 +11,3 @@ export * from './directBillingGraphql';
11
11
  export * from './directActivityGraphql';
12
12
  export * from './gatewayGraphql';
13
13
  export * from './planFeatureQuantity';
14
- //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,10 @@
1
- import "./tokens.js";
2
- import "./format.js";
3
- import "./status.js";
4
- import "./error.js";
5
- import "./paymentTheme.js";
6
- import "./gatewayGraphql.js";
7
- import "./directBillingGraphql.js";
1
+ import { alertTokens as e, categoryTokens as t, getProgressTokens as n, getStatusBadgeTokens as r, getStatusTokens as i, progressTokens as a, statusTokens as o } from "./tokens.js";
2
+ import { formatBytes as s, formatCreditTransactionType as c, formatCredits as l, formatCurrency as u, formatDate as d, formatDateTime as f, formatInvoiceNumber as p, formatInvoiceStatus as m, formatNumber as h, formatPercentage as g, formatPlanDuration as _, formatPlanDurationLabel as v, formatQuotaValue as y, formatRelativeTime as b, formatSubscriptionStatus as x } from "./format.js";
3
+ import { getCreditTransactionStatusColor as S, getInvoiceStatusColor as C, getQuotaProgressColor as w, getStatusBadgeClasses as T, getSubscriptionStatusColor as E, getTransactionStatusColor as D } from "./status.js";
4
+ import { isServerError as O } from "./error.js";
5
+ import { getPaymentProviderThemeColor as k, getPaymentThemePalette as A, getStripeCardElementStyle as j } from "./paymentTheme.js";
6
+ import { directBillingGraphqlRequest as M, resolveDirectBillingGraphqlUrl as N } from "./directBillingGraphql.js";
8
7
  import "./directActivityGraphql.js";
9
- import "./planFeatureQuantity.js";
8
+ import { gatewayGraphqlRequest as P, normalizeGlobalGatewayBaseUrl as F, toGraphqlQuery as I } from "./gatewayGraphql.js";
9
+ import { getPlanFeatureQuantity as L, getPlanFeatureUnit as R, getQuotaDisplayName as z, humanizeQuotaName as B } from "./planFeatureQuantity.js";
10
+ export { e as alertTokens, t as categoryTokens, M as directBillingGraphqlRequest, s as formatBytes, c as formatCreditTransactionType, l as formatCredits, u as formatCurrency, d as formatDate, f as formatDateTime, p as formatInvoiceNumber, m as formatInvoiceStatus, h as formatNumber, g as formatPercentage, _ as formatPlanDuration, v as formatPlanDurationLabel, y as formatQuotaValue, b as formatRelativeTime, x as formatSubscriptionStatus, P as gatewayGraphqlRequest, S as getCreditTransactionStatusColor, C as getInvoiceStatusColor, k as getPaymentProviderThemeColor, A as getPaymentThemePalette, L as getPlanFeatureQuantity, R as getPlanFeatureUnit, n as getProgressTokens, z as getQuotaDisplayName, w as getQuotaProgressColor, T as getStatusBadgeClasses, r as getStatusBadgeTokens, i as getStatusTokens, j as getStripeCardElementStyle, E as getSubscriptionStatusColor, D as getTransactionStatusColor, B as humanizeQuotaName, O as isServerError, F as normalizeGlobalGatewayBaseUrl, a as progressTokens, N as resolveDirectBillingGraphqlUrl, o as statusTokens, I as toGraphqlQuery };
@@ -1,2 +1 @@
1
1
  export declare function withBillingAccountId(path: string, billingAccountId?: string | null): string;
2
- //# sourceMappingURL=navigation.d.ts.map
@@ -1,8 +1,7 @@
1
- //#region src/billing/shared/utils/navigation.ts
1
+ // src/billing/shared/utils/navigation.ts
2
2
  function e(e, t) {
3
3
  return t ? `${e}${e.includes("?") ? "&" : "?"}billingAccountId=${encodeURIComponent(t)}` : e;
4
4
  }
5
- //#endregion
6
5
  export { e as withBillingAccountId };
7
6
 
8
7
  //# sourceMappingURL=navigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","names":[],"sources":["../../../../src/billing/shared/utils/navigation.ts"],"sourcesContent":["export function withBillingAccountId(path: string, billingAccountId?: string | null): string {\n if (!billingAccountId) return path;\n\n const separator = path.includes('?') ? '&' : '?';\n return `${path}${separator}billingAccountId=${encodeURIComponent(billingAccountId)}`;\n}\n"],"mappings":";AAAA,SAAgB,EAAqB,GAAc,GAA0C;CAI3F,OAHK,IAGE,GAAG,IADQ,EAAK,SAAS,GAAG,IAAI,MAAM,IAClB,mBAAmB,mBAAmB,CAAgB,MAHnD;AAIhC"}
1
+ {"version":3,"file":"navigation.js","names":["withBillingAccountId","billingAccountId","path"],"sources":["../../../../src/billing/shared/utils/navigation.ts"],"sourcesContent":["export function withBillingAccountId(path: string, billingAccountId?: string | null): string {\n if (!billingAccountId) return path;\n\n const separator = path.includes('?') ? '&' : '?';\n return `${path}${separator}billingAccountId=${encodeURIComponent(billingAccountId)}`;\n}\n"],"mappings":";AAAA,SAAgBA,EAAqB,GAAc,GAA0C;CAI3F,OAHKC,IAGE,GAAGC,IADQA,EAAK,SAAS,GAAG,IAAI,MAAM,IAClB,mBAAmB,mBAAmBD,CAAgB,MAHnDC;AAIhC"}
@@ -15,4 +15,3 @@ export declare function getStripeCardElementStyle(fontFamily?: string): {
15
15
  };
16
16
  export declare function getPaymentProviderThemeColor(): string | undefined;
17
17
  export {};
18
- //# sourceMappingURL=paymentTheme.d.ts.map
@@ -1,6 +1,6 @@
1
- //#region src/billing/shared/utils/paymentTheme.ts
1
+ // src/billing/shared/utils/paymentTheme.ts
2
2
  function e(e) {
3
- if (!(typeof window > "u")) return window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || void 0;
3
+ if (typeof window < "u") return window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || void 0;
4
4
  }
5
5
  function t() {
6
6
  return {
@@ -26,7 +26,6 @@ function n(e = "Inter, system-ui, sans-serif") {
26
26
  function r() {
27
27
  return t().primaryColor;
28
28
  }
29
- //#endregion
30
29
  export { r as getPaymentProviderThemeColor, t as getPaymentThemePalette, n as getStripeCardElementStyle };
31
30
 
32
31
  //# sourceMappingURL=paymentTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paymentTheme.js","names":[],"sources":["../../../../src/billing/shared/utils/paymentTheme.ts"],"sourcesContent":["/**\n * Utilities for adapting third-party payment widgets to the current semantic theme.\n */\n\ninterface PaymentThemePalette {\n textColor?: string;\n placeholderColor?: string;\n mutedColor?: string;\n errorColor?: string;\n primaryColor?: string;\n}\n\nfunction readCssVar(name: string): string | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || undefined;\n}\n\nexport function getPaymentThemePalette(): PaymentThemePalette {\n return {\n textColor: readCssVar('--color-text-primary'),\n placeholderColor: readCssVar('--color-text-placeholder'),\n mutedColor: readCssVar('--color-text-secondary'),\n errorColor: readCssVar('--color-status-error-bg'),\n primaryColor: readCssVar('--color-action-primary-bg'),\n };\n}\n\nexport function getStripeCardElementStyle(fontFamily = 'Inter, system-ui, sans-serif') {\n const palette = getPaymentThemePalette();\n\n const base: Record<string, unknown> = {\n fontSize: '16px',\n fontFamily,\n };\n\n if (palette.textColor) {\n base.color = palette.textColor;\n }\n\n if (palette.placeholderColor) {\n base['::placeholder'] = { color: palette.placeholderColor };\n }\n\n if (palette.mutedColor) {\n base.iconColor = palette.mutedColor;\n }\n\n const invalid: Record<string, unknown> = {};\n\n if (palette.errorColor) {\n invalid.color = palette.errorColor;\n invalid.iconColor = palette.errorColor;\n }\n\n return {\n base,\n invalid,\n };\n}\n\nexport function getPaymentProviderThemeColor(): string | undefined {\n return getPaymentThemePalette().primaryColor;\n}\n"],"mappings":";AAYA,SAAS,EAAW,GAAkC;CAChD,aAAO,SAAW,MAKtB,OADc,OAAO,iBAAiB,SAAS,eAAe,EAAE,iBAAiB,CAAI,EAAE,KAChF,KAAS,KAAA;AAClB;AAEA,SAAgB,IAA8C;CAC5D,OAAO;EACL,WAAW,EAAW,sBAAsB;EAC5C,kBAAkB,EAAW,0BAA0B;EACvD,YAAY,EAAW,wBAAwB;EAC/C,YAAY,EAAW,yBAAyB;EAChD,cAAc,EAAW,2BAA2B;CACtD;AACF;AAEA,SAAgB,EAA0B,IAAa,gCAAgC;CACrF,IAAM,IAAU,EAAuB,GAEjC,IAAgC;EACpC,UAAU;EACV;CACF;CAUA,AARI,EAAQ,cACV,EAAK,QAAQ,EAAQ,YAGnB,EAAQ,qBACV,EAAK,mBAAmB,EAAE,OAAO,EAAQ,iBAAiB,IAGxD,EAAQ,eACV,EAAK,YAAY,EAAQ;CAG3B,IAAM,IAAmC,CAAC;CAO1C,OALI,EAAQ,eACV,EAAQ,QAAQ,EAAQ,YACxB,EAAQ,YAAY,EAAQ,aAGvB;EACL;EACA;CACF;AACF;AAEA,SAAgB,IAAmD;CACjE,OAAO,EAAuB,EAAE;AAClC"}
1
+ {"version":3,"file":"paymentTheme.js","names":["readCssVar","name","getPaymentThemePalette","getStripeCardElementStyle","palette","base","invalid","getPaymentProviderThemeColor"],"sources":["../../../../src/billing/shared/utils/paymentTheme.ts"],"sourcesContent":["/**\n * Utilities for adapting third-party payment widgets to the current semantic theme.\n */\n\ninterface PaymentThemePalette {\n textColor?: string;\n placeholderColor?: string;\n mutedColor?: string;\n errorColor?: string;\n primaryColor?: string;\n}\n\nfunction readCssVar(name: string): string | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || undefined;\n}\n\nexport function getPaymentThemePalette(): PaymentThemePalette {\n return {\n textColor: readCssVar('--color-text-primary'),\n placeholderColor: readCssVar('--color-text-placeholder'),\n mutedColor: readCssVar('--color-text-secondary'),\n errorColor: readCssVar('--color-status-error-bg'),\n primaryColor: readCssVar('--color-action-primary-bg'),\n };\n}\n\nexport function getStripeCardElementStyle(fontFamily = 'Inter, system-ui, sans-serif') {\n const palette = getPaymentThemePalette();\n\n const base: Record<string, unknown> = {\n fontSize: '16px',\n fontFamily,\n };\n\n if (palette.textColor) {\n base.color = palette.textColor;\n }\n\n if (palette.placeholderColor) {\n base['::placeholder'] = { color: palette.placeholderColor };\n }\n\n if (palette.mutedColor) {\n base.iconColor = palette.mutedColor;\n }\n\n const invalid: Record<string, unknown> = {};\n\n if (palette.errorColor) {\n invalid.color = palette.errorColor;\n invalid.iconColor = palette.errorColor;\n }\n\n return {\n base,\n invalid,\n };\n}\n\nexport function getPaymentProviderThemeColor(): string | undefined {\n return getPaymentThemePalette().primaryColor;\n}\n"],"mappings":";AAYA,SAASA,EAAW,GAAkC;CACpD,IAAI,OAAO,SAAW,KAKtB,OADc,OAAO,iBAAiB,SAAS,eAAe,CAAC,CAAC,iBAAiBC,CAAI,CAAC,CAAC,KAChF,KAAS,KAAA;AAClB;AAEA,SAAgBC,IAA8C;CAC5D,OAAO;EACL,WAAWF,EAAW,sBAAsB;EAC5C,kBAAkBA,EAAW,0BAA0B;EACvD,YAAYA,EAAW,wBAAwB;EAC/C,YAAYA,EAAW,yBAAyB;EAChD,cAAcA,EAAW,2BAA2B;CACtD;AACF;AAEA,SAAgBG,EAA0B,IAAa,gCAAgC;CACrF,IAAMC,IAAUF,EAAuB,GAEjCG,IAAgC;EACpC,UAAU;EACV;CACF;CAUA,AARID,EAAQ,cACV,EAAK,QAAQA,EAAQ,YAGnBA,EAAQ,qBACV,EAAK,mBAAmB,EAAE,OAAOA,EAAQ,iBAAiB,IAGxDA,EAAQ,eACV,EAAK,YAAYA,EAAQ;CAG3B,IAAME,IAAmC,CAAC;CAO1C,OALIF,EAAQ,eACV,EAAQ,QAAQA,EAAQ,YACxB,EAAQ,YAAYA,EAAQ,aAGvB;EACL;EACA;CACF;AACF;AAEA,SAAgBG,IAAmD;CACjE,OAAOL,EAAuB,CAAC,CAAC;AAClC"}
@@ -0,0 +1,48 @@
1
+ import { GraphQLFetchOptions, GraphQLResponse } from '@burdenoff/fe-libs/shared/graphql';
2
+ export declare const SIGN_IN_REQUIRED_MESSAGE = "Your session has ended. Sign in again, then retry this action.";
3
+ export declare const ACTOR_CHANGED_MESSAGE = "The active account changed before this action was sent. Review it and try again.";
4
+ /** What identifies the acting user when an action starts. */
5
+ export interface RequestActorSource {
6
+ /** The bearer the caller was given (usually the MFE's `authToken` prop). */
7
+ authToken?: string | null;
8
+ /** The acting user, when the caller knows it. Defaults to the token subject. */
9
+ actorId?: string | null;
10
+ }
11
+ /** The account and bearer an action was started with. */
12
+ export interface CapturedRequestActor {
13
+ readonly actorId: string;
14
+ readonly authToken: string;
15
+ }
16
+ /** The `sub` claim of an access token, or null when it cannot be read. */
17
+ export declare function getTokenSubject(token: string | null | undefined): string | null;
18
+ /** True when the document contains a mutation operation. */
19
+ export declare function isMutationDocument(query: string): boolean;
20
+ /**
21
+ * Record the acting user when an action starts. Call it synchronously when the
22
+ * write begins so the capture reflects the account the user acted as.
23
+ */
24
+ export declare function captureRequestActor(source: RequestActorSource): CapturedRequestActor;
25
+ /**
26
+ * Options for one operation sent on behalf of a captured actor. Billing talks
27
+ * to the global gateway only, which carries no workspace authority, so there
28
+ * is no workspace token to prepare for the captured actor.
29
+ */
30
+ export type PinnedFetchOptions = Omit<GraphQLFetchOptions, 'authToken' | 'authTokenMode' | 'skipAuthRetry' | 'workspaceToken' | 'gateway'> & {
31
+ gateway: 'global';
32
+ };
33
+ /**
34
+ * Send one operation bound to the captured actor. Returns the raw GraphQL
35
+ * response so callers keep their own error and empty-data handling.
36
+ */
37
+ export declare function pinnedFetch<T>(actor: CapturedRequestActor, options: PinnedFetchOptions): Promise<GraphQLResponse<T>>;
38
+ /** Request options of the billing wrappers: an explicit bearer plus context. */
39
+ export type ActorBoundFetchOptions = PinnedFetchOptions & {
40
+ authToken?: string;
41
+ /** The acting user, when the caller knows it. Defaults to the token subject. */
42
+ actorId?: string | null;
43
+ };
44
+ /**
45
+ * Send a billing operation. Mutations are bound to the actor that started
46
+ * them; queries keep the refreshable transport.
47
+ */
48
+ export declare function actorBoundGraphqlFetch<T>(options: ActorBoundFetchOptions): Promise<GraphQLResponse<T>>;
@@ -0,0 +1,63 @@
1
+ import { getActiveUser as e } from "@burdenoff/fe-libs/shared/providers/shell";
2
+ import { Kind as t, parse as n } from "graphql";
3
+ import { clearGraphqlFetchResponseCache as r, getStoredAuthToken as i, graphqlFetch as a, graphqlFetchPinned as o } from "@burdenoff/fe-libs/shared/graphql";
4
+ // src/billing/shared/utils/pinnedRequest.ts
5
+ var s = "Your session has ended. Sign in again, then retry this action.", c = "The active account changed before this action was sent. Review it and try again.";
6
+ function l(e) {
7
+ let t = e.split(".")[1];
8
+ if (!t) return null;
9
+ try {
10
+ let e = atob(t.replace(/-/g, "+").replace(/_/g, "/")), n = JSON.parse(e);
11
+ return n && typeof n == "object" ? n : null;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+ function u(e) {
17
+ if (!e) return null;
18
+ let t = l(e)?.sub;
19
+ return typeof t == "string" && t.length > 0 ? t : null;
20
+ }
21
+ function d(e) {
22
+ let t = l(e)?.exp;
23
+ return typeof t == "number" && t * 1e3 <= Date.now();
24
+ }
25
+ function f(e) {
26
+ try {
27
+ return n(e).definitions.some((e) => e.kind === t.OPERATION_DEFINITION && e.operation === "mutation");
28
+ } catch {
29
+ return /^\s*mutation\b/.test(e.replace(/^\s*#[^\n]*\n/gm, ""));
30
+ }
31
+ }
32
+ function p(t) {
33
+ let n = e()?.id || null, r = t.actorId || u(t.authToken) || n;
34
+ if (!r || !n) throw Error(s);
35
+ if (n !== r) throw Error(c);
36
+ let a = i() || t.authToken || "";
37
+ if (!a || d(a)) throw Error(s);
38
+ return {
39
+ actorId: r,
40
+ authToken: a
41
+ };
42
+ }
43
+ async function m(t, n) {
44
+ if (e()?.id !== t.actorId) throw Error(c);
45
+ let i = await o({
46
+ ...n,
47
+ authToken: t.authToken
48
+ });
49
+ return i.errors?.length || r(), i;
50
+ }
51
+ async function h(e) {
52
+ let { actorId: t, authToken: n, ...r } = e;
53
+ return f(r.query) ? m(p({
54
+ authToken: n,
55
+ actorId: t
56
+ }), r) : a({
57
+ ...r,
58
+ ...n ? { authToken: n } : {}
59
+ });
60
+ }
61
+ export { c as ACTOR_CHANGED_MESSAGE, s as SIGN_IN_REQUIRED_MESSAGE, h as actorBoundGraphqlFetch, p as captureRequestActor, u as getTokenSubject, f as isMutationDocument, m as pinnedFetch };
62
+
63
+ //# sourceMappingURL=pinnedRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pinnedRequest.js","names":["SIGN_IN_REQUIRED_MESSAGE","ACTOR_CHANGED_MESSAGE","decodeJwtClaims","payload","token","json","claims","getTokenSubject","sub","isTokenExpired","exp","isMutationDocument","parse","query","definition","Kind","captureRequestActor","activeActorId","getActiveUser","actorId","source","authToken","getStoredAuthToken","pinnedFetch","actor","response","graphqlFetchPinned","options","clearGraphqlFetchResponseCache","actorBoundGraphqlFetch","request","graphqlFetch"],"sources":["../../../../src/billing/shared/utils/pinnedRequest.ts"],"sourcesContent":["/**\n * Actor-bound transport for billing writes (BOFF-11028, following BOFF-10939).\n *\n * The default `graphqlFetch` is refreshable: when an explicit `authToken` has\n * expired it falls back to the token of whichever profile is active in the\n * browser, and its UNAUTHENTICATED retry re-reads storage. A billing write\n * started by one account (a payout account change, a withdrawal, a team\n * permission grant...) could therefore be sent with another account's bearer\n * if the user switched profile while it was in flight.\n *\n * The shared request wrappers (`gatewayGraphqlRequest`,\n * `directBillingGraphqlRequest`, `directActivityGraphqlRequest`) send every\n * operation through `actorBoundGraphqlFetch`, which splits by operation type:\n *\n * - Mutations are bound to the account that started them.\n * `captureRequestActor` identifies that account from the explicit token\n * (its `sub` claim) and refuses if the profile active in the browser is a\n * different account. `graphqlFetchPinned` then sends the captured bearer,\n * refuses an expired one before dispatch and never refreshes or replays the\n * operation under the profile token stored in the browser.\n * - Queries keep the refreshable `graphqlFetch`. They are same-actor reads on\n * long-lived pages where a silent token refresh is the expected behaviour,\n * and a refreshed read cannot change data.\n */\nimport {\n clearGraphqlFetchResponseCache,\n getStoredAuthToken,\n graphqlFetch,\n graphqlFetchPinned,\n type GraphQLFetchOptions,\n type GraphQLResponse,\n} from '@burdenoff/fe-libs/shared/graphql';\nimport { getActiveUser } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Kind, parse } from 'graphql';\n\nexport const SIGN_IN_REQUIRED_MESSAGE =\n 'Your session has ended. Sign in again, then retry this action.';\nexport const ACTOR_CHANGED_MESSAGE =\n 'The active account changed before this action was sent. Review it and try again.';\n\n/** What identifies the acting user when an action starts. */\nexport interface RequestActorSource {\n /** The bearer the caller was given (usually the MFE's `authToken` prop). */\n authToken?: string | null;\n /** The acting user, when the caller knows it. Defaults to the token subject. */\n actorId?: string | null;\n}\n\n/** The account and bearer an action was started with. */\nexport interface CapturedRequestActor {\n readonly actorId: string;\n readonly authToken: string;\n}\n\ninterface JwtClaims {\n sub?: unknown;\n exp?: unknown;\n}\n\nfunction decodeJwtClaims(token: string): JwtClaims | null {\n const payload = token.split('.')[1];\n if (!payload) return null;\n try {\n // Base64URL to Base64 before decoding; the JWT alphabet is not the atob one.\n const json = atob(payload.replace(/-/g, '+').replace(/_/g, '/'));\n const claims: unknown = JSON.parse(json);\n return claims && typeof claims === 'object' ? (claims as JwtClaims) : null;\n } catch {\n return null;\n }\n}\n\n/** The `sub` claim of an access token, or null when it cannot be read. */\nexport function getTokenSubject(token: string | null | undefined): string | null {\n if (!token) return null;\n const sub = decodeJwtClaims(token)?.sub;\n return typeof sub === 'string' && sub.length > 0 ? sub : null;\n}\n\nfunction isTokenExpired(token: string): boolean {\n const exp = decodeJwtClaims(token)?.exp;\n return typeof exp === 'number' && exp * 1000 <= Date.now();\n}\n\n/** True when the document contains a mutation operation. */\nexport function isMutationDocument(query: string): boolean {\n try {\n return parse(query).definitions.some(\n (definition) =>\n definition.kind === Kind.OPERATION_DEFINITION && definition.operation === 'mutation'\n );\n } catch {\n // An unparsable document is refused by the gateway either way; classify it\n // conservatively from its leading keyword so a write is never sent through\n // the refreshable transport.\n return /^\\s*mutation\\b/.test(query.replace(/^\\s*#[^\\n]*\\n/gm, ''));\n }\n}\n\n/**\n * Record the acting user when an action starts. Call it synchronously when the\n * write begins so the capture reflects the account the user acted as.\n */\nexport function captureRequestActor(source: RequestActorSource): CapturedRequestActor {\n const activeActorId = getActiveUser()?.id || null;\n const actorId = source.actorId || getTokenSubject(source.authToken) || activeActorId;\n if (!actorId || !activeActorId) {\n throw new Error(SIGN_IN_REQUIRED_MESSAGE);\n }\n if (activeActorId !== actorId) {\n throw new Error(ACTOR_CHANGED_MESSAGE);\n }\n // The active profile belongs to the acting user, so its stored token is that\n // user's current bearer (it may be fresher than the explicit one after a\n // refresh). `getStoredAuthToken` returns null for an expired token; the\n // explicit token is then the only candidate.\n const authToken = getStoredAuthToken() || source.authToken || '';\n if (!authToken || isTokenExpired(authToken)) {\n throw new Error(SIGN_IN_REQUIRED_MESSAGE);\n }\n return { actorId, authToken };\n}\n\n/**\n * Options for one operation sent on behalf of a captured actor. Billing talks\n * to the global gateway only, which carries no workspace authority, so there\n * is no workspace token to prepare for the captured actor.\n */\nexport type PinnedFetchOptions = Omit<\n GraphQLFetchOptions,\n 'authToken' | 'authTokenMode' | 'skipAuthRetry' | 'workspaceToken' | 'gateway'\n> & { gateway: 'global' };\n\n/**\n * Send one operation bound to the captured actor. Returns the raw GraphQL\n * response so callers keep their own error and empty-data handling.\n */\nexport async function pinnedFetch<T>(\n actor: CapturedRequestActor,\n options: PinnedFetchOptions\n): Promise<GraphQLResponse<T>> {\n // Synchronous with the dispatch below: nothing can switch the profile between\n // this check and the pinned transport reading the request options.\n if (getActiveUser()?.id !== actor.actorId) {\n throw new Error(ACTOR_CHANGED_MESSAGE);\n }\n const response = await graphqlFetchPinned<T>({ ...options, authToken: actor.authToken });\n\n // A completed write must not be followed by a refetch served from the\n // 15-second response cache with pre-write data.\n if (!response.errors?.length) {\n clearGraphqlFetchResponseCache();\n }\n return response;\n}\n\n/** Request options of the billing wrappers: an explicit bearer plus context. */\nexport type ActorBoundFetchOptions = PinnedFetchOptions & {\n authToken?: string;\n /** The acting user, when the caller knows it. Defaults to the token subject. */\n actorId?: string | null;\n};\n\n/**\n * Send a billing operation. Mutations are bound to the actor that started\n * them; queries keep the refreshable transport.\n */\nexport async function actorBoundGraphqlFetch<T>(\n options: ActorBoundFetchOptions\n): Promise<GraphQLResponse<T>> {\n const { actorId, authToken, ...request } = options;\n if (!isMutationDocument(request.query)) {\n return graphqlFetch<T>({ ...request, ...(authToken ? { authToken } : {}) });\n }\n return pinnedFetch<T>(captureRequestActor({ authToken, actorId }), request);\n}\n"],"mappings":";;;;AAmCA,IAAaA,IACX,kEACWC,IACX;AAqBF,SAASC,EAAgB,GAAiC;CACxD,IAAMC,IAAUC,EAAM,MAAM,GAAG,CAAC,CAAC;CACjC,IAAI,CAACD,GAAS,OAAO;CACrB,IAAI;EAEF,IAAME,IAAO,KAAKF,EAAQ,QAAQ,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,GACzDG,IAAkB,KAAK,MAAMD,CAAI;EACvC,OAAOC,KAAU,OAAOA,KAAW,WAAYA,IAAuB;CACxE,QAAQ;EACN,OAAO;CACT;AACF;AAGA,SAAgBC,EAAgB,GAAiD;CAC/E,IAAI,CAACH,GAAO,OAAO;CACnB,IAAMI,IAAMN,EAAgBE,CAAK,CAAC,EAAE;CACpC,OAAO,OAAOI,KAAQ,YAAYA,EAAI,SAAS,IAAIA,IAAM;AAC3D;AAEA,SAASC,EAAe,GAAwB;CAC9C,IAAMC,IAAMR,EAAgBE,CAAK,CAAC,EAAE;CACpC,OAAO,OAAOM,KAAQ,YAAYA,IAAM,OAAQ,KAAK,IAAI;AAC3D;AAGA,SAAgBC,EAAmB,GAAwB;CACzD,IAAI;EACF,OAAOC,EAAMC,CAAK,CAAC,CAAC,YAAY,MAC7B,MACCC,EAAW,SAASC,EAAK,wBAAwBD,EAAW,cAAc,UAC9E;CACF,QAAQ;EAIN,OAAO,iBAAiB,KAAKD,EAAM,QAAQ,mBAAmB,EAAE,CAAC;CACnE;AACF;AAMA,SAAgBG,EAAoB,GAAkD;CACpF,IAAMC,IAAgBC,EAAc,CAAC,EAAE,MAAM,MACvCC,IAAUC,EAAO,WAAWb,EAAgBa,EAAO,SAAS,KAAKH;CACvE,IAAI,CAACE,KAAW,CAACF,GACf,MAAU,MAAMjB,CAAwB;CAE1C,IAAIiB,MAAkBE,GACpB,MAAU,MAAMlB,CAAqB;CAMvC,IAAMoB,IAAYC,EAAmB,KAAKF,EAAO,aAAa;CAC9D,IAAI,CAACC,KAAaZ,EAAeY,CAAS,GACxC,MAAU,MAAMrB,CAAwB;CAE1C,OAAO;EAAE;EAAS;CAAU;AAC9B;AAgBA,eAAsBuB,EACpB,GACA,GAC6B;CAG7B,IAAIL,EAAc,CAAC,EAAE,OAAOM,EAAM,SAChC,MAAU,MAAMvB,CAAqB;CAEvC,IAAMwB,IAAW,MAAMC,EAAsB;EAAE,GAAGC;EAAS,WAAWH,EAAM;CAAU,CAAC;CAOvF,OAHKC,EAAS,QAAQ,UACpBG,EAA+B,GAE1BH;AACT;AAaA,eAAsBI,EACpB,GAC6B;CAC7B,IAAM,EAAE,YAAS,cAAW,GAAGC,MAAYH;CAI3C,OAHKhB,EAAmBmB,EAAQ,KAAK,IAG9BP,EAAeP,EAAoB;EAAE;EAAW;CAAQ,CAAC,GAAGc,CAAO,IAFjEC,EAAgB;EAAE,GAAGD;EAAS,GAAIT,IAAY,EAAE,aAAU,IAAI,CAAC;CAAG,CAAC;AAG9E"}
@@ -37,4 +37,3 @@ export declare function humanizeQuotaName(name: string): string;
37
37
  */
38
38
  export declare function getQuotaDisplayName(feature: FeatureLike): string;
39
39
  export {};
40
- //# sourceMappingURL=planFeatureQuantity.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/billing/shared/utils/planFeatureQuantity.ts
1
+ // src/billing/shared/utils/planFeatureQuantity.ts
2
2
  function e(e) {
3
3
  let t = e.context;
4
4
  if (t && typeof t.quantity == "number") return t.quantity;
@@ -9,7 +9,7 @@ function t(e) {
9
9
  let t = e.context;
10
10
  return typeof t?.unit == "string" ? t.unit : void 0;
11
11
  }
12
- var n = new Set([
12
+ var n = /* @__PURE__ */ new Set([
13
13
  "count",
14
14
  "bytes",
15
15
  "days",
@@ -29,7 +29,6 @@ function i(e) {
29
29
  let n = e.quota?.name;
30
30
  return n ? r(n) : "Unknown Quota";
31
31
  }
32
- //#endregion
33
32
  export { e as getPlanFeatureQuantity, t as getPlanFeatureUnit, i as getQuotaDisplayName, r as humanizeQuotaName };
34
33
 
35
34
  //# sourceMappingURL=planFeatureQuantity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"planFeatureQuantity.js","names":[],"sources":["../../../../src/billing/shared/utils/planFeatureQuantity.ts"],"sourcesContent":["/**\n * Source of truth for \"how big is this quota on this plan\":\n * 1. Per-plan override stored on the SubscriptionFeature row's\n * `context.quantity` (autoseed + post-OSS-release createPlan path).\n * 2. Fall back to the catalog default `quota.limits.value` for plans that\n * pre-date per-plan overrides (only the autoseeded Free plan today).\n */\ntype FeatureLike = {\n context?: unknown;\n quota?: { name?: string | null; limits?: unknown; context?: unknown } | null;\n};\n\nexport function getPlanFeatureQuantity(feature: FeatureLike): number {\n const ctx = feature.context as { quantity?: number } | null | undefined;\n if (ctx && typeof ctx.quantity === 'number') return ctx.quantity;\n\n const limits = feature.quota?.limits as { value?: number } | null | undefined;\n return typeof limits?.value === 'number' ? limits.value : 0;\n}\n\n/**\n * The unit a quota's quantity is denominated in (e.g. \"bytes\", \"days\",\n * \"workflows\"), as seeded on the SubscriptionFeature row's `context.unit`.\n * Used to render byte-denominated quotas (storage, uploads) as MB/GB instead\n * of a raw byte count — see formatQuotaValue in format.ts.\n */\nexport function getPlanFeatureUnit(feature: FeatureLike): string | undefined {\n const ctx = feature.context as { unit?: string } | null | undefined;\n return typeof ctx?.unit === 'string' ? ctx.unit : undefined;\n}\n\n// Trailing name segments that describe the unit/cadence, not the quota\n// itself (e.g. \"fluidgrids.storage.bytes\" → the \"bytes\" segment). Stripped\n// by humanizeQuotaName so the fallback label doesn't end in a redundant\n// technical word.\nconst NAME_SUFFIX_STOPWORDS = new Set([\n 'count',\n 'bytes',\n 'days',\n 'seconds',\n 'hours',\n 'monthly',\n 'daily',\n 'concurrent',\n]);\n\n/**\n * Best-effort human label for a quota that has no seeded `displayName`\n * (older rows only — every quota seeded since BOFF-3058 carries one). Turns\n * \"fluidgrids.scheduled_triggers.count\" into \"Scheduled Triggers\": drops the\n * leading product/boundary segment and a trailing unit/cadence stopword,\n * then title-cases the rest.\n */\nexport function humanizeQuotaName(name: string): string {\n const segments = name.split('.').filter(Boolean);\n const withoutBoundary = segments.length > 1 ? segments.slice(1) : segments;\n const last = withoutBoundary[withoutBoundary.length - 1];\n const meaningful =\n withoutBoundary.length > 1 && last && NAME_SUFFIX_STOPWORDS.has(last)\n ? withoutBoundary.slice(0, -1)\n : withoutBoundary;\n\n const words = meaningful.join(' ').replace(/_/g, ' ').trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return name;\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\n}\n\n/**\n * The name to show a user for a quota: prefers the curated `displayName`\n * seeded on Quota.context (e.g. \"Storage\", \"Team Members\"); falls back to a\n * humanized version of the raw dotted identifier for any quota seeded before\n * displayName was added to the catalog.\n */\nexport function getQuotaDisplayName(feature: FeatureLike): string {\n const quotaContext = feature.quota?.context as { displayName?: string } | null | undefined;\n if (quotaContext && typeof quotaContext.displayName === 'string' && quotaContext.displayName) {\n return quotaContext.displayName;\n }\n\n const rawName = feature.quota?.name;\n return rawName ? humanizeQuotaName(rawName) : 'Unknown Quota';\n}\n"],"mappings":";AAYA,SAAgB,EAAuB,GAA8B;CACnE,IAAM,IAAM,EAAQ;CACpB,IAAI,KAAO,OAAO,EAAI,YAAa,UAAU,OAAO,EAAI;CAExD,IAAM,IAAS,EAAQ,OAAO;CAC9B,OAAO,OAAO,GAAQ,SAAU,WAAW,EAAO,QAAQ;AAC5D;AAQA,SAAgB,EAAmB,GAA0C;CAC3E,IAAM,IAAM,EAAQ;CACpB,OAAO,OAAO,GAAK,QAAS,WAAW,EAAI,OAAO,KAAA;AACpD;AAMA,IAAM,IAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AASD,SAAgB,EAAkB,GAAsB;CACtD,IAAM,IAAW,EAAK,MAAM,GAAG,EAAE,OAAO,OAAO,GACzC,IAAkB,EAAS,SAAS,IAAI,EAAS,MAAM,CAAC,IAAI,GAC5D,IAAO,EAAgB,EAAgB,SAAS,IAMhD,KAJJ,EAAgB,SAAS,KAAK,KAAQ,EAAsB,IAAI,CAAI,IAChE,EAAgB,MAAM,GAAG,EAAE,IAC3B,GAEmB,KAAK,GAAG,EAAE,QAAQ,MAAM,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,EAAE,OAAO,OAAO;CAExF,OADI,EAAM,WAAW,IAAU,IACxB,EAAM,KAAK,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,IAAI,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG;AAC1E;AAQA,SAAgB,EAAoB,GAA8B;CAChE,IAAM,IAAe,EAAQ,OAAO;CACpC,IAAI,KAAgB,OAAO,EAAa,eAAgB,YAAY,EAAa,aAC/E,OAAO,EAAa;CAGtB,IAAM,IAAU,EAAQ,OAAO;CAC/B,OAAO,IAAU,EAAkB,CAAO,IAAI;AAChD"}
1
+ {"version":3,"file":"planFeatureQuantity.js","names":["getPlanFeatureQuantity","ctx","feature","limits","getPlanFeatureUnit","NAME_SUFFIX_STOPWORDS","humanizeQuotaName","segments","name","withoutBoundary","last","words","w","getQuotaDisplayName","quotaContext","rawName"],"sources":["../../../../src/billing/shared/utils/planFeatureQuantity.ts"],"sourcesContent":["/**\n * Source of truth for \"how big is this quota on this plan\":\n * 1. Per-plan override stored on the SubscriptionFeature row's\n * `context.quantity` (autoseed + post-OSS-release createPlan path).\n * 2. Fall back to the catalog default `quota.limits.value` for plans that\n * pre-date per-plan overrides (only the autoseeded Free plan today).\n */\ntype FeatureLike = {\n context?: unknown;\n quota?: { name?: string | null; limits?: unknown; context?: unknown } | null;\n};\n\nexport function getPlanFeatureQuantity(feature: FeatureLike): number {\n const ctx = feature.context as { quantity?: number } | null | undefined;\n if (ctx && typeof ctx.quantity === 'number') return ctx.quantity;\n\n const limits = feature.quota?.limits as { value?: number } | null | undefined;\n return typeof limits?.value === 'number' ? limits.value : 0;\n}\n\n/**\n * The unit a quota's quantity is denominated in (e.g. \"bytes\", \"days\",\n * \"workflows\"), as seeded on the SubscriptionFeature row's `context.unit`.\n * Used to render byte-denominated quotas (storage, uploads) as MB/GB instead\n * of a raw byte count — see formatQuotaValue in format.ts.\n */\nexport function getPlanFeatureUnit(feature: FeatureLike): string | undefined {\n const ctx = feature.context as { unit?: string } | null | undefined;\n return typeof ctx?.unit === 'string' ? ctx.unit : undefined;\n}\n\n// Trailing name segments that describe the unit/cadence, not the quota\n// itself (e.g. \"fluidgrids.storage.bytes\" → the \"bytes\" segment). Stripped\n// by humanizeQuotaName so the fallback label doesn't end in a redundant\n// technical word.\nconst NAME_SUFFIX_STOPWORDS = new Set([\n 'count',\n 'bytes',\n 'days',\n 'seconds',\n 'hours',\n 'monthly',\n 'daily',\n 'concurrent',\n]);\n\n/**\n * Best-effort human label for a quota that has no seeded `displayName`\n * (older rows only — every quota seeded since BOFF-3058 carries one). Turns\n * \"fluidgrids.scheduled_triggers.count\" into \"Scheduled Triggers\": drops the\n * leading product/boundary segment and a trailing unit/cadence stopword,\n * then title-cases the rest.\n */\nexport function humanizeQuotaName(name: string): string {\n const segments = name.split('.').filter(Boolean);\n const withoutBoundary = segments.length > 1 ? segments.slice(1) : segments;\n const last = withoutBoundary[withoutBoundary.length - 1];\n const meaningful =\n withoutBoundary.length > 1 && last && NAME_SUFFIX_STOPWORDS.has(last)\n ? withoutBoundary.slice(0, -1)\n : withoutBoundary;\n\n const words = meaningful.join(' ').replace(/_/g, ' ').trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return name;\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\n}\n\n/**\n * The name to show a user for a quota: prefers the curated `displayName`\n * seeded on Quota.context (e.g. \"Storage\", \"Team Members\"); falls back to a\n * humanized version of the raw dotted identifier for any quota seeded before\n * displayName was added to the catalog.\n */\nexport function getQuotaDisplayName(feature: FeatureLike): string {\n const quotaContext = feature.quota?.context as { displayName?: string } | null | undefined;\n if (quotaContext && typeof quotaContext.displayName === 'string' && quotaContext.displayName) {\n return quotaContext.displayName;\n }\n\n const rawName = feature.quota?.name;\n return rawName ? humanizeQuotaName(rawName) : 'Unknown Quota';\n}\n"],"mappings":";AAYA,SAAgBA,EAAuB,GAA8B;CACnE,IAAMC,IAAMC,EAAQ;CACpB,IAAID,KAAO,OAAOA,EAAI,YAAa,UAAU,OAAOA,EAAI;CAExD,IAAME,IAASD,EAAQ,OAAO;CAC9B,OAAO,OAAOC,GAAQ,SAAU,WAAWA,EAAO,QAAQ;AAC5D;AAQA,SAAgBC,EAAmB,GAA0C;CAC3E,IAAMH,IAAMC,EAAQ;CACpB,OAAO,OAAOD,GAAK,QAAS,WAAWA,EAAI,OAAO,KAAA;AACpD;AAMA,IAAMI,oBAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AASD,SAAgBC,EAAkB,GAAsB;CACtD,IAAMC,IAAWC,EAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,GACzCC,IAAkBF,EAAS,SAAS,IAAIA,EAAS,MAAM,CAAC,IAAIA,GAC5DG,IAAOD,EAAgBA,EAAgB,SAAS,IAMhDE,KAJJF,EAAgB,SAAS,KAAKC,KAAQL,EAAsB,IAAIK,CAAI,IAChED,EAAgB,MAAM,GAAG,EAAE,IAC3BA,EAAA,CAEmB,KAAK,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAExF,OADIE,EAAM,WAAW,IAAUH,IACxBG,EAAM,KAAK,MAAMC,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;AAC1E;AAQA,SAAgBC,EAAoB,GAA8B;CAChE,IAAMC,IAAeZ,EAAQ,OAAO;CACpC,IAAIY,KAAgB,OAAOA,EAAa,eAAgB,YAAYA,EAAa,aAC/E,OAAOA,EAAa;CAGtB,IAAMC,IAAUb,EAAQ,OAAO;CAC/B,OAAOa,IAAUT,EAAkBS,CAAO,IAAI;AAChD"}
@@ -24,4 +24,3 @@ export declare function isPendingPayment(status: PaymentStatus): boolean;
24
24
  export declare function isHealthyQuota(status: QuotaStatus): boolean;
25
25
  export declare function isQuotaAtRisk(status: QuotaStatus): boolean;
26
26
  export declare function isQuotaExhausted(status: QuotaStatus): boolean;
27
- //# sourceMappingURL=status.d.ts.map
@@ -1,45 +1,44 @@
1
- import { getProgressTokens as e, getStatusBadgeTokens as t } from "./tokens.js";
2
- import { CreditTransactionStatus as n, InvoiceStatus as r, SubscriptionStatus as i, TransactionStatus as a } from "../types/graphql.js";
3
- //#region src/billing/shared/utils/status.ts
1
+ import { CreditTransactionStatus as e, InvoiceStatus as t, SubscriptionStatus as n, TransactionStatus as r } from "../types/graphql.js";
2
+ import { getProgressTokens as i, getStatusBadgeTokens as a } from "./tokens.js";
3
+ // src/billing/shared/utils/status.ts
4
4
  function o(e) {
5
5
  return {
6
- [i.ACTIVE]: "success",
7
- [i.CANCELED]: "error",
8
- [i.EXPIRED]: "neutral",
9
- [i.UPGRADED]: "info"
6
+ [n.ACTIVE]: "success",
7
+ [n.CANCELED]: "error",
8
+ [n.EXPIRED]: "neutral",
9
+ [n.UPGRADED]: "info"
10
10
  }[e] || "neutral";
11
11
  }
12
12
  function s(e) {
13
13
  return {
14
- [r.DRAFT]: "neutral",
15
- [r.OPEN]: "info",
16
- [r.PAID]: "success",
17
- [r.VOID]: "neutral",
18
- [r.UNCOLLECTIBLE]: "error"
14
+ [t.DRAFT]: "neutral",
15
+ [t.OPEN]: "info",
16
+ [t.PAID]: "success",
17
+ [t.VOID]: "neutral",
18
+ [t.UNCOLLECTIBLE]: "error"
19
19
  }[e] || "neutral";
20
20
  }
21
21
  function c(e) {
22
22
  return {
23
- [a.PENDING]: "warning",
24
- [a.SUCCESS]: "success",
25
- [a.FAILED]: "error"
23
+ [r.PENDING]: "warning",
24
+ [r.SUCCESS]: "success",
25
+ [r.FAILED]: "error"
26
26
  }[e] || "neutral";
27
27
  }
28
- function l(e) {
28
+ function l(t) {
29
29
  return {
30
- [n.PENDING]: "warning",
31
- [n.SUCCESS]: "success",
32
- [n.FAILED]: "error",
33
- [n.REFUND]: "info"
34
- }[e] || "neutral";
30
+ [e.PENDING]: "warning",
31
+ [e.SUCCESS]: "success",
32
+ [e.FAILED]: "error",
33
+ [e.REFUND]: "info"
34
+ }[t] || "neutral";
35
35
  }
36
36
  function u(e) {
37
- return t(e);
37
+ return a(e);
38
38
  }
39
- function d(t) {
40
- return e(t).bar;
39
+ function d(e) {
40
+ return i(e).bar;
41
41
  }
42
- //#endregion
43
42
  export { l as getCreditTransactionStatusColor, s as getInvoiceStatusColor, d as getQuotaProgressColor, u as getStatusBadgeClasses, o as getSubscriptionStatusColor, c as getTransactionStatusColor };
44
43
 
45
44
  //# sourceMappingURL=status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.js","names":[],"sources":["../../../../src/billing/shared/utils/status.ts"],"sourcesContent":["/**\n * Status utilities for the billing module\n * Provides status colors, icons, and helper functions\n *\n * Uses semantic design tokens from tokens.ts for consistent theming\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n RefundStatus,\n QuotaStatus,\n TransactionStatus,\n CreditTransactionStatus,\n} from '../types';\nimport { type SemanticStatus, getStatusBadgeTokens, getProgressTokens } from './tokens';\n\n// ============================================================================\n// Status Color Types\n// ============================================================================\n\nexport type StatusColor = SemanticStatus;\n\n// ============================================================================\n// Status Color Mappings\n// ============================================================================\n\nexport function getSubscriptionStatusColor(status: SubscriptionStatus): StatusColor {\n const colors: Record<SubscriptionStatus, StatusColor> = {\n [SubscriptionStatus.ACTIVE]: 'success',\n [SubscriptionStatus.CANCELED]: 'error',\n [SubscriptionStatus.EXPIRED]: 'neutral',\n [SubscriptionStatus.UPGRADED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getInvoiceStatusColor(status: InvoiceStatus): StatusColor {\n const colors: Record<InvoiceStatus, StatusColor> = {\n [InvoiceStatus.DRAFT]: 'neutral',\n [InvoiceStatus.OPEN]: 'info',\n [InvoiceStatus.PAID]: 'success',\n [InvoiceStatus.VOID]: 'neutral',\n [InvoiceStatus.UNCOLLECTIBLE]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getPaymentStatusColor(status: PaymentStatus): StatusColor {\n const colors: Record<PaymentStatus, StatusColor> = {\n [PaymentStatus.PENDING]: 'warning',\n [PaymentStatus.SUCCEEDED]: 'success',\n [PaymentStatus.FAILED]: 'error',\n [PaymentStatus.CANCELED]: 'neutral',\n [PaymentStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getChargeStatusColor(status: ChargeStatus): StatusColor {\n const colors: Record<ChargeStatus, StatusColor> = {\n [ChargeStatus.PENDING]: 'warning',\n [ChargeStatus.SUCCEEDED]: 'success',\n [ChargeStatus.FAILED]: 'error',\n [ChargeStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getRefundStatusColor(status: RefundStatus): StatusColor {\n const colors: Record<RefundStatus, StatusColor> = {\n [RefundStatus.PENDING]: 'warning',\n [RefundStatus.SUCCEEDED]: 'success',\n [RefundStatus.FAILED]: 'error',\n [RefundStatus.CANCELED]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getQuotaStatusColor(status: QuotaStatus): StatusColor {\n const colors: Record<QuotaStatus, StatusColor> = {\n [QuotaStatus.HEALTHY]: 'success',\n [QuotaStatus.WARNING]: 'warning',\n [QuotaStatus.CRITICAL]: 'error',\n [QuotaStatus.EXHAUSTED]: 'error',\n [QuotaStatus.INACTIVE]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getTransactionStatusColor(status: TransactionStatus): StatusColor {\n const colors: Record<TransactionStatus, StatusColor> = {\n [TransactionStatus.PENDING]: 'warning',\n [TransactionStatus.SUCCESS]: 'success',\n [TransactionStatus.FAILED]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getCreditTransactionStatusColor(status: CreditTransactionStatus): StatusColor {\n const colors: Record<CreditTransactionStatus, StatusColor> = {\n [CreditTransactionStatus.PENDING]: 'warning',\n [CreditTransactionStatus.SUCCESS]: 'success',\n [CreditTransactionStatus.FAILED]: 'error',\n [CreditTransactionStatus.REFUND]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\n// ============================================================================\n// CSS Class Mappings (using semantic tokens)\n// ============================================================================\n\n/**\n * Get combined badge classes for a status.\n */\nexport function getStatusBadgeClasses(color: StatusColor): string {\n return getStatusBadgeTokens(color);\n}\n\n// ============================================================================\n// Quota Status Helpers\n// ============================================================================\n\nexport function getQuotaStatusFromPercentage(percentage: number): QuotaStatus {\n if (percentage >= 100) return QuotaStatus.EXHAUSTED;\n if (percentage >= 90) return QuotaStatus.CRITICAL;\n if (percentage >= 75) return QuotaStatus.WARNING;\n return QuotaStatus.HEALTHY;\n}\n\nexport function getQuotaProgressColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.bar;\n}\n\nexport function getQuotaProgressBgColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.track;\n}\n\n// ============================================================================\n// Status Checks\n// ============================================================================\n\nexport function isActiveSubscription(status: SubscriptionStatus): boolean {\n return status === SubscriptionStatus.ACTIVE;\n}\n\nexport function isPaidInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.PAID;\n}\n\nexport function isOpenInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.OPEN;\n}\n\nexport function isSuccessfulPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.SUCCEEDED;\n}\n\nexport function isPendingPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.PENDING;\n}\n\nexport function isHealthyQuota(status: QuotaStatus): boolean {\n return status === QuotaStatus.HEALTHY;\n}\n\nexport function isQuotaAtRisk(status: QuotaStatus): boolean {\n return status === QuotaStatus.WARNING || status === QuotaStatus.CRITICAL;\n}\n\nexport function isQuotaExhausted(status: QuotaStatus): boolean {\n return status === QuotaStatus.EXHAUSTED;\n}\n"],"mappings":";;;AA6BA,SAAgB,EAA2B,GAAyC;CAOlF,OAAO;GALJ,EAAmB,SAAS;GAC5B,EAAmB,WAAW;GAC9B,EAAmB,UAAU;GAC7B,EAAmB,WAAW;CAE1B,EAAO,MAAW;AAC3B;AAEA,SAAgB,EAAsB,GAAoC;CAQxE,OAAO;GANJ,EAAc,QAAQ;GACtB,EAAc,OAAO;GACrB,EAAc,OAAO;GACrB,EAAc,OAAO;GACrB,EAAc,gBAAgB;CAE1B,EAAO,MAAW;AAC3B;AA4CA,SAAgB,EAA0B,GAAwC;CAMhF,OAAO;GAJJ,EAAkB,UAAU;GAC5B,EAAkB,UAAU;GAC5B,EAAkB,SAAS;CAEvB,EAAO,MAAW;AAC3B;AAEA,SAAgB,EAAgC,GAA8C;CAO5F,OAAO;GALJ,EAAwB,UAAU;GAClC,EAAwB,UAAU;GAClC,EAAwB,SAAS;GACjC,EAAwB,SAAS;CAE7B,EAAO,MAAW;AAC3B;AASA,SAAgB,EAAsB,GAA4B;CAChE,OAAO,EAAqB,CAAK;AACnC;AAaA,SAAgB,EAAsB,GAA4B;CAEhE,OADe,EAAkB,CAC1B,EAAO;AAChB"}
1
+ {"version":3,"file":"status.js","names":["getSubscriptionStatusColor","SubscriptionStatus","status","getInvoiceStatusColor","InvoiceStatus","getTransactionStatusColor","TransactionStatus","getCreditTransactionStatusColor","CreditTransactionStatus","getStatusBadgeClasses","getStatusBadgeTokens","color","getQuotaProgressColor","getProgressTokens","percentage"],"sources":["../../../../src/billing/shared/utils/status.ts"],"sourcesContent":["/**\n * Status utilities for the billing module\n * Provides status colors, icons, and helper functions\n *\n * Uses semantic design tokens from tokens.ts for consistent theming\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n RefundStatus,\n QuotaStatus,\n TransactionStatus,\n CreditTransactionStatus,\n} from '../types';\nimport { type SemanticStatus, getStatusBadgeTokens, getProgressTokens } from './tokens';\n\n// ============================================================================\n// Status Color Types\n// ============================================================================\n\nexport type StatusColor = SemanticStatus;\n\n// ============================================================================\n// Status Color Mappings\n// ============================================================================\n\nexport function getSubscriptionStatusColor(status: SubscriptionStatus): StatusColor {\n const colors: Record<SubscriptionStatus, StatusColor> = {\n [SubscriptionStatus.ACTIVE]: 'success',\n [SubscriptionStatus.CANCELED]: 'error',\n [SubscriptionStatus.EXPIRED]: 'neutral',\n [SubscriptionStatus.UPGRADED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getInvoiceStatusColor(status: InvoiceStatus): StatusColor {\n const colors: Record<InvoiceStatus, StatusColor> = {\n [InvoiceStatus.DRAFT]: 'neutral',\n [InvoiceStatus.OPEN]: 'info',\n [InvoiceStatus.PAID]: 'success',\n [InvoiceStatus.VOID]: 'neutral',\n [InvoiceStatus.UNCOLLECTIBLE]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getPaymentStatusColor(status: PaymentStatus): StatusColor {\n const colors: Record<PaymentStatus, StatusColor> = {\n [PaymentStatus.PENDING]: 'warning',\n [PaymentStatus.SUCCEEDED]: 'success',\n [PaymentStatus.FAILED]: 'error',\n [PaymentStatus.CANCELED]: 'neutral',\n [PaymentStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getChargeStatusColor(status: ChargeStatus): StatusColor {\n const colors: Record<ChargeStatus, StatusColor> = {\n [ChargeStatus.PENDING]: 'warning',\n [ChargeStatus.SUCCEEDED]: 'success',\n [ChargeStatus.FAILED]: 'error',\n [ChargeStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getRefundStatusColor(status: RefundStatus): StatusColor {\n const colors: Record<RefundStatus, StatusColor> = {\n [RefundStatus.PENDING]: 'warning',\n [RefundStatus.SUCCEEDED]: 'success',\n [RefundStatus.FAILED]: 'error',\n [RefundStatus.CANCELED]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getQuotaStatusColor(status: QuotaStatus): StatusColor {\n const colors: Record<QuotaStatus, StatusColor> = {\n [QuotaStatus.HEALTHY]: 'success',\n [QuotaStatus.WARNING]: 'warning',\n [QuotaStatus.CRITICAL]: 'error',\n [QuotaStatus.EXHAUSTED]: 'error',\n [QuotaStatus.INACTIVE]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getTransactionStatusColor(status: TransactionStatus): StatusColor {\n const colors: Record<TransactionStatus, StatusColor> = {\n [TransactionStatus.PENDING]: 'warning',\n [TransactionStatus.SUCCESS]: 'success',\n [TransactionStatus.FAILED]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getCreditTransactionStatusColor(status: CreditTransactionStatus): StatusColor {\n const colors: Record<CreditTransactionStatus, StatusColor> = {\n [CreditTransactionStatus.PENDING]: 'warning',\n [CreditTransactionStatus.SUCCESS]: 'success',\n [CreditTransactionStatus.FAILED]: 'error',\n [CreditTransactionStatus.REFUND]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\n// ============================================================================\n// CSS Class Mappings (using semantic tokens)\n// ============================================================================\n\n/**\n * Get combined badge classes for a status.\n */\nexport function getStatusBadgeClasses(color: StatusColor): string {\n return getStatusBadgeTokens(color);\n}\n\n// ============================================================================\n// Quota Status Helpers\n// ============================================================================\n\nexport function getQuotaStatusFromPercentage(percentage: number): QuotaStatus {\n if (percentage >= 100) return QuotaStatus.EXHAUSTED;\n if (percentage >= 90) return QuotaStatus.CRITICAL;\n if (percentage >= 75) return QuotaStatus.WARNING;\n return QuotaStatus.HEALTHY;\n}\n\nexport function getQuotaProgressColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.bar;\n}\n\nexport function getQuotaProgressBgColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.track;\n}\n\n// ============================================================================\n// Status Checks\n// ============================================================================\n\nexport function isActiveSubscription(status: SubscriptionStatus): boolean {\n return status === SubscriptionStatus.ACTIVE;\n}\n\nexport function isPaidInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.PAID;\n}\n\nexport function isOpenInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.OPEN;\n}\n\nexport function isSuccessfulPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.SUCCEEDED;\n}\n\nexport function isPendingPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.PENDING;\n}\n\nexport function isHealthyQuota(status: QuotaStatus): boolean {\n return status === QuotaStatus.HEALTHY;\n}\n\nexport function isQuotaAtRisk(status: QuotaStatus): boolean {\n return status === QuotaStatus.WARNING || status === QuotaStatus.CRITICAL;\n}\n\nexport function isQuotaExhausted(status: QuotaStatus): boolean {\n return status === QuotaStatus.EXHAUSTED;\n}\n"],"mappings":";;;AA6BA,SAAgBA,EAA2B,GAAyC;CAOlF,OAAO;GALJC,EAAmB,SAAS;GAC5BA,EAAmB,WAAW;GAC9BA,EAAmB,UAAU;GAC7BA,EAAmB,WAAW;CAE1B,EAAOC,MAAW;AAC3B;AAEA,SAAgBC,EAAsB,GAAoC;CAQxE,OAAO;GANJC,EAAc,QAAQ;GACtBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,gBAAgB;CAE1B,EAAOF,MAAW;AAC3B;AA4CA,SAAgBG,EAA0B,GAAwC;CAMhF,OAAO;GAJJC,EAAkB,UAAU;GAC5BA,EAAkB,UAAU;GAC5BA,EAAkB,SAAS;CAEvB,EAAOJ,MAAW;AAC3B;AAEA,SAAgBK,EAAgC,GAA8C;CAO5F,OAAO;GALJC,EAAwB,UAAU;GAClCA,EAAwB,UAAU;GAClCA,EAAwB,SAAS;GACjCA,EAAwB,SAAS;CAE7B,EAAON,MAAW;AAC3B;AASA,SAAgBO,EAAsB,GAA4B;CAChE,OAAOC,EAAqBC,CAAK;AACnC;AAaA,SAAgBC,EAAsB,GAA4B;CAEhE,OADeC,EAAkBC,CAC1B,CAAA,CAAO;AAChB"}
@@ -153,4 +153,3 @@ export declare function getAlertTokens(type: 'success' | 'warning' | 'error' | '
153
153
  text: string;
154
154
  icon: string;
155
155
  };
156
- //# sourceMappingURL=tokens.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/billing/shared/utils/tokens.ts
1
+ // src/billing/shared/utils/tokens.ts
2
2
  var e = {
3
3
  success: {
4
4
  bg: "bg-status-success-bg-subtle",
@@ -105,7 +105,6 @@ var a = {
105
105
  icon: "text-status-info-bg"
106
106
  }
107
107
  };
108
- //#endregion
109
108
  export { o as alertTokens, a as categoryTokens, i as getProgressTokens, n as getStatusBadgeTokens, t as getStatusTokens, r as progressTokens, e as statusTokens };
110
109
 
111
110
  //# sourceMappingURL=tokens.js.map