@burdenoff/microfe-billing 2026.1115.1 → 2026.1116.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -424,7 +424,7 @@ var Fe = [
424
424
  className: "mb-4 flex items-center justify-between",
425
425
  children: [/* @__PURE__ */ m("h2", {
426
426
  className: "text-lg font-semibold text-text-primary",
427
- children: "Request payout"
427
+ children: g ? "Withdrawals" : "Request payout"
428
428
  }), /* @__PURE__ */ h("button", {
429
429
  type: "button",
430
430
  onClick: () => void X(),
@@ -432,7 +432,11 @@ var Fe = [
432
432
  children: [/* @__PURE__ */ m(Ne, { className: "size-4" }), "Refresh"]
433
433
  })]
434
434
  }),
435
- M.length === 0 && !P ? /* @__PURE__ */ m(d, {
435
+ g ? /* @__PURE__ */ h("div", {
436
+ className: "space-y-2 text-sm text-text-secondary",
437
+ role: "note",
438
+ children: [/* @__PURE__ */ m("p", { children: "Developer revenue is withdrawn from Developer, then Revenue. Approval adds the amount to your earned credits." }), /* @__PURE__ */ m("p", { children: "Earned credits are withdrawn as cash from Withdraw credits." })]
439
+ }) : M.length === 0 && !P ? /* @__PURE__ */ m(d, {
436
440
  illustration: "empty-generic",
437
441
  title: "No payout accounts yet",
438
442
  description: "Add a payout account before requesting a withdrawal."
@@ -1 +1 @@
1
- {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","tr","useTr","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutFailure","setPayoutFailure","actionFailure","setActionFailure","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","serverError","ServerError","plainPayoutError","ShowTechnicalDetails","rawErrorText","guarded","action","failure","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","PayoutErrorNotice","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","PayoutDestinationList","toPayoutDestinations","item","destination","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n ShowTechnicalDetails,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\nimport { PayoutDestinationList } from '../components/PayoutDestinationList';\nimport { PayoutErrorNotice } from '../components/PayoutErrorNotice';\nimport { toPayoutDestinations } from '../utils/payoutDestination';\nimport { plainPayoutError, rawErrorText } from '../utils/plainPayoutError';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n const tr = useTr();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n // Raw failure kept so its text can sit under \"Show technical details\".\n const [payoutFailure, setPayoutFailure] = useState<unknown>(null);\n // FluidGrids: failures of account actions (save, default, archive) shown in plain words.\n const [actionFailure, setActionFailure] = useState<unknown>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n const serverError = (\n <ServerError\n title=\"Payout data unavailable\"\n message={isFluidgrids ? plainPayoutError(error, tr) : error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n return isFluidgrids ? (\n <>\n {serverError}\n <div className=\"px-6\">\n <ShowTechnicalDetails copyable>{rawErrorText(error)}</ShowTechnicalDetails>\n </div>\n </>\n ) : (\n serverError\n );\n }\n\n // FluidGrids: show a failed account action in plain words instead of an unhandled rejection.\n const guarded = async (action: () => Promise<void>): Promise<void> => {\n if (!isFluidgrids) return action();\n setActionFailure(null);\n try {\n await action();\n } catch (failure) {\n setActionFailure(failure);\n }\n };\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n setPayoutFailure(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutFailure(err);\n setPayoutError(plainPayoutError(err, tr));\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ...(payoutFailure && rawErrorText(payoutFailure)\n ? [\n {\n label: tr('billing.payoutError.technical', 'Technical details'),\n value: (\n <ShowTechnicalDetails copyable>\n {rawErrorText(payoutFailure)}\n </ShowTechnicalDetails>\n ),\n },\n ]\n : []),\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n isFluidgrids ? (\n <PayoutErrorNotice error={error} />\n ) : (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n )\n ) : null}\n {isFluidgrids && actionFailure ? <PayoutErrorNotice error={actionFailure} /> : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void guarded(handleAddAccount)}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">Request payout</h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutFailure(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {isFluidgrids ? (\n <PayoutDestinationList\n destinations={toPayoutDestinations(accounts)}\n renderActions={(destination) => {\n const account = accounts.find((item) => item.id === destination.id);\n if (!account) return null;\n return (\n <>\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.edit', 'Edit')}\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.makeDefault', 'Make default')}\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n {tr('billing.payouts.archive', 'Archive')}\n </button>\n </>\n );\n }}\n />\n ) : (\n <>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void guarded(() => handleArchive(id));\n }}\n >\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AA;WACL;UACF,CAAA,CAAA;SA5CE,GAAAA,EAAQ,EA4CV;QAET,CAAC,EACD,CAAA,CAED;OACH,CAAA,IAAA;MACD;KAEL,CAAA,GAAA,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAAC,MAAD;OAAI,WAAU;OAA+C,UAAA;MAAmB,CAAA,GAC/EvD,EAAS,WAAW,KAAK,CAACE,IACzB,kBAACoE,GAAD;OACE,cAAa;OACb,OAAM;OACN,aAAY;MACb,CAAA,IAED,kBAACS,IAAD;OACE,MAAM/E;OACN,SAAS,MAAY7B,EAAQ;OAC7B,SAASF;MACV,CAAA,CAEA;KACE,CAAA,CAAA;IACN,CAAA,CAAA;;GAEL,kBAAC+G,IAAD;IACE,MAAMlE,OAAqB;IAC3B,eAAe,MAAS;KACtB,AAAKmE,KAAMlE,EAAoB,IAAI;IACrC;IAEA,UAAA,kBAACmE,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,IAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK3E;MAEX,AADAC,EAAoB,IAAI,GACpB0E,KAAIjD,QAAmBY,GAAcqC,CAAE,CAAC;KAC9C;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
1
+ {"version":3,"file":"PayoutsPage.js","names":["_Fragment","Fragment$1","payoutRequestColumns","formatCurrency","request","formatDateTime","PayoutsPage","permissions","useBillingPermissions","isFluidgrids","useIsFluidgridsVariant","tr","useTr","isReviewingPayout","setIsReviewingPayout","useState","isSubmittingPayout","setIsSubmittingPayout","payoutError","setPayoutError","payoutFailure","setPayoutFailure","actionFailure","setActionFailure","payoutResult","setPayoutResult","useBillingEventEmitter","useBilling","billingAccountData","useGetDefaultBillingAccountSettingsQuery","billingAccountId","accounts","setAccounts","requests","setRequests","loading","setLoading","error","setError","accountForm","setAccountForm","requestAmount","setRequestAmount","selectedAccountId","setSelectedAccountId","editingAccountId","setEditingAccountId","archiveAccountId","setArchiveAccountId","notice","setNotice","requestContext","useMemo","apiGatewayUrl","authToken","orgId","loadData","useCallback","loadedAccounts","loadedRequests","fetchPayoutAccounts","fetchPayoutRequests","pickPayableAccountId","current","loadError","useEffect","AccessDenied","isServerError","serverError","ServerError","plainPayoutError","ShowTechnicalDetails","rawErrorText","guarded","action","failure","handleAddAccount","payload","updatePayoutAccount","emit","created","addPayoutAccount","handleSetDefault","setDefaultPayoutAccount","accountId","handleArchive","archivePayoutAccount","handleEditAccount","account","selectedAccount","hasPayableAccount","isPayoutAccountPayable","handleRequestPayout","requestPayout","confirmPayout","err","MoneyActionDialog","PageHeader","PagePurpose","PayoutErrorNotice","event","Landmark","RefreshCw","IllustratedEmptyState","payoutAccountStatusView","Send","PayoutDestinationList","toPayoutDestinations","item","destination","statusView","PAYOUT_ACCOUNT_TONE_CLASSES","ResponsiveTable","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id"],"sources":["../../../../../src/billing/modules/earnings/pages/PayoutsPage.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport { Landmark, RefreshCw, Send } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n ResponsiveTable,\n ShowTechnicalDetails,\n type ResponsiveTableColumn,\n} from '@burdenoff/fe-libs/ui';\n\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useIsFluidgridsVariant } from '../../../hooks/useBillingVariant';\nimport { MoneyActionDialog } from '../../../shared/components';\nimport { useTr } from '../../../shared/hooks/useTr';\nimport { useBillingEventEmitter } from '../../../hooks/useBillingEventEmitter';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, PageHeader, ServerError } from '../../../shared/components';\nimport { PagePurpose, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { formatCurrency, formatDateTime, isServerError } from '../../../shared/utils';\nimport { useGetDefaultBillingAccountSettingsQuery } from '../../../../generated/global-operations';\nimport {\n addPayoutAccount,\n archivePayoutAccount,\n fetchPayoutAccounts,\n fetchPayoutRequests,\n requestPayout,\n setDefaultPayoutAccount,\n updatePayoutAccount,\n type PayoutAccount,\n type PayoutRequest,\n} from '../api';\nimport {\n PAYOUT_ACCOUNT_TONE_CLASSES,\n isPayoutAccountPayable,\n payoutAccountStatusView,\n pickPayableAccountId,\n} from '../payoutAccountStatus';\nimport { PayoutDestinationList } from '../components/PayoutDestinationList';\nimport { PayoutErrorNotice } from '../components/PayoutErrorNotice';\nimport { toPayoutDestinations } from '../utils/payoutDestination';\nimport { plainPayoutError, rawErrorText } from '../utils/plainPayoutError';\n\nconst payoutRequestColumns: ResponsiveTableColumn<PayoutRequest>[] = [\n {\n key: 'amount',\n header: 'Amount',\n priority: 'primary',\n cell: (request) => (\n <span className=\"tabular-nums\">\n {formatCurrency(request.requestedAmount, request.currency)}\n </span>\n ),\n },\n { key: 'provider', header: 'Provider', cell: (request) => request.provider },\n { key: 'status', header: 'Status', cell: (request) => request.status },\n {\n key: 'account',\n header: 'Account',\n cell: (request) => request.payoutAccount?.label || '-',\n },\n {\n key: 'created',\n header: 'Created',\n cell: (request) => formatDateTime(request.createdAt),\n },\n];\n\nexport const PayoutsPage: FC = () => {\n const permissions = useBillingPermissions();\n const isFluidgrids = useIsFluidgridsVariant();\n const tr = useTr();\n // FluidGrids: a review step precedes the request, and the outcome is always shown.\n const [isReviewingPayout, setIsReviewingPayout] = useState(false);\n const [isSubmittingPayout, setIsSubmittingPayout] = useState(false);\n const [payoutError, setPayoutError] = useState<string | null>(null);\n // Raw failure kept so its text can sit under \"Show technical details\".\n const [payoutFailure, setPayoutFailure] = useState<unknown>(null);\n // FluidGrids: failures of account actions (save, default, archive) shown in plain words.\n const [actionFailure, setActionFailure] = useState<unknown>(null);\n const [payoutResult, setPayoutResult] = useState<{ ok: boolean; message: string } | null>(null);\n const { emit } = useBillingEventEmitter();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n const { data: billingAccountData } = useGetDefaultBillingAccountSettingsQuery({});\n const billingAccountId = billingAccountData?.getDefaultBillingAccount?.id;\n\n const [accounts, setAccounts] = useState<PayoutAccount[]>([]);\n const [requests, setRequests] = useState<PayoutRequest[]>([]);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const [accountForm, setAccountForm] = useState({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n const [requestAmount, setRequestAmount] = useState('');\n const [selectedAccountId, setSelectedAccountId] = useState<string>('');\n const [editingAccountId, setEditingAccountId] = useState<string | null>(null);\n const [archiveAccountId, setArchiveAccountId] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n\n const requestContext = useMemo(\n () => ({\n apiGatewayUrl,\n authToken,\n orgId,\n }),\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setLoading(true);\n setError(null);\n try {\n const [loadedAccounts, loadedRequests] = await Promise.all([\n fetchPayoutAccounts(billingAccountId, requestContext),\n fetchPayoutRequests(billingAccountId, requestContext),\n ]);\n setAccounts(loadedAccounts);\n setRequests(loadedRequests);\n // Only verified accounts can be paid out to (BOFF-10953).\n setSelectedAccountId((current) => pickPayableAccountId(loadedAccounts, current));\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError : new Error('Failed to load payout data'));\n } finally {\n setLoading(false);\n }\n }, [billingAccountId, requestContext]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n if (!permissions.canManagePaymentMethods) {\n return <AccessDenied message=\"You don't have permission to manage payout accounts.\" />;\n }\n\n if (error && isServerError(error)) {\n const serverError = (\n <ServerError\n title=\"Payout data unavailable\"\n message={isFluidgrids ? plainPayoutError(error, tr) : error.message}\n onRetry={() => void loadData()}\n showRetry\n />\n );\n return isFluidgrids ? (\n <>\n {serverError}\n <div className=\"px-6\">\n <ShowTechnicalDetails copyable>{rawErrorText(error)}</ShowTechnicalDetails>\n </div>\n </>\n ) : (\n serverError\n );\n }\n\n // FluidGrids: show a failed account action in plain words instead of an unhandled rejection.\n const guarded = async (action: () => Promise<void>): Promise<void> => {\n if (!isFluidgrids) return action();\n setActionFailure(null);\n try {\n await action();\n } catch (failure) {\n setActionFailure(failure);\n }\n };\n\n const handleAddAccount = async () => {\n if (!billingAccountId) return;\n setNotice(null);\n const payload = {\n billingAccountId,\n ...accountForm,\n };\n\n if (editingAccountId) {\n await updatePayoutAccount(editingAccountId, payload, requestContext);\n emit('billing.payout_account.updated', {\n route: '/billing/payouts',\n entityId: editingAccountId,\n source: 'payouts',\n });\n } else {\n const created = await addPayoutAccount(payload, requestContext);\n emit('billing.payout_account.added', {\n route: '/billing/payouts',\n entityId: billingAccountId,\n source: 'payouts',\n });\n // RazorpayX and Stripe Connect accounts stay pending until processor\n // onboarding verifies them (BOFF-10895); say so instead of implying the\n // account is ready to receive payouts.\n setNotice(\n created.status === 'ACTIVE'\n ? 'Payout account saved and ready to receive payouts.'\n : 'Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.'\n );\n }\n\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n setEditingAccountId(null);\n await loadData();\n };\n\n const handleSetDefault = async (accountId: string) => {\n setNotice(null);\n await setDefaultPayoutAccount(accountId, requestContext);\n await loadData();\n };\n\n const handleArchive = async (accountId: string) => {\n setNotice(null);\n await archivePayoutAccount(accountId, requestContext);\n emit('billing.payout_account.archived', {\n route: '/billing/payouts',\n entityId: accountId,\n source: 'payouts',\n });\n await loadData();\n };\n\n const handleEditAccount = (account: PayoutAccount) => {\n setNotice(null);\n setEditingAccountId(account.id);\n setAccountForm((current) => ({\n ...current,\n label: account.label,\n type: account.type,\n providerPreference: account.providerPreference,\n country: account.country || current.country,\n currency: account.currency,\n accountHolderName: account.displayName || current.accountHolderName,\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n }));\n };\n\n const selectedAccount = accounts.find((account) => account.id === selectedAccountId);\n const hasPayableAccount = accounts.some(isPayoutAccountPayable);\n\n const handleRequestPayout = async () => {\n if (!billingAccountId || !selectedAccountId || !requestAmount) return;\n if (!selectedAccount || !isPayoutAccountPayable(selectedAccount)) return;\n await requestPayout(\n {\n billingAccountId,\n payoutAccountId: selectedAccountId,\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n },\n requestContext\n );\n emit('billing.payout.requested', {\n route: '/billing/payouts',\n entityId: selectedAccountId,\n source: 'payouts',\n amount: Number(requestAmount),\n currency: selectedAccount.currency,\n });\n setRequestAmount('');\n await loadData();\n };\n\n const confirmPayout = async () => {\n setIsSubmittingPayout(true);\n setPayoutError(null);\n setPayoutFailure(null);\n try {\n await handleRequestPayout();\n setIsReviewingPayout(false);\n setPayoutResult({\n ok: true,\n message: `Payout of ${formatCurrency(Number(requestAmount), selectedAccount?.currency ?? '')} requested. We'll show its status below.`,\n });\n } catch (err) {\n setPayoutFailure(err);\n setPayoutError(plainPayoutError(err, tr));\n } finally {\n setIsSubmittingPayout(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n {isFluidgrids && (\n <MoneyActionDialog\n open={isReviewingPayout}\n title=\"Review your payout\"\n description=\"The amount is moved out of your available balance when you confirm.\"\n details={[\n {\n label: 'Amount',\n value: formatCurrency(Number(requestAmount), selectedAccount?.currency ?? ''),\n },\n {\n label: 'Paid to',\n value: selectedAccount\n ? `${selectedAccount.label} · ${selectedAccount.currency}`\n : '',\n },\n ...(payoutFailure && rawErrorText(payoutFailure)\n ? [\n {\n label: tr('billing.payoutError.technical', 'Technical details'),\n value: (\n <ShowTechnicalDetails copyable>\n {rawErrorText(payoutFailure)}\n </ShowTechnicalDetails>\n ),\n },\n ]\n : []),\n ]}\n confirmLabel=\"Request payout\"\n busyLabel=\"Requesting…\"\n isBusy={isSubmittingPayout}\n error={payoutError}\n onConfirm={() => void confirmPayout()}\n onCancel={() => setIsReviewingPayout(false)}\n />\n )}\n {isFluidgrids && payoutResult && (\n <div\n role={payoutResult.ok ? 'status' : 'alert'}\n className={`rounded-md border p-3 text-sm ${payoutResult.ok ? 'border-status-success-border text-status-success-text' : 'border-status-error-border text-status-error-text'}`}\n >\n {payoutResult.message}\n </div>\n )}\n <PageHeader\n title=\"Payouts\"\n description=\"Register payout accounts, request withdrawals, and track disbursement status.\"\n />\n\n <PagePurpose>\n Get your earnings paid out to a real bank account or UPI. Register where you want to be\n paid, request a withdrawal of your available balance, and track each request from submission\n through to disbursement here.\n </PagePurpose>\n\n {notice ? (\n <div\n role=\"status\"\n className=\"rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text\"\n >\n {notice}\n </div>\n ) : null}\n\n {error && !isServerError(error) ? (\n isFluidgrids ? (\n <PayoutErrorNotice error={error} />\n ) : (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text\">\n {error.message}\n </div>\n )\n ) : null}\n {isFluidgrids && actionFailure ? <PayoutErrorNotice error={actionFailure} /> : null}\n\n <div className=\"grid gap-6 xl:grid-cols-[1.05fr,1.95fr]\">\n <section className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">\n {editingAccountId ? 'Edit payout account' : 'Add payout account'}\n </h2>\n <div className=\"space-y-3\">\n <input\n value={accountForm.label}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, label: event.target.value }))\n }\n placeholder=\"Label\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <div className=\"grid gap-3 md:grid-cols-2\">\n <select\n value={accountForm.type}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, type: event.target.value }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"BANK_ACCOUNT\">Bank account</option>\n <option value=\"UPI\">UPI</option>\n <option value=\"WALLET\">Wallet</option>\n </select>\n <select\n value={accountForm.providerPreference}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n providerPreference: event.target.value,\n }))\n }\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"AUTO\">Auto</option>\n <option value=\"STRIPE\">Stripe</option>\n <option value=\"RAZORPAY\">Razorpay</option>\n <option value=\"MANUAL\">Manual</option>\n </select>\n </div>\n <div className=\"grid gap-3 md:grid-cols-2\">\n <input\n value={accountForm.country}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n country: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Country\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.currency}\n onChange={(event) =>\n setAccountForm((current) => ({\n ...current,\n currency: event.target.value.toUpperCase(),\n }))\n }\n placeholder=\"Currency\"\n className=\"rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </div>\n <input\n value={accountForm.accountHolderName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountHolderName: event.target.value }))\n }\n placeholder=\"Account holder name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n {accountForm.type === 'BANK_ACCOUNT' ? (\n <>\n <input\n value={accountForm.bankName}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, bankName: event.target.value }))\n }\n placeholder=\"Bank name\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={accountForm.accountNumber}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, accountNumber: event.target.value }))\n }\n placeholder=\"Account number\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n <input\n value={\n accountForm.country === 'IN' ? accountForm.ifsc : accountForm.routingNumber\n }\n onChange={(event) =>\n setAccountForm((current) =>\n current.country === 'IN'\n ? { ...current, ifsc: event.target.value }\n : { ...current, routingNumber: event.target.value }\n )\n }\n placeholder={accountForm.country === 'IN' ? 'IFSC' : 'Routing number'}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </>\n ) : accountForm.type === 'UPI' ? (\n <input\n value={accountForm.upiId}\n onChange={(event) =>\n setAccountForm((current) => ({ ...current, upiId: event.target.value }))\n }\n placeholder=\"UPI ID\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n ) : null}\n </div>\n <button\n type=\"button\"\n onClick={() => void guarded(handleAddAccount)}\n className=\"mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Landmark className=\"size-4\" />\n {editingAccountId ? 'Update payout account' : 'Save payout account'}\n </button>\n {editingAccountId ? (\n <button\n type=\"button\"\n onClick={() => {\n setEditingAccountId(null);\n setAccountForm({\n label: '',\n type: 'BANK_ACCOUNT',\n providerPreference: 'AUTO',\n country: 'US',\n currency: 'USD',\n accountHolderName: '',\n bankName: '',\n accountNumber: '',\n routingNumber: '',\n ifsc: '',\n upiId: '',\n });\n }}\n className=\"mt-4 ml-3 inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary\"\n >\n Cancel edit\n </button>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {isFluidgrids ? 'Withdrawals' : 'Request payout'}\n </h2>\n <button\n type=\"button\"\n onClick={() => void loadData()}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary\"\n >\n <RefreshCw className=\"size-4\" />\n Refresh\n </button>\n </div>\n {isFluidgrids ? (\n // This page has no working way to submit a payout (the request is not\n // implemented here), so FluidGrids points to the two that work.\n <div className=\"space-y-2 text-sm text-text-secondary\" role=\"note\">\n <p>\n Developer revenue is withdrawn from Developer, then Revenue. Approval adds the\n amount to your earned credits.\n </p>\n <p>Earned credits are withdrawn as cash from Withdraw credits.</p>\n </div>\n ) : accounts.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title=\"No payout accounts yet\"\n description=\"Add a payout account before requesting a withdrawal.\"\n />\n ) : (\n <div className=\"space-y-3\">\n <select\n value={selectedAccountId}\n onChange={(event) => setSelectedAccountId(event.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {!hasPayableAccount ? (\n <option value=\"\">No verified payout account yet</option>\n ) : null}\n {accounts.map((account) => (\n <option\n key={account.id}\n value={account.id}\n disabled={!isPayoutAccountPayable(account)}\n >\n {account.label} · {account.currency} ·{' '}\n {payoutAccountStatusView(account.status).label}\n </option>\n ))}\n </select>\n {!hasPayableAccount ? (\n <p className=\"text-sm text-text-secondary\">\n Payouts can be requested once one of your payout accounts is verified.\n </p>\n ) : null}\n <label className=\"block space-y-1 text-sm font-medium text-text-primary\">\n <span>Amount</span>\n <input\n value={requestAmount}\n onChange={(event) => setRequestAmount(event.target.value)}\n inputMode=\"decimal\"\n placeholder=\"0.00\"\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary\"\n />\n </label>\n <button\n type=\"button\"\n onClick={() => {\n if (!isFluidgrids) {\n void handleRequestPayout();\n return;\n }\n setPayoutError(null);\n setPayoutFailure(null);\n setPayoutResult(null);\n setIsReviewingPayout(true);\n }}\n disabled={!selectedAccount || !isPayoutAccountPayable(selectedAccount)}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <Send className=\"size-4\" />\n Request payout\n </button>\n </div>\n )}\n\n {accounts.length > 0 ? (\n <div className=\"mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Saved payout accounts</h3>\n {isFluidgrids ? (\n <PayoutDestinationList\n destinations={toPayoutDestinations(accounts)}\n renderActions={(destination) => {\n const account = accounts.find((item) => item.id === destination.id);\n if (!account) return null;\n return (\n <>\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.edit', 'Edit')}\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n {tr('billing.payouts.makeDefault', 'Make default')}\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n {tr('billing.payouts.archive', 'Archive')}\n </button>\n </>\n );\n }}\n />\n ) : (\n <>\n {accounts.map((account) => {\n const statusView = payoutAccountStatusView(account.status);\n return (\n <div\n key={account.id}\n className=\"flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm\"\n >\n <div>\n <p className=\"flex flex-wrap items-center gap-2 font-medium text-text-primary\">\n {account.label} {account.isDefault ? '• Default' : ''}\n <span\n className={`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${PAYOUT_ACCOUNT_TONE_CLASSES[statusView.tone]}`}\n >\n {statusView.label}\n </span>\n </p>\n <p className=\"text-text-secondary\">\n {account.providerPreference} · {account.currency}\n </p>\n {statusView.hint ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{statusView.hint}</p>\n ) : null}\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={() => handleEditAccount(account)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Edit\n </button>\n {!account.isDefault ? (\n <button\n type=\"button\"\n onClick={() => void guarded(() => handleSetDefault(account.id))}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary\"\n >\n Make default\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => setArchiveAccountId(account.id)}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text\"\n >\n Archive\n </button>\n </div>\n </div>\n );\n })}\n </>\n )}\n </div>\n ) : null}\n </div>\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h2 className=\"mb-4 text-lg font-semibold text-text-primary\">Payout requests</h2>\n {requests.length === 0 && !loading ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No payout requests yet\"\n description=\"Your payout requests and processing updates will appear here.\"\n />\n ) : (\n <ResponsiveTable\n data={requests}\n rowKey={(request) => request.id}\n columns={payoutRequestColumns}\n />\n )}\n </div>\n </section>\n </div>\n\n <AlertDialog\n open={archiveAccountId !== null}\n onOpenChange={(open) => {\n if (!open) setArchiveAccountId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Archive payout account?</AlertDialogTitle>\n <AlertDialogDescription>\n Archive this payout account? You can add a new one at any time.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = archiveAccountId;\n setArchiveAccountId(null);\n if (id) void guarded(() => handleArchive(id));\n }}\n >\n Archive\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAME,KAA+D;CACnE;EACE,KAAK;EACL,QAAQ;EACR,UAAU;EACV,OAAO,MACL,kBAAC,QAAD;GAAM,WAAU;GACb,UAAAC,EAAeC,EAAQ,iBAAiBA,EAAQ,QAAQ;EACrD,CAAA;CAEV;CACA;EAAE,KAAK;EAAY,QAAQ;EAAY,OAAO,MAAYA,EAAQ;CAAS;CAC3E;EAAE,KAAK;EAAU,QAAQ;EAAU,OAAO,MAAYA,EAAQ;CAAO;CACrE;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYA,EAAQ,eAAe,SAAS;CACrD;CACA;EACE,KAAK;EACL,QAAQ;EACR,OAAO,MAAYC,EAAeD,EAAQ,SAAS;CACrD;AACF,GAEaE,UAAwB;CACnC,IAAMC,IAAcC,EAAsB,GACpCC,IAAeC,EAAuB,GACtCC,IAAKC,GAAM,GAEX,CAACC,IAAmBC,KAAwBC,EAAS,EAAK,GAC1D,CAACC,IAAoBC,KAAyBF,EAAS,EAAK,GAC5D,CAACG,IAAaC,KAAkBJ,EAAwB,IAAI,GAE5D,CAACK,GAAeC,KAAo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,kBAACC,IAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,IAAD,EAAA,UAAwB,kEAEA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,IAAD;KACE,eAAe;MACb,IAAMC,IAAK3E;MAEX,AADAC,EAAoB,IAAI,GACpB0E,KAAIjD,QAAmBY,GAAcqC,CAAE,CAAC;KAC9C;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;;AAET"}
@@ -194,73 +194,77 @@ var S = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, C = "
194
194
  }) : $.length === 0 ? /* @__PURE__ */ b("div", {
195
195
  className: "p-6 text-sm text-text-secondary",
196
196
  children: "No members assigned yet."
197
- }) : /* @__PURE__ */ x("table", {
198
- className: "w-full text-sm",
199
- children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", {
200
- className: "border-b border-border-subtle text-left text-xs text-text-secondary",
201
- children: [
202
- /* @__PURE__ */ b("th", {
203
- className: "px-4 py-2",
204
- children: "Member"
205
- }),
206
- /* @__PURE__ */ b("th", {
207
- className: "px-4 py-2",
208
- children: "Type"
209
- }),
210
- /* @__PURE__ */ b("th", {
211
- className: "px-4 py-2",
212
- children: "Roles"
213
- }),
214
- /* @__PURE__ */ b("th", {
215
- className: "px-4 py-2 text-right",
216
- children: "Actions"
217
- })
218
- ]
219
- }) }), /* @__PURE__ */ b("tbody", { children: $.map((e) => /* @__PURE__ */ x("tr", {
220
- className: "border-b border-border-subtle last:border-0",
221
- children: [
222
- /* @__PURE__ */ b("td", {
223
- className: "px-4 py-3",
224
- children: /* @__PURE__ */ b(r, {
225
- profile: ae[e.actorId] ?? {
226
- actorId: e.actorId,
227
- actorType: e.actorType,
228
- displayName: e.actorType.toLowerCase() === "user" ? `User ${e.actorId.slice(0, 8)}…` : e.actorType,
229
- secondaryLabel: e.actorId.slice(0, 12),
230
- resolved: !1
231
- },
232
- variant: "cell"
233
- })
234
- }),
235
- /* @__PURE__ */ b("td", {
236
- className: "px-4 py-3 text-xs capitalize text-text-secondary",
237
- children: e.actorType.toLowerCase()
238
- }),
239
- /* @__PURE__ */ b("td", {
240
- className: "px-4 py-3",
241
- children: /* @__PURE__ */ b("div", {
242
- className: "flex flex-wrap gap-1",
243
- children: e.roleAssignments.filter((e) => e.isActive).map((e) => /* @__PURE__ */ x("span", {
244
- className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs",
245
- children: [e.role?.name ?? e.roleId, /* @__PURE__ */ b("button", {
246
- type: "button",
247
- onClick: () => X(e.id),
248
- className: "text-text-secondary hover:text-status-error-text",
249
- "aria-label": `Remove ${e.role?.name ?? "role"}`,
250
- children: "×"
251
- })]
252
- }, e.id))
197
+ }) : /* @__PURE__ */ b("div", {
198
+ className: "overflow-x-auto",
199
+ "data-testid": "billing-team-members-scroll",
200
+ children: /* @__PURE__ */ x("table", {
201
+ className: "w-full text-sm",
202
+ children: [/* @__PURE__ */ b("thead", { children: /* @__PURE__ */ x("tr", {
203
+ className: "border-b border-border-subtle text-left text-xs text-text-secondary",
204
+ children: [
205
+ /* @__PURE__ */ b("th", {
206
+ className: "px-4 py-2",
207
+ children: "Member"
208
+ }),
209
+ /* @__PURE__ */ b("th", {
210
+ className: "px-4 py-2",
211
+ children: "Type"
212
+ }),
213
+ /* @__PURE__ */ b("th", {
214
+ className: "px-4 py-2",
215
+ children: "Roles"
216
+ }),
217
+ /* @__PURE__ */ b("th", {
218
+ className: "px-4 py-2 text-right",
219
+ children: "Actions"
253
220
  })
254
- }),
255
- /* @__PURE__ */ b("td", {
256
- className: "px-4 py-3 text-right",
257
- children: /* @__PURE__ */ x("span", {
258
- className: "text-xs text-text-secondary",
259
- children: [e.effectivePermissionCount ?? "—", " permissions"]
221
+ ]
222
+ }) }), /* @__PURE__ */ b("tbody", { children: $.map((e) => /* @__PURE__ */ x("tr", {
223
+ className: "border-b border-border-subtle last:border-0",
224
+ children: [
225
+ /* @__PURE__ */ b("td", {
226
+ className: "px-4 py-3",
227
+ children: /* @__PURE__ */ b(r, {
228
+ profile: ae[e.actorId] ?? {
229
+ actorId: e.actorId,
230
+ actorType: e.actorType,
231
+ displayName: e.actorType.toLowerCase() === "user" ? `User ${e.actorId.slice(0, 8)}…` : e.actorType,
232
+ secondaryLabel: e.actorId.slice(0, 12),
233
+ resolved: !1
234
+ },
235
+ variant: "cell"
236
+ })
237
+ }),
238
+ /* @__PURE__ */ b("td", {
239
+ className: "px-4 py-3 text-xs capitalize text-text-secondary",
240
+ children: e.actorType.toLowerCase()
241
+ }),
242
+ /* @__PURE__ */ b("td", {
243
+ className: "px-4 py-3",
244
+ children: /* @__PURE__ */ b("div", {
245
+ className: "flex flex-wrap gap-1",
246
+ children: e.roleAssignments.filter((e) => e.isActive).map((e) => /* @__PURE__ */ x("span", {
247
+ className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs",
248
+ children: [e.role?.name ?? e.roleId, /* @__PURE__ */ b("button", {
249
+ type: "button",
250
+ onClick: () => X(e.id),
251
+ className: "text-text-secondary hover:text-status-error-text",
252
+ "aria-label": `Remove ${e.role?.name ?? "role"}`,
253
+ children: "×"
254
+ })]
255
+ }, e.id))
256
+ })
257
+ }),
258
+ /* @__PURE__ */ b("td", {
259
+ className: "px-4 py-3 text-right",
260
+ children: /* @__PURE__ */ x("span", {
261
+ className: "text-xs text-text-secondary",
262
+ children: [e.effectivePermissionCount ?? "—", " permissions"]
263
+ })
260
264
  })
261
- })
262
- ]
263
- }, e.actorId)) })]
265
+ ]
266
+ }, e.actorId)) })]
267
+ })
264
268
  })]
265
269
  }),
