@burdenoff/microfe-billing 2026.1108.1 → 2026.1108.2

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 (769) 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 +0 -1
  504. package/dist/billing/shared/utils/directBillingGraphql.d.ts +0 -1
  505. package/dist/billing/shared/utils/directBillingGraphql.js +1 -2
  506. package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
  507. package/dist/billing/shared/utils/error.d.ts +0 -1
  508. package/dist/billing/shared/utils/error.js +1 -2
  509. package/dist/billing/shared/utils/error.js.map +1 -1
  510. package/dist/billing/shared/utils/format.d.ts +0 -1
  511. package/dist/billing/shared/utils/format.js +1 -2
  512. package/dist/billing/shared/utils/format.js.map +1 -1
  513. package/dist/billing/shared/utils/gatewayGraphql.d.ts +0 -1
  514. package/dist/billing/shared/utils/gatewayGraphql.js +2 -3
  515. package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
  516. package/dist/billing/shared/utils/index.d.ts +0 -1
  517. package/dist/billing/shared/utils/index.js +9 -8
  518. package/dist/billing/shared/utils/navigation.d.ts +0 -1
  519. package/dist/billing/shared/utils/navigation.js +1 -2
  520. package/dist/billing/shared/utils/navigation.js.map +1 -1
  521. package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
  522. package/dist/billing/shared/utils/paymentTheme.js +2 -3
  523. package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
  524. package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
  525. package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
  526. package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
  527. package/dist/billing/shared/utils/status.d.ts +0 -1
  528. package/dist/billing/shared/utils/status.js +24 -25
  529. package/dist/billing/shared/utils/status.js.map +1 -1
  530. package/dist/billing/shared/utils/tokens.d.ts +0 -1
  531. package/dist/billing/shared/utils/tokens.js +1 -2
  532. package/dist/billing/shared/utils/tokens.js.map +1 -1
  533. package/dist/billing/translations/en.d.ts +0 -1
  534. package/dist/billing/types/index.d.ts +0 -1
  535. package/dist/dev/main.d.ts +0 -1
  536. package/dist/generated/global-operations.d.ts +3252 -3206
  537. package/dist/generated/global-operations.js +445 -422
  538. package/dist/generated/global-operations.js.map +1 -1
  539. package/dist/generated/global-types.d.ts +2 -22
  540. package/dist/generated/global-types.js +1 -2
  541. package/dist/generated/global-types.js.map +1 -1
  542. package/dist/generated/wspace-operations.d.ts +76 -47
  543. package/dist/generated/wspace-operations.js +2 -3
  544. package/dist/generated/wspace-operations.js.map +1 -1
  545. package/dist/generated/wspace-types.d.ts +4 -24
  546. package/dist/index.d.ts +0 -1
  547. package/dist/index.js +1 -2
  548. package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
  549. package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
  550. package/dist/node_modules/sonner/dist/index.js +75 -69
  551. package/dist/node_modules/sonner/dist/index.js.map +1 -1
  552. package/dist/utils/nativeBridge.d.ts +0 -1
  553. package/dist/utils/nativeBridge.js +1 -2
  554. package/package.json +65 -54
  555. package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
  556. package/dist/billing/BillingRoot.d.ts.map +0 -1
  557. package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
  558. package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
  559. package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
  560. package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
  561. package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
  562. package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
  563. package/dist/billing/hooks/useProducts.d.ts.map +0 -1
  564. package/dist/billing/index.d.ts.map +0 -1
  565. package/dist/billing/lib/native-purchases.d.ts.map +0 -1
  566. package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
  567. package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
  568. package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
  569. package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
  570. package/dist/billing/modules/addons/index.d.ts.map +0 -1
  571. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
  572. package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
  573. package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
  574. package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
  575. package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
  576. package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
  577. package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
  578. package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
  579. package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
  580. package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
  581. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
  582. package/dist/billing/modules/analytics/index.d.ts.map +0 -1
  583. package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
  584. package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
  585. package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
  586. package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
  587. package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
  588. package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
  589. package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
  590. package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
  591. package/dist/billing/modules/billing/index.d.ts.map +0 -1
  592. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
  593. package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
  594. package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
  595. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
  596. package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
  597. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
  598. package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
  599. package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
  600. package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
  601. package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
  602. package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
  603. package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
  604. package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
  605. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
  606. package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
  607. package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
  608. package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
  609. package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
  610. package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
  611. package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
  612. package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
  613. package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
  614. package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
  615. package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
  616. package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
  617. package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
  618. package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
  619. package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
  620. package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
  621. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
  622. package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
  623. package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
  624. package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
  625. package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
  626. package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
  627. package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
  628. package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
  629. package/dist/billing/modules/checkout/index.d.ts.map +0 -1
  630. package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
  631. package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
  632. package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
  633. package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
  634. package/dist/billing/modules/coupons/index.d.ts.map +0 -1
  635. package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
  636. package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
  637. package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
  638. package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
  639. package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
  640. package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
  641. package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
  642. package/dist/billing/modules/credits/index.d.ts.map +0 -1
  643. package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
  644. package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
  645. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
  646. package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
  647. package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
  648. package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
  649. package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
  650. package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
  651. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
  652. package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
  653. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
  654. package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
  655. package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
  656. package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
  657. package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
  658. package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
  659. package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
  660. package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
  661. package/dist/billing/modules/discounts/index.d.ts.map +0 -1
  662. package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
  663. package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
  664. package/dist/billing/modules/earnings/api.d.ts.map +0 -1
  665. package/dist/billing/modules/earnings/index.d.ts.map +0 -1
  666. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
  667. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
  668. package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
  669. package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
  670. package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
  671. package/dist/billing/modules/earnings/payoutAccountStatus.d.ts.map +0 -1
  672. package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
  673. package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
  674. package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
  675. package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
  676. package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
  677. package/dist/billing/modules/plans/index.d.ts.map +0 -1
  678. package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
  679. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
  680. package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
  681. package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
  682. package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
  683. package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
  684. package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
  685. package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
  686. package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
  687. package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
  688. package/dist/billing/modules/promotions/index.d.ts.map +0 -1
  689. package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
  690. package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
  691. package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
  692. package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
  693. package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
  694. package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
  695. package/dist/billing/modules/quota/index.d.ts.map +0 -1
  696. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
  697. package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
  698. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
  699. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
  700. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
  701. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
  702. package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
  703. package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
  704. package/dist/billing/modules/settings/index.d.ts.map +0 -1
  705. package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
  706. package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
  707. package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
  708. package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
  709. package/dist/billing/modules/store/index.d.ts.map +0 -1
  710. package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
  711. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
  712. package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
  713. package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
  714. package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
  715. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
  716. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
  717. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
  718. package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
  719. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
  720. package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
  721. package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
  722. package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
  723. package/dist/billing/modules/usage/index.d.ts.map +0 -1
  724. package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
  725. package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
  726. package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
  727. package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
  728. package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
  729. package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
  730. package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
  731. package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
  732. package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
  733. package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
  734. package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
  735. package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
  736. package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
  737. package/dist/billing/shared/components/index.d.ts.map +0 -1
  738. package/dist/billing/shared/hooks/index.d.ts.map +0 -1
  739. package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
  740. package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
  741. package/dist/billing/shared/index.d.ts.map +0 -1
  742. package/dist/billing/shared/types/graphql.d.ts.map +0 -1
  743. package/dist/billing/shared/types/index.d.ts.map +0 -1
  744. package/dist/billing/shared/ui/Card.d.ts.map +0 -1
  745. package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
  746. package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
  747. package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
  748. package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
  749. package/dist/billing/shared/ui/index.d.ts.map +0 -1
  750. package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
  751. package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
  752. package/dist/billing/shared/utils/error.d.ts.map +0 -1
  753. package/dist/billing/shared/utils/format.d.ts.map +0 -1
  754. package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
  755. package/dist/billing/shared/utils/index.d.ts.map +0 -1
  756. package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
  757. package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
  758. package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
  759. package/dist/billing/shared/utils/status.d.ts.map +0 -1
  760. package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
  761. package/dist/billing/translations/en.d.ts.map +0 -1
  762. package/dist/billing/types/index.d.ts.map +0 -1
  763. package/dist/dev/main.d.ts.map +0 -1
  764. package/dist/generated/global-operations.d.ts.map +0 -1
  765. package/dist/generated/global-types.d.ts.map +0 -1
  766. package/dist/generated/wspace-operations.d.ts.map +0 -1
  767. package/dist/generated/wspace-types.d.ts.map +0 -1
  768. package/dist/index.d.ts.map +0 -1
  769. package/dist/utils/nativeBridge.d.ts.map +0 -1
@@ -1,11 +1,11 @@
1
- import { useAddonCartStore as e } from "../store/addonCartStore.js";
2
- import { useBillingNavigate as t } from "../../../hooks/useBillingNavigate.js";
1
+ import { useBillingNavigate as e } from "../../../hooks/useBillingNavigate.js";
2
+ import { useAddonCartStore as t } from "../store/addonCartStore.js";
3
3
  import { Minus as n, Plus as r, ShoppingCart as i, Trash2 as a, X as o } from "lucide-react";
4
4
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
5
5
  import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
6
  import { createPortal as d } from "react-dom";
7
7
  import { ASSISTANT_BOTTOM_CHROME_CLEARANCE as f } from "@burdenoff/fe-libs/shared/assistant";