266
270
  /* @__PURE__ */ x("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"TeamPermissionsPage.js","names":["_Fragment","Fragment$1","UUID_RE","ROLES_QUERY","ACTORS_QUERY","ASSIGN_ROLE_MUTATION","REMOVE_ROLE_MUTATION","TeamPermissionsPage","useBilling","useBillingAccounts","useBillingAccountSelection","billingAccountId","selectedAccountId","permissions","useBillingPermissions","roles","setRoles","useState","actors","setActors","isLoading","setIsLoading","error","setError","newActorId","setNewActorId","newRoleId","setNewRoleId","isAdding","setIsAdding","removeAssignmentId","setRemoveAssignmentId","gqlPost","useCallback","directBillingGraphqlRequest","apiGatewayUrl","authToken","orgId","loadData","rolesResp","actorsResp","viewer","r","err","sortedActors","useMemo","priA","a","ra","b","profileInputs","profileMap","useActorProfiles","billingAccountName","billingAccounts","acct","handleAddMember","trimmedActorId","handleRemoveAssignment","embedded","PageHeader","PagePurpose","ActorIdentity","actor","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id","IllustratedEmptyState","AccessDenied"],"sources":["../../../../../src/billing/modules/settings/pages/TeamPermissionsPage.tsx"],"sourcesContent":["/**\n * Settings Module - Team & Permissions Page\n *\n * Lets a Billing Admin manage billing-scope role assignments for a specific\n * billing account. Calls global-rbac-svc directly via the same gateway URL\n * used by the rest of the billing module.\n *\n * Scope: `scopeType: \"billing\"`, `scopeId: <billingAccountId>`\n * Roles cloned per billing account at creation time:\n * - Billing Admin (full access to this billing account)\n * - Billing Viewer (read-only access to this billing account)\n */\nimport { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n PagePurpose,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, ActorIdentity, PageHeader } from '../../../shared/components';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useBillingAccountSelection } from '../../../hooks/useBillingAccountSelection';\nimport { useBillingAccounts } from '../../dashboard/hooks/useDashboard';\nimport { directBillingGraphqlRequest } from '../../../shared/utils';\nimport { useActorProfiles } from '../../../shared/hooks';\n\n// Basic UUID-v1-through-v5 shape — accept any 8-4-4-4-12 hex pattern.\n// We intentionally don't strictly validate the version nibble; the rbac\n// service is the authoritative ID validator.\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\ninterface Role {\n id: string;\n name: string;\n description?: string | null;\n priority: number;\n isSystem: boolean;\n}\n\ninterface ActorRoleAssignment {\n id: string;\n actorId: string;\n actorType: string;\n roleId: string;\n scopeId: string;\n isActive: boolean;\n expiresAt?: string | null;\n role?: Role;\n}\n\ninterface ActorRbacSummary {\n actorId: string;\n actorType: string;\n roleAssignments: ActorRoleAssignment[];\n effectivePermissionCount?: number;\n}\n\nconst ROLES_QUERY = `\n query BillingScopeRoles($scopeId: String!) {\n roles(scopeId: $scopeId) {\n id\n name\n description\n priority\n isSystem\n }\n }\n`;\n\nconst ACTORS_QUERY = `\n query BillingScopeActors($scopeId: String!) {\n actors(scopeId: $scopeId) {\n actorId\n actorType\n roleAssignments {\n id\n actorId\n actorType\n roleId\n scopeId\n isActive\n expiresAt\n role { id name priority }\n }\n }\n }\n`;\n\nconst ASSIGN_ROLE_MUTATION = `\n mutation AssignBillingRole($input: AssignRoleInput!) {\n assignRoleToActor(input: $input) {\n id\n actorId\n roleId\n scopeId\n }\n }\n`;\n\nconst REMOVE_ROLE_MUTATION = `\n mutation RemoveBillingRole($assignmentId: String!) {\n removeRoleFromActor(assignmentId: $assignmentId)\n }\n`;\n\ninterface TeamPermissionsPageProps {\n /** Rendered inside the Settings page: no page header or outer padding, and silent when not allowed. */\n embedded?: boolean;\n}\n\nexport const TeamPermissionsPage: FC<TeamPermissionsPageProps> = ({ embedded = false }) => {\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n\n // Resolution priority: URL `?billingAccountId=` → persisted localStorage →\n // default/first available account. Pass `billingAccounts` so first-time\n // users with empty localStorage still land on the default account\n // (without it the hook's auto-select effect can't fire and the page\n // dead-ends on \"No billing account selected\").\n const { billingAccounts } = useBillingAccounts();\n const { selectedAccountId } = useBillingAccountSelection({\n orgId,\n billingAccounts,\n syncFromUrl: true,\n urlParamName: 'billingAccountId',\n });\n const billingAccountId = selectedAccountId ?? undefined;\n\n // Share the resolved account with `useBillingPermissions` so its\n // billing-scope permissions fetch observes the same ID. Without this,\n // a first-time user (no URL param, empty localStorage) would see the\n // page resolve to the default account here while the permissions hook\n // still sat at null — billing-scope-only admins would see AccessDenied\n // until a navigation/reload propagated the localStorage write.\n const permissions = useBillingPermissions({ billingAccountIdOverride: billingAccountId });\n\n const [roles, setRoles] = useState<Role[]>([]);\n const [actors, setActors] = useState<ActorRbacSummary[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Add-member form\n const [newActorId, setNewActorId] = useState('');\n const [newRoleId, setNewRoleId] = useState('');\n const [isAdding, setIsAdding] = useState(false);\n const [removeAssignmentId, setRemoveAssignmentId] = useState<string | null>(null);\n\n const gqlPost = useCallback(\n async <T,>(query: string, variables: Record<string, unknown>): Promise<T> => {\n return directBillingGraphqlRequest<T>({\n apiGatewayUrl,\n authToken,\n orgId,\n query,\n variables,\n });\n },\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setIsLoading(true);\n setError(null);\n try {\n const [rolesResp, actorsResp] = await Promise.all([\n gqlPost<{ roles: Role[] }>(ROLES_QUERY, { scopeId: billingAccountId }),\n gqlPost<{ actors: ActorRbacSummary[] }>(ACTORS_QUERY, {\n scopeId: billingAccountId,\n }),\n ]);\n setRoles(rolesResp.roles ?? []);\n setActors(actorsResp.actors ?? []);\n // Default the role-picker to \"Billing Viewer\" if available, else first role\n const viewer = (rolesResp.roles ?? []).find((r) => /viewer/i.test(r.name));\n setNewRoleId(viewer?.id ?? rolesResp.roles?.[0]?.id ?? '');\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to load team data');\n } finally {\n setIsLoading(false);\n }\n }, [billingAccountId, gqlPost]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n const sortedActors = useMemo(\n () =>\n [...actors].sort((a, b) => {\n const priA = Math.max(...a.roleAssignments.map((ra) => ra.role?.priority ?? 0), 0);\n const priB = Math.max(...b.roleAssignments.map((ra) => ra.role?.priority ?? 0), 0);\n return priB - priA;\n }),\n [actors]\n );\n\n const profileInputs = useMemo(\n () =>\n sortedActors.map((a) => ({\n actorId: a.actorId,\n actorType: a.actorType,\n })),\n [sortedActors]\n );\n const profileMap = useActorProfiles(profileInputs);\n\n const billingAccountName = useMemo(() => {\n if (!billingAccountId) return undefined;\n return billingAccounts.find((acct) => acct.id === billingAccountId)?.name ?? undefined;\n }, [billingAccountId, billingAccounts]);\n\n const handleAddMember = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!billingAccountId || !newActorId.trim() || !newRoleId) return;\n const trimmedActorId = newActorId.trim();\n if (!UUID_RE.test(trimmedActorId)) {\n setError('User ID must be a UUID (e.g. 1a2b3c4d-...). Get it from the user profile page.');\n return;\n }\n setIsAdding(true);\n setError(null);\n try {\n await gqlPost(ASSIGN_ROLE_MUTATION, {\n input: {\n actorId: trimmedActorId,\n actorType: 'USER',\n roleId: newRoleId,\n scopeId: billingAccountId,\n },\n });\n setNewActorId('');\n await loadData();\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to assign role');\n } finally {\n setIsAdding(false);\n }\n };\n\n const handleRemoveAssignment = async (assignmentId: string) => {\n setError(null);\n try {\n await gqlPost(REMOVE_ROLE_MUTATION, { assignmentId });\n await loadData();\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to remove role');\n }\n };\n\n if (permissions.isLoading) {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!permissions.isBillingAdmin) {\n if (embedded) return null;\n return (\n <AccessDenied message=\"You don't have permission to manage team and permissions for this billing account.\" />\n );\n }\n\n if (!billingAccountId) {\n if (embedded) return null;\n return (\n <div className=\"space-y-6 p-6\">\n <PageHeader\n title=\"Team & Permissions\"\n description=\"Select a billing account to manage who can access it.\"\n />\n <IllustratedEmptyState\n illustration=\"empty-people\"\n title=\"No billing account selected\"\n description=\"Pick one from the billing account selector to manage its members and roles.\"\n />\n </div>\n );\n }\n\n return (\n <div className={embedded ? 'space-y-6' : 'space-y-6 p-6'}>\n {embedded ? null : (\n <>\n <PageHeader\n title=\"Team & Permissions\"\n description=\"Control who can manage this billing account and what they can do.\"\n />\n\n <PagePurpose>\n Decide who on your team can see and manage this billing account. Assign the Billing\n Admin role (full access) or Billing Viewer (read-only) to specific people, and revoke\n access when someone no longer needs it.\n </PagePurpose>\n </>\n )}\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm\">\n <span className=\"font-medium text-text-primary\">Billing account:</span>{' '}\n <span className=\"text-text-primary\">{billingAccountName ?? 'Unnamed account'}</span>\n {billingAccountId ? (\n <details className=\"mt-2 text-xs text-text-secondary\">\n <summary className=\"cursor-pointer\">Account ID</summary>\n <span className=\"mt-1 inline-block font-mono\">{billingAccountId}</span>\n </details>\n ) : null}\n </div>\n\n {error && (\n <div className=\"rounded-lg border border-status-error-border/30 bg-status-error-bg/5 p-4 text-sm text-status-error-text\">\n {error}\n </div>\n )}\n\n {/* Add member form */}\n <form\n onSubmit={(e) => void handleAddMember(e)}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3\"\n >\n <h3 className=\"text-sm font-semibold text-text-primary\">Add member</h3>\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-3\">\n <div className=\"md:col-span-2\">\n <label htmlFor=\"newActorId\" className=\"block text-xs font-medium text-text-secondary\">\n User ID\n </label>\n <input\n id=\"newActorId\"\n type=\"text\"\n value={newActorId}\n onChange={(e) => setNewActorId(e.target.value)}\n placeholder=\"Paste the user ID from their profile page\"\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm\"\n required\n />\n <p className=\"mt-1 text-[11px] text-text-secondary\">\n Find this on the user&apos;s profile page.\n </p>\n </div>\n <div>\n <label htmlFor=\"newRoleId\" className=\"block text-xs font-medium text-text-secondary\">\n Role\n </label>\n <select\n id=\"newRoleId\"\n value={newRoleId}\n onChange={(e) => setNewRoleId(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n required\n >\n {roles.map((r) => (\n <option key={r.id} value={r.id}>\n {r.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n <button\n type=\"submit\"\n disabled={isAdding || !newActorId.trim() || !newRoleId}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:opacity-50\"\n >\n {isAdding ? 'Adding…' : 'Add member'}\n </button>\n </form>\n\n {/* Members table */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface\">\n <div className=\"border-b border-border-subtle px-4 py-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Members</h3>\n <p className=\"text-xs text-text-secondary\">\n Each member&apos;s role applies only to this billing account.\n </p>\n </div>\n {isLoading ? (\n <div className=\"p-6 text-sm text-text-secondary\">Loading…</div>\n ) : sortedActors.length === 0 ? (\n <div className=\"p-6 text-sm text-text-secondary\">No members assigned yet.</div>\n ) : (\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"border-b border-border-subtle text-left text-xs text-text-secondary\">\n <th className=\"px-4 py-2\">Member</th>\n <th className=\"px-4 py-2\">Type</th>\n <th className=\"px-4 py-2\">Roles</th>\n <th className=\"px-4 py-2 text-right\">Actions</th>\n </tr>\n </thead>\n <tbody>\n {sortedActors.map((actor) => (\n <tr key={actor.actorId} className=\"border-b border-border-subtle last:border-0\">\n <td className=\"px-4 py-3\">\n <ActorIdentity\n profile={\n profileMap[actor.actorId] ?? {\n actorId: actor.actorId,\n actorType: actor.actorType,\n displayName:\n actor.actorType.toLowerCase() === 'user'\n ? `User ${actor.actorId.slice(0, 8)}…`\n : actor.actorType,\n secondaryLabel: actor.actorId.slice(0, 12),\n resolved: false,\n }\n }\n variant=\"cell\"\n />\n </td>\n <td className=\"px-4 py-3 text-xs capitalize text-text-secondary\">\n {actor.actorType.toLowerCase()}\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"flex flex-wrap gap-1\">\n {actor.roleAssignments\n .filter((ra) => ra.isActive)\n .map((ra) => (\n <span\n key={ra.id}\n className=\"inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs\"\n >\n {ra.role?.name ?? ra.roleId}\n <button\n type=\"button\"\n onClick={() => setRemoveAssignmentId(ra.id)}\n className=\"text-text-secondary hover:text-status-error-text\"\n aria-label={`Remove ${ra.role?.name ?? 'role'}`}\n >\n ×\n </button>\n </span>\n ))}\n </div>\n </td>\n <td className=\"px-4 py-3 text-right\">\n <span className=\"text-xs text-text-secondary\">\n {actor.effectivePermissionCount ?? '—'} permissions\n </span>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </div>\n\n {/* Roles reference */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Available roles</h3>\n <p className=\"mt-1 text-xs text-text-secondary\">\n Roles are cloned from the system templates when a billing account is created.\n </p>\n <ul className=\"mt-3 space-y-2\">\n {roles.map((r) => (\n <li\n key={r.id}\n className=\"flex items-start gap-3 rounded-md border border-border-subtle bg-bg-surface p-3\"\n >\n <div className=\"flex-1\">\n <div className=\"text-sm font-medium text-text-primary\">{r.name}</div>\n {r.description && (\n <p className=\"mt-1 text-xs text-text-secondary\">{r.description}</p>\n )}\n </div>\n <span className=\"text-xs text-text-secondary\">priority {r.priority}</span>\n </li>\n ))}\n </ul>\n </div>\n\n <AlertDialog\n open={removeAssignmentId !== null}\n onOpenChange={(open) => {\n if (!open) setRemoveAssignmentId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Remove role assignment?</AlertDialogTitle>\n <AlertDialogDescription>\n Remove this role assignment? The member will lose the access this role grants for this\n billing account.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = removeAssignmentId;\n setRemoveAssignmentId(null);\n if (id) void handleRemoveAssignment(id);\n }}\n >\n Remove\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,IAAME,IAAU,mEA4BVC,IAAc,2KAYdC,IAAe,+TAmBfC,IAAuB,0KAWvBC,IAAuB,yHAWhBC,KAAqD,EAAE,cAAW,SAAY;CACzF,IAAM,EAAE,kBAAe,cAAW,aAAUC,EAAW,GAOjD,EAAE,uBAAoBC,EAAmB,GACzC,EAAE,yBAAsBC,EAA2B;EACvD;EACA;EACA,aAAa;EACb,cAAc;CAChB,CAAC,GACKC,IAAmBC,KAAqB,KAAA,GAQxCC,IAAcC,EAAsB,EAAE,0BAA0BH,EAAiB,CAAC,GAElF,CAACI,GAAOC,KAAYC,EAAiB,CAAC,CAAC,GACvC,CAACC,GAAQC,KAAaF,EAA6B,CAAC,CAAC,GACrD,CAACG,GAAWC,KAAgBJ,EAAS,EAAK,GAC1C,CAACK,GAAOC,KAAYN,EAAwB,IAAI,GAGhD,CAACO,GAAYC,KAAiBR,EAAS,EAAE,GACzC,CAACS,GAAWC,KAAgBV,EAAS,EAAE,GACvC,CAACW,GAAUC,KAAeZ,EAAS,EAAK,GACxC,CAACa,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K,WAAU;SAAyC,UAAA2B,EAAE;QAAU,CAAA,GACnEA,EAAE,eACD,kBAAC,KAAD;SAAG,WAAU;SAAoC,UAAAA,EAAE;QAAe,CAAA,CAEjE;OACL,CAAA,GAAA,kBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA,CAA8C,aAAUA,EAAE,QAAe;OACvE,CAAA,CAAA;MAVG,GAAAA,EAAE,EAUL,CACL;KACC,CAAA;IACD;;GAEL,kBAACsB,GAAD;IACE,MAAMlC,MAAuB;IAC7B,eAAe,MAAS;KACtB,AAAKmC,KAAMlC,EAAsB,IAAI;IACvC;IAEA,UAAA,kBAACmC,GAAD,EAAA,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAkB,0BAAyC,CAAA,GAC3D,kBAACC,IAAD,EAAA,UAAwB,0GAGA,CAAA,CACP,EAAA,CAAA,GACnB,kBAACC,IAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAmB,SAAyB,CAAA,GAC5C,kBAACC,GAAD;KACE,eAAe;MACb,IAAMC,IAAK3C;MAEX,AADAC,EAAsB,IAAI,GACtB0C,KAAIf,GAA4Be,CAAE;KACxC;KACD,UAAA;IAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;GACT,CAAA;EACV;C,KAzODd,IAAiB,OAEnB,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACC,GAAD;GACE,OAAM;GACN,aAAY;EACb,CAAA,GACD,kBAACc,IAAD;GACE,cAAa;GACb,OAAM;GACN,aAAY;EACb,CAAA,CACE;C,KAnBHf,IAAiB,OAEnB,kBAACgB,GAAD,EAAc,SAAQ,qFAAsF,CAAA;AAgPlH"}