8
- //#region src/billing/modules/addons/components/FloatingCartDrawer.tsx
8
+ // src/billing/modules/addons/components/FloatingCartDrawer.tsx
9
9
  var p = (e, t) => new Intl.NumberFormat("en-US", {
10
10
  style: "currency",
11
11
  currency: t || "USD",
@@ -15,7 +15,7 @@ var p = (e, t) => new Intl.NumberFormat("en-US", {
15
15
  let { t: h } = u(), g = (e, t) => {
16
16
  let n = h(e);
17
17
  return n === e ? t : n;
18
- }, _ = t(), { items: v, isCartOpen: y, toggleCart: b, closeCart: x, removeFromCart: S, updateQuantity: C, clearCart: w, getCartTotal: T } = e(), E = v.reduce((e, t) => e + t.quantity, 0), D = T();
18
+ }, _ = e(), { items: v, isCartOpen: y, toggleCart: b, closeCart: x, removeFromCart: S, updateQuantity: C, clearCart: w, getCartTotal: T } = t(), E = v.reduce((e, t) => e + t.quantity, 0), D = T();
19
19
  return v.length === 0 && !y ? null : /* @__PURE__ */ l(s, { children: [!y && v.length > 0 && d(/* @__PURE__ */ l("button", {
20
20
  type: "button",
21
21
  onClick: b,
@@ -183,7 +183,6 @@ var p = (e, t) => new Intl.NumberFormat("en-US", {
183
183
  })]
184
184
  })] });
185
185
  };
186
- //#endregion
187
186
  export { h as FloatingCartDrawer };
188
187
 
189
188
  //# sourceMappingURL=FloatingCartDrawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingCartDrawer.js","names":[],"sources":["../../../../../src/billing/modules/addons/components/FloatingCartDrawer.tsx"],"sourcesContent":["/**\n * Floating Cart Drawer Component\n * Displays the addon cart as a floating button and drawer overlay\n * Reusable across pages that need cart functionality\n */\n\nimport { type FC } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { ShoppingCart, X, Minus, Plus, Trash2 } from 'lucide-react';\nimport { useAddonCartStore } from '../store/addonCartStore';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ASSISTANT_BOTTOM_CHROME_CLEARANCE } from '@burdenoff/fe-libs/shared/assistant';\n\n// Format currency helper\nconst formatCurrency = (amount: number, currency: string) => {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: currency || 'USD',\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n }).format(amount);\n};\n\n// Format plan duration helper\nconst formatPlanDuration = (duration: string) => {\n return duration === 'yearly' ? 'year' : 'month';\n};\n\nexport const FloatingCartDrawer: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const navigateTo = useBillingNavigate();\n const {\n items,\n isCartOpen,\n toggleCart,\n closeCart,\n removeFromCart,\n updateQuantity,\n clearCart,\n getCartTotal,\n } = useAddonCartStore();\n\n const itemCount = items.reduce((sum, item) => sum + item.quantity, 0);\n const cartTotal = getCartTotal();\n\n if (items.length === 0 && !isCartOpen) return null;\n\n const handleCheckout = () => {\n closeCart();\n // Navigate to checkout - same path used in AddonsListPage\n navigateTo('/checkout/addons');\n };\n\n return (\n <>\n {/* Floating Cart Button — portaled to <body> so it stays anchored to\n the real viewport, not a transformed route-transition ancestor on\n the installed app (see AddonsBrowsePage's FloatingCartDrawer for\n the full explanation). Bottom-left on phone widths only so it\n doesn't compete with the AI Assistant launcher's bottom-right\n corner (BOFF-9854); unchanged bottom-right at `sm:` and up. */}\n {!isCartOpen &&\n items.length > 0 &&\n createPortal(\n <button\n type=\"button\"\n onClick={toggleCart}\n style={{ bottom: `calc(1.5rem + ${ASSISTANT_BOTTOM_CHROME_CLEARANCE})` }}\n className=\"fixed left-6 sm:left-auto sm:right-6 z-50 flex items-center gap-2 px-4 py-3 bg-action-primary-bg text-action-primary-text rounded-full shadow-elevation-3 hover:bg-action-primary-bgHover hover:shadow-elevation-4 transition-all duration-200\"\n aria-label={`Open addon cart with ${itemCount} item${itemCount !== 1 ? 's' : ''}`}\n >\n <ShoppingCart className=\"size-5\" />\n <span className=\"font-medium\">\n {itemCount} item{itemCount !== 1 ? 's' : ''}\n </span>\n <span className=\"px-2 py-0.5 bg-action-primary-text/20 rounded-full text-sm\">\n {formatCurrency(cartTotal, items[0]?.addon.currency || 'USD')}\n </span>\n </button>,\n document.body\n )}\n\n {/* Cart Drawer */}\n {isCartOpen && (\n <div className=\"fixed inset-0 z-50 flex items-end sm:items-center justify-center\">\n {/* Backdrop */}\n <div className=\"absolute inset-0 bg-overlay-scrim\" onClick={closeCart} />\n\n {/* Drawer */}\n <div\n className=\"relative w-full max-w-md max-h-[80vh] bg-bg-surface border border-border-subtle rounded-t-card sm:rounded-card shadow-[var(--shadow-elevation-4)] overflow-hidden\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"addon-cart-title\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-subtle bg-bg-sunken\">\n <div className=\"flex items-center gap-2\">\n <ShoppingCart className=\"size-5 text-text-primary\" />\n <h3 id=\"addon-cart-title\" className=\"font-semibold text-text-primary\">\n {tr('billing.addons.yourCart', 'Your Cart')}\n </h3>\n <span className=\"px-2 py-0.5 text-xs bg-action-primary-bg text-action-primary-text rounded-full\">\n {itemCount} item{itemCount !== 1 ? 's' : ''}\n </span>\n </div>\n <button\n type=\"button\"\n onClick={closeCart}\n className=\"p-1.5 rounded hover:bg-bg-sunken transition-colors\"\n aria-label=\"Close addon cart\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Cart Items */}\n <div className=\"overflow-y-auto max-h-[50vh] divide-y divide-border-subtle\">\n {items.map(({ addon, quantity }) => (\n <div key={addon.id} className=\"p-4 flex items-center gap-3\">\n <div className=\"size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0\">\n <svg\n className=\"size-5 text-text-link\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4\"\n />\n </svg>\n </div>\n <div className=\"flex-1 min-w-0\">\n <h4 className=\"font-medium text-text-primary truncate\">{addon.name}</h4>\n <p className=\"text-sm text-text-secondary\">\n {formatCurrency(addon.price, addon.currency)} /{' '}\n {formatPlanDuration(addon.duration)}\n </p>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, quantity - 1)}\n className=\"p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n aria-label={`Decrease ${addon.name} quantity`}\n >\n <Minus className=\"size-3\" />\n </button>\n <span className=\"w-6 text-center text-sm font-medium\">{quantity}</span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, quantity + 1)}\n className=\"p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n aria-label={`Increase ${addon.name} quantity`}\n >\n <Plus className=\"size-3\" />\n </button>\n </div>\n <div className=\"text-right\">\n <p className=\"font-medium text-text-primary\">\n {formatCurrency(addon.price * quantity, addon.currency)}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFromCart(addon.id)}\n className=\"p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors\"\n aria-label={`Remove ${addon.name} from cart`}\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"border-t border-border-subtle p-4 space-y-3 bg-bg-sunken\">\n <div className=\"flex items-center justify-between text-lg font-semibold\">\n <span className=\"text-text-primary\">{tr('billing.addons.total', 'Total')}</span>\n <span className=\"text-text-primary\">\n {formatCurrency(cartTotal, items[0]?.addon.currency || 'USD')}\n </span>\n </div>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={clearCart}\n className=\"flex-1 px-4 py-2.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors\"\n >\n Clear Cart\n </button>\n <button\n type=\"button\"\n onClick={handleCheckout}\n className=\"flex-1 px-4 py-2.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors\"\n >\n Checkout\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAM,KAAkB,GAAgB,MAC/B,IAAI,KAAK,aAAa,SAAS;CACpC,OAAO;CACP,UAAU,KAAY;CACtB,uBAAuB;CACvB,uBAAuB;AACzB,CAAC,EAAE,OAAO,CAAM,GAIZ,KAAsB,MACnB,MAAa,WAAW,SAAS,SAG7B,UAA+B;CAC1C,IAAM,EAAE,SAAM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e,EAAM,EAAE;QACtC,WAAU;QACV,cAAY,UAAU,EAAM,KAAK;kBAEjC,kBAAC,GAAD,EAAQ,WAAU,SAAU,CAAA;OACtB,CAAA;MACL;QAvDK,EAAM,EAuDX,CACN;IACE,CAAA;IAGL,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAqB,EAAG,wBAAwB,OAAO;MAAQ,CAAA,GAC/E,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAe,GAAW,EAAM,IAAI,MAAM,YAAY,KAAK;MACxD,CAAA,CACH;SACL,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,UAAD;OACE,MAAK;OACL,SAAS;OACT,WAAU;iBACX;MAEO,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,eArJa;QAG3B,AAFA,EAAU,GAEV,EAAW,kBAAkB;OAC/B;OAkJgB,WAAU;iBACX;MAEO,CAAA,CACL;OACF;;GACF;IACF;GAEP,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"FloatingCartDrawer.js","names":["_Fragment","formatCurrency","currency","amount","formatPlanDuration","duration","FloatingCartDrawer","useI18n","tr","translated","t","key","fallback","navigateTo","useBillingNavigate","useAddonCartStore","itemCount","items","sum","item","cartTotal","getCartTotal","isCartOpen","Fragment","createPortal","toggleCart","ASSISTANT_BOTTOM_CHROME_CLEARANCE","ShoppingCart","closeCart","X","addon","updateQuantity","quantity","Minus","Plus","removeFromCart","Trash2","clearCart"],"sources":["../../../../../src/billing/modules/addons/components/FloatingCartDrawer.tsx"],"sourcesContent":["/**\n * Floating Cart Drawer Component\n * Displays the addon cart as a floating button and drawer overlay\n * Reusable across pages that need cart functionality\n */\n\nimport { type FC } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { ShoppingCart, X, Minus, Plus, Trash2 } from 'lucide-react';\nimport { useAddonCartStore } from '../store/addonCartStore';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ASSISTANT_BOTTOM_CHROME_CLEARANCE } from '@burdenoff/fe-libs/shared/assistant';\n\n// Format currency helper\nconst formatCurrency = (amount: number, currency: string) => {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: currency || 'USD',\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n }).format(amount);\n};\n\n// Format plan duration helper\nconst formatPlanDuration = (duration: string) => {\n return duration === 'yearly' ? 'year' : 'month';\n};\n\nexport const FloatingCartDrawer: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const navigateTo = useBillingNavigate();\n const {\n items,\n isCartOpen,\n toggleCart,\n closeCart,\n removeFromCart,\n updateQuantity,\n clearCart,\n getCartTotal,\n } = useAddonCartStore();\n\n const itemCount = items.reduce((sum, item) => sum + item.quantity, 0);\n const cartTotal = getCartTotal();\n\n if (items.length === 0 && !isCartOpen) return null;\n\n const handleCheckout = () => {\n closeCart();\n // Navigate to checkout - same path used in AddonsListPage\n navigateTo('/checkout/addons');\n };\n\n return (\n <>\n {/* Floating Cart Button — portaled to <body> so it stays anchored to\n the real viewport, not a transformed route-transition ancestor on\n the installed app (see AddonsBrowsePage's FloatingCartDrawer for\n the full explanation). Bottom-left on phone widths only so it\n doesn't compete with the AI Assistant launcher's bottom-right\n corner (BOFF-9854); unchanged bottom-right at `sm:` and up. */}\n {!isCartOpen &&\n items.length > 0 &&\n createPortal(\n <button\n type=\"button\"\n onClick={toggleCart}\n style={{ bottom: `calc(1.5rem + ${ASSISTANT_BOTTOM_CHROME_CLEARANCE})` }}\n className=\"fixed left-6 sm:left-auto sm:right-6 z-50 flex items-center gap-2 px-4 py-3 bg-action-primary-bg text-action-primary-text rounded-full shadow-elevation-3 hover:bg-action-primary-bgHover hover:shadow-elevation-4 transition-all duration-200\"\n aria-label={`Open addon cart with ${itemCount} item${itemCount !== 1 ? 's' : ''}`}\n >\n <ShoppingCart className=\"size-5\" />\n <span className=\"font-medium\">\n {itemCount} item{itemCount !== 1 ? 's' : ''}\n </span>\n <span className=\"px-2 py-0.5 bg-action-primary-text/20 rounded-full text-sm\">\n {formatCurrency(cartTotal, items[0]?.addon.currency || 'USD')}\n </span>\n </button>,\n document.body\n )}\n\n {/* Cart Drawer */}\n {isCartOpen && (\n <div className=\"fixed inset-0 z-50 flex items-end sm:items-center justify-center\">\n {/* Backdrop */}\n <div className=\"absolute inset-0 bg-overlay-scrim\" onClick={closeCart} />\n\n {/* Drawer */}\n <div\n className=\"relative w-full max-w-md max-h-[80vh] bg-bg-surface border border-border-subtle rounded-t-card sm:rounded-card shadow-[var(--shadow-elevation-4)] overflow-hidden\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"addon-cart-title\"\n >\n {/* Header */}\n <div className=\"flex items-center justify-between px-4 py-3 border-b border-border-subtle bg-bg-sunken\">\n <div className=\"flex items-center gap-2\">\n <ShoppingCart className=\"size-5 text-text-primary\" />\n <h3 id=\"addon-cart-title\" className=\"font-semibold text-text-primary\">\n {tr('billing.addons.yourCart', 'Your Cart')}\n </h3>\n <span className=\"px-2 py-0.5 text-xs bg-action-primary-bg text-action-primary-text rounded-full\">\n {itemCount} item{itemCount !== 1 ? 's' : ''}\n </span>\n </div>\n <button\n type=\"button\"\n onClick={closeCart}\n className=\"p-1.5 rounded hover:bg-bg-sunken transition-colors\"\n aria-label=\"Close addon cart\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n {/* Cart Items */}\n <div className=\"overflow-y-auto max-h-[50vh] divide-y divide-border-subtle\">\n {items.map(({ addon, quantity }) => (\n <div key={addon.id} className=\"p-4 flex items-center gap-3\">\n <div className=\"size-10 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center shrink-0\">\n <svg\n className=\"size-5 text-text-link\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4\"\n />\n </svg>\n </div>\n <div className=\"flex-1 min-w-0\">\n <h4 className=\"font-medium text-text-primary truncate\">{addon.name}</h4>\n <p className=\"text-sm text-text-secondary\">\n {formatCurrency(addon.price, addon.currency)} /{' '}\n {formatPlanDuration(addon.duration)}\n </p>\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, quantity - 1)}\n className=\"p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n aria-label={`Decrease ${addon.name} quantity`}\n >\n <Minus className=\"size-3\" />\n </button>\n <span className=\"w-6 text-center text-sm font-medium\">{quantity}</span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, quantity + 1)}\n className=\"p-1 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n aria-label={`Increase ${addon.name} quantity`}\n >\n <Plus className=\"size-3\" />\n </button>\n </div>\n <div className=\"text-right\">\n <p className=\"font-medium text-text-primary\">\n {formatCurrency(addon.price * quantity, addon.currency)}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFromCart(addon.id)}\n className=\"p-1.5 rounded text-status-error-text hover:bg-status-error-bg-subtle transition-colors\"\n aria-label={`Remove ${addon.name} from cart`}\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n ))}\n </div>\n\n {/* Footer */}\n <div className=\"border-t border-border-subtle p-4 space-y-3 bg-bg-sunken\">\n <div className=\"flex items-center justify-between text-lg font-semibold\">\n <span className=\"text-text-primary\">{tr('billing.addons.total', 'Total')}</span>\n <span className=\"text-text-primary\">\n {formatCurrency(cartTotal, items[0]?.addon.currency || 'USD')}\n </span>\n </div>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={clearCart}\n className=\"flex-1 px-4 py-2.5 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors\"\n >\n Clear Cart\n </button>\n <button\n type=\"button\"\n onClick={handleCheckout}\n className=\"flex-1 px-4 py-2.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors\"\n >\n Checkout\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAMC,KAAkB,GAAgB,MAC/B,IAAI,KAAK,aAAa,SAAS;CACpC,OAAO;CACP,UAAUC,KAAY;CACtB,uBAAuB;CACvB,uBAAuB;AACzB,CAAC,CAAC,CAAC,OAAOC,CAAM,GAIZC,KAAsB,MACnBC,MAAa,WAAW,SAAS,SAG7BC,UAA+B;CAC1C,IAAM,EAAE,SAAMC,EAAQ,GAChBC,KAAM,GAAa,MAA6B;EACpD,IAAMC,IAAaC,EAAEC,CAAG;EACxB,OAAOF,MAAeE,IAAMC,IAAWH;CACzC,GACMI,IAAaC,EAAmB,GAChC,EACJ,UACA,eACA,eACA,cACA,mBACA,mBACA,cACA,oBACEC,EAAkB,GAEhBC,IAAYC,EAAM,QAAQ,GAAK,MAASC,IAAMC,EAAK,UAAU,CAAC,GAC9DC,IAAYC,EAAa;CAU/B,OARIJ,EAAM,WAAW,KAAK,CAACK,IAAmB,OAS5C,kBAAAtB,GAAA,EAAA,UAAA,CAOG,CAACsB,KACAL,EAAM,SAAS,KACfO,EACE,kBAAC,UAAD;EACE,MAAK;EACL,SAASC;EACT,OAAO,EAAE,QAAQ,iBAAiBC,EAAkC,GAAG;EACvE,WAAU;EACV,cAAY,wBAAwBV,EAAU,OAAOA,MAAc,IAAU,KAAN;EALzE,UAAA;GAOE,kBAACW,GAAD,EAAc,WAAU,SAAU,CAAA;GAClC,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA;KACGX;KAAU;KAAMA,MAAc,IAAU,KAAN;IAC/B;;GACN,kBAAC,QAAD;I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;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,UAAD;OACE,MAAK;OACL,SAASoB;OACT,WAAU;OACX,UAAA;MAEO,CAAA,GACR,kBAAC,UAAD;OACE,MAAK;OACL,eArJa;QAG3B,AAFAT,EAAU,GAEVf,EAAW,kBAAkB;OAC/B;OAkJgB,WAAU;OACX,UAAA;MAEO,CAAA,CACL;KACF,CAAA,CAAA;;GACF;EACF,CAAA,CAAA;CAEP,CAAA,CAAA,EAAA,CAAA;AAEN"}
@@ -5,4 +5,3 @@
5
5
  export { useAddons, useAddon, useSelectedAddons, useAddonMutations } from './useAddons';
6
6
  export { useAddonPurchaseEligibility } from './useAddonPurchaseEligibility';
7
7
  export type { AddonPurchaseBlock } from './useAddonPurchaseEligibility';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
- import "./useAddons.js";
2
- import "./useAddonPurchaseEligibility.js";
1
+ import { useAddon as e, useAddonMutations as t, useAddons as n } from "./useAddons.js";
2
+ import { useAddonPurchaseEligibility as r } from "./useAddonPurchaseEligibility.js";
3
+ export { e as useAddon, t as useAddonMutations, r as useAddonPurchaseEligibility, n as useAddons };
@@ -20,4 +20,3 @@ interface UseAddonPurchaseEligibilityResult {
20
20
  }
21
21
  export declare function useAddonPurchaseEligibility(addonIds: string[]): UseAddonPurchaseEligibilityResult;
22
22
  export {};
23
- //# sourceMappingURL=useAddonPurchaseEligibility.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { useGetAddonPurchaseEligibilityQuery as e } from "../../../../generated/global-operations.js";
2
2
  import { useMemo as t } from "react";
3
- //#region src/billing/modules/addons/hooks/useAddonPurchaseEligibility.ts
3
+ // src/billing/modules/addons/hooks/useAddonPurchaseEligibility.ts
4
4
  function n(n) {
5
5
  let r = t(() => [...new Set(n)].sort(), [n]), { data: i, loading: a } = e({
6
6
  variables: { addonIds: r },
@@ -21,7 +21,6 @@ function n(n) {
21
21
  isLoading: a
22
22
  };
23
23
  }
24
- //#endregion
25
24
  export { n as useAddonPurchaseEligibility };
26
25
 
27
26
  //# sourceMappingURL=useAddonPurchaseEligibility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddonPurchaseEligibility.js","names":[],"sources":["../../../../../src/billing/modules/addons/hooks/useAddonPurchaseEligibility.ts"],"sourcesContent":["/**\n * Addons Module - useAddonPurchaseEligibility Hook\n *\n * BOFF-9889: add-ons require a paid subscription to their product (the\n * catalogs' \"Free tier exclusion\" rule). The backend enforces it at checkout;\n * this hook asks the same rule up front so the browse and detail pages can\n * explain the restriction instead of letting a Free workspace fill a cart it\n * cannot check out.\n */\n\nimport { useMemo } from 'react';\nimport { useGetAddonPurchaseEligibilityQuery } from '../../../../generated/global-operations';\n\nexport interface AddonPurchaseBlock {\n addonId: string;\n productId: string | null;\n reason: string;\n}\n\ninterface UseAddonPurchaseEligibilityResult {\n /** Add-ons the organization cannot buy yet, keyed by add-on id. */\n blocked: Map<string, AddonPurchaseBlock>;\n isBlocked: (addonId: string) => boolean;\n isLoading: boolean;\n}\n\nexport function useAddonPurchaseEligibility(addonIds: string[]): UseAddonPurchaseEligibilityResult {\n const ids = useMemo(() => [...new Set(addonIds)].sort(), [addonIds]);\n const { data, loading } = useGetAddonPurchaseEligibilityQuery({\n variables: { addonIds: ids },\n skip: ids.length === 0,\n fetchPolicy: 'cache-and-network',\n });\n\n const blocked = useMemo(() => {\n const map = new Map<string, AddonPurchaseBlock>();\n for (const result of data?.addonPurchaseEligibility ?? []) {\n if (!result.eligible && result.reason !== 'NOT_FOUND') {\n map.set(result.addonId, {\n addonId: result.addonId,\n productId: result.productId ?? null,\n reason: result.reason,\n });\n }\n }\n return map;\n }, [data]);\n\n return {\n blocked,\n isBlocked: (addonId: string) => blocked.has(addonId),\n isLoading: loading,\n };\n}\n"],"mappings":";;;AA0BA,SAAgB,EAA4B,GAAuD;CACjG,IAAM,IAAM,QAAc,CAAC,GAAG,IAAI,IAAI,CAAQ,CAAC,EAAE,KAAK,GAAG,CAAC,CAAQ,CAAC,GAC7D,EAAE,SAAM,eAAY,EAAoC;EAC5D,WAAW,EAAE,UAAU,EAAI;EAC3B,MAAM,EAAI,WAAW;EACrB,aAAa;CACf,CAAC,GAEK,IAAU,QAAc;EAC5B,IAAM,oBAAM,IAAI,IAAgC;EAChD,KAAK,IAAM,KAAU,GAAM,4BAA4B,CAAC,GACtD,AAAI,CAAC,EAAO,YAAY,EAAO,WAAW,eACxC,EAAI,IAAI,EAAO,SAAS;GACtB,SAAS,EAAO;GAChB,WAAW,EAAO,aAAa;GAC/B,QAAQ,EAAO;EACjB,CAAC;EAGL,OAAO;CACT,GAAG,CAAC,CAAI,CAAC;CAET,OAAO;EACL;EACA,YAAY,MAAoB,EAAQ,IAAI,CAAO;EACnD,WAAW;CACb;AACF"}
1
+ {"version":3,"file":"useAddonPurchaseEligibility.js","names":["useAddonPurchaseEligibility","ids","useMemo","addonIds","useGetAddonPurchaseEligibilityQuery","blocked","map","result","data","addonId","loading"],"sources":["../../../../../src/billing/modules/addons/hooks/useAddonPurchaseEligibility.ts"],"sourcesContent":["/**\n * Addons Module - useAddonPurchaseEligibility Hook\n *\n * BOFF-9889: add-ons require a paid subscription to their product (the\n * catalogs' \"Free tier exclusion\" rule). The backend enforces it at checkout;\n * this hook asks the same rule up front so the browse and detail pages can\n * explain the restriction instead of letting a Free workspace fill a cart it\n * cannot check out.\n */\n\nimport { useMemo } from 'react';\nimport { useGetAddonPurchaseEligibilityQuery } from '../../../../generated/global-operations';\n\nexport interface AddonPurchaseBlock {\n addonId: string;\n productId: string | null;\n reason: string;\n}\n\ninterface UseAddonPurchaseEligibilityResult {\n /** Add-ons the organization cannot buy yet, keyed by add-on id. */\n blocked: Map<string, AddonPurchaseBlock>;\n isBlocked: (addonId: string) => boolean;\n isLoading: boolean;\n}\n\nexport function useAddonPurchaseEligibility(addonIds: string[]): UseAddonPurchaseEligibilityResult {\n const ids = useMemo(() => [...new Set(addonIds)].sort(), [addonIds]);\n const { data, loading } = useGetAddonPurchaseEligibilityQuery({\n variables: { addonIds: ids },\n skip: ids.length === 0,\n fetchPolicy: 'cache-and-network',\n });\n\n const blocked = useMemo(() => {\n const map = new Map<string, AddonPurchaseBlock>();\n for (const result of data?.addonPurchaseEligibility ?? []) {\n if (!result.eligible && result.reason !== 'NOT_FOUND') {\n map.set(result.addonId, {\n addonId: result.addonId,\n productId: result.productId ?? null,\n reason: result.reason,\n });\n }\n }\n return map;\n }, [data]);\n\n return {\n blocked,\n isBlocked: (addonId: string) => blocked.has(addonId),\n isLoading: loading,\n };\n}\n"],"mappings":";;;AA0BA,SAAgBA,EAA4B,GAAuD;CACjG,IAAMC,IAAMC,QAAc,CAAC,GAAG,IAAI,IAAIC,CAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,CAACA,CAAQ,CAAC,GAC7D,EAAE,SAAM,eAAYC,EAAoC;EAC5D,WAAW,EAAE,UAAUH,EAAI;EAC3B,MAAMA,EAAI,WAAW;EACrB,aAAa;CACf,CAAC,GAEKI,IAAUH,QAAc;EAC5B,IAAMI,oBAAM,IAAI,IAAgC;EAChD,KAAK,IAAMC,KAAUC,GAAM,4BAA4B,CAAC,GACtD,AAAI,CAACD,EAAO,YAAYA,EAAO,WAAW,eACxCD,EAAI,IAAIC,EAAO,SAAS;GACtB,SAASA,EAAO;GAChB,WAAWA,EAAO,aAAa;GAC/B,QAAQA,EAAO;EACjB,CAAC;EAGL,OAAOD;CACT,GAAG,CAACE,CAAI,CAAC;CAET,OAAO;EACL;EACA,YAAY,MAAoBH,EAAQ,IAAII,CAAO;EACnD,WAAWC;CACb;AACF"}
@@ -51,4 +51,3 @@ export declare function useSelectedAddons(addonIds: string[]): UseSelectedAddons
51
51
  */
52
52
  export declare function useAddonMutations(): UseAddonMutationsResult;
53
53
  export {};
54
- //# sourceMappingURL=useAddons.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { GetAllAddOnsDocument as e, useCreateAddOnsMutation as t, useGetAllAddOnsQuery as n, useGetSelectedAddonsQuery as r, useToggleAddOnMutation as i, useUpdateAddOnDetailsMutation as a } from "../../../../generated/global-operations.js";
2
2
  import { useCallback as o } from "react";
3
3
  import { useApolloClient as s } from "@apollo/client/react";
4
- //#region src/billing/modules/addons/hooks/useAddons.ts
4
+ // src/billing/modules/addons/hooks/useAddons.ts
5
5
  function c(e = {}) {
6
6
  let { onlyActive: t = !1, productId: r, includeFree: i } = e, a = {
7
7
  ...r === void 0 ? {} : { productId: r },
@@ -71,7 +71,6 @@ function u() {
71
71
  isToggling: f
72
72
  };
73
73
  }
74
- //#endregion
75
74
  export { l as useAddon, u as useAddonMutations, c as useAddons };
76
75
 
77
76
  //# sourceMappingURL=useAddons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddons.js","names":[],"sources":["../../../../../src/billing/modules/addons/hooks/useAddons.ts"],"sourcesContent":["/**\n * Addons Module - useAddons Hook\n * Provides access to addon data and mutations\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback } from 'react';\nimport {\n useGetAllAddOnsQuery,\n useGetSelectedAddonsQuery,\n useCreateAddOnsMutation,\n useUpdateAddOnDetailsMutation,\n useToggleAddOnMutation,\n GetAllAddOnsDocument,\n} from '../../../../generated/global-operations';\nimport type { Addon, CreateAddonInput, UpdateAddonInput } from '../../../shared/types';\n\ninterface UseAddonsOptions {\n onlyActive?: boolean;\n /** Filter by product ID — pushed to backend query, not client-side. */\n productId?: string;\n /**\n * When false, free addons (price = 0) are excluded at the backend.\n * Use false on user-facing browse pages; omit or set true for admin pages.\n */\n includeFree?: boolean;\n}\n\ninterface UseAddonsResult {\n addons: Addon[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseSelectedAddonsResult {\n addons: Addon[];\n isLoading: boolean;\n error: Error | undefined;\n}\n\ninterface UseAddonMutationsResult {\n createAddon: (input: CreateAddonInput) => Promise<boolean>;\n updateAddon: (input: UpdateAddonInput) => Promise<boolean>;\n toggleAddon: (addonId: string, status: boolean) => Promise<boolean>;\n isCreating: boolean;\n isUpdating: boolean;\n isToggling: boolean;\n}\n\n/**\n * Hook for fetching all addons\n */\nexport function useAddons(options: UseAddonsOptions = {}): UseAddonsResult {\n const { onlyActive = false, productId, includeFree } = options;\n\n const filter = {\n ...(productId !== undefined ? { productId } : {}),\n ...(includeFree !== undefined ? { includeFree } : {}),\n };\n\n const { data, loading, error, refetch } = useGetAllAddOnsQuery({\n variables: { filter: Object.keys(filter).length > 0 ? filter : undefined },\n fetchPolicy: 'cache-and-network',\n });\n\n let addons: Addon[] = data?.getAllAddOns || [];\n\n if (onlyActive) {\n addons = addons.filter((addon: Addon) => addon.isActive);\n }\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n addons,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\ninterface UseAddonResult {\n addon: Addon | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\n/**\n * Hook for fetching a single addon by ID\n */\nexport function useAddon(addonId: string | undefined): UseAddonResult {\n const { data, loading, error, refetch } = useGetSelectedAddonsQuery({\n variables: { addonIDs: addonId ? [addonId] : [] },\n skip: !addonId,\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n addon: data?.getSelectedAddons?.[0] || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching specific addons by IDs\n */\nexport function useSelectedAddons(addonIds: string[]): UseSelectedAddonsResult {\n const { data, loading, error } = useGetSelectedAddonsQuery({\n variables: { addonIDs: addonIds },\n skip: addonIds.length === 0,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n addons: data?.getSelectedAddons || [],\n isLoading: loading,\n error: error as Error | undefined,\n };\n}\n\n/**\n * Hook for addon mutations (create, update, toggle)\n */\nexport function useAddonMutations(): UseAddonMutationsResult {\n const client = useApolloClient();\n\n const [createAddonMutation, { loading: isCreating }] = useCreateAddOnsMutation();\n const [updateAddonMutation, { loading: isUpdating }] = useUpdateAddOnDetailsMutation();\n const [toggleAddonMutation, { loading: isToggling }] = useToggleAddOnMutation();\n\n const createAddon = useCallback(\n async (input: CreateAddonInput): Promise<boolean> => {\n try {\n const { data } = await createAddonMutation({\n variables: {\n input: input as unknown as Parameters<\n typeof createAddonMutation\n >[0]['variables']['input'],\n },\n });\n // Refetch addons list after creation\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.createAddOns ?? false;\n } catch (error) {\n console.error('Failed to create addon:', error);\n throw error;\n }\n },\n [createAddonMutation, client]\n );\n\n const updateAddon = useCallback(\n async (input: UpdateAddonInput): Promise<boolean> => {\n try {\n const { data } = await updateAddonMutation({\n variables: {\n input: input as unknown as Parameters<\n typeof updateAddonMutation\n >[0]['variables']['input'],\n },\n });\n // Refetch addons list after update\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.updateAddOnDetails ?? false;\n } catch (error) {\n console.error('Failed to update addon:', error);\n throw error;\n }\n },\n [updateAddonMutation, client]\n );\n\n const toggleAddon = useCallback(\n async (addonId: string, status: boolean): Promise<boolean> => {\n try {\n const { data } = await toggleAddonMutation({\n variables: { id: addonId, status },\n });\n // Refetch addons list after toggle\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.toggleAddOn ?? false;\n } catch (error) {\n console.error('Failed to toggle addon:', error);\n throw error;\n }\n },\n [toggleAddonMutation, client]\n );\n\n return {\n createAddon,\n updateAddon,\n toggleAddon,\n isCreating,\n isUpdating,\n isToggling,\n };\n}\n"],"mappings":";;;;AAqDA,SAAgB,EAAU,IAA4B,CAAC,GAAoB;CACzE,IAAM,EAAE,gBAAa,IAAO,cAAW,mBAAgB,GAEjD,IAAS;EACb,GAAI,MAAc,KAAA,IAA4B,CAAC,IAAjB,EAAE,aAAU;EAC1C,GAAI,MAAgB,KAAA,IAA8B,CAAC,IAAnB,EAAE,eAAY;CAChD,GA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AClB,OAAO,MAA8C;GACnD,IAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW,EACF,SAGT,EACF,CAAC;IAGD,OADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,CAAoB,EAAE,CAAC,GACxD,GAAM,sBAAsB;GACrC,SAAS,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2B,CAAK,GACxC;GACR;EACF,GACA,CAAC,GAAqB,CAAM,CAsB5B;EACA,aApBkB,EAClB,OAAO,GAAiB,MAAsC;GAC5D,IAAI;IACF,IAAM,EAAE,YAAS,MAAM,EAAoB,EACzC,WAAW;KAAE,IAAI;KAAS;IAAO,EACnC,CAAC;IAGD,OADA,MAAM,EAAO,eAAe,EAAE,SAAS,CAAC,CAAoB,EAAE,CAAC,GACxD,GAAM,eAAe;GAC9B,SAAS,GAAO;IAEd,MADA,QAAQ,MAAM,2BAA2B,CAAK,GACxC;GACR;EACF,GACA,CAAC,GAAqB,CAAM,CAM5B;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"useAddons.js","names":["useAddons","options","filter","productId","includeFree","useGetAllAddOnsQuery","addons","data","onlyActive","addon","handleRefetch","useCallback","refetch","loading","useAddon","useGetSelectedAddonsQuery","addonId","useAddonMutations","client","useApolloClient","createAddonMutation","isCreating","useCreateAddOnsMutation","updateAddonMutation","isUpdating","useUpdateAddOnDetailsMutation","toggleAddonMutation","isToggling","useToggleAddOnMutation","GetAllAddOnsDocument","error"],"sources":["../../../../../src/billing/modules/addons/hooks/useAddons.ts"],"sourcesContent":["/**\n * Addons Module - useAddons Hook\n * Provides access to addon data and mutations\n */\n\nimport { useApolloClient } from '@apollo/client/react';\nimport { useCallback } from 'react';\nimport {\n useGetAllAddOnsQuery,\n useGetSelectedAddonsQuery,\n useCreateAddOnsMutation,\n useUpdateAddOnDetailsMutation,\n useToggleAddOnMutation,\n GetAllAddOnsDocument,\n} from '../../../../generated/global-operations';\nimport type { Addon, CreateAddonInput, UpdateAddonInput } from '../../../shared/types';\n\ninterface UseAddonsOptions {\n onlyActive?: boolean;\n /** Filter by product ID — pushed to backend query, not client-side. */\n productId?: string;\n /**\n * When false, free addons (price = 0) are excluded at the backend.\n * Use false on user-facing browse pages; omit or set true for admin pages.\n */\n includeFree?: boolean;\n}\n\ninterface UseAddonsResult {\n addons: Addon[];\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\ninterface UseSelectedAddonsResult {\n addons: Addon[];\n isLoading: boolean;\n error: Error | undefined;\n}\n\ninterface UseAddonMutationsResult {\n createAddon: (input: CreateAddonInput) => Promise<boolean>;\n updateAddon: (input: UpdateAddonInput) => Promise<boolean>;\n toggleAddon: (addonId: string, status: boolean) => Promise<boolean>;\n isCreating: boolean;\n isUpdating: boolean;\n isToggling: boolean;\n}\n\n/**\n * Hook for fetching all addons\n */\nexport function useAddons(options: UseAddonsOptions = {}): UseAddonsResult {\n const { onlyActive = false, productId, includeFree } = options;\n\n const filter = {\n ...(productId !== undefined ? { productId } : {}),\n ...(includeFree !== undefined ? { includeFree } : {}),\n };\n\n const { data, loading, error, refetch } = useGetAllAddOnsQuery({\n variables: { filter: Object.keys(filter).length > 0 ? filter : undefined },\n fetchPolicy: 'cache-and-network',\n });\n\n let addons: Addon[] = data?.getAllAddOns || [];\n\n if (onlyActive) {\n addons = addons.filter((addon: Addon) => addon.isActive);\n }\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n addons,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\ninterface UseAddonResult {\n addon: Addon | null;\n isLoading: boolean;\n error: Error | undefined;\n refetch: () => Promise<void>;\n}\n\n/**\n * Hook for fetching a single addon by ID\n */\nexport function useAddon(addonId: string | undefined): UseAddonResult {\n const { data, loading, error, refetch } = useGetSelectedAddonsQuery({\n variables: { addonIDs: addonId ? [addonId] : [] },\n skip: !addonId,\n fetchPolicy: 'cache-and-network',\n });\n\n const handleRefetch = useCallback(async () => {\n await refetch();\n }, [refetch]);\n\n return {\n addon: data?.getSelectedAddons?.[0] || null,\n isLoading: loading,\n error: error as Error | undefined,\n refetch: handleRefetch,\n };\n}\n\n/**\n * Hook for fetching specific addons by IDs\n */\nexport function useSelectedAddons(addonIds: string[]): UseSelectedAddonsResult {\n const { data, loading, error } = useGetSelectedAddonsQuery({\n variables: { addonIDs: addonIds },\n skip: addonIds.length === 0,\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n addons: data?.getSelectedAddons || [],\n isLoading: loading,\n error: error as Error | undefined,\n };\n}\n\n/**\n * Hook for addon mutations (create, update, toggle)\n */\nexport function useAddonMutations(): UseAddonMutationsResult {\n const client = useApolloClient();\n\n const [createAddonMutation, { loading: isCreating }] = useCreateAddOnsMutation();\n const [updateAddonMutation, { loading: isUpdating }] = useUpdateAddOnDetailsMutation();\n const [toggleAddonMutation, { loading: isToggling }] = useToggleAddOnMutation();\n\n const createAddon = useCallback(\n async (input: CreateAddonInput): Promise<boolean> => {\n try {\n const { data } = await createAddonMutation({\n variables: {\n input: input as unknown as Parameters<\n typeof createAddonMutation\n >[0]['variables']['input'],\n },\n });\n // Refetch addons list after creation\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.createAddOns ?? false;\n } catch (error) {\n console.error('Failed to create addon:', error);\n throw error;\n }\n },\n [createAddonMutation, client]\n );\n\n const updateAddon = useCallback(\n async (input: UpdateAddonInput): Promise<boolean> => {\n try {\n const { data } = await updateAddonMutation({\n variables: {\n input: input as unknown as Parameters<\n typeof updateAddonMutation\n >[0]['variables']['input'],\n },\n });\n // Refetch addons list after update\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.updateAddOnDetails ?? false;\n } catch (error) {\n console.error('Failed to update addon:', error);\n throw error;\n }\n },\n [updateAddonMutation, client]\n );\n\n const toggleAddon = useCallback(\n async (addonId: string, status: boolean): Promise<boolean> => {\n try {\n const { data } = await toggleAddonMutation({\n variables: { id: addonId, status },\n });\n // Refetch addons list after toggle\n await client.refetchQueries({ include: [GetAllAddOnsDocument] });\n return data?.toggleAddOn ?? false;\n } catch (error) {\n console.error('Failed to toggle addon:', error);\n throw error;\n }\n },\n [toggleAddonMutation, client]\n );\n\n return {\n createAddon,\n updateAddon,\n toggleAddon,\n isCreating,\n isUpdating,\n isToggling,\n };\n}\n"],"mappings":";;;;AAqDA,SAAgBA,EAAU,IAA4B,CAAC,GAAoB;CACzE,IAAM,EAAE,gBAAa,IAAO,cAAW,mBAAgBC,GAEjDC,IAAS;EACb,GAAIC,MAAc,KAAA,IAA4B,CAAC,IAAjB,EAAE,aAAU;EAC1C,GAAIC,MAAgB,KAAA,IAA8B,CAAC,IAAnB,EAAE,eAAY;CAChD,GAEM,EAAE,SAAM,YAAS,UAAO,eAAYC,EAAqB;EAC7D,WAAW,EAAE,QAAQ,OAAO,KAAKH,CAAM,CAAC,CAAC,SAAS,IAAIA,IAAS,KAAA,EAAU;EACzE,aAAa;CACf,CAAC,GAEGI,IAAkBC,GAAM,gBAAgB,CAAC;CAE7C,AAAIC,MACF,IAASF,EAAO,QAAQ,MAAiBG,EAAM,QAAQ;CAGzD,IAAMC,IAAgBC,EAAY,YAAY;EAC5C,MAAMC,EAAQ;CAChB,GAAG,CAACA,CAAO,CAAC;CAEZ,OAAO;EACL;EACA,WAAWC;EACJ;EACP,SAASH;CACX;AACF;AAYA,SAAgBI,EAAS,GAA6C;CACpE,IAAM,EAAE,SAAM,YAAS,UAAO,eAAYC,EAA0B;EAClE,WAAW,EAAE,UAAUC,IAAU,CAACA,CAAO,IAAI,CAAC,EAAE;EAChD,MAAM,CAACA;EACP,aAAa;CACf,CAAC,GAEKN,IAAgBC,EAAY,YAAY;EAC5C,MAAMC,EAAQ;CAChB,GAAG,CAACA,CAAO,CAAC;CAEZ,OAAO;EACL,OAAOL,GAAM,oBAAoB,MAAM;EACvC,WAAWM;EACJ;EACP,SAASH;CACX;AACF;AAsBA,SAAgBO,IAA6C;CAC3D,I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';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1,11 @@
1
- import "./hooks/useAddons.js";
2
- import "./hooks/useAddonPurchaseEligibility.js";
3
- import "./hooks/index.js";
4
- import { AddonsListPage as e } from "./pages/AddonsListPage.js";
5
- import { AddonDetailPage as t } from "./pages/AddonDetailPage.js";
6
- import { AddonEditPage as n } from "./pages/AddonEditPage.js";
7
- import { AddonCreatePage as r } from "./pages/AddonCreatePage.js";
8
- import { AddonsBrowsePage as i } from "./pages/AddonsBrowsePage.js";
9
- import { AddonBrowseDetailPage as a } from "./pages/AddonBrowseDetailPage.js";
1
+ import { useAddon as e, useAddonMutations as t, useAddons as n } from "./hooks/useAddons.js";
2
+ import { useAddonPurchaseEligibility as r } from "./hooks/useAddonPurchaseEligibility.js";
10
3
  import "./pages/index.js";
11
- export { a as AddonBrowseDetailPage, r as AddonCreatePage, t as AddonDetailPage, n as AddonEditPage, i as AddonsBrowsePage, e as AddonsListPage };
4
+ import { AddonsListPage as i } from "./pages/AddonsListPage.js";
5
+ import { AddonDetailPage as a } from "./pages/AddonDetailPage.js";
6
+ import { AddonEditPage as o } from "./pages/AddonEditPage.js";
7
+ import { AddonCreatePage as s } from "./pages/AddonCreatePage.js";
8
+ import { AddonsBrowsePage as c } from "./pages/AddonsBrowsePage.js";
9
+ import { AddonBrowseDetailPage as l } from "./pages/AddonBrowseDetailPage.js";
10
+ import "./hooks/index.js";
11
+ export { l as AddonBrowseDetailPage, s as AddonCreatePage, a as AddonDetailPage, o as AddonEditPage, c as AddonsBrowsePage, i as AddonsListPage, e as useAddon, t as useAddonMutations, r as useAddonPurchaseEligibility, n as useAddons };
@@ -1,3 +1,2 @@
1
1
  import { FC } from 'react';
2
2
  export declare const AddonBrowseDetailPage: FC;
3
- //# sourceMappingURL=AddonBrowseDetailPage.d.ts.map
@@ -1,21 +1,21 @@
1
1
  import { PageHeader as e } from "../../../shared/components/PageHeader.js";
2
2
  import { ServerError as t } from "../../../shared/components/ServerError.js";
3
+ import { useBillingNavigate as n } from "../../../hooks/useBillingNavigate.js";
4
+ import { formatCurrency as r, formatPlanDuration as i, formatPlanDurationLabel as a } from "../../../shared/utils/format.js";
5
+ import { isServerError as o } from "../../../shared/utils/error.js";
6
+ import "../hooks/index.js";
7
+ import { useAddonCartStore as s } from "../store/addonCartStore.js";
3
8
  import "../../../shared/components/index.js";
4
- import { formatCurrency as n, formatPlanDuration as r, formatPlanDurationLabel as i } from "../../../shared/utils/format.js";
5
- import { isServerError as a } from "../../../shared/utils/error.js";
6
- import "../../../shared/utils/index.js";
7
- import { useAddonCartStore as o } from "../store/addonCartStore.js";
8
- import { useBillingNavigate as s } from "../../../hooks/useBillingNavigate.js";
9
9
  import { useAddon as c } from "../hooks/useAddons.js";
10
10
  import { useAddonPurchaseEligibility as l } from "../hooks/useAddonPurchaseEligibility.js";
11
- import "../hooks/index.js";
11
+ import "../../../shared/utils/index.js";
12
12
  import { useMemo as u } from "react";
13
13
  import { Lock as d, Minus as f, Plus as p, ShoppingCart as m, Trash2 as h } from "lucide-react";
14
14
  import { useParams as g } from "react-router";
15
15
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
16
16
  import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
17
  import { EmphasisPanel as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
18
- //#region src/billing/modules/addons/pages/AddonBrowseDetailPage.tsx
18
+ // src/billing/modules/addons/pages/AddonBrowseDetailPage.tsx
19
19
  function S(e) {
20
20
  let t = /* @__PURE__ */ new Map();
21
21
  for (let n of e) {
@@ -34,7 +34,7 @@ var C = () => {
34
34
  let { t: C } = y(), w = (e, t) => {
35
35
  let n = C(e);
36
36
  return n === e ? t : n;
37
- }, { addonId: T } = g(), E = s(), { addon: D, isLoading: O, error: k, refetch: A } = c(T), { addToCart: j, removeFromCart: M, updateQuantity: N, isInCart: P, getCartItem: F } = o(), I = u(() => S(D?.features || []), [D?.features]), L = D ? P(D.id) : !1, R = (D ? F(D.id) : void 0)?.quantity || 0, { isBlocked: z } = l(u(() => D ? [D.id] : [], [D])), B = D ? z(D.id) : !1;
37
+ }, { addonId: T } = g(), E = n(), { addon: D, isLoading: O, error: k, refetch: A } = c(T), { addToCart: j, removeFromCart: M, updateQuantity: N, isInCart: P, getCartItem: F } = s(), I = u(() => S(D?.features || []), [D?.features]), L = D ? P(D.id) : !1, R = (D ? F(D.id) : void 0)?.quantity || 0, z = u(() => D ? [D.id] : [], [D]), { isBlocked: B } = l(z), V = D ? B(D.id) : !1;
38
38
  return O ? /* @__PURE__ */ v("div", {
39
39
  className: "space-y-6 p-6",
40
40
  children: [/* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ v("div", {
@@ -48,7 +48,7 @@ var C = () => {
48
48
  ].map((e) => /* @__PURE__ */ _("div", { className: "h-24 bg-bg-sunken animate-pulse rounded" }, e))
49
49
  }), /* @__PURE__ */ _("div", { className: "h-64 bg-bg-sunken animate-pulse rounded" })]
50
50
  })]
51
- }) : k && a(k) ? /* @__PURE__ */ _("div", {
51
+ }) : k && o(k) ? /* @__PURE__ */ _("div", {
52
52
  className: "p-6",
53
53
  children: /* @__PURE__ */ _(t, {
54
54
  title: w("billing.addons.serverUnavailable", "Server Unavailable"),
@@ -61,7 +61,7 @@ var C = () => {
61
61
  children: [
62
62
  /* @__PURE__ */ _(e, {
63
63
  title: D.name,
64
- description: `${i(D.duration)} addon`
64
+ description: `${a(D.duration)} addon`
65
65
  }),
66
66
  /* @__PURE__ */ _(x, { children: w("billing.addons.browseDetailPurpose", "See exactly what this add-on costs and the extra capacity it gives you on top of your plan before you buy it. Add it to your cart from here when it fits your needs.") }),
67
67
  /* @__PURE__ */ v("div", {
@@ -82,10 +82,10 @@ var C = () => {
82
82
  className: "flex items-baseline gap-2",
83
83
  children: [/* @__PURE__ */ _("span", {
84
84
  className: "text-4xl font-bold text-text-primary",
85
- children: n(D.price, D.currency)
85
+ children: r(D.price, D.currency)
86
86
  }), /* @__PURE__ */ v("span", {
87
87
  className: "text-lg text-text-secondary",
88
- children: ["/ ", r(D.duration)]
88
+ children: ["/ ", i(D.duration)]
89
89
  })]
90
90
  }), /* @__PURE__ */ v("p", {
91
91
  className: "text-sm text-text-secondary mt-2",
@@ -176,10 +176,10 @@ var C = () => {
176
176
  }), /* @__PURE__ */ v("span", {
177
177
  className: "text-sm font-medium text-text-primary",
178
178
  children: [
179
- n(D.price, D.currency),
179
+ r(D.price, D.currency),
180
180
  " /",
181
181
  " ",
182
- r(D.duration)
182
+ i(D.duration)
183
183
  ]
184
184
  })]
185
185
  }),
@@ -232,7 +232,7 @@ var C = () => {
232
232
  className: "w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors",
233
233
  children: "Proceed to Checkout"
234
234
  })]
235
- }) : B ? /* @__PURE__ */ v("div", {
235
+ }) : V ? /* @__PURE__ */ v("div", {
236
236
  className: "space-y-3",
237
237
  "data-testid": "addon-paid-plan-required",
238
238
  children: [/* @__PURE__ */ v("p", {
@@ -288,7 +288,6 @@ var C = () => {
288
288
  })
289
289
  });
290
290
  };
291
- //#endregion
292
291
  export { C as AddonBrowseDetailPage };
293
292
 
294
293
  //# sourceMappingURL=AddonBrowseDetailPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddonBrowseDetailPage.js","names":[],"sources":["../../../../../src/billing/modules/addons/pages/AddonBrowseDetailPage.tsx"],"sourcesContent":["/**\n * Addons Module - Addon Browse Detail Page (User-facing)\n * View addon details and add to cart. No edit/toggle actions.\n */\n\nimport { useMemo, type FC } from 'react';\nimport { useParams } from 'react-router';\nimport { ShoppingCart, Plus, Minus, Trash2, Lock } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useAddon, useAddonPurchaseEligibility } from '../hooks';\nimport { useAddonCartStore } from '../store/addonCartStore';\nimport { PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport {\n formatCurrency,\n formatPlanDuration,\n formatPlanDurationLabel,\n isServerError,\n} from '../../../shared/utils';\nimport type { SubscriptionFeatures } from '../../../shared/types';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface CombinedQuota {\n quotaId: string;\n name: string;\n totalValue: number;\n type: string;\n}\n\nfunction combineQuotas(features: SubscriptionFeatures[]): CombinedQuota[] {\n const quotaMap = new Map<string, CombinedQuota>();\n for (const feature of features) {\n if (!feature.quota) continue;\n const quotaId = feature.quota.id;\n const limits = feature.quota.limits as { value?: number; type?: string } | null;\n const limitValue = limits?.value ?? 0;\n const limitType = limits?.type ?? 'unknown';\n const existing = quotaMap.get(quotaId);\n if (existing) {\n existing.totalValue += limitValue;\n } else {\n quotaMap.set(quotaId, {\n quotaId,\n name: feature.quota.name ?? 'Unknown Quota',\n totalValue: limitValue,\n type: limitType,\n });\n }\n }\n return Array.from(quotaMap.values());\n}\n\nexport const AddonBrowseDetailPage: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const { addonId } = useParams<{ addonId: string }>();\n const navigateTo = useBillingNavigate();\n const { addon, isLoading, error, refetch } = useAddon(addonId);\n const { addToCart, removeFromCart, updateQuantity, isInCart, getCartItem } = useAddonCartStore();\n\n const combinedQuotas = useMemo(() => combineQuotas(addon?.features || []), [addon?.features]);\n const inCart = addon ? isInCart(addon.id) : false;\n const cartItem = addon ? getCartItem(addon.id) : undefined;\n const cartQuantity = cartItem?.quantity || 0;\n\n // BOFF-9889: add-ons require a paid subscription to their product.\n const eligibilityIds = useMemo(() => (addon ? [addon.id] : []), [addon]);\n const { isBlocked } = useAddonPurchaseEligibility(eligibilityIds);\n const purchaseBlocked = addon ? isBlocked(addon.id) : false;\n\n if (isLoading) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n <div className=\"lg:col-span-2 space-y-4\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"h-24 bg-bg-sunken animate-pulse rounded\" />\n ))}\n </div>\n <div className=\"h-64 bg-bg-sunken animate-pulse rounded\" />\n </div>\n </div>\n );\n }\n\n if (error && isServerError(error)) {\n return (\n <div className=\"p-6\">\n <ServerError\n title={tr('billing.addons.serverUnavailable', 'Server Unavailable')}\n message={tr('billing.addons.unableToLoadAddonDetails', 'Unable to load addon details.')}\n onRetry={() => refetch()}\n showRetry\n />\n </div>\n );\n }\n\n if (!addon) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.addons.addonNotFound', 'Addon not found')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'billing.addons.addonNotFoundMessage',\n \"The addon you're looking for doesn't exist or has been removed.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo('/addons')}\n className=\"px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n Back to Addons\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6\">\n <PageHeader\n title={addon.name}\n description={`${formatPlanDurationLabel(addon.duration)} addon`}\n />\n\n <PagePurpose>\n {tr(\n 'billing.addons.browseDetailPurpose',\n 'See exactly what this add-on costs and the extra capacity it gives you on top of your plan before you buy it. Add it to your cart from here when it fits your needs.'\n )}\n </PagePurpose>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n {/* Main Content */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Pricing Card — primary emphasis zone */}\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"p-4 border-b border-border-subtle\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.pricing', 'Pricing')}\n </h2>\n </div>\n <div className=\"p-6\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-4xl font-bold text-text-primary\">\n {formatCurrency(addon.price, addon.currency)}\n </span>\n <span className=\"text-lg text-text-secondary\">\n / {formatPlanDuration(addon.duration)}\n </span>\n </div>\n <p className=\"text-sm text-text-secondary mt-2\">\n {tr('billing.addons.billed', 'Billed')}{' '}\n {addon.duration === 'monthly'\n ? tr('billing.addons.everyMonth', 'every month')\n : tr('billing.addons.annually', 'annually')}\n </p>\n </div>\n </EmphasisPanel>\n\n {/* Quotas Card */}\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <div className=\"p-4 border-b border-border-subtle bg-bg-sunken/30\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.includedQuotas', 'Included Quotas')} ({combinedQuotas.length})\n </h2>\n </div>\n <div className=\"p-4\">\n {combinedQuotas.length === 0 ? (\n <p className=\"text-sm text-text-secondary py-4 text-center\">\n {tr('billing.addons.noQuotas', 'No quotas associated with this addon.')}\n </p>\n ) : (\n <div className=\"space-y-3\">\n {combinedQuotas.map((quota) => (\n <div\n key={quota.quotaId}\n className=\"flex items-center justify-between p-3 border border-border-subtle rounded-lg bg-bg-sunken/20\"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center\">\n <svg\n className=\"size-4 text-primary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">{quota.name}</p>\n <p className=\"text-xs text-text-secondary capitalize\">\n Type: {quota.type}\n </p>\n </div>\n </div>\n <div className=\"text-right\">\n <span className=\"text-lg font-semibold text-status-success-text\">\n {quota.totalValue.toLocaleString()}\n </span>\n <p className=\"text-xs text-text-secondary\">total</p>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* Purchase Card */}\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <div className=\"p-4 border-b border-border-subtle bg-bg-sunken/30\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.purchase', 'Purchase')}\n </h2>\n </div>\n <div className=\"p-4 space-y-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tr('billing.addons.price', 'Price')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {formatCurrency(addon.price, addon.currency)} /{' '}\n {formatPlanDuration(addon.duration)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tr('billing.addons.billingLabel', 'Billing')}\n </span>\n <span className=\"text-sm font-medium text-text-primary capitalize\">\n {addon.duration}\n </span>\n </div>\n\n <div className=\"pt-2 space-y-2\">\n {inCart ? (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, cartQuantity - 1)}\n className=\"p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Minus className=\"size-4\" />\n </button>\n <span className=\"w-10 text-center font-medium\">{cartQuantity}</span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, cartQuantity + 1)}\n className=\"p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Plus className=\"size-4\" />\n </button>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFromCart(addon.id)}\n className=\"p-1.5 rounded text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n title=\"Remove from cart\"\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo('/checkout/addons')}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n Proceed to Checkout\n </button>\n </div>\n ) : purchaseBlocked ? (\n <div className=\"space-y-3\" data-testid=\"addon-paid-plan-required\">\n <p className=\"flex items-start gap-2 text-sm text-text-secondary\">\n <Lock\n className=\"mt-0.5 size-4 shrink-0 text-status-warning-text\"\n aria-hidden=\"true\"\n />\n {tr(\n 'billing.addons.paidPlanRequiredBody',\n 'Add-ons extend a paid subscription. You are on the Free plan for this product, so upgrade to a paid plan first, then come back to add extra capacity.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo('/plans')}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('billing.addons.viewPlans', 'View plans')}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => addToCart(addon)}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors flex items-center justify-center gap-2\"\n >\n <ShoppingCart className=\"size-4\" />\n Add to Cart\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Back Button */}\n <button\n type=\"button\"\n onClick={() => navigateTo('/addons')}\n className=\"w-full px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-md hover:bg-bg-sunken transition-colors\"\n >\n Back to Addons\n </button>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,SAAS,EAAc,GAAmD;CACxE,IAAM,oBAAW,IAAI,IAA2B;CAChD,KAAK,IAAM,KAAW,GAAU;EAC9B,IAAI,CAAC,EAAQ,OAAO;EACpB,IAAM,IAAU,EAAQ,MAAM,IACxB,IAAS,EAAQ,MAAM,QACvB,IAAa,GAAQ,SAAS,GAC9B,IAAY,G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AAc,WAAU,SAAU,CAAA,GAAC,aAE7B;;QAEP,CAAA;OACF;QACF;SAGL,kBAAC,UAAD;MACE,MAAK;MACL,eAAe,EAAW,SAAS;MACnC,WAAU;gBACX;KAEO,CAAA,CACL;MACF;;EACF;MAvOH,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,gCAAgC,iBAAiB;IACnD,CAAA;IACJ,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,uCACA,iEACF;IACC,CAAA;IACH,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAW,SAAS;KACnC,WAAU;eACX;IAEO,CAAA;GACL;;CACF,CAAA;AAsNX"}
1
+ {"version":3,"file":"AddonBrowseDetailPage.js","names":["combineQuotas","quotaMap","feature","features","quotaId","limits","limitValue","limitType","existing","AddonBrowseDetailPage","useI18n","tr","translated","t","key","fallback","useParams","navigateTo","useBillingNavigate","useAddon","addonId","useAddonCartStore","combinedQuotas","useMemo","addon","inCart","isInCart","cartQuantity","getCartItem","eligibilityIds","useAddonPurchaseEligibility","purchaseBlocked","isBlocked","isLoading","i","error","isServerError","ServerError","refetch","PageHeader","formatPlanDurationLabel","PagePurpose","EmphasisPanel","formatCurrency","formatPlanDuration","quota","updateQuantity","Minus","Plus","removeFromCart","Trash2","Lock","addToCart","ShoppingCart"],"sources":["../../../../../src/billing/modules/addons/pages/AddonBrowseDetailPage.tsx"],"sourcesContent":["/**\n * Addons Module - Addon Browse Detail Page (User-facing)\n * View addon details and add to cart. No edit/toggle actions.\n */\n\nimport { useMemo, type FC } from 'react';\nimport { useParams } from 'react-router';\nimport { ShoppingCart, Plus, Minus, Trash2, Lock } from 'lucide-react';\nimport { useBillingNavigate } from '../../../hooks/useBillingNavigate';\nimport { useAddon, useAddonPurchaseEligibility } from '../hooks';\nimport { useAddonCartStore } from '../store/addonCartStore';\nimport { PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport {\n formatCurrency,\n formatPlanDuration,\n formatPlanDurationLabel,\n isServerError,\n} from '../../../shared/utils';\nimport type { SubscriptionFeatures } from '../../../shared/types';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface CombinedQuota {\n quotaId: string;\n name: string;\n totalValue: number;\n type: string;\n}\n\nfunction combineQuotas(features: SubscriptionFeatures[]): CombinedQuota[] {\n const quotaMap = new Map<string, CombinedQuota>();\n for (const feature of features) {\n if (!feature.quota) continue;\n const quotaId = feature.quota.id;\n const limits = feature.quota.limits as { value?: number; type?: string } | null;\n const limitValue = limits?.value ?? 0;\n const limitType = limits?.type ?? 'unknown';\n const existing = quotaMap.get(quotaId);\n if (existing) {\n existing.totalValue += limitValue;\n } else {\n quotaMap.set(quotaId, {\n quotaId,\n name: feature.quota.name ?? 'Unknown Quota',\n totalValue: limitValue,\n type: limitType,\n });\n }\n }\n return Array.from(quotaMap.values());\n}\n\nexport const AddonBrowseDetailPage: FC = () => {\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const translated = t(key);\n return translated === key ? fallback : translated;\n };\n const { addonId } = useParams<{ addonId: string }>();\n const navigateTo = useBillingNavigate();\n const { addon, isLoading, error, refetch } = useAddon(addonId);\n const { addToCart, removeFromCart, updateQuantity, isInCart, getCartItem } = useAddonCartStore();\n\n const combinedQuotas = useMemo(() => combineQuotas(addon?.features || []), [addon?.features]);\n const inCart = addon ? isInCart(addon.id) : false;\n const cartItem = addon ? getCartItem(addon.id) : undefined;\n const cartQuantity = cartItem?.quantity || 0;\n\n // BOFF-9889: add-ons require a paid subscription to their product.\n const eligibilityIds = useMemo(() => (addon ? [addon.id] : []), [addon]);\n const { isBlocked } = useAddonPurchaseEligibility(eligibilityIds);\n const purchaseBlocked = addon ? isBlocked(addon.id) : false;\n\n if (isLoading) {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"h-8 w-48 bg-bg-sunken animate-pulse rounded\" />\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n <div className=\"lg:col-span-2 space-y-4\">\n {[1, 2, 3].map((i) => (\n <div key={i} className=\"h-24 bg-bg-sunken animate-pulse rounded\" />\n ))}\n </div>\n <div className=\"h-64 bg-bg-sunken animate-pulse rounded\" />\n </div>\n </div>\n );\n }\n\n if (error && isServerError(error)) {\n return (\n <div className=\"p-6\">\n <ServerError\n title={tr('billing.addons.serverUnavailable', 'Server Unavailable')}\n message={tr('billing.addons.unableToLoadAddonDetails', 'Unable to load addon details.')}\n onRetry={() => refetch()}\n showRetry\n />\n </div>\n );\n }\n\n if (!addon) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.addons.addonNotFound', 'Addon not found')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'billing.addons.addonNotFoundMessage',\n \"The addon you're looking for doesn't exist or has been removed.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo('/addons')}\n className=\"px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n Back to Addons\n </button>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6\">\n <PageHeader\n title={addon.name}\n description={`${formatPlanDurationLabel(addon.duration)} addon`}\n />\n\n <PagePurpose>\n {tr(\n 'billing.addons.browseDetailPurpose',\n 'See exactly what this add-on costs and the extra capacity it gives you on top of your plan before you buy it. Add it to your cart from here when it fits your needs.'\n )}\n </PagePurpose>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-6\">\n {/* Main Content */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Pricing Card — primary emphasis zone */}\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"p-4 border-b border-border-subtle\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.pricing', 'Pricing')}\n </h2>\n </div>\n <div className=\"p-6\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-4xl font-bold text-text-primary\">\n {formatCurrency(addon.price, addon.currency)}\n </span>\n <span className=\"text-lg text-text-secondary\">\n / {formatPlanDuration(addon.duration)}\n </span>\n </div>\n <p className=\"text-sm text-text-secondary mt-2\">\n {tr('billing.addons.billed', 'Billed')}{' '}\n {addon.duration === 'monthly'\n ? tr('billing.addons.everyMonth', 'every month')\n : tr('billing.addons.annually', 'annually')}\n </p>\n </div>\n </EmphasisPanel>\n\n {/* Quotas Card */}\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <div className=\"p-4 border-b border-border-subtle bg-bg-sunken/30\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.includedQuotas', 'Included Quotas')} ({combinedQuotas.length})\n </h2>\n </div>\n <div className=\"p-4\">\n {combinedQuotas.length === 0 ? (\n <p className=\"text-sm text-text-secondary py-4 text-center\">\n {tr('billing.addons.noQuotas', 'No quotas associated with this addon.')}\n </p>\n ) : (\n <div className=\"space-y-3\">\n {combinedQuotas.map((quota) => (\n <div\n key={quota.quotaId}\n className=\"flex items-center justify-between p-3 border border-border-subtle rounded-lg bg-bg-sunken/20\"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center\">\n <svg\n className=\"size-4 text-primary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <div>\n <p className=\"font-medium text-text-primary\">{quota.name}</p>\n <p className=\"text-xs text-text-secondary capitalize\">\n Type: {quota.type}\n </p>\n </div>\n </div>\n <div className=\"text-right\">\n <span className=\"text-lg font-semibold text-status-success-text\">\n {quota.totalValue.toLocaleString()}\n </span>\n <p className=\"text-xs text-text-secondary\">total</p>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n </div>\n\n {/* Sidebar */}\n <div className=\"space-y-6\">\n {/* Purchase Card */}\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <div className=\"p-4 border-b border-border-subtle bg-bg-sunken/30\">\n <h2 className=\"font-semibold text-text-primary\">\n {tr('billing.addons.purchase', 'Purchase')}\n </h2>\n </div>\n <div className=\"p-4 space-y-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tr('billing.addons.price', 'Price')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {formatCurrency(addon.price, addon.currency)} /{' '}\n {formatPlanDuration(addon.duration)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-secondary\">\n {tr('billing.addons.billingLabel', 'Billing')}\n </span>\n <span className=\"text-sm font-medium text-text-primary capitalize\">\n {addon.duration}\n </span>\n </div>\n\n <div className=\"pt-2 space-y-2\">\n {inCart ? (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, cartQuantity - 1)}\n className=\"p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Minus className=\"size-4\" />\n </button>\n <span className=\"w-10 text-center font-medium\">{cartQuantity}</span>\n <button\n type=\"button\"\n onClick={() => updateQuantity(addon.id, cartQuantity + 1)}\n className=\"p-1.5 rounded border border-border-subtle hover:bg-bg-sunken transition-colors\"\n >\n <Plus className=\"size-4\" />\n </button>\n </div>\n <button\n type=\"button\"\n onClick={() => removeFromCart(addon.id)}\n className=\"p-1.5 rounded text-status-error-text hover:bg-status-error-bg/10 transition-colors\"\n title=\"Remove from cart\"\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo('/checkout/addons')}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n Proceed to Checkout\n </button>\n </div>\n ) : purchaseBlocked ? (\n <div className=\"space-y-3\" data-testid=\"addon-paid-plan-required\">\n <p className=\"flex items-start gap-2 text-sm text-text-secondary\">\n <Lock\n className=\"mt-0.5 size-4 shrink-0 text-status-warning-text\"\n aria-hidden=\"true\"\n />\n {tr(\n 'billing.addons.paidPlanRequiredBody',\n 'Add-ons extend a paid subscription. You are on the Free plan for this product, so upgrade to a paid plan first, then come back to add extra capacity.'\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigateTo('/plans')}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors\"\n >\n {tr('billing.addons.viewPlans', 'View plans')}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={() => addToCart(addon)}\n className=\"w-full px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 transition-colors flex items-center justify-center gap-2\"\n >\n <ShoppingCart className=\"size-4\" />\n Add to Cart\n </button>\n )}\n </div>\n </div>\n </div>\n\n {/* Back Button */}\n <button\n type=\"button\"\n onClick={() => navigateTo('/addons')}\n className=\"w-full px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-md hover:bg-bg-sunken transition-colors\"\n >\n Back to Addons\n </button>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA,SAASA,EAAc,GAAmD;CACxE,IAAMC,oBAAW,IAAI,IAA2B;CAChD,KAAK,IAAMC,KAAWC,GAAU;EAC9B,IAAI,CAACD,EAAQ,OAAO;EACpB,IAAME,IAAUF,EAAQ,MAAM,IACxBG,IAASH,EAAQ,MAAM,QACvBI,IAAaD,GAAQ,SAAS,GAC9B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,2 @@
1
1
  import { FC } from 'react';
2
2
  export declare const AddonCreatePage: FC;
3
- //# sourceMappingURL=AddonCreatePage.d.ts.map
@@ -1,25 +1,25 @@
1
1
  import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
2
  import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
3
  import { CurrencyPriceOverridesEditor as n } from "../../../shared/components/CurrencyPriceOverridesEditor.js";
4
- import "../../../shared/components/index.js";
5
- import { PlanDuration as r } from "../../../shared/types/graphql.js";
6
- import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
7
- import { useBillingNavigate as a } from "../../../hooks/useBillingNavigate.js";
8
- import { useAddonMutations as o } from "../hooks/useAddons.js";
4
+ import { useBillingNavigate as r } from "../../../hooks/useBillingNavigate.js";
9
5
  import "../hooks/index.js";
10
- import { useQuotas as s } from "../../plans/hooks/useQuotas.js";
11
6
  import "../../plans/hooks/index.js";
12
- import { useProducts as c } from "../../../hooks/useProducts.js";
7
+ import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
8
+ import { useAddonMutations as a } from "../hooks/useAddons.js";
9
+ import { useProducts as o } from "../../../hooks/useProducts.js";
10
+ import { useQuotas as s } from "../../plans/hooks/useQuotas.js";
11
+ import "../../../shared/components/index.js";
12
+ import { PlanDuration as c } from "../../../shared/types/graphql.js";
13
13
  import { useState as l } from "react";
14
14
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
15
15
  import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
16
  import { PagePurpose as m } from "@burdenoff/fe-libs/ui";
17
- //#region src/billing/modules/addons/pages/AddonCreatePage.tsx
17
+ // src/billing/modules/addons/pages/AddonCreatePage.tsx
18
18
  var h = () => {
19
19
  let { t: h } = p(), g = (e, t) => {
20
20
  let n = h(e);
21
21
  return n === e ? t : n;
22
- }, _ = a(), v = i(), { quotas: y, isLoading: b } = s({ onlyActive: !0 }), { products: x, isLoading: S } = c(), { createAddon: C, isCreating: w } = o(), [T, E] = l(""), [D, O] = l(""), [k, A] = l("USD"), [j, M] = l(r.MONTHLY), [N, P] = l(""), [F, I] = l([]), [L, R] = l([]), [z, B] = l(null), [V, H] = l(!1);
22
+ }, _ = r(), v = i(), { quotas: y, isLoading: b } = s({ onlyActive: !0 }), { products: x, isLoading: S } = o(), { createAddon: C, isCreating: w } = a(), [T, E] = l(""), [D, O] = l(""), [k, A] = l("USD"), [j, M] = l(c.MONTHLY), [N, P] = l(""), [F, I] = l([]), [L, R] = l([]), [z, B] = l(null), [V, H] = l(!1);
23
23
  if (!v.canManageAddons) return /* @__PURE__ */ d(e, { message: g("billing.addons.noCreatePermission", "You don't have permission to create addons.") });
24
24
  if (b || S) return /* @__PURE__ */ f("div", {
25
25
  className: "space-y-6 p-6",
@@ -233,10 +233,10 @@ var h = () => {
233
233
  onChange: (e) => M(e.target.value),
234
234
  className: "w-full px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
235
235
  children: [/* @__PURE__ */ d("option", {
236
- value: r.MONTHLY,
236
+ value: c.MONTHLY,
237
237
  children: "Monthly"
238
238
  }), /* @__PURE__ */ d("option", {
239
- value: r.YEARLY,
239
+ value: c.YEARLY,
240
240
  children: "Yearly"
241
241
  })]
242
242
  })] })
@@ -347,7 +347,6 @@ var h = () => {
347
347
  ]
348
348
  });
349
349
  };
350
- //#endregion
351
350
  export { h as AddonCreatePage };
352
351
 
353
352
  //# sourceMappingURL=AddonCreatePage.js.map