1
+ {"version":3,"file":"TeamPermissionsPage.js","names":["_Fragment","Fragment$1","UUID_RE","ROLES_QUERY","ACTORS_QUERY","ASSIGN_ROLE_MUTATION","REMOVE_ROLE_MUTATION","TeamPermissionsPage","useBilling","useBillingAccounts","useBillingAccountSelection","billingAccountId","selectedAccountId","permissions","useBillingPermissions","roles","setRoles","useState","actors","setActors","isLoading","setIsLoading","error","setError","newActorId","setNewActorId","newRoleId","setNewRoleId","isAdding","setIsAdding","removeAssignmentId","setRemoveAssignmentId","gqlPost","useCallback","directBillingGraphqlRequest","apiGatewayUrl","authToken","orgId","loadData","rolesResp","actorsResp","viewer","r","err","sortedActors","useMemo","priA","a","ra","b","profileInputs","profileMap","useActorProfiles","billingAccountName","billingAccounts","acct","handleAddMember","trimmedActorId","handleRemoveAssignment","embedded","PageHeader","PagePurpose","ActorIdentity","actor","AlertDialog","open","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","id","IllustratedEmptyState","AccessDenied"],"sources":["../../../../../src/billing/modules/settings/pages/TeamPermissionsPage.tsx"],"sourcesContent":["/**\n * Settings Module - Team & Permissions Page\n *\n * Lets a Billing Admin manage billing-scope role assignments for a specific\n * billing account. Calls global-rbac-svc directly via the same gateway URL\n * used by the rest of the billing module.\n *\n * Scope: `scopeType: \"billing\"`, `scopeId: <billingAccountId>`\n * Roles cloned per billing account at creation time:\n * - Billing Admin (full access to this billing account)\n * - Billing Viewer (read-only access to this billing account)\n */\nimport { useCallback, useEffect, useMemo, useState, type FC } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n PagePurpose,\n IllustratedEmptyState,\n} from '@burdenoff/fe-libs/ui';\nimport { useBilling } from '../../../providers/BillingProvider';\nimport { AccessDenied, ActorIdentity, PageHeader } from '../../../shared/components';\nimport { useBillingPermissions } from '../../../hooks/useBillingPermissions';\nimport { useBillingAccountSelection } from '../../../hooks/useBillingAccountSelection';\nimport { useBillingAccounts } from '../../dashboard/hooks/useDashboard';\nimport { directBillingGraphqlRequest } from '../../../shared/utils';\nimport { useActorProfiles } from '../../../shared/hooks';\n\n// Basic UUID-v1-through-v5 shape — accept any 8-4-4-4-12 hex pattern.\n// We intentionally don't strictly validate the version nibble; the rbac\n// service is the authoritative ID validator.\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\ninterface Role {\n id: string;\n name: string;\n description?: string | null;\n priority: number;\n isSystem: boolean;\n}\n\ninterface ActorRoleAssignment {\n id: string;\n actorId: string;\n actorType: string;\n roleId: string;\n scopeId: string;\n isActive: boolean;\n expiresAt?: string | null;\n role?: Role;\n}\n\ninterface ActorRbacSummary {\n actorId: string;\n actorType: string;\n roleAssignments: ActorRoleAssignment[];\n effectivePermissionCount?: number;\n}\n\nconst ROLES_QUERY = `\n query BillingScopeRoles($scopeId: String!) {\n roles(scopeId: $scopeId) {\n id\n name\n description\n priority\n isSystem\n }\n }\n`;\n\nconst ACTORS_QUERY = `\n query BillingScopeActors($scopeId: String!) {\n actors(scopeId: $scopeId) {\n actorId\n actorType\n roleAssignments {\n id\n actorId\n actorType\n roleId\n scopeId\n isActive\n expiresAt\n role { id name priority }\n }\n }\n }\n`;\n\nconst ASSIGN_ROLE_MUTATION = `\n mutation AssignBillingRole($input: AssignRoleInput!) {\n assignRoleToActor(input: $input) {\n id\n actorId\n roleId\n scopeId\n }\n }\n`;\n\nconst REMOVE_ROLE_MUTATION = `\n mutation RemoveBillingRole($assignmentId: String!) {\n removeRoleFromActor(assignmentId: $assignmentId)\n }\n`;\n\ninterface TeamPermissionsPageProps {\n /** Rendered inside the Settings page: no page header or outer padding, and silent when not allowed. */\n embedded?: boolean;\n}\n\nexport const TeamPermissionsPage: FC<TeamPermissionsPageProps> = ({ embedded = false }) => {\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n\n // Resolution priority: URL `?billingAccountId=` → persisted localStorage →\n // default/first available account. Pass `billingAccounts` so first-time\n // users with empty localStorage still land on the default account\n // (without it the hook's auto-select effect can't fire and the page\n // dead-ends on \"No billing account selected\").\n const { billingAccounts } = useBillingAccounts();\n const { selectedAccountId } = useBillingAccountSelection({\n orgId,\n billingAccounts,\n syncFromUrl: true,\n urlParamName: 'billingAccountId',\n });\n const billingAccountId = selectedAccountId ?? undefined;\n\n // Share the resolved account with `useBillingPermissions` so its\n // billing-scope permissions fetch observes the same ID. Without this,\n // a first-time user (no URL param, empty localStorage) would see the\n // page resolve to the default account here while the permissions hook\n // still sat at null — billing-scope-only admins would see AccessDenied\n // until a navigation/reload propagated the localStorage write.\n const permissions = useBillingPermissions({ billingAccountIdOverride: billingAccountId });\n\n const [roles, setRoles] = useState<Role[]>([]);\n const [actors, setActors] = useState<ActorRbacSummary[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Add-member form\n const [newActorId, setNewActorId] = useState('');\n const [newRoleId, setNewRoleId] = useState('');\n const [isAdding, setIsAdding] = useState(false);\n const [removeAssignmentId, setRemoveAssignmentId] = useState<string | null>(null);\n\n const gqlPost = useCallback(\n async <T,>(query: string, variables: Record<string, unknown>): Promise<T> => {\n return directBillingGraphqlRequest<T>({\n apiGatewayUrl,\n authToken,\n orgId,\n query,\n variables,\n });\n },\n [apiGatewayUrl, authToken, orgId]\n );\n\n const loadData = useCallback(async () => {\n if (!billingAccountId) return;\n setIsLoading(true);\n setError(null);\n try {\n const [rolesResp, actorsResp] = await Promise.all([\n gqlPost<{ roles: Role[] }>(ROLES_QUERY, { scopeId: billingAccountId }),\n gqlPost<{ actors: ActorRbacSummary[] }>(ACTORS_QUERY, {\n scopeId: billingAccountId,\n }),\n ]);\n setRoles(rolesResp.roles ?? []);\n setActors(actorsResp.actors ?? []);\n // Default the role-picker to \"Billing Viewer\" if available, else first role\n const viewer = (rolesResp.roles ?? []).find((r) => /viewer/i.test(r.name));\n setNewRoleId(viewer?.id ?? rolesResp.roles?.[0]?.id ?? '');\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to load team data');\n } finally {\n setIsLoading(false);\n }\n }, [billingAccountId, gqlPost]);\n\n useEffect(() => {\n void loadData();\n }, [loadData]);\n\n const sortedActors = useMemo(\n () =>\n [...actors].sort((a, b) => {\n const priA = Math.max(...a.roleAssignments.map((ra) => ra.role?.priority ?? 0), 0);\n const priB = Math.max(...b.roleAssignments.map((ra) => ra.role?.priority ?? 0), 0);\n return priB - priA;\n }),\n [actors]\n );\n\n const profileInputs = useMemo(\n () =>\n sortedActors.map((a) => ({\n actorId: a.actorId,\n actorType: a.actorType,\n })),\n [sortedActors]\n );\n const profileMap = useActorProfiles(profileInputs);\n\n const billingAccountName = useMemo(() => {\n if (!billingAccountId) return undefined;\n return billingAccounts.find((acct) => acct.id === billingAccountId)?.name ?? undefined;\n }, [billingAccountId, billingAccounts]);\n\n const handleAddMember = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!billingAccountId || !newActorId.trim() || !newRoleId) return;\n const trimmedActorId = newActorId.trim();\n if (!UUID_RE.test(trimmedActorId)) {\n setError('User ID must be a UUID (e.g. 1a2b3c4d-...). Get it from the user profile page.');\n return;\n }\n setIsAdding(true);\n setError(null);\n try {\n await gqlPost(ASSIGN_ROLE_MUTATION, {\n input: {\n actorId: trimmedActorId,\n actorType: 'USER',\n roleId: newRoleId,\n scopeId: billingAccountId,\n },\n });\n setNewActorId('');\n await loadData();\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to assign role');\n } finally {\n setIsAdding(false);\n }\n };\n\n const handleRemoveAssignment = async (assignmentId: string) => {\n setError(null);\n try {\n await gqlPost(REMOVE_ROLE_MUTATION, { assignmentId });\n await loadData();\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Failed to remove role');\n }\n };\n\n if (permissions.isLoading) {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!permissions.isBillingAdmin) {\n if (embedded) return null;\n return (\n <AccessDenied message=\"You don't have permission to manage team and permissions for this billing account.\" />\n );\n }\n\n if (!billingAccountId) {\n if (embedded) return null;\n return (\n <div className=\"space-y-6 p-6\">\n <PageHeader\n title=\"Team & Permissions\"\n description=\"Select a billing account to manage who can access it.\"\n />\n <IllustratedEmptyState\n illustration=\"empty-people\"\n title=\"No billing account selected\"\n description=\"Pick one from the billing account selector to manage its members and roles.\"\n />\n </div>\n );\n }\n\n return (\n <div className={embedded ? 'space-y-6' : 'space-y-6 p-6'}>\n {embedded ? null : (\n <>\n <PageHeader\n title=\"Team & Permissions\"\n description=\"Control who can manage this billing account and what they can do.\"\n />\n\n <PagePurpose>\n Decide who on your team can see and manage this billing account. Assign the Billing\n Admin role (full access) or Billing Viewer (read-only) to specific people, and revoke\n access when someone no longer needs it.\n </PagePurpose>\n </>\n )}\n\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm\">\n <span className=\"font-medium text-text-primary\">Billing account:</span>{' '}\n <span className=\"text-text-primary\">{billingAccountName ?? 'Unnamed account'}</span>\n {billingAccountId ? (\n <details className=\"mt-2 text-xs text-text-secondary\">\n <summary className=\"cursor-pointer\">Account ID</summary>\n <span className=\"mt-1 inline-block font-mono\">{billingAccountId}</span>\n </details>\n ) : null}\n </div>\n\n {error && (\n <div className=\"rounded-lg border border-status-error-border/30 bg-status-error-bg/5 p-4 text-sm text-status-error-text\">\n {error}\n </div>\n )}\n\n {/* Add member form */}\n <form\n onSubmit={(e) => void handleAddMember(e)}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-4 space-y-3\"\n >\n <h3 className=\"text-sm font-semibold text-text-primary\">Add member</h3>\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-3\">\n <div className=\"md:col-span-2\">\n <label htmlFor=\"newActorId\" className=\"block text-xs font-medium text-text-secondary\">\n User ID\n </label>\n <input\n id=\"newActorId\"\n type=\"text\"\n value={newActorId}\n onChange={(e) => setNewActorId(e.target.value)}\n placeholder=\"Paste the user ID from their profile page\"\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm\"\n required\n />\n <p className=\"mt-1 text-[11px] text-text-secondary\">\n Find this on the user&apos;s profile page.\n </p>\n </div>\n <div>\n <label htmlFor=\"newRoleId\" className=\"block text-xs font-medium text-text-secondary\">\n Role\n </label>\n <select\n id=\"newRoleId\"\n value={newRoleId}\n onChange={(e) => setNewRoleId(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n required\n >\n {roles.map((r) => (\n <option key={r.id} value={r.id}>\n {r.name}\n </option>\n ))}\n </select>\n </div>\n </div>\n <button\n type=\"submit\"\n disabled={isAdding || !newActorId.trim() || !newRoleId}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:opacity-50\"\n >\n {isAdding ? 'Adding…' : 'Add member'}\n </button>\n </form>\n\n {/* Members table */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface\">\n <div className=\"border-b border-border-subtle px-4 py-3\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Members</h3>\n <p className=\"text-xs text-text-secondary\">\n Each member&apos;s role applies only to this billing account.\n </p>\n </div>\n {isLoading ? (\n <div className=\"p-6 text-sm text-text-secondary\">Loading…</div>\n ) : sortedActors.length === 0 ? (\n <div className=\"p-6 text-sm text-text-secondary\">No members assigned yet.</div>\n ) : (\n // overflow-x-auto (BOFF-15045): the four columns need ~480 px, so on a\n // phone the table scrolls inside its card instead of pushing the page\n // sideways. Wherever the table fits (every desktop width) nothing scrolls.\n <div className=\"overflow-x-auto\" data-testid=\"billing-team-members-scroll\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"border-b border-border-subtle text-left text-xs text-text-secondary\">\n <th className=\"px-4 py-2\">Member</th>\n <th className=\"px-4 py-2\">Type</th>\n <th className=\"px-4 py-2\">Roles</th>\n <th className=\"px-4 py-2 text-right\">Actions</th>\n </tr>\n </thead>\n <tbody>\n {sortedActors.map((actor) => (\n <tr key={actor.actorId} className=\"border-b border-border-subtle last:border-0\">\n <td className=\"px-4 py-3\">\n <ActorIdentity\n profile={\n profileMap[actor.actorId] ?? {\n actorId: actor.actorId,\n actorType: actor.actorType,\n displayName:\n actor.actorType.toLowerCase() === 'user'\n ? `User ${actor.actorId.slice(0, 8)}…`\n : actor.actorType,\n secondaryLabel: actor.actorId.slice(0, 12),\n resolved: false,\n }\n }\n variant=\"cell\"\n />\n </td>\n <td className=\"px-4 py-3 text-xs capitalize text-text-secondary\">\n {actor.actorType.toLowerCase()}\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"flex flex-wrap gap-1\">\n {actor.roleAssignments\n .filter((ra) => ra.isActive)\n .map((ra) => (\n <span\n key={ra.id}\n className=\"inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs\"\n >\n {ra.role?.name ?? ra.roleId}\n <button\n type=\"button\"\n onClick={() => setRemoveAssignmentId(ra.id)}\n className=\"text-text-secondary hover:text-status-error-text\"\n aria-label={`Remove ${ra.role?.name ?? 'role'}`}\n >\n ×\n </button>\n </span>\n ))}\n </div>\n </td>\n <td className=\"px-4 py-3 text-right\">\n <span className=\"text-xs text-text-secondary\">\n {actor.effectivePermissionCount ?? '—'} permissions\n </span>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n\n {/* Roles reference */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-4\">\n <h3 className=\"text-sm font-semibold text-text-primary\">Available roles</h3>\n <p className=\"mt-1 text-xs text-text-secondary\">\n Roles are cloned from the system templates when a billing account is created.\n </p>\n <ul className=\"mt-3 space-y-2\">\n {roles.map((r) => (\n <li\n key={r.id}\n className=\"flex items-start gap-3 rounded-md border border-border-subtle bg-bg-surface p-3\"\n >\n <div className=\"flex-1\">\n <div className=\"text-sm font-medium text-text-primary\">{r.name}</div>\n {r.description && (\n <p className=\"mt-1 text-xs text-text-secondary\">{r.description}</p>\n )}\n </div>\n <span className=\"text-xs text-text-secondary\">priority {r.priority}</span>\n </li>\n ))}\n </ul>\n </div>\n\n <AlertDialog\n open={removeAssignmentId !== null}\n onOpenChange={(open) => {\n if (!open) setRemoveAssignmentId(null);\n }}\n >\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Remove role assignment?</AlertDialogTitle>\n <AlertDialogDescription>\n Remove this role assignment? The member will lose the access this role grants for this\n billing account.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n const id = removeAssignmentId;\n setRemoveAssignmentId(null);\n if (id) void handleRemoveAssignment(id);\n }}\n >\n Remove\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,IAAME,IAAU,mEA4BVC,IAAc,2KAYdC,IAAe,+TAmBfC,IAAuB,0KAWvBC,IAAuB,yHAWhBC,KAAqD,EAAE,cAAW,SAAY;CACzF,IAAM,EAAE,kBAAe,cAAW,aAAUC,EAAW,GAOjD,EAAE,uBAAoBC,EAAmB,GACzC,EAAE,yBAAsBC,EAA2B;EACvD;EACA;EACA,aAAa;EACb,cAAc;CAChB,CAAC,GACKC,IAAmBC,KAAqB,KAAA,GAQxCC,IAAcC,EAAsB,EAAE,0BAA0BH,EAAiB,CAAC,GAElF,CAACI,GAAOC,KAAYC,EAAiB,CAAC,CAAC,GACvC,CAACC,GAAQC,KAAaF,EAA6B,CAAC,CAAC,GACrD,CAACG,GAAWC,KAAgBJ,EAAS,EAAK,GAC1C,CAACK,GAAOC,KAAYN,EAAwB,IAAI,GAGhD,CAACO,GAAYC,KAAiBR,EAAS,EAAE,GACzC,CAACS,GAAWC,KAAgBV,EAAS,EAAE,GACvC,CAACW,GAAUC,KAAeZ,EAAS,EAAK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 "version": "2026.1116.1",
4
4
  "description": "Billing microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "files": [