@usethrottle/auth 0.2.2 → 0.2.3
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.
- package/dist/{chunk-HGBAIM6B.js → chunk-2DREGJUF.js} +2 -2
- package/dist/{chunk-SZ427BQ3.js → chunk-NCSTIPJF.js} +8 -1
- package/dist/{chunk-SZ427BQ3.js.map → chunk-NCSTIPJF.js.map} +1 -1
- package/dist/{chunk-AIXBUDOT.js → chunk-ST77QX7X.js} +12 -1
- package/dist/chunk-ST77QX7X.js.map +1 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/react/components/index.cjs +439 -297
- package/dist/react/components/index.cjs.map +1 -1
- package/dist/react/components/index.d.cts +24 -8
- package/dist/react/components/index.d.ts +24 -8
- package/dist/react/components/index.js +409 -286
- package/dist/react/components/index.js.map +1 -1
- package/dist/react/forms/index.cjs +11 -0
- package/dist/react/forms/index.cjs.map +1 -1
- package/dist/react/forms/index.js +2 -2
- package/dist/react/index.cjs +7 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +24 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react/index.js +2 -2
- package/dist/styles.css +21 -2
- package/package.json +1 -1
- package/dist/chunk-AIXBUDOT.js.map +0 -1
- /package/dist/{chunk-HGBAIM6B.js.map → chunk-2DREGJUF.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/react/components/provider.tsx","../../../src/react/components/appearance.tsx","../../../src/react/components/contrast.ts","../../../src/react/components/branding.tsx","../../../src/react/components/localization.tsx","../../../src/react/components/styles.ts","../../../src/react/components/auth/StepUpDialog.tsx","../../../src/react/components/surface.tsx","../../../src/react/components/primitives/Card.tsx","../../../src/react/components/primitives/Spinner.tsx","../../../src/react/components/primitives/Button.tsx","../../../src/react/components/primitives/Field.tsx","../../../src/react/components/primitives/Alert.tsx","../../../src/react/components/primitives/Skeleton.tsx","../../../src/react/components/primitives/Modal.tsx","../../../src/react/components/primitives/Dropdown.tsx","../../../src/react/components/primitives/Tabs.tsx","../../../src/react/components/primitives/DataTable.tsx","../../../src/react/components/primitives/EmptyState.tsx","../../../src/react/components/primitives/Avatar.tsx","../../../src/react/components/primitives/Badge.tsx","../../../src/react/components/auth/AuthModal.tsx","../../../src/react/components/auth/AuthFlow.tsx","../../../src/react/components/auth/SignIn.tsx","../../../src/react/components/useAction.ts","../../../src/react/components/auth/SignUp.tsx","../../../src/react/components/auth/ForgotPassword.tsx","../../../src/react/components/auth/ResetPassword.tsx","../../../src/react/components/auth/VerifyEmail.tsx","../../../src/react/components/account/AccountModal.tsx","../../../src/react/components/account/AccountDashboard.tsx","../../../src/react/components/account/VerifyEmailBanner.tsx","../../../src/react/components/account/icons.tsx","../../../src/react/components/account/ProfilePanel.tsx","../../../src/react/components/account/PanelState.tsx","../../../src/react/components/account/AddressesPanel.tsx","../../../src/react/components/account/AddressForm.tsx","../../../src/react/components/account/PaymentMethodsPanel.tsx","../../../src/react/components/account/OrdersPanel.tsx","../../../src/react/components/format.ts","../../../src/react/components/account/OrderStatus.tsx","../../../src/react/components/account/OrderDetail.tsx","../../../src/react/components/account/InvoicesPanel.tsx","../../../src/react/components/account/InvoiceDetail.tsx","../../../src/react/components/account/SubscriptionsPanel.tsx","../../../src/react/components/account/SecurityPanel.tsx","../../../src/react/components/account/device.ts","../../../src/react/components/auth/SignInButton.tsx","../../../src/react/components/auth/SignUpButton.tsx","../../../src/react/components/auth/SignOutButton.tsx","../../../src/react/components/auth/SignInPage.tsx","../../../src/react/components/auth/SignUpPage.tsx","../../../src/react/components/guards.tsx","../../../src/react/components/UserButton.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { createThrottleAuth, type ThrottleAuth } from '../../client';\nimport { createAccount } from '../../account';\nimport type { ThrottleAuthConfig } from '../../types';\nimport { ThrottleAuthProvider } from '../context';\nimport { AppearanceProvider, type ThrottleAppearance } from './appearance';\nimport { BrandLogoProvider } from './branding';\nimport { LocalizationProvider, type ThrottleLocalization } from './localization';\nimport { useInjectStyles } from './styles';\nimport { StepUpDialog } from './auth/StepUpDialog';\nimport { AuthModal } from './auth/AuthModal';\nimport { AccountModal } from './account/AccountModal';\nimport type { AccountTab } from './account/AccountDashboard';\n\nconst warned = new Set<string>();\n\n/** One warning per problem per page, and only in development. */\nexport function warnOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(key)) return;\n warned.add(key);\n // eslint-disable-next-line no-console\n console.warn(`[@usethrottle/auth] ${message}`);\n}\n\nexport interface ThrottleProviderProps extends Partial<ThrottleAuthConfig> {\n publishableKey: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Default logo for the `branded` card variant. A card's own `logo` prop wins over this. */\n logo?: ReactNode;\n /** Default true. Set false and import `@usethrottle/auth/styles.css` for a flash-free SSR paint. */\n injectStyles?: boolean;\n /** Returns the guest cart id to attach after a successful sign-in or sign-up. */\n claimCartOnSignIn?: () => string | null | undefined;\n /** Inject a pre-built client. Tests use it. */\n auth?: ThrottleAuth;\n children: ReactNode;\n /** @internal test seam — receives the step-up callback handed to the core. */\n __captureStepUp?: (fn: () => Promise<string | null>) => void;\n}\n\ntype Overlay = 'signIn' | 'signUp' | 'account' | null;\n\n/**\n * @internal Not exported from the package. `SignInButton`/`SignUpButton` read\n * it directly (falling back to owning their own local modal state when it is\n * null, i.e. mounted under a plain `ThrottleAuthProvider`); merchants use the\n * public `useThrottle()` hook below instead.\n */\nexport interface ThrottleUIContextValue {\n overlay: Overlay;\n openSignIn(onSuccess?: () => void): void;\n openSignUp(onSuccess?: () => void): void;\n /** `tabs` restricts which panels the shared account overlay shows;\n * `restoreFocusTo` names where focus returns when the opener is itself\n * unmounted by the same click. */\n openAccount(opts?: { tabs?: AccountTab[]; restoreFocusTo?: Element | null }): void;\n close(): void;\n}\n\nexport const ThrottleUIContext = createContext<ThrottleUIContextValue | null>(null);\n\nexport interface UseThrottleResult {\n openSignIn(): void;\n openSignUp(): void;\n openAccount(): void;\n close(): void;\n isOpen: boolean;\n}\n\n/**\n * The equivalent of Clerk's `useClerk().openSignIn()`. Lets a merchant open\n * the auth/account overlay from their own UI — a pricing CTA, a gated action,\n * a keyboard shortcut — driving the SAME modal `SignInButton`/`SignUpButton`\n * open, rather than a second competing one.\n *\n * Outside a `<ThrottleProvider>` (e.g. under a plain `ThrottleAuthProvider`)\n * this degrades to no-op functions and `isOpen: false`, with a one-time\n * development warning, rather than throwing.\n */\nexport function useThrottle(): UseThrottleResult {\n const ctx = useContext(ThrottleUIContext);\n if (!ctx) {\n warnOnce(\n 'use-throttle-no-provider',\n 'useThrottle() was called without a <ThrottleProvider> above it in the tree. ' +\n 'openSignIn/openSignUp/openAccount will do nothing — wrap your app in <ThrottleProvider> to use them.',\n );\n return { openSignIn: () => {}, openSignUp: () => {}, openAccount: () => {}, close: () => {}, isOpen: false };\n }\n return {\n openSignIn: () => ctx.openSignIn(),\n openSignUp: () => ctx.openSignUp(),\n openAccount: ctx.openAccount,\n close: ctx.close,\n isOpen: ctx.overlay !== null,\n };\n}\n\n/**\n * Composes rather than replaces. It creates the client (so it can supply\n * `onStepUpRequired` at construction time, which is the only moment the core\n * reads it) and hands it to the existing `<ThrottleAuthProvider>` through the\n * `auth` injection prop that already exists for this purpose. Every hook —\n * useAuth, useCustomer, useOrders — keeps working underneath unchanged.\n *\n * It also owns the ONE modal overlay (sign-in/sign-up/account) alongside the\n * step-up dialog it already hosts, so a `SignInButton`/`SignUpButton` click\n * and a programmatic `useThrottle().openSignIn()` call always drive the same\n * dialog rather than stacking two.\n */\nexport function ThrottleProvider(props: ThrottleProviderProps) {\n const {\n publishableKey, baseUrl, storage, appearance, localization, logo,\n injectStyles = true, claimCartOnSignIn, auth: injected, children, __captureStepUp,\n } = props;\n\n useInjectStyles(injectStyles);\n\n const [stepUpOpen, setStepUpOpen] = useState(false);\n // The bridge. The dialog renders below the client that needs its answer, so\n // the resolver travels through a ref rather than through props.\n const resolveStepUp = useRef<((password: string | null) => void) | null>(null);\n // Read through a ref so a merchant passing an inline arrow function does not\n // rebuild the client on every parent render.\n const claimRef = useRef(claimCartOnSignIn);\n claimRef.current = claimCartOnSignIn;\n\n // The one piece of overlay state. `onOverlaySuccess` is a bookkeeping ref\n // alongside it — mirroring `resolveStepUp` above — not competing state: it\n // answers \"what happens on success\", not \"is something open\".\n const [overlay, setOverlay] = useState<Overlay>(null);\n const overlayRestoreFocus = useRef<Element | null>(null);\n const [accountTabs, setAccountTabs] = useState<AccountTab[] | undefined>(undefined);\n const onOverlaySuccess = useRef<(() => void) | null>(null);\n\n const openSignIn = useCallback((onSuccess?: () => void) => {\n onOverlaySuccess.current = onSuccess ?? null;\n setOverlay('signIn');\n }, []);\n const openSignUp = useCallback((onSuccess?: () => void) => {\n onOverlaySuccess.current = onSuccess ?? null;\n setOverlay('signUp');\n }, []);\n const openAccount = useCallback((opts?: { tabs?: AccountTab[]; restoreFocusTo?: Element | null }) => {\n onOverlaySuccess.current = null;\n // A caller that is itself being unmounted by the same click (UserButton's\n // menu item) must name where focus goes back to, because by the time the\n // modal mounts the opener is gone and the browser has already reset\n // activeElement to <body>.\n overlayRestoreFocus.current = opts?.restoreFocusTo ?? null;\n setAccountTabs(opts?.tabs);\n setOverlay('account');\n }, []);\n const closeOverlay = useCallback(() => {\n onOverlaySuccess.current = null;\n overlayRestoreFocus.current = null;\n setOverlay(null);\n }, []);\n const handleOverlaySuccess = useCallback(() => {\n const fn = onOverlaySuccess.current;\n onOverlaySuccess.current = null;\n setOverlay(null);\n fn?.();\n }, []);\n\n const ui = useMemo<ThrottleUIContextValue>(\n () => ({ overlay, openSignIn, openSignUp, openAccount, close: closeOverlay }),\n [overlay, openSignIn, openSignUp, openAccount, closeOverlay],\n );\n\n // Hoisted out of the memo below and stabilized with an empty deps array: it\n // closes only over refs and a setState, neither of which ever change, so it\n // must keep one identity for the client's whole life regardless of what\n // triggers the memo to recompute (e.g. a new `auth` prop object).\n const askForStepUp = useCallback(\n () =>\n new Promise<string | null>((resolve) => {\n resolveStepUp.current = resolve;\n setStepUpOpen(true);\n }),\n [],\n );\n\n const auth = useMemo<ThrottleAuth>(() => {\n __captureStepUp?.(askForStepUp);\n\n const client =\n injected ?? createThrottleAuth({ publishableKey, baseUrl, storage, onStepUpRequired: askForStepUp });\n\n // Claim on the explicit entry points only. `restore()` also transitions the\n // snapshot to authenticated on every page load, and re-claiming there would\n // fire a pointless request per visit.\n const account = createAccount(client);\n const claim = async () => {\n const cartId = claimRef.current?.();\n if (!cartId) return;\n try {\n await account.claimCart(cartId);\n } catch (err) {\n // A cart that will not attach must never block a sign-in.\n warnOnce('claim-cart', `claimCartOnSignIn failed: ${(err as Error)?.message ?? err}`);\n }\n };\n\n // Spreading is safe: every method on the client closes over its own state\n // rather than using `this`. The provider test asserts all sixteen survive.\n return {\n ...client,\n async signIn(email: string, password: string) {\n await client.signIn(email, password);\n await claim();\n },\n async register(email: string, password: string) {\n const result = await client.register(email, password);\n // `pending` means no session exists yet, so there is nothing to claim on to.\n if (result.status === 'active') await claim();\n return result;\n },\n };\n // `storage`, `claimCartOnSignIn` and `__captureStepUp` are deliberately not\n // dependencies — same reasoning as ThrottleAuthProvider's own memo.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [injected, publishableKey, baseUrl]);\n\n const finishStepUp = (password: string | null) => {\n setStepUpOpen(false);\n const resolve = resolveStepUp.current;\n resolveStepUp.current = null;\n resolve?.(password);\n };\n\n const authOverlayOpen = overlay === 'signIn' || overlay === 'signUp';\n\n return (\n <AppearanceProvider value={appearance ?? {}}>\n <LocalizationProvider value={localization ?? {}}>\n <BrandLogoProvider value={logo ?? null}>\n <ThrottleAuthProvider auth={auth} publishableKey={publishableKey}>\n <ThrottleUIContext.Provider value={ui}>\n {children}\n <StepUpDialog open={stepUpOpen} onResolve={finishStepUp} />\n {/* Keyed on the overlay kind so each open() call mounts `AuthFlow`\n fresh with the view that call asked for, rather than reusing a\n still-mounted instance that would ignore a new `initialView`. */}\n <AuthModal\n key={overlay === 'signUp' ? 'signUp' : 'signIn'}\n open={authOverlayOpen}\n onClose={closeOverlay}\n initialView={overlay === 'signUp' ? 'signUp' : 'signIn'}\n afterSignIn={handleOverlaySuccess}\n afterSignUp={handleOverlaySuccess}\n />\n <AccountModal open={overlay === 'account'} onClose={closeOverlay} tabs={accountTabs} restoreFocusTo={overlayRestoreFocus.current} />\n </ThrottleUIContext.Provider>\n </ThrottleAuthProvider>\n </BrandLogoProvider>\n </LocalizationProvider>\n </AppearanceProvider>\n );\n}\n","import { createContext, useContext, useMemo } from 'react';\nimport type { ComponentType, CSSProperties, ReactNode } from 'react';\nimport { dangerCollisionWarning, primaryContrastWarning } from './contrast';\n\nexport type ThrottleThemeName = 'light' | 'dark' | 'auto';\n\n/**\n * camelCase key → custom property. Written out rather than derived by\n * camel-to-kebab: `borderRadius` maps to `--throttle-radius`, not\n * `--throttle-border-radius`, and three other keys are similarly irregular.\n * An algorithm would silently produce properties the stylesheet never reads.\n */\n/**\n * Dev-only, and once per distinct pairing — `useAppearance` runs in every\n * component, so an unguarded console.warn would fire dozens of times per page\n * and train integrators to ignore it.\n */\nconst warnedPairings = new Set<string>();\nfunction warnOnUnreadablePrimary(\n variables: ThrottleVariables,\n theme: 'light' | 'dark' | 'auto',\n): void {\n if (process.env.NODE_ENV === 'production') return;\n const key = `${variables.colorPrimary}|${variables.colorPrimaryForeground}|${variables.colorDanger}|${theme}`;\n if (warnedPairings.has(key)) return;\n const messages = [\n primaryContrastWarning(variables, theme),\n dangerCollisionWarning(variables, theme),\n ].filter(Boolean) as string[];\n if (messages.length === 0) return;\n warnedPairings.add(key);\n for (const m of messages) console.warn(m);\n}\n\nconst VARIABLE_PROPERTY = {\n colorPrimary: '--throttle-color-primary',\n colorPrimaryForeground: '--throttle-color-primary-foreground',\n colorBackground: '--throttle-color-background',\n colorSurface: '--throttle-color-surface',\n colorForeground: '--throttle-color-foreground',\n colorMuted: '--throttle-color-muted',\n colorMutedForeground: '--throttle-color-muted-foreground',\n colorBorder: '--throttle-color-border',\n colorBorderControl: '--throttle-color-border-control',\n colorDanger: '--throttle-color-danger',\n colorDangerSurface: '--throttle-color-danger-surface',\n colorDangerBorder: '--throttle-color-danger-border',\n colorSuccess: '--throttle-color-success',\n colorSuccessSurface: '--throttle-color-success-surface',\n colorSuccessBorder: '--throttle-color-success-border',\n colorWarning: '--throttle-color-warning',\n colorWarningSurface: '--throttle-color-warning-surface',\n colorWarningBorder: '--throttle-color-warning-border',\n fontFamily: '--throttle-font-family',\n fontSize: '--throttle-font-size',\n borderRadius: '--throttle-radius',\n borderWidth: '--throttle-border-width',\n spacing: '--throttle-spacing',\n shadowCard: '--throttle-shadow-card',\n shadowPopover: '--throttle-shadow-popover',\n transition: '--throttle-transition',\n zModal: '--throttle-z-modal',\n zPopover: '--throttle-z-popover',\n} as const;\n\nexport type ThrottleVariables = Partial<Record<keyof typeof VARIABLE_PROPERTY, string>>;\n\n/**\n * Every addressable part of every component. A merchant maps any of these to a\n * className through `appearance.elements`. The list is the API: adding a\n * rendered element without adding its key here ships something a merchant\n * cannot restyle, which the drift test in Task 15 catches.\n */\nexport const THROTTLE_ELEMENT_KEYS = [\n // shared primitives\n 'card', 'card.header', 'card.title', 'card.description', 'card.body', 'card.footer', 'card.logo',\n 'field', 'field.label', 'field.input', 'field.hint', 'field.error', 'field.group',\n 'button', 'alert', 'spinner', 'skeleton',\n 'avatar', 'badge',\n 'emptyState', 'emptyState.title', 'emptyState.description',\n 'modal.overlay', 'modal.container', 'modal.closeButton',\n 'dropdown.trigger', 'dropdown.menu', 'dropdown.item', 'dropdown.separator',\n 'tabs.list', 'tabs.tab',\n 'table', 'table.head', 'table.row', 'table.cell',\n // auth\n 'signIn.root', 'signIn.title', 'signIn.logo', 'signIn.emailField', 'signIn.passwordField',\n 'signIn.submitButton', 'signIn.forgotLink', 'signIn.switchLink',\n 'signUp.root', 'signUp.title', 'signUp.logo', 'signUp.emailField', 'signUp.passwordField',\n 'signUp.submitButton', 'signUp.switchLink',\n 'forgotPassword.root', 'forgotPassword.title', 'forgotPassword.logo', 'forgotPassword.emailField',\n 'forgotPassword.submitButton', 'forgotPassword.backLink',\n 'resetPassword.root', 'resetPassword.title', 'resetPassword.logo', 'resetPassword.passwordField',\n 'resetPassword.submitButton',\n 'verifyEmail.root', 'verifyEmail.title', 'verifyEmail.logo', 'verifyEmail.resendButton',\n 'authFlow.root',\n 'authModal.overlay', 'authModal.container',\n 'signInButton.root', 'signUpButton.root', 'signOutButton.root',\n 'stepUp.root', 'stepUp.title', 'stepUp.passwordField',\n 'stepUp.submitButton', 'stepUp.cancelButton',\n 'signInPage.root', 'signInPage.logo', 'signInPage.footer',\n 'signUpPage.root', 'signUpPage.logo', 'signUpPage.footer',\n // user button\n 'userButton.root', 'userButton.trigger', 'userButton.menu', 'userButton.identity',\n 'userButton.email', 'userButton.badge', 'userButton.item',\n 'userButton.manageButton', 'userButton.signOutButton', 'userButton.signOutAllButton',\n // account\n 'accountDashboard.root', 'accountDashboard.tabs', 'accountDashboard.sidebar', 'accountDashboard.panel',\n 'accountModal.overlay', 'accountModal.container', 'accountModal.header', 'accountModal.title', 'accountModal.body',\n 'verifyBanner.root', 'verifyBanner.message', 'verifyBanner.resendButton', 'verifyBanner.dismissButton',\n 'profilePanel.root', 'profilePanel.form', 'profilePanel.submitButton',\n 'addressesPanel.root', 'addressesPanel.list', 'addressesPanel.item',\n 'addressesPanel.addButton', 'addressesPanel.form', 'addressesPanel.defaultButton',\n 'addressesPanel.editButton', 'addressesPanel.deleteButton',\n 'addressesPanel.table', 'addressesPanel.row',\n 'paymentMethodsPanel.root', 'paymentMethodsPanel.list', 'paymentMethodsPanel.item',\n 'paymentMethodsPanel.defaultButton', 'paymentMethodsPanel.deleteButton',\n 'paymentMethodsPanel.table', 'paymentMethodsPanel.row',\n 'ordersPanel.root', 'ordersPanel.table', 'ordersPanel.row',\n 'ordersPanel.list', 'ordersPanel.item', 'ordersPanel.viewButton',\n 'orderDetail.root', 'orderDetail.backButton', 'orderDetail.lineItems',\n 'orderDetail.lineItem', 'orderDetail.totals',\n 'invoicesPanel.root', 'invoicesPanel.table', 'invoicesPanel.row',\n 'invoicesPanel.list', 'invoicesPanel.item', 'invoicesPanel.viewButton',\n 'invoiceDetail.root', 'invoiceDetail.backButton', 'invoiceDetail.downloadButton', 'invoiceDetail.totals',\n 'subscriptionsPanel.root', 'subscriptionsPanel.list', 'subscriptionsPanel.item',\n 'subscriptionsPanel.cancelButton', 'subscriptionsPanel.cancelNowButton',\n 'subscriptionsPanel.pauseButton', 'subscriptionsPanel.resumeButton',\n 'subscriptionsPanel.table', 'subscriptionsPanel.row',\n 'securityPanel.root', 'securityPanel.passwordForm', 'securityPanel.passwordButton',\n 'securityPanel.sessionList', 'securityPanel.sessionItem',\n 'securityPanel.revokeButton', 'securityPanel.revokeAllButton',\n 'securityPanel.table', 'securityPanel.row',\n] as const;\n\nexport type ThrottleElementKey = (typeof THROTTLE_ELEMENT_KEYS)[number];\n\nexport interface ThrottleSlots {\n Spinner?: ComponentType<{ className?: string }>;\n Avatar?: ComponentType<{ name: string; email: string; className?: string }>;\n Alert?: ComponentType<{ tone: 'error' | 'success' | 'info'; children: ReactNode; className?: string }>;\n EmptyState?: ComponentType<{ title: string; description?: string; className?: string }>;\n Button?: ComponentType<any>;\n}\n\nexport interface ThrottleAppearance {\n theme?: ThrottleThemeName;\n variables?: ThrottleVariables;\n elements?: Partial<Record<ThrottleElementKey, string>>;\n components?: ThrottleSlots;\n}\n\nexport interface ElementProps {\n className: string | undefined;\n 'data-throttle-element': ThrottleElementKey;\n}\n\nexport interface ResolvedAppearance {\n theme: ThrottleThemeName;\n rootProps: { className: string; style: CSSProperties; 'data-throttle-theme': ThrottleThemeName };\n el(key: ThrottleElementKey, base?: string): ElementProps;\n slots: ThrottleSlots;\n}\n\nconst Ctx = createContext<ThrottleAppearance | null>(null);\n\nexport function AppearanceProvider(props: { value: ThrottleAppearance; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\n/**\n * Merges the provider's appearance with a component-level prop. `variables`,\n * `elements` and `components` merge key-by-key so a component override of one\n * colour does not drop the provider's other twenty; `theme` is replaced whole,\n * because a half-merged theme is not a theme.\n */\nexport function useAppearance(local?: ThrottleAppearance): ResolvedAppearance {\n const provider = useContext(Ctx);\n\n return useMemo<ResolvedAppearance>(() => {\n // Default LIGHT, not 'auto'. 'auto' follows the SHOPPER's operating system,\n // which a merchant's storefront has no relationship to — so a merchant who\n // never sets a theme ships a dark widget to every dark-mode shopper on a\n // light page. Found by embedding the components in a real store: the\n // account dashboard rendered #0d1117 on a #faf7f2 page.\n //\n // A component that cannot see its host page must not guess at it. Merchants\n // who do want OS-following opt in with theme=\"auto\".\n const theme = local?.theme ?? provider?.theme ?? 'light';\n const variables = { ...provider?.variables, ...local?.variables };\n const elements = { ...provider?.elements, ...local?.elements };\n const slots = { ...provider?.components, ...local?.components };\n\n const style: CSSProperties = {};\n for (const [key, value] of Object.entries(variables)) {\n const property = (VARIABLE_PROPERTY as Record<string, string>)[key];\n // Unknown keys are dropped rather than passed through: a typo that\n // reached the DOM as `--throttle-colourPrimary` would look like it\n // worked and silently do nothing.\n if (property && value != null) (style as Record<string, string>)[property] = value;\n }\n\n warnOnUnreadablePrimary(variables, theme);\n\n return {\n theme,\n rootProps: { className: 'throttle-root', style, 'data-throttle-theme': theme },\n el(key, base) {\n const extra = elements[key];\n return {\n className: [base, extra].filter(Boolean).join(' ') || undefined,\n 'data-throttle-element': key,\n };\n },\n slots,\n };\n }, [provider, local]);\n}\n\n/**\n * True when a `<ThrottleProvider>` is above this component. Components use it\n * to warn once (in development) that step-up will surface as an error rather\n * than a prompt — never to change what they render.\n */\nexport function useHasUIContext(): boolean {\n return useContext(Ctx) !== null;\n}\n\n/**\n * Merges the ambient appearance with a component-level override and returns a\n * value suitable for re-provision via `<AppearanceProvider>`. Primitives\n * (`Button`, `Field`, `CardHeader`, …) call `useAppearance()` with no\n * argument, so a component's own `appearance` prop only reaches nested\n * primitives if that component re-provides the merged value down the tree —\n * this is the merge, kept in one place rather than duplicated per component.\n */\nexport function useAppearanceProviderValue(local?: ThrottleAppearance): ThrottleAppearance {\n const provider = useContext(Ctx);\n return useMemo<ThrottleAppearance>(\n () => ({\n theme: local?.theme ?? provider?.theme,\n variables: { ...provider?.variables, ...local?.variables },\n elements: { ...provider?.elements, ...local?.elements },\n components: { ...provider?.components, ...local?.components },\n }),\n [provider, local],\n );\n}\n","/**\n * A merchant who sets `colorPrimary` and nothing else keeps whatever\n * `colorPrimaryForeground` the theme shipped — white in light, near-black in\n * dark. That pairing is not always readable: the demo storefront sets a\n * terracotta primary alone and the resulting dark-theme button label measures\n * 3.65:1, below the 4.5:1 WCAG asks for body text.\n *\n * Nothing surfaced that. This warns in development only, so an integrator\n * finds it while wiring the component up rather than a shopper finding it on a\n * checkout page.\n */\n\n/** Theme defaults for the danger colour, kept in step with `styles.ts`. */\nexport const DEFAULT_DANGER = { light: '#c2321f', dark: '#ff6b58' } as const;\n\n/** Theme defaults, kept in step with the two palettes in `styles.ts`. */\nexport const DEFAULT_PRIMARY_FOREGROUND = { light: '#ffffff', dark: '#0d1117' } as const;\n\nfunction channel(value: number): number {\n const c = value / 255;\n return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n\n/** `null` for anything that is not a plain 3- or 6-digit hex — we do not try to\n * parse every CSS colour form, we simply decline to judge what we cannot read. */\nexport function luminance(hex: string): number | null {\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!m) return null;\n const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));\n return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);\n}\n\nexport function contrastRatio(a: string, b: string): number | null {\n const la = luminance(a);\n const lb = luminance(b);\n if (la === null || lb === null) return null;\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n\n/**\n * Returns a warning message, or `null` when the pairing is fine, unreadable, or\n * not overridden at all. `auto` is checked against BOTH palettes, because the\n * shopper's system setting decides which one they get and we cannot know it.\n */\nexport function primaryContrastWarning(\n variables: { colorPrimary?: string; colorPrimaryForeground?: string },\n theme: 'light' | 'dark' | 'auto',\n): string | null {\n const primary = variables.colorPrimary;\n if (!primary) return null;\n\n const themes = theme === 'auto' ? (['light', 'dark'] as const) : ([theme] as const);\n const failures: string[] = [];\n\n for (const t of themes) {\n const fg = variables.colorPrimaryForeground ?? DEFAULT_PRIMARY_FOREGROUND[t];\n const ratio = contrastRatio(primary, fg);\n if (ratio === null) return null; // not a hex we can read; say nothing\n if (ratio < 4.5) failures.push(`${t} ${ratio.toFixed(2)}:1 against ${fg}`);\n }\n if (failures.length === 0) return null;\n\n const advice = variables.colorPrimaryForeground\n ? 'Pick a foreground with more contrast against it.'\n : 'You set `colorPrimary` without `colorPrimaryForeground`, so the theme default is being used. Set both.';\n\n return `[@usethrottle/auth] Primary button text may be hard to read on ${primary}: ${failures.join('; ')}. WCAG asks for 4.5:1. ${advice}`;\n}\n\n\n/**\n * CIE Lab, for perceptual colour difference. Contrast ratio is the wrong tool\n * for \"can a person tell these two apart\": it measures luminance only, so a\n * blue and a red of similar lightness score near 1:1 while being obviously\n * different. My first attempt at the check below used contrast ratio and\n * flagged a perfectly distinct blue brand — the test caught it.\n */\nfunction toLab(hex: string): [number, number, number] | null {\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!m) return null;\n const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(h.slice(i, i + 2), 16) / 255;\n return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n });\n const X = (r * 0.4124 + g * 0.3576 + b * 0.1805) / 0.95047;\n const Y = r * 0.2126 + g * 0.7152 + b * 0.0722;\n const Z = (r * 0.0193 + g * 0.1192 + b * 0.9505) / 1.08883;\n const f = (t: number) => (t > 0.008856 ? Math.cbrt(t) : 7.787 * t + 16 / 116);\n const [fx, fy, fz] = [f(X), f(Y), f(Z)];\n return [116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)];\n}\n\n/** CIE76 colour difference. `null` when either colour is not plain hex. */\nexport function colourDistance(a: string, b: string): number | null {\n const la = toLab(a);\n const lb = toLab(b);\n if (!la || !lb) return null;\n return Math.hypot(la[0] - lb[0], la[1] - lb[1], la[2] - lb[2]);\n}\n\n/**\n * Below this, two colours read as the same thing at a glance. Measured against\n * the real cases: a terracotta brand against our danger red scores 16.7, while\n * every genuinely distinct brand tested scored above 80.\n */\nconst MIN_DISTINCT = 25;\n\n/**\n * Destructive row actions are told apart from neutral ones by colour: Delete is\n * the danger colour, Edit is the primary. That only works while the two are\n * actually different. A merchant with a warm brand can land right on top of the\n * danger red — a terracotta `#9a3412` against our `#c2321f` measures 1.31:1,\n * where the default `#18181b` gives 3.18:1 — and a buyer loses the only signal\n * that one of two adjacent actions is irreversible.\n *\n * This is the \"Delete looked identical to Edit\" bug arriving through the\n * theming API instead of through the variant logic, so the variant tests cannot\n * see it. 3:1 is WCAG's threshold for distinguishing UI components.\n */\nexport function dangerCollisionWarning(\n variables: { colorPrimary?: string; colorDanger?: string },\n theme: 'light' | 'dark' | 'auto',\n): string | null {\n const primary = variables.colorPrimary;\n if (!primary) return null; // our default sits far from the danger colour\n\n const themes = theme === 'auto' ? (['light', 'dark'] as const) : ([theme] as const);\n const failures: string[] = [];\n for (const t of themes) {\n const danger = variables.colorDanger ?? DEFAULT_DANGER[t];\n const d = colourDistance(primary, danger);\n if (d === null) return null;\n if (d < MIN_DISTINCT) failures.push(`${t} \\u0394E ${d.toFixed(1)} against ${danger}`);\n }\n if (failures.length === 0) return null;\n\n return `[@usethrottle/auth] Your brand colour ${primary} is too close to the destructive colour to tell apart: ${failures.join('; ')}. Delete and Edit sit side by side in the account panels and a buyer distinguishes them by colour alone, so pick a more distinct \\`colorPrimary\\`, or override \\`colorDanger\\` to something further from it.`;\n}\n","import { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Carries `ThrottleProvider`'s `logo` down to the auth cards for the\n * `branded` variant, so a merchant sets it once instead of on every card.\n * A card's own `logo` prop wins over this when both are given. Kept in its\n * own module (rather than `provider.tsx`) so the auth cards can import the\n * hook without creating an import cycle back through `AuthModal`.\n */\nconst Ctx = createContext<ReactNode>(null);\n\nexport function BrandLogoProvider(props: { value: ReactNode; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useBrandLogo(local?: ReactNode): ReactNode {\n const provider = useContext(Ctx);\n return local ?? provider ?? null;\n}\n","import { createContext, useContext, useMemo } from 'react';\nimport type { ReactNode } from 'react';\nimport { messageForError } from '../forms/messages';\n\nexport const enUS = {\n locale: 'en-US',\n common: {\n save: 'Save', cancel: 'Cancel', delete: 'Delete', edit: 'Edit', back: 'Back',\n retry: 'Try again', loading: 'Loading…', close: 'Close', confirm: 'Are you sure?',\n somethingWentWrong: 'Something went wrong.',\n actions: 'Actions', view: 'View',\n },\n signIn: {\n title: 'Sign in', description: 'Sign in to your account.',\n email: 'Email', password: 'Password',\n submitButton: 'Sign in', forgotLink: 'Forgot your password?',\n switchPrompt: \"Don't have an account?\", switchLink: 'Sign up',\n },\n signUp: {\n title: 'Create your account', description: '',\n email: 'Email', password: 'Password',\n submitButton: 'Create account',\n switchPrompt: 'Already have an account?', switchLink: 'Sign in',\n // Deliberately conditional. Registering onto an address that already has\n // an account returns the same `pending` status and sends no email, so\n // asserting one was sent would be false for that buyer.\n pendingNotice: 'If that email is new, check your inbox for a link to finish signing up.',\n },\n forgotPassword: {\n title: 'Reset your password',\n description: 'We will email you a link if an account exists.',\n email: 'Email', submitButton: 'Send reset link',\n sentNotice: 'If an account exists for that email, a reset link is on its way.',\n backLink: 'Back to sign in',\n },\n resetPassword: {\n title: 'Choose a new password', password: 'New password',\n submitButton: 'Update password', doneNotice: 'Your password has been updated.',\n missingToken: 'That link is missing its token. Request a new one.',\n },\n verifyEmail: {\n title: 'Verify your email',\n verifying: 'Confirming your email…',\n success: 'Your email is verified.',\n resendButton: 'Resend the link',\n resentNotice: 'We sent a new link.',\n instructions: 'Check your inbox for a verification link.',\n },\n stepUp: {\n title: 'Confirm your password',\n description: 'For your security, please re-enter your password to continue.',\n password: 'Password', submitButton: 'Confirm', cancelButton: 'Cancel',\n },\n userButton: {\n manage: 'Manage account', signOut: 'Sign out', signOutAll: 'Sign out of all devices',\n verified: 'Verified', unverified: 'Unverified', openMenu: 'Account menu',\n },\n verifyBanner: {\n message: 'Verify your email to see your full account history.',\n resendButton: 'Resend link', dismissButton: 'Dismiss',\n },\n account: {\n title: 'Your account',\n tabs: {\n profile: 'Profile', addresses: 'Addresses', paymentMethods: 'Saved cards',\n orders: 'Orders', invoices: 'Invoices', subscriptions: 'Subscriptions', security: 'Security',\n },\n },\n profile: {\n firstName: 'First name', lastName: 'Last name', phone: 'Phone', company: 'Company',\n acceptsMarketing: 'Send me product news and offers',\n email: 'Email', emailReadOnly: 'Your email address cannot be changed here.',\n saveButton: 'Save changes', savedNotice: 'Profile updated.',\n },\n addresses: {\n addButton: 'Add address', defaultBadge: 'Default', makeDefault: 'Make default',\n empty: 'No saved addresses',\n emptyDescription: 'Addresses you use at checkout can be saved here.',\n label: 'Label', firstName: 'First name', lastName: 'Last name', company: 'Company',\n addressLine1: 'Address', addressLine2: 'Apartment, suite, etc.',\n city: 'City', stateProvince: 'State / Province', postalCode: 'Postal code',\n countryCode: 'Country code', phone: 'Phone',\n deleteConfirm: 'Delete this address?',\n columnAddress: 'Address',\n },\n paymentMethods: {\n empty: 'No saved cards',\n // True today and still true once a buyer-plane add-card route exists.\n emptyDescription: 'Cards you use at checkout will be saved here.',\n // Shown whenever the panel is empty with no error and the buyer is not\n // verified — including simply being signed out — matching the copy\n // orders/invoices/subscriptions already show in that state.\n gatedDescription: 'Verify your email to see your saved cards.',\n defaultBadge: 'Default', makeDefault: 'Make default',\n expires: 'Expires', deleteConfirm: 'Remove this card?',\n columnCard: 'Card',\n },\n orders: {\n empty: 'No orders yet', emptyDescription: 'Orders you place will appear here.',\n gatedDescription: 'Verify your email to see your order history.',\n number: 'Order', date: 'Date', status: 'Status', total: 'Total',\n /**\n * Display copy for `order.status`. Mirrors ORDER_STATUS_META in\n * `@commerce/orders`, which is the server's single source of status copy —\n * copied rather than imported because this package ships with no runtime\n * dependencies and is a client for the wire API, not for server packages.\n * If a status is added there, add it here.\n */\n statusLabels: {\n draft: 'Draft', pending: 'Pending', processing: 'Processing',\n partiallyFulfilled: 'Partially fulfilled', fulfilled: 'Fulfilled',\n cancelled: 'Cancelled', closed: 'Closed',\n },\n /**\n * The money half of the label, shown as a second badge beside the\n * lifecycle one. `captured` is deliberately empty: paid in full is the\n * assumed happy path, and announcing it on every settled order is noise.\n */\n paymentLabels: {\n pending: 'Awaiting payment', authorized: 'Authorized', captured: '',\n partiallyPaid: 'Partially paid', partiallyRefunded: 'Partially refunded',\n refunded: 'Refunded', failed: 'Payment failed', voided: 'Voided',\n processing: 'Payment processing', disputed: 'Disputed',\n expired: 'Authorization expired',\n },\n items: 'Items', subtotal: 'Subtotal', discount: 'Discount', shipping: 'Shipping',\n tax: 'Tax', quantity: 'Qty',\n shippingAddress: 'Shipping address', billingAddress: 'Billing address',\n viewSubscription: 'View subscription',\n },\n invoices: {\n empty: 'No invoices yet', emptyDescription: 'Invoices will appear here.',\n gatedDescription: 'Verify your email to see your invoices.',\n number: 'Invoice', issued: 'Issued', due: 'Due', status: 'Status', total: 'Total',\n refunded: 'Refunded', period: 'Period', downloadButton: 'Download PDF',\n /** Display copy for `invoice.status` — the wire values are paid|open|void. */\n statusLabels: { paid: 'Paid', open: 'Open', void: 'Void' },\n downloadUnavailable: 'This invoice is not available to download right now.',\n },\n subscriptions: {\n empty: 'No subscriptions', emptyDescription: 'Subscriptions will appear here.',\n gatedDescription: 'Verify your email to see your subscriptions.',\n renewsOn: 'Renews on', endsOn: 'Ends on', cancelledOn: 'Cancelled on', trialEnds: 'Trial ends',\n cancelButton: 'Cancel', cancelAtPeriodEnd: 'Cancel at period end',\n cancelNow: 'Cancel immediately', pauseButton: 'Pause', resumeButton: 'Resume',\n cancelConfirm: 'Cancel this subscription?',\n cancelScheduled: 'Cancels at the end of the period',\n columnPlan: 'Plan', columnPrice: 'Price', columnRenews: 'Renews', columnStatus: 'Status',\n /**\n * Display copy for `subscription.status`. Mirrors SubscriptionStatus in\n * `@commerce/subscriptions`; copied rather than imported because this\n * package has no runtime dependencies. Without it a buyer in dunning saw\n * the literal pill `past_due`.\n */\n statusLabels: {\n active: 'Active', paused: 'Paused', cancelled: 'Cancelled',\n pastDue: 'Payment overdue', trialing: 'Trial', unpaid: 'Unpaid',\n },\n },\n security: {\n passwordTitle: 'Change password', newPassword: 'New password',\n changeButton: 'Update password', changedNotice: 'Password updated.',\n sessionsTitle: 'Devices', thisDevice: 'This device',\n lastActive: 'Last active', revokeButton: 'Sign out',\n revokeAllButton: 'Sign out of all other devices',\n sessionsEmpty: 'No other devices',\n columnDevice: 'Device',\n },\n errors: {} as Record<string, string>,\n};\n\n/** Every field optional, at every depth — a merchant overrides one string. */\nexport type ThrottleLocalization = DeepPartial<typeof enUS>;\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K] };\n\nexport interface ResolvedCopy {\n t: typeof enUS;\n locale: string;\n errorMessage(err: unknown): string;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction deepMerge<T>(base: T, over: any, path = ''): T {\n if (!over) return base;\n const out: any = Array.isArray(base) ? [...(base as any)] : { ...base };\n for (const [key, value] of Object.entries(over)) {\n if (value == null) continue;\n const current = (base as any)[key];\n const keyPath = path ? `${path}.${key}` : key;\n const currentIsObject = isPlainObject(current);\n const valueIsObject = isPlainObject(value);\n\n if (current !== undefined && currentIsObject !== valueIsObject) {\n // Shape mismatch: an override that replaces a subtree with a leaf (or a\n // leaf with a subtree) would silently blank every sibling under this\n // key — e.g. `{ signIn: 'oops' }` would make every `t.signIn.*` read\n // undefined. Keep the default and warn instead of corrupting the tree.\n if (typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production') {\n console.warn(\n `[useCopy] ignoring localization override at \"${keyPath}\": expected ${\n currentIsObject ? 'an object' : 'a string'\n }, got ${valueIsObject ? 'an object' : typeof value}`\n );\n }\n continue;\n }\n\n out[key] = currentIsObject && valueIsObject ? deepMerge(current, value, keyPath) : value;\n }\n return out;\n}\n\nconst Ctx = createContext<ThrottleLocalization | null>(null);\n\nexport function LocalizationProvider(props: { value: ThrottleLocalization; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useCopy(local?: ThrottleLocalization): ResolvedCopy {\n const provider = useContext(Ctx);\n\n return useMemo<ResolvedCopy>(() => {\n const t = deepMerge(deepMerge(enUS, provider), local);\n return {\n t,\n locale: t.locale,\n /**\n * A merchant's `errors` map wins; otherwise the shipped mapper decides.\n * `messageForError` stays the floor because it encodes two deliberate\n * non-passthroughs — `invalid_credentials` stays vague to avoid account\n * enumeration, and unknown codes stay generic.\n */\n errorMessage(err: unknown) {\n const code = (err as { code?: string } | null)?.code;\n const override = code ? t.errors[code] : undefined;\n return override ?? messageForError(err);\n },\n };\n }, [provider, local]);\n}\n","import { useInsertionEffect } from 'react';\n\nexport const THROTTLE_STYLE_ID = 'throttle-auth-styles';\n\n/**\n * The whole component stylesheet, as a string, so one source feeds both the\n * runtime injector and the `dist/styles.css` the build emits. There is no CSS\n * pipeline in tsup — adding one would mean the file and the injected styles\n * could drift.\n *\n * Every rule a merchant might restyle uses a SINGLE class selector. Merchant\n * classNames from `appearance.elements` land on the same element, so equal\n * specificity plus source order is what lets them win. A descendant selector\n * here would silently outrank them.\n */\nexport const THROTTLE_STYLES = `\n.throttle-root {\n --throttle-color-primary: #18181b;\n --throttle-color-primary-foreground: #ffffff;\n --throttle-color-background: #ffffff;\n --throttle-color-surface: #f8fafc;\n --throttle-color-foreground: #0e1116;\n --throttle-color-muted: #eceef2;\n --throttle-color-muted-foreground: #5b6472;\n --throttle-color-border: #e2e8f0;\n /* The boundary of an INTERACTIVE control, which WCAG 1.4.11 requires to\n reach 3:1 against its adjacent colour — an input identified only by a\n 1.23:1 hairline is not identifiable at all. Decorative separators (card\n edges, table rules, dividers) keep --throttle-color-border: they do not\n identify a control, so the requirement does not apply and darkening\n them would only add noise. */\n --throttle-color-border-control: #8b93a1;\n --throttle-color-danger: #c2321f;\n --throttle-color-danger-surface: #fef2f2;\n --throttle-color-danger-border: #fecaca;\n --throttle-color-success: #127a4a;\n --throttle-color-success-surface: #ecfdf5;\n --throttle-color-success-border: #a7f3d0;\n --throttle-color-warning: #92400e;\n --throttle-color-warning-surface: #fffbeb;\n --throttle-color-warning-border: #fde68a;\n --throttle-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --throttle-font-size: 16px;\n --throttle-font-size-xs: 12px;\n --throttle-font-size-sm: 14px;\n --throttle-font-size-lg: 20px;\n --throttle-font-size-xl: 24px;\n --throttle-line-height: 1.5;\n --throttle-line-height-tight: 1.25;\n --throttle-radius: 12px;\n --throttle-radius-sm: 8px;\n --throttle-radius-full: 999px;\n --throttle-border-width: 1px;\n --throttle-spacing: 8px;\n --throttle-space-1: 4px;\n --throttle-space-2: var(--throttle-spacing);\n --throttle-space-3: 12px;\n --throttle-space-4: 16px;\n --throttle-space-5: 24px;\n --throttle-space-6: 32px;\n --throttle-control-height: 48px;\n --throttle-control-padding-x: 16px;\n --throttle-shadow-card: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);\n --throttle-shadow-popover: 0 10px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);\n --throttle-transition: 150ms cubic-bezier(.2,0,.2,1);\n --throttle-z-modal: 2147483000;\n --throttle-z-popover: 2147482000;\n font-family: var(--throttle-font-family);\n font-size: var(--throttle-font-size);\n line-height: var(--throttle-line-height);\n color: var(--throttle-color-foreground);\n box-sizing: border-box;\n}\n.throttle-root *, .throttle-root *::before, .throttle-root *::after { box-sizing: inherit; }\n\n.throttle-root[data-throttle-theme=\"dark\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n}\n@media (prefers-color-scheme: dark) {\n .throttle-root[data-throttle-theme=\"auto\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n }\n}\n\n.throttle-card {\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-card);\n padding: var(--throttle-space-5);\n width: 100%;\n max-width: 400px;\n margin-inline: auto;\n}\n/* Inside a Modal the dialog already provides the surface — background, radius\n and elevation. A card that draws its own on top is the \"box inside a box\":\n two shadowed rounded rectangles nested, with the card's max-width stranding\n it in the middle of a much wider dialog. */\n.throttle-card--bare { border: none; box-shadow: none; background: none; max-width: none; }\n.throttle-card__header { margin-bottom: var(--throttle-space-4); }\n.throttle-card__header--branded { text-align: center; }\n.throttle-card__logo { display: flex; justify-content: center; margin-bottom: var(--throttle-space-3); }\n.throttle-card__title { font-size: var(--throttle-font-size-xl); line-height: var(--throttle-line-height-tight); font-weight: 600; letter-spacing: -0.02em; margin: 0; }\n.throttle-card__title--branded { font-size: var(--throttle-font-size-xl); }\n.throttle-card__description { color: var(--throttle-color-muted-foreground); margin: var(--throttle-space-1) 0 0; }\n.throttle-card__body { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-card__footer { margin-top: var(--throttle-space-4); text-align: center; }\n.throttle-card__footer--ruled { border-top: var(--throttle-border-width) solid var(--throttle-color-border); padding-top: var(--throttle-space-4); }\n\n.throttle-field { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n.throttle-field__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--throttle-space-2); }\n.throttle-field__label { font-weight: 500; }\n.throttle-field__input {\n font: inherit;\n font-size: var(--throttle-font-size);\n color: var(--throttle-color-foreground);\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius-sm);\n /* padding-block stays 0 so min-height alone owns the height, exactly as\n .throttle-button does. With 12px vertical padding the box computed to\n 50px against the button's 48px — a 2px mismatch, measured in a browser\n across 19 controls. An input element centres its own text vertically. */\n padding-block: 0;\n padding-inline: var(--throttle-control-padding-x);\n min-height: var(--throttle-control-height);\n width: 100%;\n transition: border-color var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-field__input:focus-visible {\n outline: none;\n border-color: var(--throttle-color-primary);\n box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary);\n}\n.throttle-field__input:disabled { background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground); cursor: not-allowed; }\n.throttle-field__input::placeholder { color: var(--throttle-color-muted-foreground); opacity: 1; }\n.throttle-field__input--grouped { border: none; border-radius: 0; padding-inline: 0; }\n.throttle-field__hint { color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-xs); }\n/* Always mounted, so it reserves its line whether or not there is an error:\n an error appearing on submit must not push the submit button out from\n under the buyer's pointer. */\n.throttle-field__error { color: var(--throttle-color-danger); font-size: var(--throttle-font-size-xs); min-height: 1rem; line-height: 1rem; }\n\n.throttle-field-group {\n display: flex;\n flex-direction: column;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n overflow: hidden;\n}\n.throttle-field-group__item { padding: var(--throttle-space-3) var(--throttle-control-padding-x); }\n.throttle-field-group__divider { height: var(--throttle-border-width); background: var(--throttle-color-border); }\n.throttle-field-group__forgot { margin-left: auto; }\n\n.throttle-button {\n font: inherit;\n font-weight: 500;\n border-radius: var(--throttle-radius-sm);\n border: var(--throttle-border-width) solid transparent;\n padding-inline: var(--throttle-control-padding-x);\n padding-block: 0;\n min-height: var(--throttle-control-height);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: opacity var(--throttle-transition), background-color var(--throttle-transition), border-color var(--throttle-transition), filter var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-button:disabled { opacity: .55; cursor: not-allowed; }\n.throttle-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary); }\n.throttle-button--primary { background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); width: 100%; }\n.throttle-button--primary:hover:not(:disabled) { filter: brightness(0.92); }\n.throttle-button--secondary { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); border-color: var(--throttle-color-border-control); }\n.throttle-button--secondary:hover:not(:disabled) { background: var(--throttle-color-muted); }\n.throttle-button--danger { background: transparent; color: var(--throttle-color-danger); border-color: var(--throttle-color-border); }\n.throttle-button--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--throttle-color-danger) 10%, transparent); }\n/* Link-style actions are the rows panel default, and they carry Delete,\n Remove, Cancel and Sign out. Zero padding with min-height 0 made those\n roughly 20px tall and ~8px apart — a mis-tap on a phone lands on something\n irreversible. The target is expanded with vertical padding and pulled back\n with an equal negative margin, so the hit box clears 44px while the text\n sits exactly where it did. Collapsing this back to zero padding shrinks the\n target again. */\n.throttle-button--link { background: none; border: none; color: var(--throttle-color-primary); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--link:hover:not(:disabled) { opacity: .8; }\n.throttle-button--linkDanger { background: none; border: none; color: var(--throttle-color-danger); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--linkDanger:hover:not(:disabled) { opacity: .8; }\n.throttle-button--xs { font-size: var(--throttle-font-size-xs); }\n\n.throttle-alert { border-radius: var(--throttle-radius-sm); padding: var(--throttle-space-3); font-size: var(--throttle-font-size-sm); }\n.throttle-alert--error { background: var(--throttle-color-danger-surface); border: var(--throttle-border-width) solid var(--throttle-color-danger-border); color: var(--throttle-color-danger); }\n.throttle-alert--success { background: var(--throttle-color-success-surface); border: var(--throttle-border-width) solid var(--throttle-color-success-border); color: var(--throttle-color-success); }\n.throttle-alert--info { background: var(--throttle-color-surface); color: var(--throttle-color-muted-foreground); }\n\n.throttle-spinner {\n display: inline-block; width: 1em; height: 1em;\n border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;\n animation: throttle-spin 700ms linear infinite;\n}\n@keyframes throttle-spin { to { transform: rotate(360deg); } }\n@media (prefers-reduced-motion: reduce) { .throttle-spinner { animation-duration: 2.4s; } }\n\n.throttle-skeleton {\n background: var(--throttle-color-muted);\n border-radius: var(--throttle-radius-sm);\n animation: throttle-pulse 1.4s ease-in-out infinite; height: 2.5em; }\n@keyframes throttle-pulse { 50% { opacity: .5; } }\n@media (prefers-reduced-motion: reduce) { .throttle-skeleton { animation: none; } }\n\n.throttle-modal__overlay {\n position: fixed; inset: 0; z-index: var(--throttle-z-modal);\n background: rgba(14,17,22,.45);\n display: flex; align-items: center; justify-content: center;\n padding: var(--throttle-space-4);\n overflow-y: auto;\n}\n.throttle-modal__container {\n background: var(--throttle-color-background);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;\n position: relative;\n}\n/* After the base rule on purpose: both are single-class, so equal specificity\n means source order decides. Declared before it, this silently lost. */\n.throttle-modal__container--compact { max-width: 440px; }\n.throttle-modal__close {\n position: absolute; top: var(--throttle-space-3); right: var(--throttle-space-3);\n background: none; border: none; cursor: pointer; font-size: var(--throttle-font-size-lg);\n color: var(--throttle-color-muted-foreground);\n transition: color var(--throttle-transition);\n}\n.throttle-modal__close:hover { color: var(--throttle-color-foreground); }\n.throttle-modal__header { padding: var(--throttle-space-4) var(--throttle-space-4) 0; }\n.throttle-modal__title { font-size: var(--throttle-font-size-lg); line-height: var(--throttle-line-height-tight); font-weight: 600; margin: 0; }\n.throttle-modal__body { padding: var(--throttle-space-4); }\n\n.throttle-dropdown__trigger { background: none; border: none; cursor: pointer; padding: 0; border-radius: var(--throttle-radius-full); transition: background-color var(--throttle-transition); }\n.throttle-dropdown__trigger:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.throttle-dropdown__menu {\n position: absolute; right: 0; top: calc(100% + var(--throttle-space-2));\n z-index: var(--throttle-z-popover);\n min-width: 260px;\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n padding: var(--throttle-space-1);\n}\n.throttle-dropdown__item {\n display: flex; align-items: center; gap: var(--throttle-space-2);\n width: 100%; text-align: left; font: inherit; color: inherit;\n background: none; border: none; cursor: pointer;\n padding: var(--throttle-space-3);\n border-radius: var(--throttle-radius-sm);\n text-decoration: none;\n transition: background-color var(--throttle-transition);\n}\n.throttle-dropdown__item:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__item:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-dropdown__separator { height: 1px; background: var(--throttle-color-border); margin: var(--throttle-space-1) 0; border: 0; }\n\n.throttle-tabs__list {\n display: flex; gap: var(--throttle-space-1);\n border-bottom: var(--throttle-border-width) solid var(--throttle-color-border);\n overflow-x: auto; scrollbar-width: thin;\n}\n.throttle-tabs__tab {\n font: inherit; background: none; border: none; cursor: pointer; white-space: nowrap;\n padding: var(--throttle-space-3);\n color: var(--throttle-color-muted-foreground);\n border-bottom: 2px solid transparent;\n transition: color var(--throttle-transition), border-color var(--throttle-transition);\n}\n.throttle-tabs__tab:hover { color: var(--throttle-color-foreground); }\n.throttle-tabs__tab--active { color: var(--throttle-color-foreground); border-bottom-color: var(--throttle-color-primary); }\n.throttle-tabs__panel { padding-top: var(--throttle-space-4); }\n\n/* Paints its own ground. A UserButton in a navbar should stay transparent, but\n the dashboard is a large surface of themed text: in dark theme its foreground\n is near-white, so on a light host page it was rendering white-on-white. */\n.throttle-account-root { container-type: inline-size; background: var(--throttle-color-background); color: var(--throttle-color-foreground); }\n.throttle-account { display: flex; gap: var(--throttle-space-5); align-items: flex-start; }\n.throttle-account__content { flex: 1; min-width: 0; }\n.throttle-tabs__rail { flex: none; width: 220px; display: flex; flex-direction: column; gap: 2px; }\n.throttle-tabs__railitem {\n font: inherit;\n font-size: var(--throttle-font-size-sm);\n display: flex;\n align-items: center;\n gap: var(--throttle-space-3);\n width: 100%;\n text-align: left;\n background: none;\n border: none;\n border-radius: var(--throttle-radius-sm);\n padding: 0 var(--throttle-space-3);\n min-height: var(--throttle-control-height);\n color: var(--throttle-color-muted-foreground);\n cursor: pointer;\n transition: background var(--throttle-transition), color var(--throttle-transition);\n}\n.throttle-tabs__railitem:hover { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); }\n.throttle-tabs__railitem:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__tab:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__railitem--active { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); font-weight: 500; }\n.throttle-tabs__railicon { flex: none; opacity: .75; }\n\n/* A CONTAINER query, not a viewport one: these components render inside a\n merchant's page, so the viewport says nothing about how much room the\n dashboard actually has — it could sit in a 400px column on a 1920px screen.\n Below ~560px of container the rail becomes a full-width list above the\n panel: all seven still visible, each still a 44px target. */\n@container (max-width: 560px) {\n /* align-items: flex-start is right in row direction and wrong in column —\n it shrinks the rail to its content width, so width:100% alone cannot make\n it span. Stretch it explicitly when stacked. */\n .throttle-account { flex-direction: column; align-items: stretch; gap: var(--throttle-space-4); }\n .throttle-tabs__rail { width: 100%; }\n}\n\n.throttle-table { width: 100%; border-collapse: collapse; text-align: left; }\n.throttle-table__head { color: var(--throttle-color-muted-foreground); font-weight: 500; font-size: var(--throttle-font-size-sm); }\n.throttle-table__row { border-top: var(--throttle-border-width) solid var(--throttle-color-border); cursor: pointer; transition: background-color var(--throttle-transition); }\n.throttle-table__row:hover { background: var(--throttle-color-surface); }\n.throttle-table__row:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-table__cell { padding: var(--throttle-space-3) var(--throttle-space-2); height: 56px; box-sizing: border-box; }\n.throttle-table__scroll { overflow-x: auto; }\n\n.throttle-empty { text-align: center; padding: var(--throttle-space-6) var(--throttle-space-4); }\n.throttle-empty__title { font-weight: 600; margin: 0 0 var(--throttle-space-1); }\n.throttle-empty__description { color: var(--throttle-color-muted-foreground); margin: 0; }\n\n.throttle-avatar {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground);\n font-size: var(--throttle-font-size-xs); font-weight: 600; text-transform: uppercase;\n}\n\n.throttle-badge {\n display: inline-block; font-size: var(--throttle-font-size-xs); font-weight: 500;\n padding: 2px var(--throttle-space-2); border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground);\n}\n.throttle-badge--muted { background: none; border: var(--throttle-border-width) solid var(--throttle-color-border); color: var(--throttle-color-muted-foreground); font-weight: 400; padding: 1px calc(var(--throttle-space-2) - 1px); }\n.throttle-badge--success { background: color-mix(in srgb, var(--throttle-color-success) 15%, transparent); color: var(--throttle-color-success); }\n.throttle-badge--warning { background: color-mix(in srgb, var(--throttle-color-warning) 15%, transparent); color: var(--throttle-color-warning); }\n.throttle-badge--danger { background: color-mix(in srgb, var(--throttle-color-danger) 15%, transparent); color: var(--throttle-color-danger); }\n\n.throttle-stack { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-muted { color: var(--throttle-color-muted-foreground); }\n.throttle-banner {\n display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n background: color-mix(in srgb, var(--throttle-color-warning) 12%, transparent);\n color: var(--throttle-color-warning);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n margin-bottom: var(--throttle-space-4);\n}\n.throttle-panel { display: flex; flex-direction: column; gap: var(--throttle-space-4); }\n/* 100dvh, not 100vh: on mobile browsers 100vh includes the space behind the\n dynamic address/toolbar, so the page would be taller than the visible\n viewport and the card would sit off-centre until the toolbar collapsed. */\n.throttle-page {\n min-height: 100dvh;\n width: 100%;\n background: var(--throttle-color-surface);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--throttle-space-5);\n padding: var(--throttle-space-5);\n}\n.throttle-page__logo { display: flex; justify-content: center; }\n.throttle-page__footer { color: var(--throttle-color-muted-foreground); text-align: center; font-size: var(--throttle-font-size-sm); }\n.throttle-listitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n}\n/* 'rows' variant: hairline rules between items instead of each item carrying\n its own border+radius, so a panel does not read as a card inside a card. */\n.throttle-rows { display: flex; flex-direction: column; }\n.throttle-rowitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border-top: var(--throttle-border-width) solid var(--throttle-color-border);\n padding: var(--throttle-space-3) 0;\n}\n.throttle-rowitem:first-child { border-top: none; padding-top: 0; }\n.throttle-actions { display: flex; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-table__money { display: block; text-align: right; font-variant-numeric: tabular-nums; }\n.throttle-lineitem { display: flex; align-items: center; gap: var(--throttle-space-3); padding: var(--throttle-space-2) 0; }\n.throttle-lineitem__image { width: 48px; height: 48px; object-fit: cover; border-radius: var(--throttle-radius-sm); flex: none; }\n.throttle-totals { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n\n@media (prefers-reduced-motion: reduce) {\n .throttle-button, .throttle-field__input, .throttle-dropdown__item, .throttle-dropdown__trigger, .throttle-tabs__tab, .throttle-table__row, .throttle-modal__close {\n transition: none;\n }\n}\n`;\n\n/**\n * Appends the stylesheet once. `useInsertionEffect` is the right phase for\n * this — React runs it before layout effects, so styles are in place before\n * anything measures. It does not run on the server, so SSR markup paints\n * unstyled for one frame; merchants who care import `@usethrottle/auth/styles.css`\n * and pass `injectStyles={false}`.\n *\n * Guarded on the element id rather than a module flag: a merchant may have\n * already inlined the sheet under the same id, and two React roots in one page\n * must not each add a copy.\n */\nexport function useInjectStyles(enabled: boolean): void {\n useInsertionEffect(() => {\n if (!enabled) return;\n if (typeof document === 'undefined') return;\n if (document.getElementById(THROTTLE_STYLE_ID)) return;\n const tag = document.createElement('style');\n tag.id = THROTTLE_STYLE_ID;\n tag.textContent = THROTTLE_STYLES;\n document.head.appendChild(tag);\n }, [enabled]);\n}\n","import { useEffect, useId, useState } from 'react';\nimport { useAppearance } from '../appearance';\nimport { useCopy } from '../localization';\nimport { useCardClass } from '../surface';\nimport { Button, CardBody, Field, Modal } from '../primitives';\n\n/**\n * The dialog behind the core's `onStepUpRequired`. It resolves that promise\n * with a password or with null; the core does the retrying. Nothing here\n * knows which request triggered it, which is exactly why one dialog serves\n * every sensitive action in the app.\n */\nexport function StepUpDialog(props: { open: boolean; onResolve(password: string | null): void }) {\n const a = useAppearance();\n const cardClass = useCardClass();\n const { t } = useCopy();\n const [password, setPassword] = useState('');\n const titleId = useId();\n\n // Never let a password linger in state between prompts.\n useEffect(() => { if (!props.open) setPassword(''); }, [props.open]);\n\n return (\n <Modal open={props.open} onClose={() => props.onResolve(null)} labelledBy={titleId}>\n <div {...a.el('stepUp.root', cardClass)}>\n <form\n onSubmit={(e) => { e.preventDefault(); props.onResolve(password); }}\n >\n <div className=\"throttle-card__header\">\n <h2 id={titleId} {...a.el('stepUp.title', 'throttle-card__title')}>{t.stepUp.title}</h2>\n <p className=\"throttle-card__description\">{t.stepUp.description}</p>\n </div>\n <CardBody>\n <Field\n label={t.stepUp.password}\n type=\"password\"\n autoComplete=\"current-password\"\n value={password}\n onChange={setPassword}\n required\n elementKey=\"stepUp.passwordField\"\n />\n <Button type=\"submit\" elementKey=\"stepUp.submitButton\">{t.stepUp.submitButton}</Button>\n <Button variant=\"link\" elementKey=\"stepUp.cancelButton\" onClick={() => props.onResolve(null)}>\n {t.stepUp.cancelButton}\n </Button>\n </CardBody>\n </form>\n </div>\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Where a card is rendering. A `Modal` already supplies the surface — its own\n * background, radius and elevation — so a card inside one must not draw a\n * second set. Two shadowed rounded rectangles nested inside each other is the\n * \"box inside a box\" look; it also strands the card's max-width in the middle\n * of a much wider dialog.\n */\nexport type ThrottleSurface = 'standalone' | 'modal';\n\nconst Ctx = createContext<ThrottleSurface>('standalone');\n\nexport function SurfaceProvider(props: { value: ThrottleSurface; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useSurface(): ThrottleSurface {\n return useContext(Ctx);\n}\n\n/** The base class a card should use for the surface it is on. */\nexport function useCardClass(): string {\n return useSurface() === 'modal' ? 'throttle-card throttle-card--bare' : 'throttle-card';\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Card(props: { children: ReactNode; className?: string; rootKey?: ThrottleElementKey }) {\n const a = useAppearance();\n const { className, ...rest } = a.el(props.rootKey ?? 'card', 'throttle-card');\n return <div {...rest} className={[className, props.className].filter(Boolean).join(' ')}>{props.children}</div>;\n}\n\nexport function CardHeader(props: {\n title: string;\n description?: string;\n titleKey?: ThrottleElementKey;\n /** Rendered above the title. Absent by default. */\n logo?: ReactNode;\n logoKey?: ThrottleElementKey;\n /** Centres the logo/title/description and enlarges the title — the `branded` variant. */\n branded?: boolean;\n}) {\n const a = useAppearance();\n const headerClass = `throttle-card__header${props.branded ? ' throttle-card__header--branded' : ''}`;\n const titleClass = `throttle-card__title${props.branded ? ' throttle-card__title--branded' : ''}`;\n return (\n <div {...a.el('card.header', headerClass)}>\n {props.logo ? (\n <div {...a.el(props.logoKey ?? 'card.logo', 'throttle-card__logo')}>{props.logo}</div>\n ) : null}\n <h2 {...a.el(props.titleKey ?? 'card.title', titleClass)}>{props.title}</h2>\n {props.description ? (\n <p {...a.el('card.description', 'throttle-card__description')}>{props.description}</p>\n ) : null}\n </div>\n );\n}\n\nexport function CardBody(props: { children: ReactNode }) {\n const a = useAppearance();\n return <div {...a.el('card.body', 'throttle-card__body')}>{props.children}</div>;\n}\n\nexport function CardFooter(props: { children: ReactNode; ruled?: boolean }) {\n const a = useAppearance();\n const className = `throttle-card__footer${props.ruled ? ' throttle-card__footer--ruled' : ''}`;\n return <div {...a.el('card.footer', className)}>{props.children}</div>;\n}\n","import { useAppearance } from '../appearance';\n\nexport function Spinner() {\n const a = useAppearance();\n const Slot = a.slots.Spinner;\n if (Slot) return <Slot />;\n return <span {...a.el('spinner', 'throttle-spinner')} aria-hidden=\"true\" />;\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\nimport { Spinner } from './Spinner';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * `'linkDanger'` is a borderless destructive action. It exists because the\n * `rows` panel variant renders actions as plain links, and a Delete that is\n * the same blue as Edit gives a buyer no signal that one of them is\n * irreversible.\n */\n variant?: 'primary' | 'secondary' | 'danger' | 'link' | 'linkDanger';\n /** `'xs'` shrinks the text to `--throttle-font-size-xs` — a link that should not compete visually with a primary CTA. */\n size?: 'default' | 'xs';\n elementKey?: ThrottleElementKey;\n loading?: boolean;\n children: ReactNode;\n}\n\nexport function Button({ variant = 'primary', size = 'default', elementKey, loading, children, ...rest }: ButtonProps) {\n const a = useAppearance();\n const Slot = a.slots.Button;\n if (Slot) return <Slot variant={variant} loading={loading} {...rest}>{children}</Slot>;\n\n const base = `throttle-button throttle-button--${variant}${size === 'xs' ? ' throttle-button--xs' : ''}`;\n return (\n <button\n type=\"button\"\n {...rest}\n {...a.el(elementKey ?? 'button', base)}\n disabled={rest.disabled || loading}\n >\n {loading ? <Spinner /> : null}\n {children}\n </button>\n );\n}\n","import { Children, Fragment, useId } from 'react';\nimport type { ChangeEvent, HTMLInputTypeAttribute, ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport interface FieldProps {\n label: string;\n value: string;\n onChange(value: string): void;\n type?: HTMLInputTypeAttribute;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n autoComplete?: string;\n hint?: string;\n error?: string;\n elementKey?: ThrottleElementKey;\n /** Rendered alongside the label, right-aligned — e.g. a \"Forgot password?\" link. */\n labelExtra?: ReactNode;\n /** Set by `FieldGroup` — drops the input's own border/radius so the group's border reads as one control. */\n grouped?: boolean;\n}\n\nexport function Field(props: FieldProps) {\n const a = useAppearance();\n // One useId per Field instance, suffixed — two Fields on a page must never\n // share an id, or clicking one label focuses the other's input.\n const base = useId();\n const inputId = `${base}-input`;\n const hintId = `${base}-hint`;\n const errorId = `${base}-error`;\n\n const describedBy = [props.hint ? hintId : null, props.error ? errorId : null].filter(Boolean).join(' ');\n const label = (\n <label {...a.el('field.label', 'throttle-field__label')} htmlFor={inputId}>{props.label}</label>\n );\n\n return (\n <div {...a.el(props.elementKey ?? 'field', 'throttle-field')}>\n {props.labelExtra ? (\n <div className=\"throttle-field__labelrow\">\n {label}\n {props.labelExtra}\n </div>\n ) : label}\n <input\n {...a.el('field.input', `throttle-field__input${props.grouped ? ' throttle-field__input--grouped' : ''}`)}\n id={inputId}\n name={props.name}\n type={props.type ?? 'text'}\n value={props.value}\n required={props.required}\n disabled={props.disabled}\n autoComplete={props.autoComplete}\n aria-describedby={describedBy || undefined}\n aria-invalid={props.error ? true : undefined}\n onChange={(e: ChangeEvent<HTMLInputElement>) => props.onChange(e.target.value)}\n />\n {props.hint ? <span {...a.el('field.hint', 'throttle-field__hint')} id={hintId}>{props.hint}</span> : null}\n {/*\n The error slot is always rendered, empty when there is no error, and\n reserves its own height in CSS. Two reasons, both load-bearing:\n\n 1. Layout. An error appearing on submit would otherwise push the submit\n button down by a line at the moment the buyer's pointer is over it.\n 2. Announcement. A live region inserted into the DOM together with its\n text is announced unreliably across screen readers; one that is\n already present when the text arrives is not. Keeping the element\n mounted is what makes role=\"alert\" actually fire.\n\n `aria-describedby` still references it only when there is something to\n read, so an empty slot never becomes part of the input's description.\n */}\n <span {...a.el('field.error', 'throttle-field__error')} id={errorId} role=\"alert\">\n {props.error ?? ''}\n </span>\n </div>\n );\n}\n\n/**\n * Joins adjacent `Field`s into one bordered group with hairline dividers,\n * instead of each carrying its own border — the `grouped` card variant.\n * Labels stay visible (children must still be `Field`s with their own\n * label/input pairing); only the shared border and divider live here.\n */\nexport function FieldGroup(props: { children: ReactNode; elementKey?: ThrottleElementKey }) {\n const a = useAppearance();\n const items = Children.toArray(props.children).filter(Boolean);\n return (\n <div {...a.el(props.elementKey ?? 'field.group', 'throttle-field-group')}>\n {items.map((child, i) => (\n <Fragment key={i}>\n {i > 0 ? <div className=\"throttle-field-group__divider\" /> : null}\n <div className=\"throttle-field-group__item\">{child}</div>\n </Fragment>\n ))}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\n\nexport function Alert(props: { tone: 'error' | 'success' | 'info'; children: ReactNode }) {\n const a = useAppearance();\n const Slot = a.slots.Alert;\n if (Slot) return <Slot tone={props.tone}>{props.children}</Slot>;\n return (\n <p\n {...a.el('alert', `throttle-alert throttle-alert--${props.tone}`)}\n // Errors must be announced; a success notice must not interrupt.\n role={props.tone === 'error' ? 'alert' : 'status'}\n >\n {props.children}\n </p>\n );\n}\n","import { useAppearance } from '../appearance';\n\n/** Reserves the final layout's height so content does not jump when it lands. */\nexport function Skeleton(props: { count?: number }) {\n const a = useAppearance();\n const rows = Array.from({ length: props.count ?? 1 });\n return (\n <div aria-hidden=\"true\" className=\"throttle-stack\">\n {rows.map((_, i) => (\n <span key={i} {...a.el('skeleton', 'throttle-skeleton')} />\n ))}\n </div>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\nimport { SurfaceProvider } from '../surface';\nimport { useCopy } from '../localization';\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport function Modal(props: {\n open: boolean;\n onClose(): void;\n labelledBy: string;\n children: ReactNode;\n overlayKey?: ThrottleElementKey;\n containerKey?: ThrottleElementKey;\n /** `'compact'` sizes the dialog to a single auth card instead of the wide default. */\n size?: 'compact' | 'default';\n /**\n * Element to restore focus to on close, captured by the caller BEFORE\n * whatever triggered `open` also has a chance to remove that element from\n * the DOM in the same commit (e.g. a Dropdown menuitem that both opens\n * this modal and closes its own menu on the same click — the browser\n * resets `document.activeElement` to <body> the instant the menuitem is\n * removed, which happens before this component's own effect would ever\n * run). Falls back to self-capturing `document.activeElement` on open,\n * which is correct for a trigger that stays mounted (a plain button).\n */\n restoreFocusTo?: Element | null;\n}) {\n const a = useAppearance();\n const { t } = useCopy();\n const panel = useRef<HTMLDivElement>(null);\n const returnFocusTo = useRef<Element | null>(null);\n // Portals need document, which does not exist while server-rendering. Gate\n // on a mounted flag rather than `typeof document` so the server and the\n // first client render agree and hydration does not mismatch.\n const [mounted, setMounted] = useState(false);\n useEffect(() => { setMounted(true); }, []);\n\n // Kept in a ref, deliberately. When this effect depended on `props.onClose`,\n // a caller passing an inline arrow (StepUpDialog did) re-ran it on every\n // render: the cleanup returned focus to the trigger and the body then\n // focused the panel, so a buyer typing their password lost focus after the\n // first character and every later keystroke went nowhere. The effect needs\n // the LATEST onClose, never a reason to re-subscribe.\n const onCloseRef = useRef(props.onClose);\n useEffect(() => { onCloseRef.current = props.onClose; });\n\n useEffect(() => {\n // On a first render with `open` already true, this effect runs before\n // `mounted` flips (the portal has not rendered yet, so `panel.current` is\n // still null). Depending on `mounted` too makes it re-run once the portal\n // exists, so focus actually enters the panel instead of silently no-oping.\n if (!props.open || !mounted) return;\n returnFocusTo.current = props.restoreFocusTo ?? document.activeElement;\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n panel.current?.focus();\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') { onCloseRef.current(); return; }\n if (e.key !== 'Tab' || !panel.current) return;\n const items = Array.from(panel.current.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (items.length === 0) { e.preventDefault(); return; }\n const first = items[0];\n const last = items[items.length - 1];\n if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }\n else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }\n };\n\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.body.style.overflow = previousOverflow;\n (returnFocusTo.current as HTMLElement | null)?.focus?.();\n };\n }, [props.open, mounted]);\n\n if (!props.open || !mounted) return null;\n\n // The portal renders directly under document.body, outside any\n // `.throttle-root` ancestor the caller may have — so every var(--throttle-*)\n // the overlay/container/close-button styles reference would otherwise\n // resolve to nothing. Declare the root here too.\n return createPortal(\n <div {...a.rootProps}>\n <div\n {...a.el(props.overlayKey ?? 'modal.overlay', 'throttle-modal__overlay')}\n data-testid=\"throttle-modal-overlay\"\n onClick={(e) => { if (e.target === e.currentTarget) props.onClose(); }}\n >\n <div\n {...a.el(props.containerKey ?? 'modal.container', props.size === 'compact' ? 'throttle-modal__container throttle-modal__container--compact' : 'throttle-modal__container')}\n ref={panel}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={props.labelledBy}\n tabIndex={-1}\n >\n {/* Escape and overlay-click are not discoverable, and neither exists\n on touch. A visible close control is the only affordance some\n viewers will find. */}\n <button\n {...a.el('modal.closeButton', 'throttle-modal__close')}\n type=\"button\"\n aria-label={t.common.close}\n onClick={props.onClose}\n >\n ×\n </button>\n <SurfaceProvider value=\"modal\">{props.children}</SurfaceProvider>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Dropdown(props: {\n label: string;\n trigger: ReactNode;\n children: ReactNode;\n triggerKey?: ThrottleElementKey;\n menuKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const [open, setOpen] = useState(false);\n const root = useRef<HTMLDivElement>(null);\n const trigger = useRef<HTMLButtonElement>(null);\n const menu = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n // The trigger and the menu are siblings, not ancestor/descendant, so a\n // real ArrowDown/ArrowUp keystroke fired while focus is still on the\n // trigger (which is where it lands after a click or an Enter/Space\n // activation — neither moves focus on its own) never reaches the menu's\n // onKeyDown handler below. Move focus onto the first item as soon as the\n // menu opens so the very next keystroke has somewhere to land.\n menu.current?.querySelector<HTMLElement>('[role=\"menuitem\"]')?.focus();\n const onDown = (e: MouseEvent) => {\n if (root.current && !root.current.contains(e.target as Node)) setOpen(false);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') { setOpen(false); trigger.current?.focus(); }\n };\n document.addEventListener('mousedown', onDown);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('mousedown', onDown);\n document.removeEventListener('keydown', onKey);\n };\n }, [open]);\n\n const move = (delta: number) => {\n const items = Array.from(menu.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n if (items.length === 0) return;\n const at = items.indexOf(document.activeElement as HTMLElement);\n // -1 (nothing focused yet) plus delta 1 lands on 0, which is what ArrowDown\n // from the trigger should do.\n const next = (at + delta + items.length) % items.length;\n items[next < 0 ? items.length - 1 : next].focus();\n };\n\n return (\n <div ref={root} style={{ position: 'relative', display: 'inline-block' }}>\n <button\n ref={trigger}\n type=\"button\"\n {...a.el(props.triggerKey ?? 'dropdown.trigger', 'throttle-dropdown__trigger')}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-label={props.label}\n onClick={() => setOpen((v) => !v)}\n >\n {props.trigger}\n </button>\n {open ? (\n <div\n ref={menu}\n {...a.el(props.menuKey ?? 'dropdown.menu', 'throttle-dropdown__menu')}\n role=\"menu\"\n onClick={() => setOpen(false)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown') { e.preventDefault(); move(1); }\n if (e.key === 'ArrowUp') { e.preventDefault(); move(-1); }\n }}\n >\n {props.children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function DropdownItem(props: {\n children: ReactNode;\n onClick?(): void;\n href?: string;\n itemKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const attrs = a.el(props.itemKey ?? 'dropdown.item', 'throttle-dropdown__item');\n if (props.href) {\n return <a {...attrs} role=\"menuitem\" href={props.href} tabIndex={-1}>{props.children}</a>;\n }\n return (\n <button {...attrs} role=\"menuitem\" type=\"button\" tabIndex={-1} onClick={props.onClick}>\n {props.children}\n </button>\n );\n}\n\nexport function DropdownSeparator() {\n const a = useAppearance();\n return <hr {...a.el('dropdown.separator', 'throttle-dropdown__separator')} />;\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\n\nexport interface TabDescriptor { id: string; label: string; icon?: ReactNode }\n\n/**\n * One component for both orientations on purpose. The roving-tabindex focus\n * move below was a real defect found by driving a browser — arrows changed\n * `aria-selected` while DOM focus stayed put, so a screen reader never heard\n * the move. A separate vertical nav would have to re-derive that, and would\n * eventually get it wrong.\n */\nexport function Tabs(props: {\n tabs: TabDescriptor[];\n active: string;\n onChange(id: string): void;\n orientation?: 'horizontal' | 'vertical';\n /**\n * Shared prefix so each tab can point at the panel it opens. The caller owns\n * it because the panel lives outside this component: without the pairing a\n * screen-reader user arrows onto a tab, hears its name, then lands on an\n * unnamed \"tab panel\" with nothing tying the two together.\n */\n idBase?: string;\n}) {\n const a = useAppearance();\n const at = props.tabs.findIndex((t) => t.id === props.active);\n const vertical = props.orientation === 'vertical';\n const listClass = vertical ? 'throttle-tabs__rail' : 'throttle-tabs__list';\n const itemClass = vertical ? 'throttle-tabs__railitem' : 'throttle-tabs__tab';\n\n return (\n <div\n {...a.el('tabs.list', listClass)}\n role=\"tablist\"\n aria-orientation={vertical ? 'vertical' : undefined}\n onKeyDown={(e) => {\n const next = vertical ? 'ArrowDown' : 'ArrowRight';\n const prev = vertical ? 'ArrowUp' : 'ArrowLeft';\n const delta = e.key === next ? 1 : e.key === prev ? -1 : 0;\n if (!delta) return;\n e.preventDefault();\n const nextIndex = (at + delta + props.tabs.length) % props.tabs.length;\n props.onChange(props.tabs[nextIndex].id);\n // Roving tabindex: the newly active tab is the only one with\n // tabIndex 0, but that alone doesn't move DOM focus there. Without\n // this, focus is stranded on the tab the user started on — a\n // screen reader never announces the move, and the visible focus\n // ring disagrees with the now-selected tab. The buttons already\n // exist in the DOM (only their tabIndex/aria-selected are about to\n // update), so focusing one directly here works ahead of that\n // re-render, not after it.\n e.currentTarget.querySelectorAll<HTMLElement>('[role=\"tab\"]')[nextIndex]?.focus();\n }}\n >\n {props.tabs.map((tab) => {\n const selected = tab.id === props.active;\n const { className, ...rest } = a.el('tabs.tab', itemClass);\n return (\n <button\n key={tab.id}\n {...rest}\n className={[className, selected ? `${itemClass}--active` : null].filter(Boolean).join(' ')}\n role=\"tab\"\n type=\"button\"\n id={props.idBase ? `${props.idBase}-tab-${tab.id}` : undefined}\n aria-controls={props.idBase ? `${props.idBase}-panel-${tab.id}` : undefined}\n aria-selected={selected}\n // Roving tabindex: one stop for the whole strip, arrows move within.\n tabIndex={selected ? 0 : -1}\n onClick={() => props.onChange(tab.id)}\n >\n {tab.icon}\n {tab.label}\n </button>\n );\n })}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport interface Column<T> { key: string; label: string; render?(row: T): ReactNode }\n\nexport function DataTable<T>(props: {\n columns: Column<T>[];\n rows: T[];\n rowKey(row: T): string;\n onRowClick?(row: T): void;\n tableKey?: ThrottleElementKey;\n rowElementKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const clickable = Boolean(props.onRowClick);\n\n return (\n // Tables are the one thing allowed to be wider than the panel; it scrolls\n // rather than forcing the whole page to.\n <div className=\"throttle-table__scroll\">\n <table {...a.el(props.tableKey ?? 'table', 'throttle-table')}>\n <thead>\n <tr>\n {props.columns.map((col) => (\n <th key={col.key} {...a.el('table.head', 'throttle-table__head')} scope=\"col\">{col.label}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {props.rows.map((row) => (\n <tr\n key={props.rowKey(row)}\n {...a.el(props.rowElementKey ?? 'table.row', 'throttle-table__row')}\n tabIndex={clickable ? 0 : undefined}\n onClick={clickable ? () => props.onRowClick!(row) : undefined}\n onKeyDown={\n clickable\n ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); props.onRowClick!(row); } }\n : undefined\n }\n >\n {props.columns.map((col) => (\n <td key={col.key} {...a.el('table.cell', 'throttle-table__cell')}>\n {col.render ? col.render(row) : String((row as any)[col.key] ?? '')}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useAppearance } from '../appearance';\n\nexport function EmptyState(props: { title: string; description?: string }) {\n const a = useAppearance();\n const Slot = a.slots.EmptyState;\n if (Slot) return <Slot title={props.title} description={props.description} />;\n return (\n <div {...a.el('emptyState', 'throttle-empty')}>\n <p {...a.el('emptyState.title', 'throttle-empty__title')}>{props.title}</p>\n {props.description ? (\n <p {...a.el('emptyState.description', 'throttle-empty__description')}>{props.description}</p>\n ) : null}\n </div>\n );\n}\n","import { useAppearance } from '../appearance';\n\n/**\n * Initials only. No gravatar, no external avatar service: a component that\n * silently hashes a buyer's email and sends it to a third party is not\n * something a merchant should have to discover.\n */\nexport function Avatar(props: { name: string; email: string }) {\n const a = useAppearance();\n const Slot = a.slots.Avatar;\n if (Slot) return <Slot name={props.name} email={props.email} />;\n\n const initials =\n props.name\n .split(' ')\n .map((part) => part.trim()[0])\n .filter(Boolean)\n .slice(0, 2)\n .join('') || props.email.trim()[0] || '?';\n\n return <span {...a.el('avatar', 'throttle-avatar')} title={props.email}>{initials.toUpperCase()}</span>;\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Badge(props: {\n /**\n * `'muted'` is the terminal tier: an outline pill for a state that is\n * finished and has nothing to act on (cancelled, closed, void). It reads\n * as quieter than the filled neutral used for live states, without\n * spending a colour on news that is neither good nor bad.\n */\n tone?: 'neutral' | 'muted' | 'success' | 'warning' | 'danger';\n children: ReactNode;\n elementKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const tone = props.tone ?? 'neutral';\n const base = tone === 'neutral' ? 'throttle-badge' : `throttle-badge throttle-badge--${tone}`;\n return <span {...a.el(props.elementKey ?? 'badge', base)}>{props.children}</span>;\n}\n","import { useId } from 'react';\nimport { AppearanceProvider, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { Modal } from '../primitives';\nimport { AuthFlow, type AuthView } from './AuthFlow';\n\nexport interface AuthModalProps {\n open: boolean;\n onClose(): void;\n initialView?: AuthView;\n afterSignIn?(): void;\n afterSignUp?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\nexport function AuthModal(props: AuthModalProps) {\n const scoped = useAppearanceProviderValue(props.appearance);\n const titleId = useId();\n return (\n <AppearanceProvider value={scoped}>\n <Modal\n open={props.open}\n onClose={props.onClose}\n labelledBy={titleId}\n size=\"compact\"\n overlayKey=\"authModal.overlay\"\n containerKey=\"authModal.container\"\n >\n {/* The flow swaps its own heading per view, so the dialog carries a\n stable accessible name of its own rather than pointing at a heading\n that disappears when the view changes. */}\n <h2 id={titleId} style={{ position: 'absolute', width: 1, height: 1, overflow: 'hidden', clip: 'rect(0 0 0 0)' }}>\n Account\n </h2>\n <AuthFlow\n initialView={props.initialView}\n afterSignIn={props.afterSignIn}\n afterSignUp={props.afterSignUp}\n appearance={props.appearance}\n localization={props.localization}\n />\n </Modal>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useState } from 'react';\nimport { useAppearance, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignIn } from './SignIn';\nimport { SignUp } from './SignUp';\nimport { ForgotPassword } from './ForgotPassword';\nimport { ResetPassword } from './ResetPassword';\nimport { VerifyEmail } from './VerifyEmail';\n\nexport type AuthView = 'signIn' | 'signUp' | 'forgotPassword' | 'resetPassword' | 'verifyEmail';\n\nconst HASH_FOR: Record<AuthView, string> = {\n signIn: '#/sign-in',\n signUp: '#/sign-up',\n forgotPassword: '#/forgot-password',\n resetPassword: '#/reset-password',\n verifyEmail: '#/verify-email',\n};\nconst VIEW_FOR_HASH: Record<string, AuthView> = Object.fromEntries(\n Object.entries(HASH_FOR).map(([view, hash]) => [hash, view as AuthView]),\n) as Record<string, AuthView>;\n\nexport interface AuthFlowProps {\n initialView?: AuthView;\n /** Controlled mode: pass both to own the value yourself. */\n view?: AuthView;\n onViewChange?(view: AuthView): void;\n /** Wins over the token in the URL. */\n token?: string;\n routing?: 'virtual' | 'hash';\n afterSignIn?(): void;\n afterSignUp?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\n/**\n * Reads the location on the client only. Returns nothing while server\n * rendering, so the server and the first client render agree; the effect below\n * applies the URL-derived view afterwards.\n */\nfunction readLocation(): { view: AuthView | null; token?: string } {\n if (typeof window === 'undefined') return { view: null };\n const params = new URLSearchParams(window.location.search);\n const token = params.get('token') ?? undefined;\n const hashView = VIEW_FOR_HASH[window.location.hash];\n if (hashView) return { view: hashView, token };\n if (!token) return { view: null };\n // A token in the URL means the buyer arrived from an email. Which email is\n // not knowable in general — merchants choose their own paths — so sniff the\n // common ones and let `initialView` override when they differ.\n const path = window.location.pathname.toLowerCase();\n if (path.includes('reset')) return { view: 'resetPassword', token };\n if (path.includes('verif')) return { view: 'verifyEmail', token };\n return { view: null, token };\n}\n\nexport function AuthFlow(props: AuthFlowProps) {\n const a = useAppearance(props.appearance);\n const controlled = props.view !== undefined;\n const [internal, setInternal] = useState<AuthView>(props.initialView ?? 'signIn');\n const [urlToken, setUrlToken] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n const found = readLocation();\n if (found.token) setUrlToken(found.token);\n // An explicit initialView or a controlled view is the merchant's decision\n // and outranks whatever the URL implies.\n if (found.view && !controlled && props.initialView === undefined) setInternal(found.view);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const view = controlled ? props.view! : internal;\n const token = props.token ?? urlToken;\n\n const go = (next: AuthView) => {\n props.onViewChange?.(next);\n if (!controlled) setInternal(next);\n if (props.routing === 'hash' && typeof window !== 'undefined') {\n window.location.hash = HASH_FOR[next];\n }\n };\n\n useEffect(() => {\n if (props.routing !== 'hash' || typeof window === 'undefined') return;\n const onHashChange = () => {\n if (controlled) return;\n const hash = window.location.hash;\n // An empty hash means Back navigated past the first pushed view entry,\n // back to the plain (view-less) URL — that always means sign-in, the\n // same default the component starts on. A no-op here left the browser\n // address bar and the rendered view disagreeing after Back.\n if (hash === '') {\n setInternal(props.initialView ?? 'signIn');\n return;\n }\n const next = VIEW_FOR_HASH[hash];\n if (next) setInternal(next);\n };\n window.addEventListener('hashchange', onHashChange);\n return () => window.removeEventListener('hashchange', onHashChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.routing, controlled]);\n\n const shared = { appearance: props.appearance, localization: props.localization };\n\n return (\n <div {...a.rootProps}>\n <div {...a.el('authFlow.root')}>\n {view === 'signIn' ? (\n <SignIn {...shared} onSuccess={props.afterSignIn}\n onForgotPassword={() => go('forgotPassword')} onSignUp={() => go('signUp')} />\n ) : null}\n {view === 'signUp' ? (\n <SignUp {...shared} onSuccess={props.afterSignUp} onSignIn={() => go('signIn')} />\n ) : null}\n {view === 'forgotPassword' ? (\n <ForgotPassword {...shared} onBack={() => go('signIn')} />\n ) : null}\n {view === 'resetPassword' ? (\n <ResetPassword {...shared} token={token} onSuccess={() => go('signIn')} />\n ) : null}\n {view === 'verifyEmail' ? <VerifyEmail {...shared} token={token} /> : null}\n </div>\n </div>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field, FieldGroup } from '../primitives';\n\nexport type AuthCardVariant = 'quiet' | 'grouped' | 'branded';\n\nexport interface SignInProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n onForgotPassword?(): void;\n onSignUp?(): void;\n}\n\nexport function SignIn(props: SignInProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, run } = useAction();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const variant = props.variant ?? 'quiet';\n const branded = variant === 'branded';\n const grouped = variant === 'grouped';\n const logo = useBrandLogo(props.logo);\n\n // `quiet` puts this beside the Password label instead of as its own\n // full-width row under the primary button, so the card has only one call\n // to action. `grouped` instead sits it right-aligned below the field\n // group, since there is no per-field label row to share once the inputs\n // are joined into one control.\n const forgotLink = props.onForgotPassword ? (\n <Button variant=\"link\" size=\"xs\" elementKey=\"signIn.forgotLink\" onClick={props.onForgotPassword}>\n {t.signIn.forgotLink}\n </Button>\n ) : null;\n\n const emailField = (\n <Field label={t.signIn.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"signIn.emailField\" grouped={grouped} />\n );\n const passwordField = (\n <Field label={t.signIn.password} type=\"password\" autoComplete=\"current-password\" required\n value={password} onChange={setPassword} elementKey=\"signIn.passwordField\" grouped={grouped}\n labelExtra={grouped ? undefined : forgotLink} />\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('signIn.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => { await auth.signIn(email, password); props.onSuccess?.(); });\n }}\n >\n <CardHeader\n title={t.signIn.title}\n description={branded ? t.signIn.description : undefined}\n titleKey=\"signIn.title\"\n logo={branded ? logo : null}\n logoKey=\"signIn.logo\"\n branded={branded}\n />\n <CardBody>\n {grouped ? <FieldGroup>{emailField}{passwordField}</FieldGroup> : <>{emailField}{passwordField}</>}\n {grouped && forgotLink ? <div className=\"throttle-field-group__forgot\">{forgotLink}</div> : null}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"signIn.submitButton\">\n {t.signIn.submitButton}\n </Button>\n </CardBody>\n {props.onSignUp ? (\n <CardFooter ruled={!branded}>\n <span className=\"throttle-muted\">{t.signIn.switchPrompt} </span>\n <Button variant=\"link\" elementKey=\"signIn.switchLink\" onClick={props.onSignUp}>\n {t.signIn.switchLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useCallback, useRef, useState } from 'react';\nimport { useCopy } from './localization';\n\nexport interface Action {\n submitting: boolean;\n error: string | null;\n notice: string | null;\n run(fn: () => Promise<string | void>): Promise<void>;\n}\n\n/**\n * Submit-once semantics plus localized error copy. Deliberately a separate hook\n * from `../forms/useFormAction`: that one maps errors through `messageForError`\n * with no path to a merchant's `localization.errors`, and `./forms` is a\n * published entry point whose contract is that it does not change.\n */\nexport function useAction(): Action {\n const { errorMessage } = useCopy();\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const inFlight = useRef(false);\n\n const run = useCallback(\n async (fn: () => Promise<string | void>) => {\n if (inFlight.current) return; // a double-click is one attempt, not two\n inFlight.current = true;\n setSubmitting(true);\n setError(null);\n setNotice(null);\n try {\n const message = await fn();\n if (typeof message === 'string') setNotice(message);\n } catch (err) {\n setError(errorMessage(err));\n } finally {\n inFlight.current = false;\n setSubmitting(false);\n }\n },\n [errorMessage],\n );\n\n return { submitting, error, notice, run };\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field, FieldGroup } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface SignUpProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n onSignIn?(): void;\n}\n\nexport function SignUp(props: SignUpProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const variant = props.variant ?? 'quiet';\n const branded = variant === 'branded';\n const grouped = variant === 'grouped';\n const logo = useBrandLogo(props.logo);\n\n const emailField = (\n <Field label={t.signUp.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"signUp.emailField\" grouped={grouped} />\n );\n const passwordField = (\n <Field label={t.signUp.password} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} elementKey=\"signUp.passwordField\" grouped={grouped} />\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('signUp.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n const result = await auth.register(email, password);\n if (result.status === 'active') { props.onSuccess?.(); return; }\n // `pending` covers two different server outcomes — a new account\n // awaiting verification, and a registration onto an address that\n // already has one, which sends nothing. The copy must be true for\n // both, so it says \"if that email is new\" rather than \"we sent\".\n return t.signUp.pendingNotice;\n });\n }}\n >\n <CardHeader\n title={t.signUp.title}\n description={branded ? t.signUp.description : undefined}\n titleKey=\"signUp.title\"\n logo={branded ? logo : null}\n logoKey=\"signUp.logo\"\n branded={branded}\n />\n <CardBody>\n {grouped ? <FieldGroup>{emailField}{passwordField}</FieldGroup> : <>{emailField}{passwordField}</>}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"info\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"signUp.submitButton\">\n {t.signUp.submitButton}\n </Button>\n </CardBody>\n {props.onSignIn ? (\n <CardFooter ruled={!branded}>\n <span className=\"throttle-muted\">{t.signUp.switchPrompt} </span>\n <Button variant=\"link\" elementKey=\"signUp.switchLink\" onClick={props.onSignIn}>\n {t.signUp.switchLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface ForgotPasswordProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. A single input, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onBack?(): void;\n}\n\nexport function ForgotPassword(props: ForgotPasswordProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [email, setEmail] = useState('');\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('forgotPassword.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n // The server answers identically whether or not the address exists,\n // and so must this: a notice that varied would enumerate accounts.\n void run(async () => { await auth.forgotPassword(email); return t.forgotPassword.sentNotice; });\n }}\n >\n <CardHeader\n title={t.forgotPassword.title}\n description={branded ? t.forgotPassword.description : undefined}\n titleKey=\"forgotPassword.title\"\n logo={branded ? logo : null}\n logoKey=\"forgotPassword.logo\"\n branded={branded}\n />\n <CardBody>\n <Field label={t.forgotPassword.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"forgotPassword.emailField\" />\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"forgotPassword.submitButton\">\n {t.forgotPassword.submitButton}\n </Button>\n </CardBody>\n {props.onBack ? (\n <CardFooter ruled={!branded}>\n <Button variant=\"link\" elementKey=\"forgotPassword.backLink\" onClick={props.onBack}>\n {t.forgotPassword.backLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardHeader, Field } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface ResetPasswordProps {\n token?: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. A single input, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n}\n\nexport function ResetPassword(props: ResetPasswordProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [password, setPassword] = useState('');\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('resetPassword.root', cardClass)}>\n <CardHeader\n title={t.resetPassword.title}\n titleKey=\"resetPassword.title\"\n logo={branded ? logo : null}\n logoKey=\"resetPassword.logo\"\n branded={branded}\n />\n <CardBody>\n {!props.token ? (\n // No form at all without a token. A submit button that can only\n // fail is worse than an explanation.\n <Alert tone=\"error\">{t.resetPassword.missingToken}</Alert>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n await auth.resetPassword(props.token!, password);\n props.onSuccess?.();\n return t.resetPassword.doneNotice;\n });\n }}\n >\n <div className=\"throttle-stack\">\n <Field label={t.resetPassword.password} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} elementKey=\"resetPassword.passwordField\" />\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"resetPassword.submitButton\">\n {t.resetPassword.submitButton}\n </Button>\n </div>\n </form>\n )}\n </CardBody>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardHeader, Spinner } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface VerifyEmailProps {\n token?: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. This card has no inputs, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n}\n\nexport function VerifyEmail(props: VerifyEmailProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, errorMessage } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, notice, run } = useAction();\n const [state, setState] = useState<'idle' | 'verifying' | 'done' | 'failed'>(props.token ? 'verifying' : 'idle');\n const [error, setError] = useState<string | null>(null);\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n // StrictMode mounts effects twice in development, and a verification token is\n // single-use: a second call would fail with token_already_used and show the\n // buyer an error for a link that worked.\n const attempted = useRef<string | null>(null);\n\n useEffect(() => {\n const token = props.token;\n if (!token || attempted.current === token) return;\n attempted.current = token;\n setState('verifying');\n auth\n .verifyEmail(token)\n .then(() => { setState('done'); props.onSuccess?.(); })\n .catch((err) => { setError(errorMessage(err)); setState('failed'); });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.token, auth]);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('verifyEmail.root', cardClass)}>\n <CardHeader\n title={t.verifyEmail.title}\n titleKey=\"verifyEmail.title\"\n logo={branded ? logo : null}\n logoKey=\"verifyEmail.logo\"\n branded={branded}\n />\n <CardBody>\n {state === 'verifying' ? <p><Spinner /> {t.verifyEmail.verifying}</p> : null}\n {state === 'done' ? <Alert tone=\"success\">{t.verifyEmail.success}</Alert> : null}\n {state === 'failed' && error ? <Alert tone=\"error\">{error}</Alert> : null}\n {state === 'idle' ? <p className=\"throttle-muted\">{t.verifyEmail.instructions}</p> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n {state !== 'done' ? (\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"verifyEmail.resendButton\"\n onClick={() => void run(async () => {\n await auth.resendVerification();\n return t.verifyEmail.resentNotice;\n })}\n >\n {t.verifyEmail.resendButton}\n </Button>\n ) : null}\n </CardBody>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useId } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Modal } from '../primitives';\nimport { AccountDashboard, type AccountTab } from './AccountDashboard';\n\nexport interface AccountModalProps {\n open: boolean;\n onClose(): void;\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Where focus returns on close. See `Modal`'s own doc for why a caller\n * sometimes has to name this rather than let the modal capture it. */\n restoreFocusTo?: Element | null;\n}\n\n/**\n * The account dashboard, reachable without going through `UserButton`'s\n * menu — a merchant can wire this to a \"Settings\" control anywhere. Mirrors\n * `AuthModal`'s shape (a `Modal` hosting the existing card/dashboard), so a\n * merchant who wants to own the open/close state themselves has the same\n * kind of component available for the account surface that they already\n * have for sign-in.\n */\nexport function AccountModal(props: AccountModalProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const titleId = useId();\n\n return (\n <AppearanceProvider value={scoped}>\n <Modal\n open={props.open}\n onClose={props.onClose}\n labelledBy={titleId}\n restoreFocusTo={props.restoreFocusTo}\n overlayKey=\"accountModal.overlay\"\n containerKey=\"accountModal.container\"\n >\n <div {...a.el('accountModal.header', 'throttle-modal__header')}>\n <h2 id={titleId} {...a.el('accountModal.title', 'throttle-modal__title')}>{t.account.title}</h2>\n </div>\n <div {...a.el('accountModal.body', 'throttle-modal__body')}>\n <AccountDashboard tabs={props.tabs} appearance={props.appearance} localization={props.localization} />\n </div>\n </Modal>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useId, useState } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Tabs } from '../primitives';\nimport { VerifyEmailBanner } from './VerifyEmailBanner';\nimport { ACCOUNT_ICONS } from './icons';\nimport { ProfilePanel } from './ProfilePanel';\nimport { AddressesPanel } from './AddressesPanel';\nimport { PaymentMethodsPanel } from './PaymentMethodsPanel';\nimport { OrdersPanel } from './OrdersPanel';\nimport { InvoicesPanel } from './InvoicesPanel';\nimport { SubscriptionsPanel } from './SubscriptionsPanel';\nimport { SecurityPanel } from './SecurityPanel';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport type AccountTab =\n | 'profile' | 'addresses' | 'paymentMethods' | 'orders' | 'invoices' | 'subscriptions' | 'security';\n\nexport const ACCOUNT_TABS: readonly AccountTab[] = [\n 'profile', 'addresses', 'paymentMethods', 'orders', 'invoices', 'subscriptions', 'security',\n];\n\nconst HASH_FOR: Record<AccountTab, string> = {\n profile: '#/profile', addresses: '#/addresses', paymentMethods: '#/payment-methods',\n orders: '#/orders', invoices: '#/invoices', subscriptions: '#/subscriptions', security: '#/security',\n};\nconst TAB_FOR_HASH: Record<string, AccountTab> = Object.fromEntries(\n Object.entries(HASH_FOR).map(([tab, hash]) => [hash, tab as AccountTab]),\n) as Record<string, AccountTab>;\n\nexport interface AccountDashboardProps {\n /** Which panels to show, in order. Defaults to all seven. */\n tabs?: AccountTab[];\n tab?: AccountTab;\n onTabChange?(tab: AccountTab): void;\n routing?: 'virtual' | 'hash';\n /**\n * `'sidebar'` (default) puts the seven panels in a vertical rail beside the\n * content; `'tabs'` is the original horizontal strip above it. Seven is a lot\n * for a strip — at narrow widths most of them sit off-screen behind a scroll\n * with nothing signalling they exist — so the rail is the default. The strip\n * remains for merchants whose surrounding page already has a side nav and\n * would end up with two.\n */\n layout?: 'sidebar' | 'tabs';\n /**\n * Default composition for every panel rendered here. A panel's own\n * `variant` prop cannot be set through the dashboard (it does not expose\n * per-tab overrides), so in practice this is the only source of `variant`\n * each panel receives when rendered through `AccountDashboard` — a panel\n * rendered directly, outside the dashboard, keeps deciding its own default\n * from its own `variant` prop rather than this one.\n */\n panelVariant?: AccountPanelVariant;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\nexport function AccountDashboard(props: AccountDashboardProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { status } = useAuth();\n const shown = props.tabs ?? [...ACCOUNT_TABS];\n const controlled = props.tab !== undefined;\n const [internal, setInternal] = useState<AccountTab>(shown[0] ?? 'profile');\n // Above the signed-out early return: every hook must run on every render.\n const idBase = useId();\n\n useEffect(() => {\n if (props.routing !== 'hash' || typeof window === 'undefined') return;\n const apply = () => {\n // An empty/unrecognized hash (e.g. the browser Back button returning\n // to the pre-navigation URL) falls back to the first shown tab rather\n // than being ignored — otherwise \"Back\" is a dead button once the\n // hash empties out.\n const next = TAB_FOR_HASH[window.location.hash] ?? shown[0];\n // A hash naming a hidden tab is ignored rather than rendering a panel\n // with no tab to go back to.\n if (!next || !shown.includes(next)) return;\n if (controlled) props.onTabChange?.(next);\n else setInternal(next);\n };\n apply();\n window.addEventListener('hashchange', apply);\n return () => window.removeEventListener('hashchange', apply);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.routing, controlled, shown.join(',')]);\n\n // Signed out there is nothing to show; an empty tab shell would be worse\n // than nothing. Pair with <SignedIn> or <Protect> for a fallback.\n if (status !== 'authenticated') return null;\n\n const active = controlled ? props.tab! : internal;\n\n const go = (next: AccountTab) => {\n props.onTabChange?.(next);\n if (!controlled) setInternal(next);\n if (props.routing === 'hash' && typeof window !== 'undefined') window.location.hash = HASH_FOR[next];\n };\n\n const shared = { appearance: props.appearance, localization: props.localization };\n const sidebar = (props.layout ?? 'sidebar') === 'sidebar';\n\n const nav = (\n <Tabs\n idBase={idBase}\n orientation={sidebar ? 'vertical' : 'horizontal'}\n active={active}\n onChange={(id) => go(id as AccountTab)}\n tabs={shown.map((id) => ({\n id,\n label: t.account.tabs[id],\n // Icons ride the rail only. In the horizontal strip they cost\n // horizontal room, which is the scarce axis there.\n icon: sidebar ? ACCOUNT_ICONS[id] : undefined,\n }))}\n />\n );\n\n const panel = (\n <div\n {...a.el('accountDashboard.panel', sidebar ? 'throttle-account__content' : 'throttle-tabs__panel')}\n role=\"tabpanel\"\n id={`${idBase}-panel-${active}`}\n aria-labelledby={`${idBase}-tab-${active}`}\n tabIndex={0}\n >\n {active === 'profile' ? <ProfilePanel {...shared} /> : null}\n {active === 'addresses' ? <AddressesPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'paymentMethods' ? <PaymentMethodsPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'orders' ? (\n <OrdersPanel {...shared} variant={props.panelVariant} onViewSubscription={() => go('subscriptions')} />\n ) : null}\n {active === 'invoices' ? <InvoicesPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'subscriptions' ? <SubscriptionsPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'security' ? <SecurityPanel {...shared} variant={props.panelVariant} /> : null}\n </div>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('accountDashboard.root', 'throttle-panel throttle-account-root')}>\n <VerifyEmailBanner {...shared} />\n {sidebar ? (\n <div className=\"throttle-account\">\n <div {...a.el('accountDashboard.sidebar')}>{nav}</div>\n {panel}\n </div>\n ) : (\n <>\n <div {...a.el('accountDashboard.tabs')}>{nav}</div>\n {panel}\n </>\n )}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Button } from '../primitives';\n\nconst DISMISS_KEY = 'throttle-auth:verify-banner-dismissed';\n\n/** Every read and write is guarded: a private window or blocked site data\n * makes the accessor itself throw, and a banner must not take the page down. */\nfunction readDismissed(): boolean {\n try { return sessionStorage.getItem(DISMISS_KEY) === '1'; } catch { return false; }\n}\nfunction writeDismissed(): void {\n try { sessionStorage.setItem(DISMISS_KEY, '1'); } catch { /* not worth reporting */ }\n}\n\nexport function VerifyEmailBanner(props: { appearance?: ThrottleAppearance; localization?: ThrottleLocalization }) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, emailVerified } = useAuth();\n const { submitting, notice, error, run } = useAction();\n const [dismissed, setDismissed] = useState(readDismissed);\n\n if (status !== 'authenticated' || emailVerified || dismissed) return null;\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('verifyBanner.root', 'throttle-banner')}>\n <span {...a.el('verifyBanner.message')}>{t.verifyBanner.message}</span>\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <span className=\"throttle-actions\">\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"verifyBanner.resendButton\"\n onClick={() => void run(async () => {\n await auth.resendVerification();\n return t.verifyEmail.resentNotice;\n })}\n >\n {t.verifyBanner.resendButton}\n </Button>\n <Button\n variant=\"link\"\n elementKey=\"verifyBanner.dismissButton\"\n onClick={() => { writeDismissed(); setDismissed(true); }}\n >\n {t.verifyBanner.dismissButton}\n </Button>\n </span>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport type { AccountTab } from './AccountDashboard';\n\n/**\n * One 18px stroked glyph per account tab, drawn inline.\n *\n * Inline rather than an icon dependency because this package ships with no\n * runtime dependencies at all, and stroked rather than filled so a single\n * `currentColor` follows the merchant's own text colour in both themes.\n * `aria-hidden` on every one: the tab's own text is the accessible name, and\n * a second announcement of \"person icon, Profile\" is noise.\n */\nfunction Glyph(props: { children: ReactNode }) {\n return (\n <svg\n className=\"throttle-tabs__railicon\"\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {props.children}\n </svg>\n );\n}\n\nexport const ACCOUNT_ICONS: Record<AccountTab, ReactNode> = {\n profile: (\n <Glyph><circle cx=\"12\" cy=\"8\" r=\"4\" /><path d=\"M4 21c0-4 3.6-6 8-6s8 2 8 6\" /></Glyph>\n ),\n addresses: (\n <Glyph><path d=\"M12 21s7-5.3 7-11a7 7 0 1 0-14 0c0 5.7 7 11 7 11Z\" /><circle cx=\"12\" cy=\"10\" r=\"2.5\" /></Glyph>\n ),\n paymentMethods: (\n <Glyph><rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"2.5\" /><path d=\"M2.5 10h19\" /></Glyph>\n ),\n orders: (\n <Glyph><path d=\"M4 7h16v13H4z\" /><path d=\"M8 7V4h8v3\" /><path d=\"M8 12h8\" /></Glyph>\n ),\n invoices: (\n <Glyph><path d=\"M6 3h12v18l-3-2-3 2-3-2-3 2Z\" /><path d=\"M9 8h6M9 12h6\" /></Glyph>\n ),\n subscriptions: (\n <Glyph><path d=\"M3 12a9 9 0 0 1 15.5-6.2\" /><path d=\"M21 12a9 9 0 0 1-15.5 6.2\" /><path d=\"M18 3v4h-4M6 21v-4h4\" /></Glyph>\n ),\n security: (\n <Glyph><path d=\"M12 3 4 6.5V12c0 5 3.4 8.3 8 9 4.6-.7 8-4 8-9V6.5Z\" /><path d=\"m9 12 2 2 4-4\" /></Glyph>\n ),\n};\n","import { useEffect, useState, useRef } from 'react';\nimport { useAuth } from '../../context';\nimport { useCustomer } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Button, Field } from '../primitives';\nimport { PanelState } from './PanelState';\n\nexport function ProfilePanel(props: { appearance?: ThrottleAppearance; localization?: ThrottleLocalization }) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { status } = useAuth();\n const resource = useCustomer();\n const { submitting, error, notice, run } = useAction();\n\n const [form, setForm] = useState({ firstName: '', lastName: '', phone: '', company: '', acceptsMarketing: false });\n\n // True once the buyer has touched any field, cleared again after a save.\n // Without it, ANY refetch landing mid-edit silently wiped what they had\n // typed — the effect below resets from `resource.data`, and a refetch fires\n // whenever `status`/`emailVerified` change or `update()` completes. Rare in\n // a single tab, certain if verification finishes in another one. It also\n // made the ProfilePanel test flaky: the reset occasionally landed between\n // the keystroke and the submit, so the patch carried '' instead of 'Ada'.\n const edited = useRef(false);\n\n // Reset the form whenever a new profile lands, including after a save — but\n // never on top of edits in progress.\n useEffect(() => {\n const c = resource.data;\n if (!c || edited.current) return;\n setForm({\n firstName: c.firstName ?? '', lastName: c.lastName ?? '',\n phone: c.phone ?? '', company: c.company ?? '',\n acceptsMarketing: Boolean(c.acceptsMarketing),\n });\n }, [resource.data]);\n\n // Mounted standalone (outside <SignedIn>), a signed-out visitor makes\n // useCustomer() resolve to (data: null, error: null) with no network call\n // ever made — a null profile is only genuinely unexpected for a signed-in\n // buyer. Render nothing rather than \"Something went wrong.\" once we know\n // for certain there's no one signed in (not during the initial 'loading'\n // status, which still deserves its skeleton), matching how UserButton\n // already handles being mounted while signed out.\n if (status === 'unauthenticated') return null;\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('profilePanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n isEmpty={(c) => c === null}\n emptyTitle={t.common.somethingWentWrong}\n skeletonRows={4}\n >\n {(customer) => (\n <form\n {...a.el('profilePanel.form', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n // Explicit patch. `email` is not in it — the buyer plane has no\n // email-change route, and sending an unknown field would be\n // rejected rather than silently ignored.\n edited.current = false;\n await resource.update({\n firstName: form.firstName,\n lastName: form.lastName,\n phone: form.phone,\n company: form.company || null,\n acceptsMarketing: form.acceptsMarketing,\n });\n return t.profile.savedNotice;\n });\n }}\n >\n <Field label={t.profile.email} type=\"email\" value={customer!.email} onChange={() => {}}\n disabled hint={t.profile.emailReadOnly} />\n <Field label={t.profile.firstName} value={form.firstName} autoComplete=\"given-name\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, firstName: v })); }} />\n <Field label={t.profile.lastName} value={form.lastName} autoComplete=\"family-name\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, lastName: v })); }} />\n <Field label={t.profile.phone} type=\"tel\" value={form.phone} autoComplete=\"tel\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, phone: v })); }} />\n <Field label={t.profile.company} value={form.company} autoComplete=\"organization\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, company: v })); }} />\n <label className=\"throttle-row\">\n <input\n type=\"checkbox\"\n checked={form.acceptsMarketing}\n onChange={(e) => { edited.current = true; setForm((f) => ({ ...f, acceptsMarketing: e.target.checked })); }}\n />\n <span>{t.profile.acceptsMarketing}</span>\n </label>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"profilePanel.submitButton\">\n {t.profile.saveButton}\n </Button>\n </form>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport type { Resource } from '../../hooks';\nimport { useCopy } from '../localization';\nimport { Alert, Button, EmptyState, Skeleton } from '../primitives';\n\nexport interface PanelStateProps<T> {\n resource: Resource<T>;\n /**\n * True when the buyer is unverified AND this resource is behind the claim\n * cutoff. An empty list then means \"withheld\", not \"none\" — see spec §10.\n */\n gated?: boolean;\n gatedDescription?: string;\n isEmpty(data: T): boolean;\n emptyTitle: string;\n emptyDescription?: string;\n skeletonRows?: number;\n children(data: T): ReactNode;\n}\n\nexport function PanelState<T>(props: PanelStateProps<T>) {\n const { t, errorMessage } = useCopy();\n const { data, isLoading, error, refetch } = props.resource;\n const empty = props.isEmpty(data);\n\n // Only skeleton the FIRST load. A refetch that blanked the panel would make\n // every save flash the whole list away and back.\n if (isLoading && empty) return <Skeleton count={props.skeletonRows ?? 3} />;\n\n const errorBanner = error ? (\n <div className=\"throttle-stack\">\n <Alert tone=\"error\">{errorMessage(error)}</Alert>\n <Button variant=\"secondary\" onClick={() => void refetch()}>{t.common.retry}</Button>\n </div>\n ) : null;\n\n // A verification error is not a failure — it is the gate. Routes differ in\n // how they express it: /me/orders is `buyerAuth: 'session'` so an unverified\n // buyer gets an empty 200, while /me/payment-methods is 'session+verified'\n // and returns 403. Same cause, two signals. Without this, one panel tells the\n // buyer to verify their email and its sibling shows a red alert with a Retry\n // button that cannot possibly succeed.\n const gatedByVerification = (error as { code?: string } | null)?.code === 'verification_required';\n if (gatedByVerification && empty) {\n return <EmptyState title={props.emptyTitle} description={props.gatedDescription ?? props.emptyDescription} />;\n }\n\n // An error with nothing behind it is all there is to show. But a resource\n // can hold an error (e.g. a refetch that blipped after a successful write)\n // while `data` still holds good, freshly-saved content — dropping that\n // content here would report a working save as a failure.\n if (error && empty) return errorBanner;\n\n if (empty) {\n return props.gated\n ? <EmptyState title={props.emptyTitle} description={props.gatedDescription} />\n : <EmptyState title={props.emptyTitle} description={props.emptyDescription} />;\n }\n\n return (\n <>\n {errorBanner}\n {props.children(data)}\n </>\n );\n}\n","import { useState } from 'react';\nimport type { Address } from '../../../types';\nimport { useAddresses } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { AddressForm } from './AddressForm';\n\n/**\n * Composition of the list of records a panel renders. `'boxed'` is today's\n * shipped look (each item its own bordered box, outlined action buttons) and\n * must stay byte-for-byte identical to it. `'rows'` separates items with a\n * hairline instead, and renders actions as plain text — the motivation is\n * that the account dashboard is itself a bordered card, so a panel built from\n * bordered boxes is a card inside a card with nothing establishing hierarchy.\n * `'table'` is a real `<table>` with column headers, for merchants who want\n * their buyer's records (especially money) in aligned tabular columns.\n */\nexport type AccountPanelVariant = 'rows' | 'boxed' | 'table';\n\nexport function AddressesPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const resource = useAddresses();\n const { submitting, error, run } = useAction();\n // `null` = closed, 'new' = creating, an Address = editing that one.\n const [editing, setEditing] = useState<Address | 'new' | null>(null);\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const close = () => setEditing(null);\n\n const formatAddress = (address: Address) =>\n [address.addressLine2, address.city, address.stateProvince, address.postalCode, address.countryCode]\n .filter(Boolean).join(', ');\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('addressesPanel.root', 'throttle-panel')}>\n {/*\n Only outside the form: AddressForm renders the same `error` itself,\n and showing it twice would be worse than not at all. Without this,\n a failed delete or make-default produced no feedback anywhere — the\n row simply stayed put and the buyer clicked again. Every sibling\n panel already surfaces its action errors here.\n */}\n {!editing && error ? <Alert tone=\"error\">{error}</Alert> : null}\n {editing ? (\n <AddressForm\n initial={editing === 'new' ? undefined : editing}\n submitting={submitting}\n error={error}\n onCancel={close}\n onSubmit={(input) => void run(async () => {\n if (editing === 'new') await resource.create(input);\n else await resource.update(editing.id, input);\n close();\n })}\n />\n ) : (\n <>\n <Button elementKey=\"addressesPanel.addButton\" variant=\"secondary\" onClick={() => setEditing('new')}>\n {t.addresses.addButton}\n </Button>\n <PanelState\n resource={resource}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.addresses.empty}\n emptyDescription={t.addresses.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"addressesPanel.table\"\n rowElementKey=\"addressesPanel.row\"\n rowKey={(address) => address.id}\n rows={rows}\n columns={[\n { key: 'label', label: t.addresses.label, render: (address) => address.label || address.addressLine1 },\n { key: 'address', label: t.addresses.columnAddress, render: (address) => (\n <>\n {address.addressLine1}\n {formatAddress(address) ? `, ${formatAddress(address)}` : ''}\n </>\n ) },\n { key: 'default', label: t.addresses.defaultBadge, render: (address) => (\n address.isDefault ? <Badge tone=\"success\">{t.addresses.defaultBadge}</Badge> : null\n ) },\n { key: 'actions', label: t.common.actions, render: (address) => (\n <div className=\"throttle-actions\">\n {!address.isDefault ? (\n <Button variant=\"secondary\" elementKey=\"addressesPanel.defaultButton\"\n onClick={() => void run(() => resource.update(address.id, { isDefault: true }))}>\n {t.addresses.makeDefault}\n </Button>\n ) : null}\n <Button variant=\"secondary\" elementKey=\"addressesPanel.editButton\"\n onClick={() => setEditing(address)}>\n {t.common.edit}\n </Button>\n <Button\n variant=\"danger\"\n elementKey=\"addressesPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.addresses.deleteConfirm)) return;\n void run(() => resource.remove(address.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n ) },\n ]}\n />\n ) : (\n <div {...a.el('addressesPanel.list', listBase)}>\n {rows.map((address) => (\n <div key={address.id} {...a.el('addressesPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{address.label || address.addressLine1}</strong>\n {address.isDefault ? <Badge tone=\"success\">{t.addresses.defaultBadge}</Badge> : null}\n </div>\n <p className=\"throttle-muted\">\n {/* addressLine1 stays its own text node (not joined into the\n sentence below) so it remains exact-text-matchable on its\n own, the way a merchant's own address list would render it. */}\n {address.addressLine1}\n </p>\n <p className=\"throttle-muted\">\n {formatAddress(address)}\n </p>\n </div>\n <div className=\"throttle-actions\">\n {/* No \"make default\" on the one that already is — a\n control whose only outcome is a no-op is noise. */}\n {!address.isDefault ? (\n <Button variant={actionVariant('secondary')} elementKey=\"addressesPanel.defaultButton\"\n onClick={() => void run(() => resource.update(address.id, { isDefault: true }))}>\n {t.addresses.makeDefault}\n </Button>\n ) : null}\n <Button variant={actionVariant('secondary')} elementKey=\"addressesPanel.editButton\"\n onClick={() => setEditing(address)}>\n {t.common.edit}\n </Button>\n <Button\n variant={actionVariant('danger')}\n elementKey=\"addressesPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.addresses.deleteConfirm)) return;\n void run(() => resource.remove(address.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </>\n )}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { Address, AddressInput } from '../../../types';\nimport { useAppearance } from '../appearance';\nimport { useCopy } from '../localization';\nimport { Alert, Button, Field } from '../primitives';\n\nexport function AddressForm(props: {\n initial?: Address;\n submitting: boolean;\n error: string | null;\n onSubmit(input: AddressInput): void;\n onCancel(): void;\n}) {\n const a = useAppearance();\n const { t } = useCopy();\n const i = props.initial;\n const [form, setForm] = useState({\n label: i?.label ?? '', firstName: i?.firstName ?? '', lastName: i?.lastName ?? '',\n company: i?.company ?? '', addressLine1: i?.addressLine1 ?? '', addressLine2: i?.addressLine2 ?? '',\n city: i?.city ?? '', stateProvince: i?.stateProvince ?? '', postalCode: i?.postalCode ?? '',\n countryCode: i?.countryCode ?? '', phone: i?.phone ?? '',\n });\n const set = (key: keyof typeof form) => (value: string) => setForm((f) => ({ ...f, [key]: value }));\n\n return (\n <form\n {...a.el('addressesPanel.form', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n props.onSubmit({\n label: form.label || undefined,\n firstName: form.firstName || undefined,\n lastName: form.lastName || undefined,\n company: form.company || undefined,\n addressLine1: form.addressLine1,\n addressLine2: form.addressLine2 || undefined,\n city: form.city,\n stateProvince: form.stateProvince || undefined,\n postalCode: form.postalCode || undefined,\n // The API wants ISO-3166 alpha-2; uppercase so \"gb\" is not rejected.\n countryCode: form.countryCode.toUpperCase(),\n phone: form.phone || undefined,\n });\n }}\n >\n <Field label={t.addresses.label} value={form.label} onChange={set('label')} />\n <Field label={t.addresses.firstName} value={form.firstName} onChange={set('firstName')} autoComplete=\"given-name\" />\n <Field label={t.addresses.lastName} value={form.lastName} onChange={set('lastName')} autoComplete=\"family-name\" />\n <Field label={t.addresses.company} value={form.company} onChange={set('company')} autoComplete=\"organization\" />\n <Field label={t.addresses.addressLine1} value={form.addressLine1} onChange={set('addressLine1')}\n required autoComplete=\"address-line1\" />\n <Field label={t.addresses.addressLine2} value={form.addressLine2} onChange={set('addressLine2')}\n autoComplete=\"address-line2\" />\n <Field label={t.addresses.city} value={form.city} onChange={set('city')} required autoComplete=\"address-level2\" />\n <Field label={t.addresses.stateProvince} value={form.stateProvince} onChange={set('stateProvince')}\n autoComplete=\"address-level1\" />\n <Field label={t.addresses.postalCode} value={form.postalCode} onChange={set('postalCode')}\n autoComplete=\"postal-code\" />\n <Field label={t.addresses.countryCode} value={form.countryCode} onChange={set('countryCode')}\n required autoComplete=\"country\" hint=\"ISO 3166-1 alpha-2, e.g. GB\" />\n <Field label={t.addresses.phone} type=\"tel\" value={form.phone} onChange={set('phone')} autoComplete=\"tel\" />\n {props.error ? <Alert tone=\"error\">{props.error}</Alert> : null}\n <div className=\"throttle-actions\">\n <Button type=\"submit\" loading={props.submitting}>{t.common.save}</Button>\n <Button variant=\"link\" onClick={props.onCancel}>{t.common.cancel}</Button>\n </div>\n </form>\n );\n}\n","import { useAuth } from '../../context';\nimport { useSavedCards } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\n/**\n * Read-only by design. There is no buyer-plane route to add a payment method —\n * the embed-token endpoint lives on the merchant plane behind a pm_client_token\n * — so this panel offers no \"Add card\" control, not even a disabled one. The\n * empty state explains where cards actually come from, which stays true if a\n * buyer-plane add route is built later.\n */\nexport function PaymentMethodsPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useSavedCards();\n const { submitting, error, run } = useAction();\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const cardLabel = (card: { cardBrand: string | null; methodType: string; cardLastFour: string | null }) =>\n `${(card.cardBrand ?? card.methodType).toUpperCase()} •••• ${card.cardLastFour ?? '____'}`;\n const expiryLabel = (card: { cardExpMonth: number | null; cardExpYear: number | null }) =>\n card.cardExpMonth && card.cardExpYear\n ? `${String(card.cardExpMonth).padStart(2, '0')}/${card.cardExpYear}`\n : '';\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('paymentMethodsPanel.root', 'throttle-panel')}>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {/*\n The real GET /me/payment-methods 403s outright for an unverified\n buyer (buyerAuth: 'session+verified'), which PanelState's own\n error branch already renders — this `gated` prop instead covers\n the OTHER empty case every sibling panel (Orders/Invoices/\n Subscriptions) already covers: signed-out entirely (status !==\n 'authenticated'), where the resource resets to empty/no-error\n without ever calling the network. Before this, PaymentMethodsPanel\n was the only one of the four that showed the plain \"No saved\n cards\" copy there instead of matching its siblings.\n */}\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.paymentMethods.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.paymentMethods.empty}\n emptyDescription={t.paymentMethods.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"paymentMethodsPanel.table\"\n rowElementKey=\"paymentMethodsPanel.row\"\n rowKey={(card) => card.id}\n rows={rows}\n columns={[\n { key: 'card', label: t.paymentMethods.columnCard, render: (card) => cardLabel(card) },\n { key: 'expires', label: t.paymentMethods.expires, render: (card) => expiryLabel(card) },\n { key: 'default', label: t.paymentMethods.defaultBadge, render: (card) => (\n card.isDefault ? <Badge tone=\"success\">{t.paymentMethods.defaultBadge}</Badge> : null\n ) },\n { key: 'actions', label: t.common.actions, render: (card) => (\n <div className=\"throttle-actions\">\n {!card.isDefault ? (\n <Button variant=\"secondary\" loading={submitting}\n elementKey=\"paymentMethodsPanel.defaultButton\"\n onClick={() => void run(() => resource.setDefault(card.id))}>\n {t.paymentMethods.makeDefault}\n </Button>\n ) : null}\n <Button\n variant=\"danger\"\n elementKey=\"paymentMethodsPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.paymentMethods.deleteConfirm)) return;\n void run(() => resource.remove(card.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n ) },\n ]}\n />\n ) : (\n <div {...a.el('paymentMethodsPanel.list', listBase)}>\n {rows.map((card) => (\n <div key={card.id} {...a.el('paymentMethodsPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{cardLabel(card)}</strong>\n {card.isDefault ? <Badge tone=\"success\">{t.paymentMethods.defaultBadge}</Badge> : null}\n </div>\n {card.cardExpMonth && card.cardExpYear ? (\n <p className=\"throttle-muted\">\n {t.paymentMethods.expires} {String(card.cardExpMonth).padStart(2, '0')}/{card.cardExpYear}\n </p>\n ) : null}\n </div>\n <div className=\"throttle-actions\">\n {!card.isDefault ? (\n <Button variant={actionVariant('secondary')} loading={submitting}\n elementKey=\"paymentMethodsPanel.defaultButton\"\n onClick={() => void run(() => resource.setDefault(card.id))}>\n {t.paymentMethods.makeDefault}\n </Button>\n ) : null}\n <Button\n variant={actionVariant('danger')}\n elementKey=\"paymentMethodsPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.paymentMethods.deleteConfirm)) return;\n void run(() => resource.remove(card.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport { useAuth } from '../../context';\nimport { useOrders } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { OrderDetail } from './OrderDetail';\nimport { OrderStatus } from './OrderStatus';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function OrdersPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n onViewSubscription?(id: string): void;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useOrders();\n const [openId, setOpenId] = useState<string | null>(null);\n // Orders/Invoices already render a DataTable, so `table` stays their default\n // — a merchant configuring nothing keeps money in aligned tabular columns.\n const variant = props.variant ?? 'table';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n\n if (openId) {\n return (\n <OrderDetail\n orderId={openId}\n onBack={() => setOpenId(null)}\n onViewSubscription={props.onViewSubscription}\n appearance={props.appearance}\n localization={props.localization}\n />\n );\n }\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('ordersPanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n // An unverified buyer is behind the claim cutoff: an empty list here\n // means \"withheld\", not \"none\".\n gated={!emailVerified}\n gatedDescription={t.orders.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.orders.empty}\n emptyDescription={t.orders.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"ordersPanel.table\"\n rowElementKey=\"ordersPanel.row\"\n rowKey={(o) => o.id}\n onRowClick={(o) => setOpenId(o.id)}\n rows={rows}\n columns={[\n { key: 'orderNumber', label: t.orders.number },\n { key: 'createdAt', label: t.orders.date, render: (o) => formatDate(o.createdAt, locale) },\n { key: 'status', label: t.orders.status,\n render: (o) => <OrderStatus status={o.status} paymentStatus={o.paymentStatus} t={t} /> },\n { key: 'total', label: t.orders.total,\n render: (o) => <span className=\"throttle-table__money\">{formatMoney(o.total, o.currency, locale)}</span> },\n ]}\n />\n ) : (\n <div {...a.el('ordersPanel.list', listBase)}>\n {rows.map((o) => (\n <div key={o.id} {...a.el('ordersPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{o.orderNumber}</strong>\n <OrderStatus status={o.status} paymentStatus={o.paymentStatus} t={t} />\n </div>\n <p className=\"throttle-muted\">{formatDate(o.createdAt, locale)}</p>\n <p className=\"throttle-muted\">{formatMoney(o.total, o.currency, locale)}</p>\n </div>\n <div className=\"throttle-actions\">\n <Button variant={rowsVariant ? 'link' : 'secondary'} elementKey=\"ordersPanel.viewButton\"\n onClick={() => setOpenId(o.id)}>\n {t.common.view}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","/**\n * The only place minor units become major units. Every amount on the wire is\n * an integer in the currency's smallest unit, and the exponent varies: USD and\n * EUR are 2, JPY and KRW are 0, and a few are 3. `Intl` knows all of them, so\n * ask it rather than hardcoding 100.\n */\nexport function formatMoney(minorUnits: number, currency: string, locale: string): string {\n const code = (currency || 'USD').toUpperCase();\n\n // The exponent is a property of the currency, not of the display locale, so\n // probe it with a fixed locale rather than the caller's — a locale problem\n // must never be able to corrupt the amount.\n let digits = 2;\n try {\n digits = new Intl.NumberFormat('en-US', { style: 'currency', currency: code }).resolvedOptions()\n .maximumFractionDigits ?? 2;\n } catch {\n // Only a malformed code (not 3 letters) reaches here. 2 is a guess for\n // that case, not a rule about currencies in general.\n }\n const major = minorUnits / 10 ** digits;\n\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency: code }).format(major);\n } catch {\n try {\n return new Intl.NumberFormat('en-US', { style: 'currency', currency: code }).format(major);\n } catch {\n // Both locales rejected the code outright. Label the amount with the\n // code rather than showing a bare number — a buyer seeing \"US 25.00\"\n // is better served than one seeing an unlabelled \"25\".\n return `${code} ${major.toFixed(digits)}`;\n }\n }\n}\n\nexport function formatDate(value: string | Date, locale: string): string {\n const date = value instanceof Date ? value : new Date(value);\n // An unparseable date must not render the literal text \"Invalid Date\".\n if (Number.isNaN(date.getTime())) return '';\n try {\n return new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date);\n } catch {\n return date.toISOString().slice(0, 10);\n }\n}\n","import { Badge } from '../primitives';\nimport type { ResolvedCopy } from '../localization';\n\n/**\n * An order's status is two facts, not one string: where it is in the\n * fulfilment lifecycle, and — only when there is something to say — what the\n * money is doing. The server models them as two columns for the same reason:\n * fulfilment only moves forward while money moves both ways, so a shipped\n * order can still be refunded.\n *\n * Rendering them as two badges rather than one compound label keeps the common\n * case (paid in full) to a single quiet pill, and keeps the money half legible\n * at table scale instead of truncating \"Fulfilled — Partially refunded\".\n */\n\n/** snake_case on the wire, camelCase in the copy object. */\nfunction copyKey(wire: string): string {\n return wire.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase());\n}\n\n/**\n * The money states a buyer must act on or would want to notice. Everything\n * else stays neutral — a lifecycle state is a fact, not good or bad news, and\n * a table where every row carries a tone teaches buyers to ignore all of them.\n */\nconst ATTENTION_PAYMENT_STATES = new Set(['pending', 'failed', 'disputed', 'expired']);\n\n/**\n * Renders one status value through a copy map, falling back to a readable form\n * of the wire value. Shared by orders, invoices and subscriptions so a status\n * added server-side degrades the same way everywhere instead of leaking\n * snake_case into one panel and not another.\n */\n/**\n * States that are over. They get the quiet outline tier rather than the filled\n * neutral one: a cancelled order and a processing order previously drew the\n * same pill, so a buyer scanning a list could not tell live from finished\n * without reading every row.\n */\nconst TERMINAL_STATUSES = new Set(['cancelled', 'closed', 'void', 'expired', 'voided']);\n\nexport function StatusBadge(props: { status: string; labels: Record<string, string | undefined> }) {\n const label = props.labels[copyKey(props.status)] ?? props.status.replace(/_/g, ' ');\n return <Badge tone={TERMINAL_STATUSES.has(props.status) ? 'muted' : 'neutral'}>{label}</Badge>;\n}\n\nexport function OrderStatus(props: { status: string; paymentStatus?: string | null; t: ResolvedCopy['t'] }) {\n const labels = props.t.orders.statusLabels as Record<string, string | undefined>;\n const payLabels = props.t.orders.paymentLabels as Record<string, string | undefined>;\n\n // An unrecognised status still has to render something a buyer can read, so\n // fall back to the wire value with its underscores removed rather than\n // showing `partially_fulfilled` or an empty pill.\n const lifecycle = labels[copyKey(props.status)] ?? props.status.replace(/_/g, ' ');\n const money = props.paymentStatus ? payLabels[copyKey(props.paymentStatus)] : undefined;\n\n return (\n <>\n <Badge tone={TERMINAL_STATUSES.has(props.status) ? 'muted' : 'neutral'}>{lifecycle}</Badge>\n {money ? (\n <Badge tone={ATTENTION_PAYMENT_STATES.has(props.paymentStatus!) ? 'warning' : 'neutral'}>{money}</Badge>\n ) : null}\n </>\n );\n}\n","import { useOrder } from '../../hooks';\nimport { OrderStatus } from './OrderStatus';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Badge, Button } from '../primitives';\nimport { PanelState } from './PanelState';\n\nfunction Line(props: { label: string; value: string }) {\n return (\n <div className=\"throttle-row\">\n <span className=\"throttle-muted\">{props.label}</span>\n <span>{props.value}</span>\n </div>\n );\n}\n\nexport function OrderDetail(props: {\n orderId: string;\n onBack?(): void;\n onViewSubscription?(id: string): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const resource = useOrder(props.orderId);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('orderDetail.root', 'throttle-panel')}>\n {props.onBack ? (\n // Wrapped on purpose. The panel is a column flex container, so a\n // direct child stretches to its full width however `width: auto`\n // the link variant is — the control rendered 748px wide with a\n // centred label. The wrapper takes the stretch; the button keeps\n // its own width. A CSS fix would need a compound selector, and\n // those outrank the merchant overrides in `appearance.elements`.\n <div>\n <Button variant=\"link\" elementKey=\"orderDetail.backButton\" onClick={props.onBack}>\n {t.common.back}\n </Button>\n </div>\n ) : null}\n\n <PanelState\n resource={resource}\n isEmpty={(o) => o === null}\n emptyTitle={t.orders.empty}\n skeletonRows={5}\n >\n {(order) => (\n <>\n <div className=\"throttle-row\">\n <h3>{order!.orderNumber}</h3>\n <OrderStatus status={order!.status} paymentStatus={order!.paymentStatus} t={t} />\n </div>\n <p className=\"throttle-muted\">{formatDate(order!.createdAt, locale)}</p>\n\n <div {...a.el('orderDetail.lineItems', 'throttle-stack')}>\n {order!.lineItems.map((item) => (\n <div key={item.id} {...a.el('orderDetail.lineItem', 'throttle-lineitem')}>\n {item.imageUrl ? (\n <img className=\"throttle-lineitem__image\" src={item.imageUrl} alt=\"\" />\n ) : null}\n <div style={{ flex: 1 }}>\n <strong>{item.name}</strong>\n {item.description ? <p className=\"throttle-muted\">{item.description}</p> : null}\n <p className=\"throttle-muted\">\n {t.orders.quantity} {item.quantity} × {formatMoney(item.unitPrice, order!.currency, locale)}\n </p>\n </div>\n <span>{formatMoney(item.total, order!.currency, locale)}</span>\n </div>\n ))}\n </div>\n\n <div {...a.el('orderDetail.totals', 'throttle-totals')}>\n <Line label={t.orders.subtotal} value={formatMoney(order!.subtotal, order!.currency, locale)} />\n {order!.discountTotal ? (\n <Line label={t.orders.discount} value={formatMoney(-order!.discountTotal, order!.currency, locale)} />\n ) : null}\n <Line label={t.orders.shipping} value={formatMoney(order!.shippingTotal, order!.currency, locale)} />\n <Line label={t.orders.tax} value={formatMoney(order!.taxTotal, order!.currency, locale)} />\n <Line label={t.orders.total} value={formatMoney(order!.total, order!.currency, locale)} />\n </div>\n\n {order!.subscriptionId && props.onViewSubscription ? (\n <Button variant=\"secondary\" onClick={() => props.onViewSubscription!(order!.subscriptionId!)}>\n {t.orders.viewSubscription}\n </Button>\n ) : null}\n </>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport { StatusBadge } from './OrderStatus';\nimport { useAuth } from '../../context';\nimport { useInvoices } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { InvoiceDetail } from './InvoiceDetail';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function InvoicesPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useInvoices();\n const [openId, setOpenId] = useState<string | null>(null);\n // Orders/Invoices already render a DataTable, so `table` stays their default\n // — a merchant configuring nothing keeps money in aligned tabular columns.\n const variant = props.variant ?? 'table';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n\n if (openId) {\n return (\n <InvoiceDetail invoiceId={openId} onBack={() => setOpenId(null)}\n appearance={props.appearance} localization={props.localization} />\n );\n }\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('invoicesPanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.invoices.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.invoices.empty}\n emptyDescription={t.invoices.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"invoicesPanel.table\"\n rowElementKey=\"invoicesPanel.row\"\n rowKey={(i) => i.id}\n onRowClick={(i) => setOpenId(i.id)}\n rows={rows}\n columns={[\n { key: 'number', label: t.invoices.number },\n { key: 'issuedAt', label: t.invoices.issued, render: (i) => formatDate(i.issuedAt, locale) },\n { key: 'status', label: t.invoices.status, render: (i) => <StatusBadge status={i.status} labels={t.invoices.statusLabels} /> },\n { key: 'total', label: t.invoices.total,\n render: (i) => <span className=\"throttle-table__money\">{formatMoney(i.total, i.currency, locale)}</span> },\n ]}\n />\n ) : (\n <div {...a.el('invoicesPanel.list', listBase)}>\n {rows.map((i) => (\n <div key={i.id} {...a.el('invoicesPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{i.number}</strong>\n <StatusBadge status={i.status} labels={t.invoices.statusLabels} />\n </div>\n <p className=\"throttle-muted\">{formatDate(i.issuedAt, locale)}</p>\n <p className=\"throttle-muted\">{formatMoney(i.total, i.currency, locale)}</p>\n </div>\n <div className=\"throttle-actions\">\n <Button variant={rowsVariant ? 'link' : 'secondary'} elementKey=\"invoicesPanel.viewButton\"\n onClick={() => setOpenId(i.id)}>\n {t.common.view}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useAuth } from '../../context';\nimport { StatusBadge } from './OrderStatus';\nimport { useInvoice } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate, formatMoney } from '../format';\nimport { Alert, Badge, Button } from '../primitives';\nimport { PanelState } from './PanelState';\n\nfunction Line(props: { label: string; value: string }) {\n return (\n <div className=\"throttle-row\">\n <span className=\"throttle-muted\">{props.label}</span>\n <span>{props.value}</span>\n </div>\n );\n}\n\nexport function InvoiceDetail(props: {\n invoiceId: string;\n onBack?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { account } = useAuth();\n const resource = useInvoice(props.invoiceId);\n const { submitting, error, run } = useAction();\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('invoiceDetail.root', 'throttle-panel')}>\n {props.onBack ? (\n // Wrapped on purpose. The panel is a column flex container, so a\n // direct child stretches to its full width however `width: auto`\n // the link variant is — the control rendered 748px wide with a\n // centred label. The wrapper takes the stretch; the button keeps\n // its own width. A CSS fix would need a compound selector, and\n // those outrank the merchant overrides in `appearance.elements`.\n <div>\n <Button variant=\"link\" elementKey=\"invoiceDetail.backButton\" onClick={props.onBack}>\n {t.common.back}\n </Button>\n </div>\n ) : null}\n\n <PanelState resource={resource} isEmpty={(i) => i === null} emptyTitle={t.invoices.empty} skeletonRows={4}>\n {(invoice) => (\n <>\n <div className=\"throttle-row\">\n <h3>{invoice!.number}</h3>\n <StatusBadge status={invoice!.status} labels={t.invoices.statusLabels} />\n </div>\n\n <div {...a.el('invoiceDetail.totals', 'throttle-totals')}>\n <Line label={t.invoices.issued} value={formatDate(invoice!.issuedAt, locale)} />\n {invoice!.dueAt ? <Line label={t.invoices.due} value={formatDate(invoice!.dueAt, locale)} /> : null}\n {invoice!.periodStart && invoice!.periodEnd ? (\n <Line\n label={t.invoices.period}\n value={`${formatDate(invoice!.periodStart, locale)} – ${formatDate(invoice!.periodEnd, locale)}`}\n />\n ) : null}\n <Line label={t.invoices.total} value={formatMoney(invoice!.total, invoice!.currency, locale)} />\n {invoice!.amountRefunded ? (\n <Line label={t.invoices.refunded}\n value={formatMoney(invoice!.amountRefunded, invoice!.currency, locale)} />\n ) : null}\n </div>\n\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"invoiceDetail.downloadButton\"\n onClick={() => void run(async () => {\n // Fetched on click, never on render: the signed URL lives 600\n // seconds, so a link prepared when the page loaded would be\n // dead by the time a buyer reading the invoice clicked it.\n const { url } = await account.getInvoicePdfUrl(invoice!.id);\n // The user-activation token does not survive the await, so\n // Safari blocks this popup outright and Chrome does past\n // about a second. window.open then returns null and the\n // buyer saw the spinner stop with nothing else happening.\n // Navigating the current tab always works; the PDF is a\n // terminal destination, so nothing is lost by not opening\n // a new one.\n const opened = window.open(url, '_blank', 'noopener,noreferrer');\n if (!opened) window.location.assign(url);\n })}\n >\n {t.invoices.downloadButton}\n </Button>\n </>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useAuth } from '../../context';\nimport { StatusBadge } from './OrderStatus';\nimport { useSubscriptions } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate, formatMoney } from '../format';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\n// Lifecycle controls only make sense in some states. Acting on a cancelled\n// subscription either 400s or silently no-ops depending on the action, so the\n// controls are hidden rather than shown and allowed to fail.\nconst CAN_PAUSE = new Set(['active', 'trialing']);\nconst CAN_RESUME = new Set(['paused']);\n// 'unpaid' is the terminal dunning state — cancel() does not short-circuit on\n// it (only on 'cancelled'), so a buyer stuck there must still be able to get\n// out rather than being left with no control but \"contact support\".\nconst CAN_CANCEL = new Set(['active', 'trialing', 'paused', 'past_due', 'unpaid']);\n\nexport function SubscriptionsPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useSubscriptions();\n const { submitting, error, run } = useAction();\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const confirmThen = (fn: () => Promise<void>) => () => {\n if (!window.confirm(t.subscriptions.cancelConfirm)) return;\n void run(fn);\n };\n\n const priceLabel = (sub: { amount: number; currency: string; interval: string; quantity: number }) =>\n `${formatMoney(sub.amount, sub.currency, locale)} / ${sub.interval}${sub.quantity > 1 ? ` × ${sub.quantity}` : ''}`;\n\n const renewsLabel = (sub: { status: string; cancelledAt: string | null; currentPeriodEnd: string }) =>\n formatDate(sub.status === 'cancelled' ? (sub.cancelledAt ?? sub.currentPeriodEnd) : sub.currentPeriodEnd, locale);\n\n const lifecycleActions = (\n sub: { id: string; status: string; cancelAtPeriodEnd: boolean },\n variantFor: (base: 'secondary' | 'danger') => 'secondary' | 'danger' | 'link' | 'linkDanger',\n ) => (\n <div className=\"throttle-actions\">\n {CAN_PAUSE.has(sub.status) ? (\n <Button variant={variantFor('secondary')} loading={submitting}\n elementKey=\"subscriptionsPanel.pauseButton\"\n onClick={() => void run(() => resource.pause(sub.id))}>\n {t.subscriptions.pauseButton}\n </Button>\n ) : null}\n {CAN_RESUME.has(sub.status) ? (\n <Button variant={variantFor('secondary')} loading={submitting}\n elementKey=\"subscriptionsPanel.resumeButton\"\n onClick={() => void run(() => resource.resume(sub.id))}>\n {t.subscriptions.resumeButton}\n </Button>\n ) : null}\n {CAN_CANCEL.has(sub.status) && !sub.cancelAtPeriodEnd ? (\n <Button variant={variantFor('secondary')} elementKey=\"subscriptionsPanel.cancelButton\" disabled={submitting}\n onClick={confirmThen(() => resource.cancel(sub.id, { atPeriodEnd: true }))}>\n {t.subscriptions.cancelAtPeriodEnd}\n </Button>\n ) : null}\n {CAN_CANCEL.has(sub.status) ? (\n <Button variant={variantFor('danger')} elementKey=\"subscriptionsPanel.cancelNowButton\" disabled={submitting}\n onClick={confirmThen(() => resource.cancel(sub.id, { atPeriodEnd: false }))}>\n {t.subscriptions.cancelNow}\n </Button>\n ) : null}\n </div>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('subscriptionsPanel.root', 'throttle-panel')}>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.subscriptions.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.subscriptions.empty}\n emptyDescription={t.subscriptions.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"subscriptionsPanel.table\"\n rowElementKey=\"subscriptionsPanel.row\"\n rowKey={(sub) => sub.id}\n rows={rows}\n columns={[\n { key: 'plan', label: t.subscriptions.columnPlan, render: (sub) => sub.planName ?? sub.planReference },\n { key: 'price', label: t.subscriptions.columnPrice, render: (sub) => (\n <span className=\"throttle-table__money\">{priceLabel(sub)}</span>\n ) },\n { key: 'renews', label: t.subscriptions.columnRenews, render: (sub) => renewsLabel(sub) },\n { key: 'status', label: t.subscriptions.columnStatus, render: (sub) => (\n <div className=\"throttle-row\">\n <StatusBadge status={sub.status} labels={t.subscriptions.statusLabels} />\n {sub.cancelAtPeriodEnd ? <Badge tone=\"warning\">{t.subscriptions.cancelScheduled}</Badge> : null}\n </div>\n ) },\n { key: 'actions', label: t.common.actions, render: (sub) => lifecycleActions(sub, (base) => base) },\n ]}\n />\n ) : (\n <div {...a.el('subscriptionsPanel.list', listBase)}>\n {rows.map((sub) => (\n <div key={sub.id} {...a.el('subscriptionsPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{sub.planName ?? sub.planReference}</strong>\n <StatusBadge status={sub.status} labels={t.subscriptions.statusLabels} />\n </div>\n <p className=\"throttle-muted\">\n {formatMoney(sub.amount, sub.currency, locale)} / {sub.interval}\n {sub.quantity > 1 ? ` × ${sub.quantity}` : ''}\n </p>\n {sub.status === 'cancelled' ? (\n <p className=\"throttle-muted\">\n {t.subscriptions.cancelledOn} {formatDate(sub.cancelledAt ?? sub.currentPeriodEnd, locale)}\n </p>\n ) : (\n <p className=\"throttle-muted\">\n {sub.cancelAtPeriodEnd ? t.subscriptions.endsOn : t.subscriptions.renewsOn}{' '}\n {formatDate(sub.currentPeriodEnd, locale)}\n </p>\n )}\n {sub.trialEnd ? (\n <p className=\"throttle-muted\">{t.subscriptions.trialEnds} {formatDate(sub.trialEnd, locale)}</p>\n ) : null}\n {sub.cancelAtPeriodEnd ? (\n <Badge tone=\"warning\">{t.subscriptions.cancelScheduled}</Badge>\n ) : null}\n </div>\n {lifecycleActions(sub, actionVariant)}\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\nimport { useAuth } from '../../context';\nimport type { DeviceSession } from '../../../client';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate } from '../format';\nimport { describeDevice } from './device';\nimport { Alert, Badge, Button, DataTable, Field, Skeleton } from '../primitives';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function SecurityPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale, errorMessage } = useCopy(props.localization);\n const { auth } = useAuth();\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // Revoking a session is destructive, so it keeps the danger colour even\n // when the rows variant strips the border — matching every other panel.\n // Plain 'link' made it pixel-identical to a neutral action, which is the\n // bug AddressesPanel's comment describes.\n const revokeVariant = rowsVariant ? 'linkDanger' : 'danger';\n\n const [password, setPassword] = useState('');\n const passwordAction = useAction();\n const sessionAction = useAction();\n\n const [sessions, setSessions] = useState<DeviceSession[] | null>(null);\n const [listError, setListError] = useState<string | null>(null);\n\n // `errorMessage` is held in a ref rather than listed as a dependency. It comes\n // from useCopy(props.localization), which re-memoises whenever the merchant\n // passes a fresh object literal — `<AccountDashboard localization={{ … }} />`\n // is the normal way to write it — so depending on it re-created `load` on\n // every parent render and re-fired GET /me/sessions each time. The callback\n // only needs the latest formatter, never a reason to be rebuilt.\n const errorMessageRef = useRef(errorMessage);\n useEffect(() => { errorMessageRef.current = errorMessage; });\n\n const load = useCallback(async () => {\n try {\n setSessions(await auth.listSessions());\n setListError(null);\n } catch (err) {\n setListError(errorMessageRef.current(err));\n }\n }, [auth]);\n\n useEffect(() => { void load(); }, [load]);\n\n const others = (sessions ?? []).filter((s) => !s.current);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('securityPanel.root', 'throttle-panel')}>\n <form\n {...a.el('securityPanel.passwordForm', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n void passwordAction.run(async () => {\n // May raise step_up_required; the core opens the provider's dialog\n // and retries. Nothing to do here but await the result.\n await auth.changePassword(password);\n setPassword('');\n return t.security.changedNotice;\n });\n }}\n >\n <h3>{t.security.passwordTitle}</h3>\n <Field label={t.security.newPassword} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} />\n {passwordAction.error ? <Alert tone=\"error\">{passwordAction.error}</Alert> : null}\n {passwordAction.notice ? <Alert tone=\"success\">{passwordAction.notice}</Alert> : null}\n <Button type=\"submit\" loading={passwordAction.submitting} elementKey=\"securityPanel.passwordButton\">\n {t.security.changeButton}\n </Button>\n </form>\n\n <div {...a.el('securityPanel.sessionList', 'throttle-stack')}>\n <h3>{t.security.sessionsTitle}</h3>\n {listError ? (\n <>\n <Alert tone=\"error\">{listError}</Alert>\n <Button variant=\"secondary\" onClick={() => void load()}>{t.common.retry}</Button>\n </>\n ) : null}\n {sessionAction.error ? <Alert tone=\"error\">{sessionAction.error}</Alert> : null}\n {sessions === null && !listError ? <Skeleton count={2} /> : null}\n\n {sessions !== null && !listError && variant === 'table' ? (\n <DataTable\n tableKey=\"securityPanel.table\"\n rowElementKey=\"securityPanel.row\"\n rowKey={(session) => session.id}\n rows={sessions}\n columns={[\n { key: 'device', label: t.security.columnDevice, render: (session) => (\n <div className=\"throttle-row\">\n <span>{describeDevice(session.userAgent) || session.ipPrefix || session.id}</span>\n {session.current ? <Badge tone=\"success\">{t.security.thisDevice}</Badge> : null}\n </div>\n ) },\n { key: 'lastActive', label: t.security.lastActive, render: (session) => formatDate(session.lastUsedAt, locale) },\n { key: 'actions', label: t.common.actions, render: (session) => (\n !session.current ? (\n <Button\n variant=\"danger\"\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeButton\"\n onClick={() => void sessionAction.run(async () => {\n await auth.revokeSession(session.id);\n await load();\n })}\n >\n {t.security.revokeButton}\n </Button>\n ) : null\n ) },\n ]}\n />\n ) : (\n (sessions ?? []).map((session) => (\n <div key={session.id} {...a.el('securityPanel.sessionItem', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{describeDevice(session.userAgent) || session.ipPrefix || session.id}</strong>\n {session.current ? <Badge tone=\"success\">{t.security.thisDevice}</Badge> : null}\n </div>\n <p className=\"throttle-muted\">\n {t.security.lastActive} {formatDate(session.lastUsedAt, locale)}\n </p>\n </div>\n {/* No revoke on the current session: that is just signing out, and\n a button that logs you out while labelled \"sign out of this\n device\" in a device list is a trap. */}\n {!session.current ? (\n <Button\n variant={revokeVariant}\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeButton\"\n onClick={() => void sessionAction.run(async () => {\n await auth.revokeSession(session.id);\n await load();\n })}\n >\n {t.security.revokeButton}\n </Button>\n ) : null}\n </div>\n ))\n )}\n\n {sessions !== null && others.length === 0 ? (\n <p className=\"throttle-muted\">{t.security.sessionsEmpty}</p>\n ) : null}\n\n {others.length > 0 ? (\n <Button\n variant=\"danger\"\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeAllButton\"\n onClick={() => void sessionAction.run(async () => {\n // Revoke the other sessions individually rather than calling\n // signOutEverywhere(). That posts /auth/logout-all, which\n // revokes EVERY session including this one and then clears\n // local state — so a button labelled \"all other devices\"\n // signed the buyer out of the device they were reading it on\n // and blanked the dashboard with no explanation. Exactly the\n // trap the per-row comment above rejects.\n //\n // `others` is already the list this button is gated on, and\n // the per-row control uses this same endpoint. A session\n // created between the load and the click is missed; that is\n // worth far less than not logging the buyer out by surprise,\n // and the reload below immediately shows any that remain.\n for (const session of others) {\n await auth.revokeSession(session.id);\n }\n await load();\n })}\n >\n {t.security.revokeAllButton}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","/**\n * Turns a session's user agent into something a shopper can recognise.\n *\n * The device list exists so a buyer can spot a session that is not theirs and\n * revoke it. A raw 120-character UA string does not support that decision, so\n * this reduces it to browser + platform. Order matters in both tables: Edge and\n * Opera both carry \"Chrome\", and Chrome carries \"Safari\", so the more specific\n * pattern has to be tested first or every Edge session reads as Chrome.\n */\nconst BROWSERS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\bEdg(?:e|A|iOS)?\\//, 'Edge'],\n [/\\bOPR\\/|\\bOpera\\b/, 'Opera'],\n // No leading \\b: real agents ship prefixed builds (HeadlessChrome), and a\n // word boundary there sends them to the Safari rule instead.\n [/Chrome\\/|CriOS\\//, 'Chrome'],\n [/\\bFirefox\\/|\\bFxiOS\\//, 'Firefox'],\n [/\\bSafari\\//, 'Safari'],\n];\n\nconst PLATFORMS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\biPhone\\b|\\biPad\\b|\\biPod\\b/, 'iOS'],\n [/\\bAndroid\\b/, 'Android'],\n [/\\bMac OS X\\b|\\bMacintosh\\b/, 'macOS'],\n [/\\bWindows\\b/, 'Windows'],\n [/\\bLinux\\b|\\bX11\\b/, 'Linux'],\n];\n\nfunction first(ua: string, table: ReadonlyArray<readonly [RegExp, string]>) {\n for (const [pattern, label] of table) if (pattern.test(ua)) return label;\n return null;\n}\n\nexport function describeDevice(userAgent: string | null | undefined): string {\n const ua = (userAgent ?? '').trim();\n if (!ua) return '';\n const browser = first(ua, BROWSERS);\n // Nothing recognisable — an API client or a bot. Its own name is the most\n // useful thing we can show, so hand the string back untouched.\n if (!browser) return ua;\n const platform = first(ua, PLATFORMS);\n return platform ? `${browser} on ${platform}` : browser;\n}\n","import { cloneElement, isValidElement, useContext, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Button } from '../primitives';\nimport { ThrottleUIContext } from '../provider';\nimport { AuthModal } from './AuthModal';\nimport type { AuthView } from './AuthFlow';\n\nexport interface SignInButtonProps {\n mode?: 'modal' | 'redirect';\n /** Required when mode is \"redirect\". */\n url?: string;\n initialView?: AuthView;\n asChild?: boolean;\n children?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignIn?(): void;\n}\n\nexport function SignInButton(props: SignInButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n // Mounted under a <ThrottleProvider>, this drives ITS single shared modal\n // instead of opening a second one of our own — see the provider's\n // ThrottleUIContext doc. Falls back to fully local state when there is no\n // provider above (a plain <ThrottleAuthProvider>), so this component keeps\n // working on its own.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n // The shared modal only knows how to open on the plain sign-in/sign-up\n // split; an explicit `initialView` (e.g. straight to forgot-password) is a\n // per-button customization the shared instance cannot represent, so that\n // one case keeps its own local modal even under a provider.\n const useShared = ui !== null && props.initialView === undefined;\n const label = props.children ?? t.signIn.submitButton;\n\n if (props.mode === 'redirect') {\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <a {...a.el('signInButton.root', 'throttle-button throttle-button--primary')} href={props.url ?? '#'}>\n {label}\n </a>\n </span>\n </AppearanceProvider>\n );\n }\n\n const openModal = () => {\n if (useShared) ui!.openSignIn(props.afterSignIn);\n else setLocalOpen(true);\n };\n const closeModal = () => {\n if (useShared) ui!.close();\n else setLocalOpen(false);\n };\n\n const trigger =\n props.asChild && isValidElement(props.children)\n ? cloneElement(props.children as ReactElement<any>, { onClick: openModal })\n : (\n <Button elementKey=\"signInButton.root\" onClick={openModal}>{label}</Button>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n {trigger}\n </span>\n {!useShared ? (\n <AuthModal\n open={localOpen}\n onClose={closeModal}\n initialView={props.initialView}\n appearance={props.appearance}\n localization={props.localization}\n afterSignIn={() => { closeModal(); props.afterSignIn?.(); }}\n />\n ) : null}\n </AppearanceProvider>\n );\n}\n","import { cloneElement, isValidElement, useContext, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Button } from '../primitives';\nimport { ThrottleUIContext } from '../provider';\nimport { AuthModal } from './AuthModal';\nimport type { AuthView } from './AuthFlow';\n\n/** The twin of `SignInButton`, opening the same flow on the sign-up view. */\nexport interface SignUpButtonProps {\n mode?: 'modal' | 'redirect';\n /** Required when mode is \"redirect\". */\n url?: string;\n initialView?: AuthView;\n asChild?: boolean;\n children?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignUp?(): void;\n}\n\nexport function SignUpButton(props: SignUpButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n // See SignInButton: drives the provider's single shared modal when one is\n // above it, falling back to a fully local modal otherwise.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const useShared = ui !== null && props.initialView === undefined;\n const label = props.children ?? t.signUp.submitButton;\n\n if (props.mode === 'redirect') {\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <a {...a.el('signUpButton.root', 'throttle-button throttle-button--primary')} href={props.url ?? '#'}>\n {label}\n </a>\n </span>\n </AppearanceProvider>\n );\n }\n\n const openModal = () => {\n if (useShared) ui!.openSignUp(props.afterSignUp);\n else setLocalOpen(true);\n };\n const closeModal = () => {\n if (useShared) ui!.close();\n else setLocalOpen(false);\n };\n\n const trigger =\n props.asChild && isValidElement(props.children)\n ? cloneElement(props.children as ReactElement<any>, { onClick: openModal })\n : (\n <Button elementKey=\"signUpButton.root\" onClick={openModal}>{label}</Button>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n {trigger}\n </span>\n {!useShared ? (\n <AuthModal\n open={localOpen}\n onClose={closeModal}\n initialView={props.initialView ?? 'signUp'}\n appearance={props.appearance}\n localization={props.localization}\n afterSignUp={() => { closeModal(); props.afterSignUp?.(); }}\n />\n ) : null}\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { useAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Button } from '../primitives';\n\nexport interface SignOutButtonProps {\n /** Revokes every session, not just this device. May raise a step-up prompt. */\n everywhere?: boolean;\n children?: ReactNode;\n localization?: ThrottleLocalization;\n onSignedOut?(): void;\n}\n\n// Mountable on its own (not necessarily nested under another root-bearing\n// component), so it declares `.throttle-root` itself — otherwise every\n// `var(--throttle-*)` the shipped Button styles reference resolves to\n// nothing and the button renders unstyled.\nexport function SignOutButton(props: SignOutButtonProps) {\n const a = useAppearance();\n const { auth } = useAuth();\n const { t } = useCopy(props.localization);\n const { submitting, run } = useAction();\n const label = props.children ?? (props.everywhere ? t.userButton.signOutAll : t.userButton.signOut);\n\n return (\n <span {...a.rootProps}>\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"signOutButton.root\"\n onClick={() => void run(async () => {\n // signOutEverywhere can return step_up_required; the core opens the\n // provider's dialog and retries, so nothing extra is needed here.\n if (props.everywhere) await auth.signOutEverywhere();\n else await auth.signOut();\n props.onSignedOut?.();\n })}\n >\n {label}\n </Button>\n </span>\n );\n}\n","import type { ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignIn } from './SignIn';\n\nexport interface SignInPageProps {\n /** Rendered above the card. Absent by default. */\n logo?: ReactNode;\n /** Rendered below the card. Absent by default. */\n footer?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n onSuccess?(): void;\n onForgotPassword?(): void;\n onSignUp?(): void;\n}\n\n/**\n * A full-viewport, centred shell around `<SignIn/>` for merchants who drop it\n * directly on a route (e.g. `/sign-in`) and would otherwise get a card stuck\n * at the top of a bare page. `100dvh`, not `100vh` — see styles.ts.\n */\nexport function SignInPage(props: SignInPageProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('signInPage.root', 'throttle-page')}>\n {props.logo ? (\n <div {...a.el('signInPage.logo', 'throttle-page__logo')}>{props.logo}</div>\n ) : null}\n <SignIn\n onSuccess={props.onSuccess}\n onForgotPassword={props.onForgotPassword}\n onSignUp={props.onSignUp}\n appearance={props.appearance}\n localization={props.localization}\n />\n {props.footer ? (\n <div {...a.el('signInPage.footer', 'throttle-page__footer')}>{props.footer}</div>\n ) : null}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignUp } from './SignUp';\n\nexport interface SignUpPageProps {\n /** Rendered above the card. Absent by default. */\n logo?: ReactNode;\n /** Rendered below the card. Absent by default. */\n footer?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n onSuccess?(): void;\n onSignIn?(): void;\n}\n\n/** The `<SignUp/>` twin of `SignInPage`. */\nexport function SignUpPage(props: SignUpPageProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('signUpPage.root', 'throttle-page')}>\n {props.logo ? (\n <div {...a.el('signUpPage.logo', 'throttle-page__logo')}>{props.logo}</div>\n ) : null}\n <SignUp\n onSuccess={props.onSuccess}\n onSignIn={props.onSignIn}\n appearance={props.appearance}\n localization={props.localization}\n />\n {props.footer ? (\n <div {...a.el('signUpPage.footer', 'throttle-page__footer')}>{props.footer}</div>\n ) : null}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAuth } from '../context';\n\n/**\n * All three render nothing while `status === 'loading'`. A guard that treated\n * loading as signed-out would flash a \"Sign in\" button at a buyer whose\n * session is a few milliseconds from being restored.\n */\nexport function SignedIn(props: { children: ReactNode }) {\n const { status } = useAuth();\n return status === 'authenticated' ? <>{props.children}</> : null;\n}\n\nexport function SignedOut(props: { children: ReactNode }) {\n const { status } = useAuth();\n return status === 'unauthenticated' ? <>{props.children}</> : null;\n}\n\nexport function Protect(props: { requireVerified?: boolean; fallback?: ReactNode; children: ReactNode }) {\n const { status, emailVerified } = useAuth();\n if (status === 'loading') return null;\n if (status !== 'authenticated') return <>{props.fallback ?? null}</>;\n if (props.requireVerified && !emailVerified) return <>{props.fallback ?? null}</>;\n return <>{props.children}</>;\n}\n","import { useContext, useId, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from './appearance';\nimport { useCopy, type ThrottleLocalization } from './localization';\nimport { Avatar, Badge, Dropdown, DropdownItem, DropdownSeparator, Modal } from './primitives';\nimport { AccountDashboard, type AccountTab } from './account/AccountDashboard';\nimport { ThrottleUIContext } from './provider';\n\nexport interface UserButtonProps {\n /** \"modal\" opens the dashboard in an overlay; \"navigate\" links to accountUrl. */\n mode?: 'modal' | 'navigate';\n accountUrl?: string;\n /** Forwarded to the dashboard in modal mode. */\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignOut?(): void;\n children?: ReactNode;\n}\n\nfunction UserButtonRoot(props: UserButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, customer, emailVerified } = useAuth();\n // Delegate to the provider's single overlay when there is one. Two account\n // modals mounting at once is not cosmetic: each Modal captures the body's\n // overflow on open, so the second captures 'hidden' and restores 'hidden' on\n // close — leaving the merchant's page permanently unscrollable.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const accountOpen = ui ? false : localOpen;\n const titleId = useId();\n // \"Manage account\" both opens this modal AND is inside the Dropdown menu,\n // whose own onClick closes the dropdown on any click within it — both\n // state updates land in the same React commit, so the menuitem is removed\n // from the DOM in the same commit that mounts the Modal, and the browser\n // resets document.activeElement to <body> the instant a focused element is\n // removed (before Modal's own effect could ever capture it). Look up the\n // Dropdown's own trigger button instead, which stays mounted throughout —\n // see Modal's `restoreFocusTo` doc.\n const rootRef = useRef<HTMLSpanElement>(null);\n const openerRef = useRef<Element | null>(null);\n const openAccount = () => {\n const opener = rootRef.current?.querySelector('button[aria-haspopup=\"menu\"]') ?? null;\n openerRef.current = opener;\n if (ui) ui.openAccount({ tabs: props.tabs, restoreFocusTo: opener });\n else setLocalOpen(true);\n };\n\n // Nothing to show without a buyer — and nothing while loading either, so a\n // navbar never flickers between states during session restore.\n if (status !== 'authenticated' || !customer) return null;\n\n const name = [customer.firstName, customer.lastName].filter(Boolean).join(' ');\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <span ref={rootRef} {...a.el('userButton.root')}>\n <Dropdown\n label={t.userButton.openMenu}\n triggerKey=\"userButton.trigger\"\n menuKey=\"userButton.menu\"\n trigger={<Avatar name={name} email={customer.email} />}\n >\n <div {...a.el('userButton.identity', 'throttle-dropdown__item')}>\n <span>\n <span {...a.el('userButton.email')}>{customer.email}</span>\n <br />\n <Badge tone={emailVerified ? 'success' : 'warning'} elementKey=\"userButton.badge\">\n {emailVerified ? t.userButton.verified : t.userButton.unverified}\n </Badge>\n </span>\n </div>\n <DropdownSeparator />\n\n {props.mode === 'navigate' ? (\n <DropdownItem itemKey=\"userButton.manageButton\" href={props.accountUrl ?? '#'}>\n {t.userButton.manage}\n </DropdownItem>\n ) : (\n <DropdownItem itemKey=\"userButton.manageButton\" onClick={openAccount}>\n {t.userButton.manage}\n </DropdownItem>\n )}\n\n {props.children}\n <DropdownSeparator />\n\n <DropdownItem\n itemKey=\"userButton.signOutButton\"\n onClick={() => void auth.signOut().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOut}\n </DropdownItem>\n <DropdownItem\n itemKey=\"userButton.signOutAllButton\"\n // May raise step_up_required; the core opens the provider's dialog\n // and retries, so no handling is needed here.\n onClick={() => void auth.signOutEverywhere().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOutAll}\n </DropdownItem>\n </Dropdown>\n\n {props.mode !== 'navigate' && !ui ? (\n <Modal\n open={accountOpen}\n onClose={() => setLocalOpen(false)}\n labelledBy={titleId}\n restoreFocusTo={openerRef.current}\n >\n <h2 id={titleId} style={{ padding: '16px 16px 0', margin: 0 }}>{t.account.title}</h2>\n <div style={{ padding: 16 }}>\n <AccountDashboard\n tabs={props.tabs}\n appearance={props.appearance}\n localization={props.localization}\n />\n </div>\n </Modal>\n ) : null}\n </span>\n </span>\n </AppearanceProvider>\n );\n}\n\n/** `<UserButton.Link href label icon?/>` — a merchant link inside the menu. */\nfunction UserButtonLink(props: { href: string; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" href={props.href}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\n/** `<UserButton.Action onClick label icon?/>` — a merchant action inside the menu. */\nfunction UserButtonAction(props: { onClick(): void; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" onClick={props.onClick}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\nexport const UserButton = Object.assign(UserButtonRoot, {\n Link: UserButtonLink,\n Action: UserButtonAction,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAAA,gBAAe,eAAAC,cAAa,cAAAC,aAAY,WAAAC,UAAS,UAAAC,SAAQ,YAAAC,kBAAgB;;;ACAlF,SAAS,eAAe,YAAY,eAAe;;;ACa5C,IAAM,iBAAiB,EAAE,OAAO,WAAW,MAAM,UAAU;AAG3D,IAAM,6BAA6B,EAAE,OAAO,WAAW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,mBAAkB,MAAM,MAAM,MACjD;AAAA,UAAM;AAAA,IAAM,MAAM;AAAA,KACrB;AAEJ;AAGA,SAAS,iBAAiB,OAA6D;AACrF,SACE,gBAAAA,OAAC,gBAAa,SAAQ,mBAAkB,SAAS,MAAM,SACpD;AAAA,UAAM;AAAA,IAAM,MAAM;AAAA,KACrB;AAEJ;AAEO,IAAM,aAAa,OAAO,OAAO,gBAAgB;AAAA,EACtD,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;","names":["createContext","useCallback","useContext","useMemo","useRef","useState","createContext","useContext","jsx","Ctx","createContext","useContext","useMemo","jsx","Ctx","createContext","useContext","useMemo","useEffect","useId","useState","createContext","useContext","jsx","Ctx","jsx","jsx","jsx","jsx","jsxs","jsx","jsxs","jsx","jsx","jsx","jsxs","first","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsx","jsx","jsxs","useState","useId","useEffect","useId","useEffect","useState","useState","useRef","useState","useState","useRef","Fragment","jsx","jsxs","useState","useState","Fragment","jsx","jsxs","useState","useState","jsx","jsxs","useState","useState","jsx","jsxs","useState","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsxs","useState","useEffect","jsx","jsxs","useId","useId","useEffect","useId","useState","useState","jsx","jsxs","useState","jsx","jsxs","useEffect","useState","useRef","Fragment","jsx","jsxs","jsx","jsxs","useState","useRef","useEffect","useState","useState","jsx","jsxs","useState","Fragment","jsx","jsxs","useState","jsx","jsxs","useState","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","useState","useState","Fragment","jsx","jsxs","Line","jsx","jsxs","useState","jsx","jsxs","useCallback","useEffect","useRef","useState","Fragment","jsx","jsxs","useState","useRef","useEffect","useCallback","Fragment","jsx","jsxs","HASH_FOR","useState","useId","useEffect","jsx","jsxs","useId","jsx","jsxs","createContext","useContext","useState","useRef","useCallback","useMemo","useContext","useState","jsx","jsxs","useContext","useState","cloneElement","isValidElement","useContext","useState","jsx","jsxs","useContext","useState","isValidElement","cloneElement","jsx","jsx","jsxs","jsx","jsxs","Fragment","jsx","useContext","useId","useRef","useState","jsx","jsxs","useContext","useState","useId","useRef"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/react/components/provider.tsx","../../../src/react/components/appearance.tsx","../../../src/react/components/contrast.ts","../../../src/react/components/branding.tsx","../../../src/react/components/localization.tsx","../../../src/react/components/styles.ts","../../../src/react/components/auth/StepUpDialog.tsx","../../../src/react/components/surface.tsx","../../../src/react/components/primitives/Card.tsx","../../../src/react/components/primitives/Spinner.tsx","../../../src/react/components/primitives/Button.tsx","../../../src/react/components/primitives/Field.tsx","../../../src/react/components/primitives/Alert.tsx","../../../src/react/components/primitives/Skeleton.tsx","../../../src/react/components/primitives/Modal.tsx","../../../src/react/components/primitives/Dropdown.tsx","../../../src/react/components/primitives/Tabs.tsx","../../../src/react/components/primitives/DataTable.tsx","../../../src/react/components/primitives/EmptyState.tsx","../../../src/react/components/primitives/Avatar.tsx","../../../src/react/components/primitives/Badge.tsx","../../../src/react/components/auth/AuthModal.tsx","../../../src/react/components/auth/AuthFlow.tsx","../../../src/react/components/auth/SignIn.tsx","../../../src/react/components/useAction.ts","../../../src/react/components/auth/SignUp.tsx","../../../src/react/components/auth/ForgotPassword.tsx","../../../src/react/components/auth/ResetPassword.tsx","../../../src/react/components/auth/VerifyEmail.tsx","../../../src/react/components/account/AccountModal.tsx","../../../src/react/components/account/AccountDashboard.tsx","../../../src/react/components/account/VerifyEmailBanner.tsx","../../../src/react/components/account/icons.tsx","../../../src/react/components/account/ProfilePanel.tsx","../../../src/react/components/account/PanelState.tsx","../../../src/react/components/account/AddressesPanel.tsx","../../../src/react/components/account/AddressForm.tsx","../../../src/react/components/account/PaymentMethodsPanel.tsx","../../../src/react/components/account/AddCardDialog.tsx","../../../src/react/components/account/OrdersPanel.tsx","../../../src/react/components/format.ts","../../../src/react/components/account/OrderStatus.tsx","../../../src/react/components/account/OrderDetail.tsx","../../../src/react/components/account/InvoicesPanel.tsx","../../../src/react/components/account/InvoiceDetail.tsx","../../../src/react/components/account/SubscriptionsPanel.tsx","../../../src/react/components/account/SecurityPanel.tsx","../../../src/react/components/account/device.ts","../../../src/react/components/auth/SignInButton.tsx","../../../src/react/components/auth/SignUpButton.tsx","../../../src/react/components/auth/SignOutButton.tsx","../../../src/react/components/auth/SignInPage.tsx","../../../src/react/components/auth/SignUpPage.tsx","../../../src/react/components/guards.tsx","../../../src/react/components/UserButton.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { createThrottleAuth, type ThrottleAuth } from '../../client';\nimport { createAccount } from '../../account';\nimport type { ThrottleAuthConfig } from '../../types';\nimport { ThrottleAuthProvider } from '../context';\nimport { AppearanceProvider, type ThrottleAppearance } from './appearance';\nimport { BrandLogoProvider } from './branding';\nimport { LocalizationProvider, type ThrottleLocalization } from './localization';\nimport { useInjectStyles } from './styles';\nimport { StepUpDialog } from './auth/StepUpDialog';\nimport { AuthModal } from './auth/AuthModal';\nimport { AccountModal } from './account/AccountModal';\nimport type { AccountTab } from './account/AccountDashboard';\n\nconst warned = new Set<string>();\n\n/** One warning per problem per page, and only in development. */\nexport function warnOnce(key: string, message: string): void {\n if (process.env.NODE_ENV === 'production') return;\n if (warned.has(key)) return;\n warned.add(key);\n // eslint-disable-next-line no-console\n console.warn(`[@usethrottle/auth] ${message}`);\n}\n\nexport interface ThrottleProviderProps extends Partial<ThrottleAuthConfig> {\n publishableKey: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Default logo for the `branded` card variant. A card's own `logo` prop wins over this. */\n logo?: ReactNode;\n /** Default true. Set false and import `@usethrottle/auth/styles.css` for a flash-free SSR paint. */\n injectStyles?: boolean;\n /** Returns the guest cart id to attach after a successful sign-in or sign-up. */\n claimCartOnSignIn?: () => string | null | undefined;\n /** Inject a pre-built client. Tests use it. */\n auth?: ThrottleAuth;\n children: ReactNode;\n /** @internal test seam — receives the step-up callback handed to the core. */\n __captureStepUp?: (fn: () => Promise<string | null>) => void;\n}\n\ntype Overlay = 'signIn' | 'signUp' | 'account' | null;\n\n/**\n * @internal Not exported from the package. `SignInButton`/`SignUpButton` read\n * it directly (falling back to owning their own local modal state when it is\n * null, i.e. mounted under a plain `ThrottleAuthProvider`); merchants use the\n * public `useThrottle()` hook below instead.\n */\nexport interface ThrottleUIContextValue {\n overlay: Overlay;\n openSignIn(onSuccess?: () => void): void;\n openSignUp(onSuccess?: () => void): void;\n /** `tabs` restricts which panels the shared account overlay shows;\n * `restoreFocusTo` names where focus returns when the opener is itself\n * unmounted by the same click. */\n openAccount(opts?: { tabs?: AccountTab[]; restoreFocusTo?: Element | null }): void;\n close(): void;\n}\n\nexport const ThrottleUIContext = createContext<ThrottleUIContextValue | null>(null);\n\nexport interface UseThrottleResult {\n openSignIn(): void;\n openSignUp(): void;\n openAccount(): void;\n close(): void;\n isOpen: boolean;\n}\n\n/**\n * The equivalent of Clerk's `useClerk().openSignIn()`. Lets a merchant open\n * the auth/account overlay from their own UI — a pricing CTA, a gated action,\n * a keyboard shortcut — driving the SAME modal `SignInButton`/`SignUpButton`\n * open, rather than a second competing one.\n *\n * Outside a `<ThrottleProvider>` (e.g. under a plain `ThrottleAuthProvider`)\n * this degrades to no-op functions and `isOpen: false`, with a one-time\n * development warning, rather than throwing.\n */\nexport function useThrottle(): UseThrottleResult {\n const ctx = useContext(ThrottleUIContext);\n if (!ctx) {\n warnOnce(\n 'use-throttle-no-provider',\n 'useThrottle() was called without a <ThrottleProvider> above it in the tree. ' +\n 'openSignIn/openSignUp/openAccount will do nothing — wrap your app in <ThrottleProvider> to use them.',\n );\n return { openSignIn: () => {}, openSignUp: () => {}, openAccount: () => {}, close: () => {}, isOpen: false };\n }\n return {\n openSignIn: () => ctx.openSignIn(),\n openSignUp: () => ctx.openSignUp(),\n openAccount: ctx.openAccount,\n close: ctx.close,\n isOpen: ctx.overlay !== null,\n };\n}\n\n/**\n * Composes rather than replaces. It creates the client (so it can supply\n * `onStepUpRequired` at construction time, which is the only moment the core\n * reads it) and hands it to the existing `<ThrottleAuthProvider>` through the\n * `auth` injection prop that already exists for this purpose. Every hook —\n * useAuth, useCustomer, useOrders — keeps working underneath unchanged.\n *\n * It also owns the ONE modal overlay (sign-in/sign-up/account) alongside the\n * step-up dialog it already hosts, so a `SignInButton`/`SignUpButton` click\n * and a programmatic `useThrottle().openSignIn()` call always drive the same\n * dialog rather than stacking two.\n */\nexport function ThrottleProvider(props: ThrottleProviderProps) {\n const {\n publishableKey, baseUrl, storage, appearance, localization, logo,\n injectStyles = true, claimCartOnSignIn, auth: injected, children, __captureStepUp,\n } = props;\n\n useInjectStyles(injectStyles);\n\n const [stepUpOpen, setStepUpOpen] = useState(false);\n // The bridge. The dialog renders below the client that needs its answer, so\n // the resolver travels through a ref rather than through props.\n const resolveStepUp = useRef<((password: string | null) => void) | null>(null);\n // Read through a ref so a merchant passing an inline arrow function does not\n // rebuild the client on every parent render.\n const claimRef = useRef(claimCartOnSignIn);\n claimRef.current = claimCartOnSignIn;\n\n // The one piece of overlay state. `onOverlaySuccess` is a bookkeeping ref\n // alongside it — mirroring `resolveStepUp` above — not competing state: it\n // answers \"what happens on success\", not \"is something open\".\n const [overlay, setOverlay] = useState<Overlay>(null);\n const overlayRestoreFocus = useRef<Element | null>(null);\n const [accountTabs, setAccountTabs] = useState<AccountTab[] | undefined>(undefined);\n const onOverlaySuccess = useRef<(() => void) | null>(null);\n\n const openSignIn = useCallback((onSuccess?: () => void) => {\n onOverlaySuccess.current = onSuccess ?? null;\n setOverlay('signIn');\n }, []);\n const openSignUp = useCallback((onSuccess?: () => void) => {\n onOverlaySuccess.current = onSuccess ?? null;\n setOverlay('signUp');\n }, []);\n const openAccount = useCallback((opts?: { tabs?: AccountTab[]; restoreFocusTo?: Element | null }) => {\n onOverlaySuccess.current = null;\n // A caller that is itself being unmounted by the same click (UserButton's\n // menu item) must name where focus goes back to, because by the time the\n // modal mounts the opener is gone and the browser has already reset\n // activeElement to <body>.\n overlayRestoreFocus.current = opts?.restoreFocusTo ?? null;\n setAccountTabs(opts?.tabs);\n setOverlay('account');\n }, []);\n const closeOverlay = useCallback(() => {\n onOverlaySuccess.current = null;\n overlayRestoreFocus.current = null;\n setOverlay(null);\n }, []);\n const handleOverlaySuccess = useCallback(() => {\n const fn = onOverlaySuccess.current;\n onOverlaySuccess.current = null;\n setOverlay(null);\n fn?.();\n }, []);\n\n const ui = useMemo<ThrottleUIContextValue>(\n () => ({ overlay, openSignIn, openSignUp, openAccount, close: closeOverlay }),\n [overlay, openSignIn, openSignUp, openAccount, closeOverlay],\n );\n\n // Hoisted out of the memo below and stabilized with an empty deps array: it\n // closes only over refs and a setState, neither of which ever change, so it\n // must keep one identity for the client's whole life regardless of what\n // triggers the memo to recompute (e.g. a new `auth` prop object).\n const askForStepUp = useCallback(\n () =>\n new Promise<string | null>((resolve) => {\n resolveStepUp.current = resolve;\n setStepUpOpen(true);\n }),\n [],\n );\n\n const auth = useMemo<ThrottleAuth>(() => {\n __captureStepUp?.(askForStepUp);\n\n const client =\n injected ?? createThrottleAuth({ publishableKey, baseUrl, storage, onStepUpRequired: askForStepUp });\n\n // Claim on the explicit entry points only. `restore()` also transitions the\n // snapshot to authenticated on every page load, and re-claiming there would\n // fire a pointless request per visit.\n const account = createAccount(client);\n const claim = async () => {\n const cartId = claimRef.current?.();\n if (!cartId) return;\n try {\n await account.claimCart(cartId);\n } catch (err) {\n // A cart that will not attach must never block a sign-in.\n warnOnce('claim-cart', `claimCartOnSignIn failed: ${(err as Error)?.message ?? err}`);\n }\n };\n\n // Spreading is safe: every method on the client closes over its own state\n // rather than using `this`. The provider test asserts all sixteen survive.\n return {\n ...client,\n async signIn(email: string, password: string) {\n await client.signIn(email, password);\n await claim();\n },\n async register(email: string, password: string) {\n const result = await client.register(email, password);\n // `pending` means no session exists yet, so there is nothing to claim on to.\n if (result.status === 'active') await claim();\n return result;\n },\n };\n // `storage`, `claimCartOnSignIn` and `__captureStepUp` are deliberately not\n // dependencies — same reasoning as ThrottleAuthProvider's own memo.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [injected, publishableKey, baseUrl]);\n\n const finishStepUp = (password: string | null) => {\n setStepUpOpen(false);\n const resolve = resolveStepUp.current;\n resolveStepUp.current = null;\n resolve?.(password);\n };\n\n const authOverlayOpen = overlay === 'signIn' || overlay === 'signUp';\n\n return (\n <AppearanceProvider value={appearance ?? {}}>\n <LocalizationProvider value={localization ?? {}}>\n <BrandLogoProvider value={logo ?? null}>\n <ThrottleAuthProvider auth={auth} publishableKey={publishableKey}>\n <ThrottleUIContext.Provider value={ui}>\n {children}\n <StepUpDialog open={stepUpOpen} onResolve={finishStepUp} />\n {/* Keyed on the overlay kind so each open() call mounts `AuthFlow`\n fresh with the view that call asked for, rather than reusing a\n still-mounted instance that would ignore a new `initialView`. */}\n <AuthModal\n key={overlay === 'signUp' ? 'signUp' : 'signIn'}\n open={authOverlayOpen}\n onClose={closeOverlay}\n initialView={overlay === 'signUp' ? 'signUp' : 'signIn'}\n afterSignIn={handleOverlaySuccess}\n afterSignUp={handleOverlaySuccess}\n />\n <AccountModal open={overlay === 'account'} onClose={closeOverlay} tabs={accountTabs} restoreFocusTo={overlayRestoreFocus.current} />\n </ThrottleUIContext.Provider>\n </ThrottleAuthProvider>\n </BrandLogoProvider>\n </LocalizationProvider>\n </AppearanceProvider>\n );\n}\n","import { createContext, useContext, useMemo } from 'react';\nimport type { ComponentType, CSSProperties, ReactNode } from 'react';\nimport { dangerCollisionWarning, primaryContrastWarning } from './contrast';\n\nexport type ThrottleThemeName = 'light' | 'dark' | 'auto';\n\n/**\n * camelCase key → custom property. Written out rather than derived by\n * camel-to-kebab: `borderRadius` maps to `--throttle-radius`, not\n * `--throttle-border-radius`, and three other keys are similarly irregular.\n * An algorithm would silently produce properties the stylesheet never reads.\n */\n/**\n * Dev-only, and once per distinct pairing — `useAppearance` runs in every\n * component, so an unguarded console.warn would fire dozens of times per page\n * and train integrators to ignore it.\n */\nconst warnedPairings = new Set<string>();\nfunction warnOnUnreadablePrimary(\n variables: ThrottleVariables,\n theme: 'light' | 'dark' | 'auto',\n): void {\n if (process.env.NODE_ENV === 'production') return;\n const key = `${variables.colorPrimary}|${variables.colorPrimaryForeground}|${variables.colorDanger}|${theme}`;\n if (warnedPairings.has(key)) return;\n const messages = [\n primaryContrastWarning(variables, theme),\n dangerCollisionWarning(variables, theme),\n ].filter(Boolean) as string[];\n if (messages.length === 0) return;\n warnedPairings.add(key);\n for (const m of messages) console.warn(m);\n}\n\nconst VARIABLE_PROPERTY = {\n colorPrimary: '--throttle-color-primary',\n colorPrimaryForeground: '--throttle-color-primary-foreground',\n colorBackground: '--throttle-color-background',\n colorSurface: '--throttle-color-surface',\n colorForeground: '--throttle-color-foreground',\n colorMuted: '--throttle-color-muted',\n colorMutedForeground: '--throttle-color-muted-foreground',\n colorBorder: '--throttle-color-border',\n colorBorderControl: '--throttle-color-border-control',\n colorDanger: '--throttle-color-danger',\n colorDangerSurface: '--throttle-color-danger-surface',\n colorDangerBorder: '--throttle-color-danger-border',\n colorSuccess: '--throttle-color-success',\n colorSuccessSurface: '--throttle-color-success-surface',\n colorSuccessBorder: '--throttle-color-success-border',\n colorWarning: '--throttle-color-warning',\n colorWarningSurface: '--throttle-color-warning-surface',\n colorWarningBorder: '--throttle-color-warning-border',\n fontFamily: '--throttle-font-family',\n fontSize: '--throttle-font-size',\n borderRadius: '--throttle-radius',\n borderWidth: '--throttle-border-width',\n spacing: '--throttle-spacing',\n // The account dashboard's own surface and outer padding. Separate from\n // colorBackground/colorSurface because a merchant embedding the dashboard\n // in their page usually wants it to paint nothing at all, while still\n // theming the cards inside it.\n accountSurface: '--throttle-color-account-surface',\n accountPadding: '--throttle-account-padding',\n shadowCard: '--throttle-shadow-card',\n shadowPopover: '--throttle-shadow-popover',\n transition: '--throttle-transition',\n zModal: '--throttle-z-modal',\n zPopover: '--throttle-z-popover',\n} as const;\n\nexport type ThrottleVariables = Partial<Record<keyof typeof VARIABLE_PROPERTY, string>>;\n\n/**\n * Every addressable part of every component. A merchant maps any of these to a\n * className through `appearance.elements`. The list is the API: adding a\n * rendered element without adding its key here ships something a merchant\n * cannot restyle, which the drift test in Task 15 catches.\n */\nexport const THROTTLE_ELEMENT_KEYS = [\n // shared primitives\n 'card', 'card.header', 'card.title', 'card.description', 'card.body', 'card.footer', 'card.logo',\n 'field', 'field.label', 'field.input', 'field.hint', 'field.error', 'field.group',\n 'button', 'alert', 'spinner', 'skeleton',\n 'avatar', 'badge',\n 'emptyState', 'emptyState.title', 'emptyState.description',\n 'modal.overlay', 'modal.container', 'modal.closeButton',\n 'dropdown.trigger', 'dropdown.menu', 'dropdown.item', 'dropdown.separator',\n 'tabs.list', 'tabs.tab',\n 'table', 'table.head', 'table.row', 'table.cell',\n // auth\n 'signIn.root', 'signIn.title', 'signIn.logo', 'signIn.emailField', 'signIn.passwordField',\n 'signIn.submitButton', 'signIn.forgotLink', 'signIn.switchLink',\n 'signUp.root', 'signUp.title', 'signUp.logo', 'signUp.emailField', 'signUp.passwordField',\n 'signUp.submitButton', 'signUp.switchLink',\n 'forgotPassword.root', 'forgotPassword.title', 'forgotPassword.logo', 'forgotPassword.emailField',\n 'forgotPassword.submitButton', 'forgotPassword.backLink',\n 'resetPassword.root', 'resetPassword.title', 'resetPassword.logo', 'resetPassword.passwordField',\n 'resetPassword.submitButton',\n 'verifyEmail.root', 'verifyEmail.title', 'verifyEmail.logo', 'verifyEmail.resendButton',\n 'authFlow.root',\n 'authModal.overlay', 'authModal.container',\n 'signInButton.root', 'signUpButton.root', 'signOutButton.root',\n 'stepUp.root', 'stepUp.title', 'stepUp.passwordField',\n 'stepUp.submitButton', 'stepUp.cancelButton',\n 'signInPage.root', 'signInPage.logo', 'signInPage.footer',\n 'signUpPage.root', 'signUpPage.logo', 'signUpPage.footer',\n // user button\n 'userButton.root', 'userButton.trigger', 'userButton.menu', 'userButton.identity',\n 'userButton.email', 'userButton.badge', 'userButton.item',\n 'userButton.manageButton', 'userButton.signOutButton', 'userButton.signOutAllButton',\n // account\n 'accountDashboard.root', 'accountDashboard.tabs', 'accountDashboard.sidebar', 'accountDashboard.panel',\n 'accountModal.overlay', 'accountModal.container', 'accountModal.header', 'accountModal.title', 'accountModal.body',\n 'verifyBanner.root', 'verifyBanner.message', 'verifyBanner.resendButton', 'verifyBanner.dismissButton',\n 'profilePanel.root', 'profilePanel.form', 'profilePanel.submitButton',\n 'addressesPanel.root', 'addressesPanel.list', 'addressesPanel.item',\n 'addressesPanel.addButton', 'addressesPanel.form', 'addressesPanel.defaultButton',\n 'addressesPanel.editButton', 'addressesPanel.deleteButton',\n 'addressesPanel.table', 'addressesPanel.row',\n 'paymentMethodsPanel.root', 'paymentMethodsPanel.list', 'paymentMethodsPanel.item',\n 'paymentMethodsPanel.defaultButton', 'paymentMethodsPanel.deleteButton',\n 'paymentMethodsPanel.addButton', 'paymentMethodsPanel.addDialog',\n 'paymentMethodsPanel.table', 'paymentMethodsPanel.row',\n 'ordersPanel.root', 'ordersPanel.table', 'ordersPanel.row',\n 'ordersPanel.list', 'ordersPanel.item', 'ordersPanel.viewButton',\n 'orderDetail.root', 'orderDetail.backButton', 'orderDetail.lineItems',\n 'orderDetail.lineItem', 'orderDetail.totals',\n 'invoicesPanel.root', 'invoicesPanel.table', 'invoicesPanel.row',\n 'invoicesPanel.list', 'invoicesPanel.item', 'invoicesPanel.viewButton',\n 'invoiceDetail.root', 'invoiceDetail.backButton', 'invoiceDetail.downloadButton', 'invoiceDetail.totals',\n 'subscriptionsPanel.root', 'subscriptionsPanel.list', 'subscriptionsPanel.item',\n 'subscriptionsPanel.cancelButton', 'subscriptionsPanel.cancelNowButton',\n 'subscriptionsPanel.pauseButton', 'subscriptionsPanel.resumeButton',\n 'subscriptionsPanel.table', 'subscriptionsPanel.row',\n 'securityPanel.root', 'securityPanel.passwordForm', 'securityPanel.passwordButton',\n 'securityPanel.sessionList', 'securityPanel.sessionItem',\n 'securityPanel.revokeButton', 'securityPanel.revokeAllButton',\n 'securityPanel.table', 'securityPanel.row',\n] as const;\n\nexport type ThrottleElementKey = (typeof THROTTLE_ELEMENT_KEYS)[number];\n\nexport interface ThrottleSlots {\n Spinner?: ComponentType<{ className?: string }>;\n Avatar?: ComponentType<{ name: string; email: string; className?: string }>;\n Alert?: ComponentType<{ tone: 'error' | 'success' | 'info'; children: ReactNode; className?: string }>;\n EmptyState?: ComponentType<{ title: string; description?: string; className?: string }>;\n Button?: ComponentType<any>;\n}\n\nexport interface ThrottleAppearance {\n theme?: ThrottleThemeName;\n variables?: ThrottleVariables;\n elements?: Partial<Record<ThrottleElementKey, string>>;\n components?: ThrottleSlots;\n}\n\nexport interface ElementProps {\n className: string | undefined;\n 'data-throttle-element': ThrottleElementKey;\n}\n\nexport interface ResolvedAppearance {\n theme: ThrottleThemeName;\n rootProps: { className: string; style: CSSProperties; 'data-throttle-theme': ThrottleThemeName };\n el(key: ThrottleElementKey, base?: string): ElementProps;\n slots: ThrottleSlots;\n}\n\nconst Ctx = createContext<ThrottleAppearance | null>(null);\n\nexport function AppearanceProvider(props: { value: ThrottleAppearance; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\n/**\n * Merges the provider's appearance with a component-level prop. `variables`,\n * `elements` and `components` merge key-by-key so a component override of one\n * colour does not drop the provider's other twenty; `theme` is replaced whole,\n * because a half-merged theme is not a theme.\n */\nexport function useAppearance(local?: ThrottleAppearance): ResolvedAppearance {\n const provider = useContext(Ctx);\n\n return useMemo<ResolvedAppearance>(() => {\n // Default LIGHT, not 'auto'. 'auto' follows the SHOPPER's operating system,\n // which a merchant's storefront has no relationship to — so a merchant who\n // never sets a theme ships a dark widget to every dark-mode shopper on a\n // light page. Found by embedding the components in a real store: the\n // account dashboard rendered #0d1117 on a #faf7f2 page.\n //\n // A component that cannot see its host page must not guess at it. Merchants\n // who do want OS-following opt in with theme=\"auto\".\n const theme = local?.theme ?? provider?.theme ?? 'light';\n const variables = { ...provider?.variables, ...local?.variables };\n const elements = { ...provider?.elements, ...local?.elements };\n const slots = { ...provider?.components, ...local?.components };\n\n const style: CSSProperties = {};\n for (const [key, value] of Object.entries(variables)) {\n const property = (VARIABLE_PROPERTY as Record<string, string>)[key];\n // Unknown keys are dropped rather than passed through: a typo that\n // reached the DOM as `--throttle-colourPrimary` would look like it\n // worked and silently do nothing.\n if (property && value != null) (style as Record<string, string>)[property] = value;\n }\n\n warnOnUnreadablePrimary(variables, theme);\n\n return {\n theme,\n rootProps: { className: 'throttle-root', style, 'data-throttle-theme': theme },\n el(key, base) {\n const extra = elements[key];\n return {\n className: [base, extra].filter(Boolean).join(' ') || undefined,\n 'data-throttle-element': key,\n };\n },\n slots,\n };\n }, [provider, local]);\n}\n\n/**\n * True when a `<ThrottleProvider>` is above this component. Components use it\n * to warn once (in development) that step-up will surface as an error rather\n * than a prompt — never to change what they render.\n */\nexport function useHasUIContext(): boolean {\n return useContext(Ctx) !== null;\n}\n\n/**\n * Merges the ambient appearance with a component-level override and returns a\n * value suitable for re-provision via `<AppearanceProvider>`. Primitives\n * (`Button`, `Field`, `CardHeader`, …) call `useAppearance()` with no\n * argument, so a component's own `appearance` prop only reaches nested\n * primitives if that component re-provides the merged value down the tree —\n * this is the merge, kept in one place rather than duplicated per component.\n */\nexport function useAppearanceProviderValue(local?: ThrottleAppearance): ThrottleAppearance {\n const provider = useContext(Ctx);\n return useMemo<ThrottleAppearance>(\n () => ({\n theme: local?.theme ?? provider?.theme,\n variables: { ...provider?.variables, ...local?.variables },\n elements: { ...provider?.elements, ...local?.elements },\n components: { ...provider?.components, ...local?.components },\n }),\n [provider, local],\n );\n}\n","/**\n * A merchant who sets `colorPrimary` and nothing else keeps whatever\n * `colorPrimaryForeground` the theme shipped — white in light, near-black in\n * dark. That pairing is not always readable: the demo storefront sets a\n * terracotta primary alone and the resulting dark-theme button label measures\n * 3.65:1, below the 4.5:1 WCAG asks for body text.\n *\n * Nothing surfaced that. This warns in development only, so an integrator\n * finds it while wiring the component up rather than a shopper finding it on a\n * checkout page.\n */\n\n/** Theme defaults for the danger colour, kept in step with `styles.ts`. */\nexport const DEFAULT_DANGER = { light: '#c2321f', dark: '#ff6b58' } as const;\n\n/** Theme defaults, kept in step with the two palettes in `styles.ts`. */\nexport const DEFAULT_PRIMARY_FOREGROUND = { light: '#ffffff', dark: '#0d1117' } as const;\n\nfunction channel(value: number): number {\n const c = value / 255;\n return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n\n/** `null` for anything that is not a plain 3- or 6-digit hex — we do not try to\n * parse every CSS colour form, we simply decline to judge what we cannot read. */\nexport function luminance(hex: string): number | null {\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!m) return null;\n const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));\n return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);\n}\n\nexport function contrastRatio(a: string, b: string): number | null {\n const la = luminance(a);\n const lb = luminance(b);\n if (la === null || lb === null) return null;\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n\n/**\n * Returns a warning message, or `null` when the pairing is fine, unreadable, or\n * not overridden at all. `auto` is checked against BOTH palettes, because the\n * shopper's system setting decides which one they get and we cannot know it.\n */\nexport function primaryContrastWarning(\n variables: { colorPrimary?: string; colorPrimaryForeground?: string },\n theme: 'light' | 'dark' | 'auto',\n): string | null {\n const primary = variables.colorPrimary;\n if (!primary) return null;\n\n const themes = theme === 'auto' ? (['light', 'dark'] as const) : ([theme] as const);\n const failures: string[] = [];\n\n for (const t of themes) {\n const fg = variables.colorPrimaryForeground ?? DEFAULT_PRIMARY_FOREGROUND[t];\n const ratio = contrastRatio(primary, fg);\n if (ratio === null) return null; // not a hex we can read; say nothing\n if (ratio < 4.5) failures.push(`${t} ${ratio.toFixed(2)}:1 against ${fg}`);\n }\n if (failures.length === 0) return null;\n\n const advice = variables.colorPrimaryForeground\n ? 'Pick a foreground with more contrast against it.'\n : 'You set `colorPrimary` without `colorPrimaryForeground`, so the theme default is being used. Set both.';\n\n return `[@usethrottle/auth] Primary button text may be hard to read on ${primary}: ${failures.join('; ')}. WCAG asks for 4.5:1. ${advice}`;\n}\n\n\n/**\n * CIE Lab, for perceptual colour difference. Contrast ratio is the wrong tool\n * for \"can a person tell these two apart\": it measures luminance only, so a\n * blue and a red of similar lightness score near 1:1 while being obviously\n * different. My first attempt at the check below used contrast ratio and\n * flagged a perfectly distinct blue brand — the test caught it.\n */\nfunction toLab(hex: string): [number, number, number] | null {\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!m) return null;\n const h = m[1].length === 3 ? m[1].replace(/./g, (c) => c + c) : m[1];\n const [r, g, b] = [0, 2, 4].map((i) => {\n const c = parseInt(h.slice(i, i + 2), 16) / 255;\n return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n });\n const X = (r * 0.4124 + g * 0.3576 + b * 0.1805) / 0.95047;\n const Y = r * 0.2126 + g * 0.7152 + b * 0.0722;\n const Z = (r * 0.0193 + g * 0.1192 + b * 0.9505) / 1.08883;\n const f = (t: number) => (t > 0.008856 ? Math.cbrt(t) : 7.787 * t + 16 / 116);\n const [fx, fy, fz] = [f(X), f(Y), f(Z)];\n return [116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)];\n}\n\n/** CIE76 colour difference. `null` when either colour is not plain hex. */\nexport function colourDistance(a: string, b: string): number | null {\n const la = toLab(a);\n const lb = toLab(b);\n if (!la || !lb) return null;\n return Math.hypot(la[0] - lb[0], la[1] - lb[1], la[2] - lb[2]);\n}\n\n/**\n * Below this, two colours read as the same thing at a glance. Measured against\n * the real cases: a terracotta brand against our danger red scores 16.7, while\n * every genuinely distinct brand tested scored above 80.\n */\nconst MIN_DISTINCT = 25;\n\n/**\n * Destructive row actions are told apart from neutral ones by colour: Delete is\n * the danger colour, Edit is the primary. That only works while the two are\n * actually different. A merchant with a warm brand can land right on top of the\n * danger red — a terracotta `#9a3412` against our `#c2321f` measures 1.31:1,\n * where the default `#18181b` gives 3.18:1 — and a buyer loses the only signal\n * that one of two adjacent actions is irreversible.\n *\n * This is the \"Delete looked identical to Edit\" bug arriving through the\n * theming API instead of through the variant logic, so the variant tests cannot\n * see it. 3:1 is WCAG's threshold for distinguishing UI components.\n */\nexport function dangerCollisionWarning(\n variables: { colorPrimary?: string; colorDanger?: string },\n theme: 'light' | 'dark' | 'auto',\n): string | null {\n const primary = variables.colorPrimary;\n if (!primary) return null; // our default sits far from the danger colour\n\n const themes = theme === 'auto' ? (['light', 'dark'] as const) : ([theme] as const);\n const failures: string[] = [];\n for (const t of themes) {\n const danger = variables.colorDanger ?? DEFAULT_DANGER[t];\n const d = colourDistance(primary, danger);\n if (d === null) return null;\n if (d < MIN_DISTINCT) failures.push(`${t} \\u0394E ${d.toFixed(1)} against ${danger}`);\n }\n if (failures.length === 0) return null;\n\n return `[@usethrottle/auth] Your brand colour ${primary} is too close to the destructive colour to tell apart: ${failures.join('; ')}. Delete and Edit sit side by side in the account panels and a buyer distinguishes them by colour alone, so pick a more distinct \\`colorPrimary\\`, or override \\`colorDanger\\` to something further from it.`;\n}\n","import { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Carries `ThrottleProvider`'s `logo` down to the auth cards for the\n * `branded` variant, so a merchant sets it once instead of on every card.\n * A card's own `logo` prop wins over this when both are given. Kept in its\n * own module (rather than `provider.tsx`) so the auth cards can import the\n * hook without creating an import cycle back through `AuthModal`.\n */\nconst Ctx = createContext<ReactNode>(null);\n\nexport function BrandLogoProvider(props: { value: ReactNode; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useBrandLogo(local?: ReactNode): ReactNode {\n const provider = useContext(Ctx);\n return local ?? provider ?? null;\n}\n","import { createContext, useContext, useMemo } from 'react';\nimport type { ReactNode } from 'react';\nimport { messageForError } from '../forms/messages';\n\nexport const enUS = {\n locale: 'en-US',\n common: {\n save: 'Save', cancel: 'Cancel', delete: 'Delete', edit: 'Edit', back: 'Back',\n retry: 'Try again', loading: 'Loading…', close: 'Close', confirm: 'Are you sure?',\n somethingWentWrong: 'Something went wrong.',\n actions: 'Actions', view: 'View',\n },\n signIn: {\n title: 'Sign in', description: 'Sign in to your account.',\n email: 'Email', password: 'Password',\n submitButton: 'Sign in', forgotLink: 'Forgot your password?',\n switchPrompt: \"Don't have an account?\", switchLink: 'Sign up',\n },\n signUp: {\n title: 'Create your account', description: '',\n email: 'Email', password: 'Password',\n submitButton: 'Create account',\n switchPrompt: 'Already have an account?', switchLink: 'Sign in',\n // Deliberately conditional. Registering onto an address that already has\n // an account returns the same `pending` status and sends no email, so\n // asserting one was sent would be false for that buyer.\n pendingNotice: 'If that email is new, check your inbox for a link to finish signing up.',\n },\n forgotPassword: {\n title: 'Reset your password',\n description: 'We will email you a link if an account exists.',\n email: 'Email', submitButton: 'Send reset link',\n sentNotice: 'If an account exists for that email, a reset link is on its way.',\n backLink: 'Back to sign in',\n },\n resetPassword: {\n title: 'Choose a new password', password: 'New password',\n submitButton: 'Update password', doneNotice: 'Your password has been updated.',\n missingToken: 'That link is missing its token. Request a new one.',\n },\n verifyEmail: {\n title: 'Verify your email',\n verifying: 'Confirming your email…',\n success: 'Your email is verified.',\n resendButton: 'Resend the link',\n resentNotice: 'We sent a new link.',\n instructions: 'Check your inbox for a verification link.',\n },\n stepUp: {\n title: 'Confirm your password',\n description: 'For your security, please re-enter your password to continue.',\n password: 'Password', submitButton: 'Confirm', cancelButton: 'Cancel',\n },\n userButton: {\n manage: 'Manage account', signOut: 'Sign out', signOutAll: 'Sign out of all devices',\n verified: 'Verified', unverified: 'Unverified', openMenu: 'Account menu',\n },\n verifyBanner: {\n message: 'Verify your email to see your full account history.',\n resendButton: 'Resend link', dismissButton: 'Dismiss',\n },\n account: {\n title: 'Your account',\n tabs: {\n profile: 'Profile', addresses: 'Addresses', paymentMethods: 'Saved cards',\n orders: 'Orders', invoices: 'Invoices', subscriptions: 'Subscriptions', security: 'Security',\n },\n },\n profile: {\n firstName: 'First name', lastName: 'Last name', phone: 'Phone', company: 'Company',\n acceptsMarketing: 'Send me product news and offers',\n email: 'Email', emailReadOnly: 'Your email address cannot be changed here.',\n saveButton: 'Save changes', savedNotice: 'Profile updated.',\n },\n addresses: {\n addButton: 'Add address', defaultBadge: 'Default', makeDefault: 'Make default',\n empty: 'No saved addresses',\n emptyDescription: 'Addresses you use at checkout can be saved here.',\n label: 'Label', firstName: 'First name', lastName: 'Last name', company: 'Company',\n addressLine1: 'Address', addressLine2: 'Apartment, suite, etc.',\n city: 'City', stateProvince: 'State / Province', postalCode: 'Postal code',\n countryCode: 'Country code', phone: 'Phone',\n deleteConfirm: 'Delete this address?',\n columnAddress: 'Address',\n },\n paymentMethods: {\n empty: 'No saved cards',\n emptyDescription: 'Add a card here, or one will be saved when you check out.',\n addButton: 'Add card',\n addTitle: 'Add a card',\n // Shown whenever the panel is empty with no error and the buyer is not\n // verified — including simply being signed out — matching the copy\n // orders/invoices/subscriptions already show in that state.\n gatedDescription: 'Verify your email to see your saved cards.',\n defaultBadge: 'Default', makeDefault: 'Make default',\n expires: 'Expires', deleteConfirm: 'Remove this card?',\n columnCard: 'Card',\n },\n orders: {\n empty: 'No orders yet', emptyDescription: 'Orders you place will appear here.',\n gatedDescription: 'Verify your email to see your order history.',\n number: 'Order', date: 'Date', status: 'Status', total: 'Total',\n /**\n * Display copy for `order.status`. Mirrors ORDER_STATUS_META in\n * `@commerce/orders`, which is the server's single source of status copy —\n * copied rather than imported because this package ships with no runtime\n * dependencies and is a client for the wire API, not for server packages.\n * If a status is added there, add it here.\n */\n statusLabels: {\n draft: 'Draft', pending: 'Pending', processing: 'Processing',\n partiallyFulfilled: 'Partially fulfilled', fulfilled: 'Fulfilled',\n cancelled: 'Cancelled', closed: 'Closed',\n },\n /**\n * The money half of the label, shown as a second badge beside the\n * lifecycle one. `captured` is deliberately empty: paid in full is the\n * assumed happy path, and announcing it on every settled order is noise.\n */\n paymentLabels: {\n pending: 'Awaiting payment', authorized: 'Authorized', captured: '',\n partiallyPaid: 'Partially paid', partiallyRefunded: 'Partially refunded',\n refunded: 'Refunded', failed: 'Payment failed', voided: 'Voided',\n processing: 'Payment processing', disputed: 'Disputed',\n expired: 'Authorization expired',\n },\n items: 'Items', subtotal: 'Subtotal', discount: 'Discount', shipping: 'Shipping',\n tax: 'Tax', quantity: 'Qty',\n shippingAddress: 'Shipping address', billingAddress: 'Billing address',\n viewSubscription: 'View subscription',\n },\n invoices: {\n empty: 'No invoices yet', emptyDescription: 'Invoices will appear here.',\n gatedDescription: 'Verify your email to see your invoices.',\n number: 'Invoice', issued: 'Issued', due: 'Due', status: 'Status', total: 'Total',\n refunded: 'Refunded', period: 'Period', downloadButton: 'Download PDF',\n /** Display copy for `invoice.status` — the wire values are paid|open|void. */\n statusLabels: { paid: 'Paid', open: 'Open', void: 'Void' },\n downloadUnavailable: 'This invoice is not available to download right now.',\n },\n subscriptions: {\n empty: 'No subscriptions', emptyDescription: 'Subscriptions will appear here.',\n gatedDescription: 'Verify your email to see your subscriptions.',\n renewsOn: 'Renews on', endsOn: 'Ends on', cancelledOn: 'Cancelled on', trialEnds: 'Trial ends',\n cancelButton: 'Cancel', cancelAtPeriodEnd: 'Cancel at period end',\n cancelNow: 'Cancel immediately', pauseButton: 'Pause', resumeButton: 'Resume',\n cancelConfirm: 'Cancel this subscription?',\n cancelScheduled: 'Cancels at the end of the period',\n columnPlan: 'Plan', columnPrice: 'Price', columnRenews: 'Renews', columnStatus: 'Status',\n /**\n * Display copy for `subscription.status`. Mirrors SubscriptionStatus in\n * `@commerce/subscriptions`; copied rather than imported because this\n * package has no runtime dependencies. Without it a buyer in dunning saw\n * the literal pill `past_due`.\n */\n statusLabels: {\n active: 'Active', paused: 'Paused', cancelled: 'Cancelled',\n pastDue: 'Payment overdue', trialing: 'Trial', unpaid: 'Unpaid',\n },\n },\n security: {\n passwordTitle: 'Change password', newPassword: 'New password',\n changeButton: 'Update password', changedNotice: 'Password updated.',\n sessionsTitle: 'Devices', thisDevice: 'This device',\n lastActive: 'Last active', revokeButton: 'Sign out',\n revokeAllButton: 'Sign out of all other devices',\n sessionsEmpty: 'No other devices',\n columnDevice: 'Device',\n },\n errors: {} as Record<string, string>,\n};\n\n/** Every field optional, at every depth — a merchant overrides one string. */\nexport type ThrottleLocalization = DeepPartial<typeof enUS>;\ntype DeepPartial<T> = { [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K] };\n\nexport interface ResolvedCopy {\n t: typeof enUS;\n locale: string;\n errorMessage(err: unknown): string;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction deepMerge<T>(base: T, over: any, path = ''): T {\n if (!over) return base;\n const out: any = Array.isArray(base) ? [...(base as any)] : { ...base };\n for (const [key, value] of Object.entries(over)) {\n if (value == null) continue;\n const current = (base as any)[key];\n const keyPath = path ? `${path}.${key}` : key;\n const currentIsObject = isPlainObject(current);\n const valueIsObject = isPlainObject(value);\n\n if (current !== undefined && currentIsObject !== valueIsObject) {\n // Shape mismatch: an override that replaces a subtree with a leaf (or a\n // leaf with a subtree) would silently blank every sibling under this\n // key — e.g. `{ signIn: 'oops' }` would make every `t.signIn.*` read\n // undefined. Keep the default and warn instead of corrupting the tree.\n if (typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production') {\n console.warn(\n `[useCopy] ignoring localization override at \"${keyPath}\": expected ${\n currentIsObject ? 'an object' : 'a string'\n }, got ${valueIsObject ? 'an object' : typeof value}`\n );\n }\n continue;\n }\n\n out[key] = currentIsObject && valueIsObject ? deepMerge(current, value, keyPath) : value;\n }\n return out;\n}\n\nconst Ctx = createContext<ThrottleLocalization | null>(null);\n\nexport function LocalizationProvider(props: { value: ThrottleLocalization; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useCopy(local?: ThrottleLocalization): ResolvedCopy {\n const provider = useContext(Ctx);\n\n return useMemo<ResolvedCopy>(() => {\n const t = deepMerge(deepMerge(enUS, provider), local);\n return {\n t,\n locale: t.locale,\n /**\n * A merchant's `errors` map wins; otherwise the shipped mapper decides.\n * `messageForError` stays the floor because it encodes two deliberate\n * non-passthroughs — `invalid_credentials` stays vague to avoid account\n * enumeration, and unknown codes stay generic.\n */\n errorMessage(err: unknown) {\n const code = (err as { code?: string } | null)?.code;\n const override = code ? t.errors[code] : undefined;\n return override ?? messageForError(err);\n },\n };\n }, [provider, local]);\n}\n","import { useInsertionEffect } from 'react';\n\nexport const THROTTLE_STYLE_ID = 'throttle-auth-styles';\n\n/**\n * The whole component stylesheet, as a string, so one source feeds both the\n * runtime injector and the `dist/styles.css` the build emits. There is no CSS\n * pipeline in tsup — adding one would mean the file and the injected styles\n * could drift.\n *\n * Every rule a merchant might restyle uses a SINGLE class selector. Merchant\n * classNames from `appearance.elements` land on the same element, so equal\n * specificity plus source order is what lets them win. A descendant selector\n * here would silently outrank them.\n */\nexport const THROTTLE_STYLES = `\n.throttle-root {\n --throttle-color-primary: #18181b;\n --throttle-color-primary-foreground: #ffffff;\n --throttle-color-background: #ffffff;\n --throttle-color-surface: #f8fafc;\n --throttle-color-foreground: #0e1116;\n --throttle-color-muted: #eceef2;\n --throttle-color-muted-foreground: #5b6472;\n --throttle-color-border: #e2e8f0;\n /* The boundary of an INTERACTIVE control, which WCAG 1.4.11 requires to\n reach 3:1 against its adjacent colour — an input identified only by a\n 1.23:1 hairline is not identifiable at all. Decorative separators (card\n edges, table rules, dividers) keep --throttle-color-border: they do not\n identify a control, so the requirement does not apply and darkening\n them would only add noise. */\n /* The account dashboard paints nothing by default so it can drop into a\n merchant's page without fighting their background. The accountSurface and\n accountPadding appearance variables opt back into a card.\n No backticks in this comment: the sheet is a TS template literal. */\n --throttle-color-account-surface: transparent;\n --throttle-account-padding: 0;\n --throttle-color-border-control: #8b93a1;\n --throttle-color-danger: #c2321f;\n --throttle-color-danger-surface: #fef2f2;\n --throttle-color-danger-border: #fecaca;\n --throttle-color-success: #127a4a;\n --throttle-color-success-surface: #ecfdf5;\n --throttle-color-success-border: #a7f3d0;\n --throttle-color-warning: #92400e;\n --throttle-color-warning-surface: #fffbeb;\n --throttle-color-warning-border: #fde68a;\n --throttle-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --throttle-font-size: 16px;\n --throttle-font-size-xs: 12px;\n --throttle-font-size-sm: 14px;\n --throttle-font-size-lg: 20px;\n --throttle-font-size-xl: 24px;\n --throttle-line-height: 1.5;\n --throttle-line-height-tight: 1.25;\n --throttle-radius: 12px;\n --throttle-radius-sm: 8px;\n --throttle-radius-full: 999px;\n --throttle-border-width: 1px;\n --throttle-spacing: 8px;\n --throttle-space-1: 4px;\n --throttle-space-2: var(--throttle-spacing);\n --throttle-space-3: 12px;\n --throttle-space-4: 16px;\n --throttle-space-5: 24px;\n --throttle-space-6: 32px;\n --throttle-control-height: 48px;\n --throttle-control-padding-x: 16px;\n --throttle-shadow-card: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);\n --throttle-shadow-popover: 0 10px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);\n --throttle-transition: 150ms cubic-bezier(.2,0,.2,1);\n --throttle-z-modal: 2147483000;\n --throttle-z-popover: 2147482000;\n font-family: var(--throttle-font-family);\n font-size: var(--throttle-font-size);\n line-height: var(--throttle-line-height);\n color: var(--throttle-color-foreground);\n box-sizing: border-box;\n}\n.throttle-root *, .throttle-root *::before, .throttle-root *::after { box-sizing: inherit; }\n\n.throttle-root[data-throttle-theme=\"dark\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n}\n@media (prefers-color-scheme: dark) {\n .throttle-root[data-throttle-theme=\"auto\"] {\n --throttle-color-primary: #e6edf3;\n --throttle-color-primary-foreground: #0d1117;\n --throttle-color-background: #0d1117;\n --throttle-color-surface: #1c2129;\n --throttle-color-foreground: #e6edf3;\n --throttle-color-muted: #21262d;\n --throttle-color-muted-foreground: #9aa4b2;\n --throttle-color-border: #30363d;\n --throttle-color-border-control: #5c6570;\n --throttle-color-danger: #ff6b58;\n --throttle-color-danger-surface: #2a1513;\n --throttle-color-danger-border: #5c2b25;\n --throttle-color-success: #45c08a;\n --throttle-color-success-surface: #0f2419;\n --throttle-color-success-border: #1f4d36;\n --throttle-color-warning: #e0a53a;\n --throttle-color-warning-surface: #2a2113;\n --throttle-color-warning-border: #5c4a25;\n --throttle-shadow-card: 0 1px 3px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);\n --throttle-shadow-popover: 0 10px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);\n }\n}\n\n.throttle-card {\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-card);\n padding: var(--throttle-space-5);\n width: 100%;\n max-width: 400px;\n margin-inline: auto;\n}\n/* Inside a Modal the dialog already provides the surface — background, radius\n and elevation. A card that draws its own on top is the \"box inside a box\":\n two shadowed rounded rectangles nested, with the card's max-width stranding\n it in the middle of a much wider dialog. */\n.throttle-card--bare { border: none; box-shadow: none; background: none; max-width: none; }\n.throttle-card__header { margin-bottom: var(--throttle-space-4); }\n.throttle-card__header--branded { text-align: center; }\n.throttle-card__logo { display: flex; justify-content: center; margin-bottom: var(--throttle-space-3); }\n.throttle-card__title { font-size: var(--throttle-font-size-xl); line-height: var(--throttle-line-height-tight); font-weight: 600; letter-spacing: -0.02em; margin: 0; }\n.throttle-card__title--branded { font-size: var(--throttle-font-size-xl); }\n.throttle-card__description { color: var(--throttle-color-muted-foreground); margin: var(--throttle-space-1) 0 0; }\n.throttle-card__body { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-card__footer { margin-top: var(--throttle-space-4); text-align: center; }\n.throttle-card__footer--ruled { border-top: var(--throttle-border-width) solid var(--throttle-color-border); padding-top: var(--throttle-space-4); }\n\n.throttle-field { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n.throttle-field__labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--throttle-space-2); }\n.throttle-field__label { font-weight: 500; }\n.throttle-field__input {\n font: inherit;\n font-size: var(--throttle-font-size);\n color: var(--throttle-color-foreground);\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border-control);\n border-radius: var(--throttle-radius-sm);\n /* padding-block stays 0 so min-height alone owns the height, exactly as\n .throttle-button does. With 12px vertical padding the box computed to\n 50px against the button's 48px — a 2px mismatch, measured in a browser\n across 19 controls. An input element centres its own text vertically. */\n padding-block: 0;\n padding-inline: var(--throttle-control-padding-x);\n min-height: var(--throttle-control-height);\n width: 100%;\n transition: border-color var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-field__input:focus-visible {\n outline: none;\n border-color: var(--throttle-color-primary);\n box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary);\n}\n.throttle-field__input:disabled { background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground); cursor: not-allowed; }\n.throttle-field__input::placeholder { color: var(--throttle-color-muted-foreground); opacity: 1; }\n.throttle-field__input--grouped { border: none; border-radius: 0; padding-inline: 0; }\n.throttle-field__hint { color: var(--throttle-color-muted-foreground); font-size: var(--throttle-font-size-xs); }\n/* Always mounted, so it reserves its line whether or not there is an error:\n an error appearing on submit must not push the submit button out from\n under the buyer's pointer. */\n.throttle-field__error { color: var(--throttle-color-danger); font-size: var(--throttle-font-size-xs); line-height: 1rem; }\n/* Reserved a full line under EVERY input even with nothing to say, which\n with the stack gap put 28px of dead space beneath each field, on every\n form and all seven account panels. The element stays mounted when empty\n because role=alert only announces changes to a live region that was\n already there; it just stops occupying a line. */\n.throttle-field__error:empty { display: none; }\n\n.throttle-field-group {\n display: flex;\n flex-direction: column;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n overflow: hidden;\n}\n.throttle-field-group__item { padding: var(--throttle-space-3) var(--throttle-control-padding-x); }\n.throttle-field-group__divider { height: var(--throttle-border-width); background: var(--throttle-color-border); }\n.throttle-field-group__forgot { margin-left: auto; }\n\n.throttle-button {\n font: inherit;\n font-weight: 500;\n border-radius: var(--throttle-radius-sm);\n border: var(--throttle-border-width) solid transparent;\n padding-inline: var(--throttle-control-padding-x);\n padding-block: 0;\n min-height: var(--throttle-control-height);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: opacity var(--throttle-transition), background-color var(--throttle-transition), border-color var(--throttle-transition), filter var(--throttle-transition), box-shadow var(--throttle-transition);\n}\n.throttle-button:disabled { opacity: .55; cursor: not-allowed; }\n.throttle-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--throttle-color-background), 0 0 0 4px var(--throttle-color-primary); }\n.throttle-button--primary { background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); width: 100%; }\n.throttle-button--primary:hover:not(:disabled) { filter: brightness(0.92); }\n.throttle-button--secondary { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); border-color: var(--throttle-color-border-control); }\n.throttle-button--secondary:hover:not(:disabled) { background: var(--throttle-color-muted); }\n.throttle-button--danger { background: transparent; color: var(--throttle-color-danger); border-color: var(--throttle-color-border); }\n.throttle-button--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--throttle-color-danger) 10%, transparent); }\n/* Link-style actions are the rows panel default, and they carry Delete,\n Remove, Cancel and Sign out. Zero padding with min-height 0 made those\n roughly 20px tall and ~8px apart — a mis-tap on a phone lands on something\n irreversible. The target is expanded with vertical padding and pulled back\n with an equal negative margin, so the hit box clears 44px while the text\n sits exactly where it did. Collapsing this back to zero padding shrinks the\n target again. */\n.throttle-button--link { background: none; border: none; color: var(--throttle-color-primary); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--link:hover:not(:disabled) { opacity: .8; }\n.throttle-button--linkDanger { background: none; border: none; color: var(--throttle-color-danger); padding-inline: 0; padding-block: var(--throttle-space-3); margin-block: calc(var(--throttle-space-3) * -1); min-height: 0; text-decoration: underline; width: auto; }\n.throttle-button--linkDanger:hover:not(:disabled) { opacity: .8; }\n.throttle-button--xs { font-size: var(--throttle-font-size-xs); }\n\n.throttle-alert { border-radius: var(--throttle-radius-sm); padding: var(--throttle-space-3); font-size: var(--throttle-font-size-sm); }\n.throttle-alert--error { background: var(--throttle-color-danger-surface); border: var(--throttle-border-width) solid var(--throttle-color-danger-border); color: var(--throttle-color-danger); }\n.throttle-alert--success { background: var(--throttle-color-success-surface); border: var(--throttle-border-width) solid var(--throttle-color-success-border); color: var(--throttle-color-success); }\n.throttle-alert--info { background: var(--throttle-color-surface); color: var(--throttle-color-muted-foreground); }\n\n.throttle-spinner {\n display: inline-block; width: 1em; height: 1em;\n border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;\n animation: throttle-spin 700ms linear infinite;\n}\n@keyframes throttle-spin { to { transform: rotate(360deg); } }\n.throttle-button--loading { position: relative; }\n.throttle-button__label { display: inline-flex; align-items: center; justify-content: center; gap: var(--throttle-space-2); }\n.throttle-button__label--hidden { visibility: hidden; }\n.throttle-spinner--centred { position: absolute; top: 50%; left: 50%; margin: -0.5em 0 0 -0.5em; }\n\n@media (prefers-reduced-motion: reduce) { .throttle-spinner { animation-duration: 2.4s; } }\n\n.throttle-skeleton {\n background: var(--throttle-color-muted);\n border-radius: var(--throttle-radius-sm);\n animation: throttle-pulse 1.4s ease-in-out infinite; height: 2.5em; }\n@keyframes throttle-pulse { 50% { opacity: .5; } }\n@media (prefers-reduced-motion: reduce) { .throttle-skeleton { animation: none; } }\n\n.throttle-modal__overlay {\n position: fixed; inset: 0; z-index: var(--throttle-z-modal);\n background: rgba(14,17,22,.45);\n display: flex; align-items: center; justify-content: center;\n padding: var(--throttle-space-4);\n overflow-y: auto;\n}\n.throttle-modal__container {\n background: var(--throttle-color-background);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;\n position: relative;\n}\n/* After the base rule on purpose: both are single-class, so equal specificity\n means source order decides. Declared before it, this silently lost. */\n.throttle-modal__container--compact { max-width: 440px; }\n.throttle-modal__close {\n position: absolute; top: var(--throttle-space-3); right: var(--throttle-space-3);\n background: none; border: none; cursor: pointer; font-size: var(--throttle-font-size-lg);\n color: var(--throttle-color-muted-foreground);\n transition: color var(--throttle-transition);\n}\n.throttle-modal__close:hover { color: var(--throttle-color-foreground); }\n.throttle-modal__header { padding: var(--throttle-space-4) var(--throttle-space-4) 0; }\n.throttle-modal__title { font-size: var(--throttle-font-size-lg); line-height: var(--throttle-line-height-tight); font-weight: 600; margin: 0; }\n.throttle-modal__body { padding: var(--throttle-space-4); }\n\n.throttle-dropdown__trigger { background: none; border: none; cursor: pointer; padding: 0; border-radius: var(--throttle-radius-full); transition: background-color var(--throttle-transition); }\n.throttle-dropdown__trigger:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }\n.throttle-dropdown__menu {\n position: absolute; right: 0; top: calc(100% + var(--throttle-space-2));\n z-index: var(--throttle-z-popover);\n min-width: 260px;\n background: var(--throttle-color-background);\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius);\n box-shadow: var(--throttle-shadow-popover);\n padding: var(--throttle-space-1);\n}\n.throttle-dropdown__item {\n display: flex; align-items: center; gap: var(--throttle-space-2);\n width: 100%; text-align: left; font: inherit; color: inherit;\n background: none; border: none; cursor: pointer;\n padding: var(--throttle-space-3);\n border-radius: var(--throttle-radius-sm);\n text-decoration: none;\n transition: background-color var(--throttle-transition);\n}\n.throttle-dropdown__item:hover { background: var(--throttle-color-surface); }\n.throttle-dropdown__item:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-dropdown__separator { height: 1px; background: var(--throttle-color-border); margin: var(--throttle-space-1) 0; border: 0; }\n\n.throttle-tabs__list {\n display: flex; gap: var(--throttle-space-1);\n border-bottom: var(--throttle-border-width) solid var(--throttle-color-border);\n overflow-x: auto; scrollbar-width: thin;\n}\n.throttle-tabs__tab {\n font: inherit; background: none; border: none; cursor: pointer; white-space: nowrap;\n padding: var(--throttle-space-3);\n color: var(--throttle-color-muted-foreground);\n border-bottom: 2px solid transparent;\n transition: color var(--throttle-transition), border-color var(--throttle-transition);\n}\n.throttle-tabs__tab:hover { color: var(--throttle-color-foreground); }\n.throttle-tabs__tab--active { color: var(--throttle-color-foreground); border-bottom-color: var(--throttle-color-primary); }\n.throttle-tabs__panel { padding-top: var(--throttle-space-4); }\n\n/* Paints its own ground. A UserButton in a navbar should stay transparent, but\n the dashboard is a large surface of themed text: in dark theme its foreground\n is near-white, so on a light host page it was rendering white-on-white. */\n.throttle-cardframe { width: 100%; min-height: 420px; border: 0; display: block; }\n.throttle-centre { display: flex; align-items: center; justify-content: center; min-height: 160px; }\n.throttle-account-root { container-type: inline-size; background: var(--throttle-color-account-surface); color: var(--throttle-color-foreground); padding: var(--throttle-account-padding); }\n.throttle-account { display: flex; gap: var(--throttle-space-5); align-items: flex-start; }\n.throttle-account__content { flex: 1; min-width: 0; }\n.throttle-tabs__rail { flex: none; width: 220px; display: flex; flex-direction: column; gap: 2px; }\n.throttle-tabs__railitem {\n font: inherit;\n font-size: var(--throttle-font-size-sm);\n display: flex;\n align-items: center;\n gap: var(--throttle-space-3);\n width: 100%;\n text-align: left;\n background: none;\n border: none;\n border-radius: var(--throttle-radius-sm);\n padding: 0 var(--throttle-space-3);\n min-height: var(--throttle-control-height);\n color: var(--throttle-color-muted-foreground);\n cursor: pointer;\n transition: background var(--throttle-transition), color var(--throttle-transition);\n}\n.throttle-tabs__railitem:hover { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); }\n.throttle-tabs__railitem:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__tab:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-tabs__railitem--active { background: var(--throttle-color-surface); color: var(--throttle-color-foreground); font-weight: 500; }\n.throttle-tabs__railicon { flex: none; opacity: .75; }\n\n/* A CONTAINER query, not a viewport one: these components render inside a\n merchant's page, so the viewport says nothing about how much room the\n dashboard actually has — it could sit in a 400px column on a 1920px screen.\n Below ~560px of container the rail becomes a full-width list above the\n panel: all seven still visible, each still a 44px target. */\n@container (max-width: 560px) {\n /* align-items: flex-start is right in row direction and wrong in column —\n it shrinks the rail to its content width, so width:100% alone cannot make\n it span. Stretch it explicitly when stacked. */\n .throttle-account { flex-direction: column; align-items: stretch; gap: var(--throttle-space-4); }\n .throttle-tabs__rail { width: 100%; }\n}\n\n.throttle-table { width: 100%; border-collapse: collapse; text-align: left; }\n.throttle-table__head { color: var(--throttle-color-muted-foreground); font-weight: 500; font-size: var(--throttle-font-size-sm); }\n.throttle-table__row { border-top: var(--throttle-border-width) solid var(--throttle-color-border); cursor: pointer; transition: background-color var(--throttle-transition); }\n.throttle-table__row:hover { background: var(--throttle-color-surface); }\n.throttle-table__row:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }\n.throttle-table__cell { padding: var(--throttle-space-3) var(--throttle-space-2); height: 56px; box-sizing: border-box; }\n.throttle-table__scroll { overflow-x: auto; }\n\n.throttle-empty { text-align: center; padding: var(--throttle-space-6) var(--throttle-space-4); }\n.throttle-empty__title { font-weight: 600; margin: 0 0 var(--throttle-space-1); }\n.throttle-empty__description { color: var(--throttle-color-muted-foreground); margin: 0; }\n\n.throttle-avatar {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground);\n font-size: var(--throttle-font-size-xs); font-weight: 600; text-transform: uppercase;\n}\n\n.throttle-badge {\n display: inline-block; font-size: var(--throttle-font-size-xs); font-weight: 500;\n padding: 2px var(--throttle-space-2); border-radius: var(--throttle-radius-full);\n background: var(--throttle-color-muted); color: var(--throttle-color-muted-foreground);\n}\n.throttle-badge--muted { background: none; border: var(--throttle-border-width) solid var(--throttle-color-border); color: var(--throttle-color-muted-foreground); font-weight: 400; padding: 1px calc(var(--throttle-space-2) - 1px); }\n.throttle-badge--success { background: color-mix(in srgb, var(--throttle-color-success) 15%, transparent); color: var(--throttle-color-success); }\n.throttle-badge--warning { background: color-mix(in srgb, var(--throttle-color-warning) 15%, transparent); color: var(--throttle-color-warning); }\n.throttle-badge--danger { background: color-mix(in srgb, var(--throttle-color-danger) 15%, transparent); color: var(--throttle-color-danger); }\n\n.throttle-stack { display: flex; flex-direction: column; gap: var(--throttle-space-3); }\n.throttle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-muted { color: var(--throttle-color-muted-foreground); }\n.throttle-banner {\n display: flex; align-items: center; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n background: color-mix(in srgb, var(--throttle-color-warning) 12%, transparent);\n color: var(--throttle-color-warning);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n margin-bottom: var(--throttle-space-4);\n}\n.throttle-panel { display: flex; flex-direction: column; gap: var(--throttle-space-4); }\n/* 100dvh, not 100vh: on mobile browsers 100vh includes the space behind the\n dynamic address/toolbar, so the page would be taller than the visible\n viewport and the card would sit off-centre until the toolbar collapsed. */\n.throttle-page {\n min-height: 100dvh;\n width: 100%;\n background: var(--throttle-color-surface);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--throttle-space-5);\n padding: var(--throttle-space-5);\n}\n.throttle-page__logo { display: flex; justify-content: center; }\n.throttle-page__footer { color: var(--throttle-color-muted-foreground); text-align: center; font-size: var(--throttle-font-size-sm); }\n.throttle-listitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border: var(--throttle-border-width) solid var(--throttle-color-border);\n border-radius: var(--throttle-radius-sm);\n padding: var(--throttle-space-3);\n}\n/* 'rows' variant: hairline rules between items instead of each item carrying\n its own border+radius, so a panel does not read as a card inside a card. */\n.throttle-rows { display: flex; flex-direction: column; }\n.throttle-rowitem {\n display: flex; align-items: flex-start; justify-content: space-between; gap: var(--throttle-space-2);\n flex-wrap: wrap;\n border-top: var(--throttle-border-width) solid var(--throttle-color-border);\n padding: var(--throttle-space-3) 0;\n}\n.throttle-rowitem:first-child { border-top: none; padding-top: 0; }\n.throttle-actions { display: flex; gap: var(--throttle-space-2); flex-wrap: wrap; }\n.throttle-table__money { display: block; text-align: right; font-variant-numeric: tabular-nums; }\n.throttle-lineitem { display: flex; align-items: center; gap: var(--throttle-space-3); padding: var(--throttle-space-2) 0; }\n.throttle-lineitem__image { width: 48px; height: 48px; object-fit: cover; border-radius: var(--throttle-radius-sm); flex: none; }\n.throttle-totals { display: flex; flex-direction: column; gap: var(--throttle-space-1); }\n\n@media (prefers-reduced-motion: reduce) {\n .throttle-button, .throttle-field__input, .throttle-dropdown__item, .throttle-dropdown__trigger, .throttle-tabs__tab, .throttle-table__row, .throttle-modal__close {\n transition: none;\n }\n}\n`;\n\n/**\n * Appends the stylesheet once. `useInsertionEffect` is the right phase for\n * this — React runs it before layout effects, so styles are in place before\n * anything measures. It does not run on the server, so SSR markup paints\n * unstyled for one frame; merchants who care import `@usethrottle/auth/styles.css`\n * and pass `injectStyles={false}`.\n *\n * Guarded on the element id rather than a module flag: a merchant may have\n * already inlined the sheet under the same id, and two React roots in one page\n * must not each add a copy.\n */\nexport function useInjectStyles(enabled: boolean): void {\n useInsertionEffect(() => {\n if (!enabled) return;\n if (typeof document === 'undefined') return;\n if (document.getElementById(THROTTLE_STYLE_ID)) return;\n const tag = document.createElement('style');\n tag.id = THROTTLE_STYLE_ID;\n tag.textContent = THROTTLE_STYLES;\n document.head.appendChild(tag);\n }, [enabled]);\n}\n","import { useEffect, useId, useState } from 'react';\nimport { useAppearance } from '../appearance';\nimport { useCopy } from '../localization';\nimport { useCardClass } from '../surface';\nimport { Button, CardBody, Field, Modal } from '../primitives';\n\n/**\n * The dialog behind the core's `onStepUpRequired`. It resolves that promise\n * with a password or with null; the core does the retrying. Nothing here\n * knows which request triggered it, which is exactly why one dialog serves\n * every sensitive action in the app.\n */\nexport function StepUpDialog(props: { open: boolean; onResolve(password: string | null): void }) {\n const a = useAppearance();\n const cardClass = useCardClass();\n const { t } = useCopy();\n const [password, setPassword] = useState('');\n const titleId = useId();\n\n // Never let a password linger in state between prompts.\n useEffect(() => { if (!props.open) setPassword(''); }, [props.open]);\n\n return (\n <Modal open={props.open} onClose={() => props.onResolve(null)} labelledBy={titleId}>\n <div {...a.el('stepUp.root', cardClass)}>\n <form\n onSubmit={(e) => { e.preventDefault(); props.onResolve(password); }}\n >\n <div className=\"throttle-card__header\">\n <h2 id={titleId} {...a.el('stepUp.title', 'throttle-card__title')}>{t.stepUp.title}</h2>\n <p className=\"throttle-card__description\">{t.stepUp.description}</p>\n </div>\n <CardBody>\n <Field\n label={t.stepUp.password}\n type=\"password\"\n autoComplete=\"current-password\"\n value={password}\n onChange={setPassword}\n required\n elementKey=\"stepUp.passwordField\"\n />\n <Button type=\"submit\" elementKey=\"stepUp.submitButton\">{t.stepUp.submitButton}</Button>\n <Button variant=\"link\" elementKey=\"stepUp.cancelButton\" onClick={() => props.onResolve(null)}>\n {t.stepUp.cancelButton}\n </Button>\n </CardBody>\n </form>\n </div>\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Where a card is rendering. A `Modal` already supplies the surface — its own\n * background, radius and elevation — so a card inside one must not draw a\n * second set. Two shadowed rounded rectangles nested inside each other is the\n * \"box inside a box\" look; it also strands the card's max-width in the middle\n * of a much wider dialog.\n */\nexport type ThrottleSurface = 'standalone' | 'modal';\n\nconst Ctx = createContext<ThrottleSurface>('standalone');\n\nexport function SurfaceProvider(props: { value: ThrottleSurface; children: ReactNode }) {\n return <Ctx.Provider value={props.value}>{props.children}</Ctx.Provider>;\n}\n\nexport function useSurface(): ThrottleSurface {\n return useContext(Ctx);\n}\n\n/** The base class a card should use for the surface it is on. */\nexport function useCardClass(): string {\n return useSurface() === 'modal' ? 'throttle-card throttle-card--bare' : 'throttle-card';\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Card(props: { children: ReactNode; className?: string; rootKey?: ThrottleElementKey }) {\n const a = useAppearance();\n const { className, ...rest } = a.el(props.rootKey ?? 'card', 'throttle-card');\n return <div {...rest} className={[className, props.className].filter(Boolean).join(' ')}>{props.children}</div>;\n}\n\nexport function CardHeader(props: {\n title: string;\n description?: string;\n titleKey?: ThrottleElementKey;\n /** Rendered above the title. Absent by default. */\n logo?: ReactNode;\n logoKey?: ThrottleElementKey;\n /** Centres the logo/title/description and enlarges the title — the `branded` variant. */\n branded?: boolean;\n}) {\n const a = useAppearance();\n const headerClass = `throttle-card__header${props.branded ? ' throttle-card__header--branded' : ''}`;\n const titleClass = `throttle-card__title${props.branded ? ' throttle-card__title--branded' : ''}`;\n return (\n <div {...a.el('card.header', headerClass)}>\n {props.logo ? (\n <div {...a.el(props.logoKey ?? 'card.logo', 'throttle-card__logo')}>{props.logo}</div>\n ) : null}\n <h2 {...a.el(props.titleKey ?? 'card.title', titleClass)}>{props.title}</h2>\n {props.description ? (\n <p {...a.el('card.description', 'throttle-card__description')}>{props.description}</p>\n ) : null}\n </div>\n );\n}\n\nexport function CardBody(props: { children: ReactNode }) {\n const a = useAppearance();\n return <div {...a.el('card.body', 'throttle-card__body')}>{props.children}</div>;\n}\n\nexport function CardFooter(props: { children: ReactNode; ruled?: boolean }) {\n const a = useAppearance();\n const className = `throttle-card__footer${props.ruled ? ' throttle-card__footer--ruled' : ''}`;\n return <div {...a.el('card.footer', className)}>{props.children}</div>;\n}\n","import { useAppearance } from '../appearance';\n\nexport function Spinner({ centred }: { centred?: boolean } = {}) {\n const a = useAppearance();\n const Slot = a.slots.Spinner;\n if (Slot) return <Slot />;\n const cls = `throttle-spinner${centred ? ' throttle-spinner--centred' : ''}`;\n return <span {...a.el('spinner', cls)} aria-hidden=\"true\" />;\n}\n","import type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\nimport { Spinner } from './Spinner';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * `'linkDanger'` is a borderless destructive action. It exists because the\n * `rows` panel variant renders actions as plain links, and a Delete that is\n * the same blue as Edit gives a buyer no signal that one of them is\n * irreversible.\n */\n variant?: 'primary' | 'secondary' | 'danger' | 'link' | 'linkDanger';\n /** `'xs'` shrinks the text to `--throttle-font-size-xs` — a link that should not compete visually with a primary CTA. */\n size?: 'default' | 'xs';\n elementKey?: ThrottleElementKey;\n loading?: boolean;\n children: ReactNode;\n}\n\nexport function Button({ variant = 'primary', size = 'default', elementKey, loading, children, ...rest }: ButtonProps) {\n const a = useAppearance();\n const Slot = a.slots.Button;\n if (Slot) return <Slot variant={variant} loading={loading} {...rest}>{children}</Slot>;\n\n // The label stays mounted while loading and is hidden instead, so the button\n // cannot change width mid-submit, and the spinner is centred over the space\n // it reserves. Both state classes are applied here rather than in CSS: the\n // stylesheet guard forbids the descendant selectors (`.a .b`) that a\n // pure-CSS version of this needs, because they would outrank a merchant's\n // own `elements` class.\n const base =\n `throttle-button throttle-button--${variant}` +\n `${size === 'xs' ? ' throttle-button--xs' : ''}` +\n `${loading ? ' throttle-button--loading' : ''}`;\n return (\n <button\n type=\"button\"\n {...rest}\n {...a.el(elementKey ?? 'button', base)}\n disabled={rest.disabled || loading}\n aria-busy={loading ? true : undefined}\n >\n {loading ? <Spinner centred /> : null}\n <span className={`throttle-button__label${loading ? ' throttle-button__label--hidden' : ''}`}>\n {children}\n </span>\n </button>\n );\n}\n","import { Children, Fragment, useId } from 'react';\nimport type { ChangeEvent, HTMLInputTypeAttribute, ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport interface FieldProps {\n label: string;\n value: string;\n onChange(value: string): void;\n type?: HTMLInputTypeAttribute;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n autoComplete?: string;\n hint?: string;\n error?: string;\n elementKey?: ThrottleElementKey;\n /** Rendered alongside the label, right-aligned — e.g. a \"Forgot password?\" link. */\n labelExtra?: ReactNode;\n /** Set by `FieldGroup` — drops the input's own border/radius so the group's border reads as one control. */\n grouped?: boolean;\n}\n\nexport function Field(props: FieldProps) {\n const a = useAppearance();\n // One useId per Field instance, suffixed — two Fields on a page must never\n // share an id, or clicking one label focuses the other's input.\n const base = useId();\n const inputId = `${base}-input`;\n const hintId = `${base}-hint`;\n const errorId = `${base}-error`;\n\n const describedBy = [props.hint ? hintId : null, props.error ? errorId : null].filter(Boolean).join(' ');\n const label = (\n <label {...a.el('field.label', 'throttle-field__label')} htmlFor={inputId}>{props.label}</label>\n );\n\n return (\n <div {...a.el(props.elementKey ?? 'field', 'throttle-field')}>\n {props.labelExtra ? (\n <div className=\"throttle-field__labelrow\">\n {label}\n {props.labelExtra}\n </div>\n ) : label}\n <input\n {...a.el('field.input', `throttle-field__input${props.grouped ? ' throttle-field__input--grouped' : ''}`)}\n id={inputId}\n name={props.name}\n type={props.type ?? 'text'}\n value={props.value}\n required={props.required}\n disabled={props.disabled}\n autoComplete={props.autoComplete}\n aria-describedby={describedBy || undefined}\n aria-invalid={props.error ? true : undefined}\n onChange={(e: ChangeEvent<HTMLInputElement>) => props.onChange(e.target.value)}\n />\n {props.hint ? <span {...a.el('field.hint', 'throttle-field__hint')} id={hintId}>{props.hint}</span> : null}\n {/*\n The error slot is always rendered, empty when there is no error, and\n reserves its own height in CSS. Two reasons, both load-bearing:\n\n 1. Layout. An error appearing on submit would otherwise push the submit\n button down by a line at the moment the buyer's pointer is over it.\n 2. Announcement. A live region inserted into the DOM together with its\n text is announced unreliably across screen readers; one that is\n already present when the text arrives is not. Keeping the element\n mounted is what makes role=\"alert\" actually fire.\n\n `aria-describedby` still references it only when there is something to\n read, so an empty slot never becomes part of the input's description.\n */}\n <span {...a.el('field.error', 'throttle-field__error')} id={errorId} role=\"alert\">\n {props.error ?? ''}\n </span>\n </div>\n );\n}\n\n/**\n * Joins adjacent `Field`s into one bordered group with hairline dividers,\n * instead of each carrying its own border — the `grouped` card variant.\n * Labels stay visible (children must still be `Field`s with their own\n * label/input pairing); only the shared border and divider live here.\n */\nexport function FieldGroup(props: { children: ReactNode; elementKey?: ThrottleElementKey }) {\n const a = useAppearance();\n const items = Children.toArray(props.children).filter(Boolean);\n return (\n <div {...a.el(props.elementKey ?? 'field.group', 'throttle-field-group')}>\n {items.map((child, i) => (\n <Fragment key={i}>\n {i > 0 ? <div className=\"throttle-field-group__divider\" /> : null}\n <div className=\"throttle-field-group__item\">{child}</div>\n </Fragment>\n ))}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\n\nexport function Alert(props: { tone: 'error' | 'success' | 'info'; children: ReactNode }) {\n const a = useAppearance();\n const Slot = a.slots.Alert;\n if (Slot) return <Slot tone={props.tone}>{props.children}</Slot>;\n return (\n <p\n {...a.el('alert', `throttle-alert throttle-alert--${props.tone}`)}\n // Errors must be announced; a success notice must not interrupt.\n role={props.tone === 'error' ? 'alert' : 'status'}\n >\n {props.children}\n </p>\n );\n}\n","import { useAppearance } from '../appearance';\n\n/** Reserves the final layout's height so content does not jump when it lands. */\nexport function Skeleton(props: { count?: number }) {\n const a = useAppearance();\n const rows = Array.from({ length: props.count ?? 1 });\n return (\n <div aria-hidden=\"true\" className=\"throttle-stack\">\n {rows.map((_, i) => (\n <span key={i} {...a.el('skeleton', 'throttle-skeleton')} />\n ))}\n </div>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\nimport { SurfaceProvider } from '../surface';\nimport { useCopy } from '../localization';\n\nconst FOCUSABLE =\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nexport function Modal(props: {\n open: boolean;\n onClose(): void;\n labelledBy: string;\n children: ReactNode;\n overlayKey?: ThrottleElementKey;\n containerKey?: ThrottleElementKey;\n /** `'compact'` sizes the dialog to a single auth card instead of the wide default. */\n size?: 'compact' | 'default';\n /**\n * Element to restore focus to on close, captured by the caller BEFORE\n * whatever triggered `open` also has a chance to remove that element from\n * the DOM in the same commit (e.g. a Dropdown menuitem that both opens\n * this modal and closes its own menu on the same click — the browser\n * resets `document.activeElement` to <body> the instant the menuitem is\n * removed, which happens before this component's own effect would ever\n * run). Falls back to self-capturing `document.activeElement` on open,\n * which is correct for a trigger that stays mounted (a plain button).\n */\n restoreFocusTo?: Element | null;\n}) {\n const a = useAppearance();\n const { t } = useCopy();\n const panel = useRef<HTMLDivElement>(null);\n const returnFocusTo = useRef<Element | null>(null);\n // Portals need document, which does not exist while server-rendering. Gate\n // on a mounted flag rather than `typeof document` so the server and the\n // first client render agree and hydration does not mismatch.\n const [mounted, setMounted] = useState(false);\n useEffect(() => { setMounted(true); }, []);\n\n // Kept in a ref, deliberately. When this effect depended on `props.onClose`,\n // a caller passing an inline arrow (StepUpDialog did) re-ran it on every\n // render: the cleanup returned focus to the trigger and the body then\n // focused the panel, so a buyer typing their password lost focus after the\n // first character and every later keystroke went nowhere. The effect needs\n // the LATEST onClose, never a reason to re-subscribe.\n const onCloseRef = useRef(props.onClose);\n useEffect(() => { onCloseRef.current = props.onClose; });\n\n useEffect(() => {\n // On a first render with `open` already true, this effect runs before\n // `mounted` flips (the portal has not rendered yet, so `panel.current` is\n // still null). Depending on `mounted` too makes it re-run once the portal\n // exists, so focus actually enters the panel instead of silently no-oping.\n if (!props.open || !mounted) return;\n returnFocusTo.current = props.restoreFocusTo ?? document.activeElement;\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n panel.current?.focus();\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') { onCloseRef.current(); return; }\n if (e.key !== 'Tab' || !panel.current) return;\n const items = Array.from(panel.current.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (items.length === 0) { e.preventDefault(); return; }\n const first = items[0];\n const last = items[items.length - 1];\n if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }\n else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }\n };\n\n document.addEventListener('keydown', onKeyDown);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.body.style.overflow = previousOverflow;\n (returnFocusTo.current as HTMLElement | null)?.focus?.();\n };\n }, [props.open, mounted]);\n\n if (!props.open || !mounted) return null;\n\n // The portal renders directly under document.body, outside any\n // `.throttle-root` ancestor the caller may have — so every var(--throttle-*)\n // the overlay/container/close-button styles reference would otherwise\n // resolve to nothing. Declare the root here too.\n return createPortal(\n <div {...a.rootProps}>\n <div\n {...a.el(props.overlayKey ?? 'modal.overlay', 'throttle-modal__overlay')}\n data-testid=\"throttle-modal-overlay\"\n onClick={(e) => { if (e.target === e.currentTarget) props.onClose(); }}\n >\n <div\n {...a.el(props.containerKey ?? 'modal.container', props.size === 'compact' ? 'throttle-modal__container throttle-modal__container--compact' : 'throttle-modal__container')}\n ref={panel}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={props.labelledBy}\n tabIndex={-1}\n >\n {/* Escape and overlay-click are not discoverable, and neither exists\n on touch. A visible close control is the only affordance some\n viewers will find. */}\n <button\n {...a.el('modal.closeButton', 'throttle-modal__close')}\n type=\"button\"\n aria-label={t.common.close}\n onClick={props.onClose}\n >\n ×\n </button>\n <SurfaceProvider value=\"modal\">{props.children}</SurfaceProvider>\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Dropdown(props: {\n label: string;\n trigger: ReactNode;\n children: ReactNode;\n triggerKey?: ThrottleElementKey;\n menuKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const [open, setOpen] = useState(false);\n const root = useRef<HTMLDivElement>(null);\n const trigger = useRef<HTMLButtonElement>(null);\n const menu = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n // The trigger and the menu are siblings, not ancestor/descendant, so a\n // real ArrowDown/ArrowUp keystroke fired while focus is still on the\n // trigger (which is where it lands after a click or an Enter/Space\n // activation — neither moves focus on its own) never reaches the menu's\n // onKeyDown handler below. Move focus onto the first item as soon as the\n // menu opens so the very next keystroke has somewhere to land.\n menu.current?.querySelector<HTMLElement>('[role=\"menuitem\"]')?.focus();\n const onDown = (e: MouseEvent) => {\n if (root.current && !root.current.contains(e.target as Node)) setOpen(false);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') { setOpen(false); trigger.current?.focus(); }\n };\n document.addEventListener('mousedown', onDown);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('mousedown', onDown);\n document.removeEventListener('keydown', onKey);\n };\n }, [open]);\n\n const move = (delta: number) => {\n const items = Array.from(menu.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []);\n if (items.length === 0) return;\n const at = items.indexOf(document.activeElement as HTMLElement);\n // -1 (nothing focused yet) plus delta 1 lands on 0, which is what ArrowDown\n // from the trigger should do.\n const next = (at + delta + items.length) % items.length;\n items[next < 0 ? items.length - 1 : next].focus();\n };\n\n return (\n <div ref={root} style={{ position: 'relative', display: 'inline-block' }}>\n <button\n ref={trigger}\n type=\"button\"\n {...a.el(props.triggerKey ?? 'dropdown.trigger', 'throttle-dropdown__trigger')}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-label={props.label}\n onClick={() => setOpen((v) => !v)}\n >\n {props.trigger}\n </button>\n {open ? (\n <div\n ref={menu}\n {...a.el(props.menuKey ?? 'dropdown.menu', 'throttle-dropdown__menu')}\n role=\"menu\"\n onClick={() => setOpen(false)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown') { e.preventDefault(); move(1); }\n if (e.key === 'ArrowUp') { e.preventDefault(); move(-1); }\n }}\n >\n {props.children}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function DropdownItem(props: {\n children: ReactNode;\n onClick?(): void;\n href?: string;\n itemKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const attrs = a.el(props.itemKey ?? 'dropdown.item', 'throttle-dropdown__item');\n if (props.href) {\n return <a {...attrs} role=\"menuitem\" href={props.href} tabIndex={-1}>{props.children}</a>;\n }\n return (\n <button {...attrs} role=\"menuitem\" type=\"button\" tabIndex={-1} onClick={props.onClick}>\n {props.children}\n </button>\n );\n}\n\nexport function DropdownSeparator() {\n const a = useAppearance();\n return <hr {...a.el('dropdown.separator', 'throttle-dropdown__separator')} />;\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\n\nexport interface TabDescriptor { id: string; label: string; icon?: ReactNode }\n\n/**\n * One component for both orientations on purpose. The roving-tabindex focus\n * move below was a real defect found by driving a browser — arrows changed\n * `aria-selected` while DOM focus stayed put, so a screen reader never heard\n * the move. A separate vertical nav would have to re-derive that, and would\n * eventually get it wrong.\n */\nexport function Tabs(props: {\n tabs: TabDescriptor[];\n active: string;\n onChange(id: string): void;\n orientation?: 'horizontal' | 'vertical';\n /**\n * Shared prefix so each tab can point at the panel it opens. The caller owns\n * it because the panel lives outside this component: without the pairing a\n * screen-reader user arrows onto a tab, hears its name, then lands on an\n * unnamed \"tab panel\" with nothing tying the two together.\n */\n idBase?: string;\n}) {\n const a = useAppearance();\n const at = props.tabs.findIndex((t) => t.id === props.active);\n const vertical = props.orientation === 'vertical';\n const listClass = vertical ? 'throttle-tabs__rail' : 'throttle-tabs__list';\n const itemClass = vertical ? 'throttle-tabs__railitem' : 'throttle-tabs__tab';\n\n return (\n <div\n {...a.el('tabs.list', listClass)}\n role=\"tablist\"\n aria-orientation={vertical ? 'vertical' : undefined}\n onKeyDown={(e) => {\n const next = vertical ? 'ArrowDown' : 'ArrowRight';\n const prev = vertical ? 'ArrowUp' : 'ArrowLeft';\n const delta = e.key === next ? 1 : e.key === prev ? -1 : 0;\n if (!delta) return;\n e.preventDefault();\n const nextIndex = (at + delta + props.tabs.length) % props.tabs.length;\n props.onChange(props.tabs[nextIndex].id);\n // Roving tabindex: the newly active tab is the only one with\n // tabIndex 0, but that alone doesn't move DOM focus there. Without\n // this, focus is stranded on the tab the user started on — a\n // screen reader never announces the move, and the visible focus\n // ring disagrees with the now-selected tab. The buttons already\n // exist in the DOM (only their tabIndex/aria-selected are about to\n // update), so focusing one directly here works ahead of that\n // re-render, not after it.\n e.currentTarget.querySelectorAll<HTMLElement>('[role=\"tab\"]')[nextIndex]?.focus();\n }}\n >\n {props.tabs.map((tab) => {\n const selected = tab.id === props.active;\n const { className, ...rest } = a.el('tabs.tab', itemClass);\n return (\n <button\n key={tab.id}\n {...rest}\n className={[className, selected ? `${itemClass}--active` : null].filter(Boolean).join(' ')}\n role=\"tab\"\n type=\"button\"\n id={props.idBase ? `${props.idBase}-tab-${tab.id}` : undefined}\n aria-controls={props.idBase ? `${props.idBase}-panel-${tab.id}` : undefined}\n aria-selected={selected}\n // Roving tabindex: one stop for the whole strip, arrows move within.\n tabIndex={selected ? 0 : -1}\n onClick={() => props.onChange(tab.id)}\n >\n {tab.icon}\n {tab.label}\n </button>\n );\n })}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport interface Column<T> { key: string; label: string; render?(row: T): ReactNode }\n\nexport function DataTable<T>(props: {\n columns: Column<T>[];\n rows: T[];\n rowKey(row: T): string;\n onRowClick?(row: T): void;\n tableKey?: ThrottleElementKey;\n rowElementKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const clickable = Boolean(props.onRowClick);\n\n return (\n // Tables are the one thing allowed to be wider than the panel; it scrolls\n // rather than forcing the whole page to.\n <div className=\"throttle-table__scroll\">\n <table {...a.el(props.tableKey ?? 'table', 'throttle-table')}>\n <thead>\n <tr>\n {props.columns.map((col) => (\n <th key={col.key} {...a.el('table.head', 'throttle-table__head')} scope=\"col\">{col.label}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {props.rows.map((row) => (\n <tr\n key={props.rowKey(row)}\n {...a.el(props.rowElementKey ?? 'table.row', 'throttle-table__row')}\n tabIndex={clickable ? 0 : undefined}\n onClick={clickable ? () => props.onRowClick!(row) : undefined}\n onKeyDown={\n clickable\n ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); props.onRowClick!(row); } }\n : undefined\n }\n >\n {props.columns.map((col) => (\n <td key={col.key} {...a.el('table.cell', 'throttle-table__cell')}>\n {col.render ? col.render(row) : String((row as any)[col.key] ?? '')}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useAppearance } from '../appearance';\n\nexport function EmptyState(props: { title: string; description?: string }) {\n const a = useAppearance();\n const Slot = a.slots.EmptyState;\n if (Slot) return <Slot title={props.title} description={props.description} />;\n return (\n <div {...a.el('emptyState', 'throttle-empty')}>\n <p {...a.el('emptyState.title', 'throttle-empty__title')}>{props.title}</p>\n {props.description ? (\n <p {...a.el('emptyState.description', 'throttle-empty__description')}>{props.description}</p>\n ) : null}\n </div>\n );\n}\n","import { useAppearance } from '../appearance';\n\n/**\n * Initials only. No gravatar, no external avatar service: a component that\n * silently hashes a buyer's email and sends it to a third party is not\n * something a merchant should have to discover.\n */\nexport function Avatar(props: { name: string; email: string }) {\n const a = useAppearance();\n const Slot = a.slots.Avatar;\n if (Slot) return <Slot name={props.name} email={props.email} />;\n\n const initials =\n props.name\n .split(' ')\n .map((part) => part.trim()[0])\n .filter(Boolean)\n .slice(0, 2)\n .join('') || props.email.trim()[0] || '?';\n\n return <span {...a.el('avatar', 'throttle-avatar')} title={props.email}>{initials.toUpperCase()}</span>;\n}\n","import type { ReactNode } from 'react';\nimport { useAppearance, type ThrottleElementKey } from '../appearance';\n\nexport function Badge(props: {\n /**\n * `'muted'` is the terminal tier: an outline pill for a state that is\n * finished and has nothing to act on (cancelled, closed, void). It reads\n * as quieter than the filled neutral used for live states, without\n * spending a colour on news that is neither good nor bad.\n */\n tone?: 'neutral' | 'muted' | 'success' | 'warning' | 'danger';\n children: ReactNode;\n elementKey?: ThrottleElementKey;\n}) {\n const a = useAppearance();\n const tone = props.tone ?? 'neutral';\n const base = tone === 'neutral' ? 'throttle-badge' : `throttle-badge throttle-badge--${tone}`;\n return <span {...a.el(props.elementKey ?? 'badge', base)}>{props.children}</span>;\n}\n","import { useId } from 'react';\nimport { AppearanceProvider, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { Modal } from '../primitives';\nimport { AuthFlow, type AuthView } from './AuthFlow';\n\nexport interface AuthModalProps {\n open: boolean;\n onClose(): void;\n initialView?: AuthView;\n afterSignIn?(): void;\n afterSignUp?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\nexport function AuthModal(props: AuthModalProps) {\n const scoped = useAppearanceProviderValue(props.appearance);\n const titleId = useId();\n return (\n <AppearanceProvider value={scoped}>\n <Modal\n open={props.open}\n onClose={props.onClose}\n labelledBy={titleId}\n size=\"compact\"\n overlayKey=\"authModal.overlay\"\n containerKey=\"authModal.container\"\n >\n {/* The flow swaps its own heading per view, so the dialog carries a\n stable accessible name of its own rather than pointing at a heading\n that disappears when the view changes. */}\n <h2 id={titleId} style={{ position: 'absolute', width: 1, height: 1, overflow: 'hidden', clip: 'rect(0 0 0 0)' }}>\n Account\n </h2>\n <AuthFlow\n initialView={props.initialView}\n afterSignIn={props.afterSignIn}\n afterSignUp={props.afterSignUp}\n appearance={props.appearance}\n localization={props.localization}\n />\n </Modal>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useState } from 'react';\nimport { useAppearance, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignIn } from './SignIn';\nimport { SignUp } from './SignUp';\nimport { ForgotPassword } from './ForgotPassword';\nimport { ResetPassword } from './ResetPassword';\nimport { VerifyEmail } from './VerifyEmail';\n\nexport type AuthView = 'signIn' | 'signUp' | 'forgotPassword' | 'resetPassword' | 'verifyEmail';\n\nconst HASH_FOR: Record<AuthView, string> = {\n signIn: '#/sign-in',\n signUp: '#/sign-up',\n forgotPassword: '#/forgot-password',\n resetPassword: '#/reset-password',\n verifyEmail: '#/verify-email',\n};\nconst VIEW_FOR_HASH: Record<string, AuthView> = Object.fromEntries(\n Object.entries(HASH_FOR).map(([view, hash]) => [hash, view as AuthView]),\n) as Record<string, AuthView>;\n\nexport interface AuthFlowProps {\n initialView?: AuthView;\n /** Controlled mode: pass both to own the value yourself. */\n view?: AuthView;\n onViewChange?(view: AuthView): void;\n /** Wins over the token in the URL. */\n token?: string;\n routing?: 'virtual' | 'hash';\n afterSignIn?(): void;\n afterSignUp?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\n/**\n * Reads the location on the client only. Returns nothing while server\n * rendering, so the server and the first client render agree; the effect below\n * applies the URL-derived view afterwards.\n */\nfunction readLocation(): { view: AuthView | null; token?: string } {\n if (typeof window === 'undefined') return { view: null };\n const params = new URLSearchParams(window.location.search);\n const token = params.get('token') ?? undefined;\n const hashView = VIEW_FOR_HASH[window.location.hash];\n if (hashView) return { view: hashView, token };\n if (!token) return { view: null };\n // A token in the URL means the buyer arrived from an email. Which email is\n // not knowable in general — merchants choose their own paths — so sniff the\n // common ones and let `initialView` override when they differ.\n const path = window.location.pathname.toLowerCase();\n if (path.includes('reset')) return { view: 'resetPassword', token };\n if (path.includes('verif')) return { view: 'verifyEmail', token };\n return { view: null, token };\n}\n\nexport function AuthFlow(props: AuthFlowProps) {\n const a = useAppearance(props.appearance);\n const controlled = props.view !== undefined;\n const [internal, setInternal] = useState<AuthView>(props.initialView ?? 'signIn');\n const [urlToken, setUrlToken] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n const found = readLocation();\n if (found.token) setUrlToken(found.token);\n // An explicit initialView or a controlled view is the merchant's decision\n // and outranks whatever the URL implies.\n if (found.view && !controlled && props.initialView === undefined) setInternal(found.view);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const view = controlled ? props.view! : internal;\n const token = props.token ?? urlToken;\n\n const go = (next: AuthView) => {\n props.onViewChange?.(next);\n if (!controlled) setInternal(next);\n if (props.routing === 'hash' && typeof window !== 'undefined') {\n window.location.hash = HASH_FOR[next];\n }\n };\n\n useEffect(() => {\n if (props.routing !== 'hash' || typeof window === 'undefined') return;\n const onHashChange = () => {\n if (controlled) return;\n const hash = window.location.hash;\n // An empty hash means Back navigated past the first pushed view entry,\n // back to the plain (view-less) URL — that always means sign-in, the\n // same default the component starts on. A no-op here left the browser\n // address bar and the rendered view disagreeing after Back.\n if (hash === '') {\n setInternal(props.initialView ?? 'signIn');\n return;\n }\n const next = VIEW_FOR_HASH[hash];\n if (next) setInternal(next);\n };\n window.addEventListener('hashchange', onHashChange);\n return () => window.removeEventListener('hashchange', onHashChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.routing, controlled]);\n\n const shared = { appearance: props.appearance, localization: props.localization };\n\n return (\n <div {...a.rootProps}>\n <div {...a.el('authFlow.root')}>\n {view === 'signIn' ? (\n <SignIn {...shared} onSuccess={props.afterSignIn}\n onForgotPassword={() => go('forgotPassword')} onSignUp={() => go('signUp')} />\n ) : null}\n {view === 'signUp' ? (\n <SignUp {...shared} onSuccess={props.afterSignUp} onSignIn={() => go('signIn')} />\n ) : null}\n {view === 'forgotPassword' ? (\n <ForgotPassword {...shared} onBack={() => go('signIn')} />\n ) : null}\n {view === 'resetPassword' ? (\n <ResetPassword {...shared} token={token} onSuccess={() => go('signIn')} />\n ) : null}\n {view === 'verifyEmail' ? <VerifyEmail {...shared} token={token} /> : null}\n </div>\n </div>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field, FieldGroup } from '../primitives';\n\nexport type AuthCardVariant = 'quiet' | 'grouped' | 'branded';\n\nexport interface SignInProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n onForgotPassword?(): void;\n onSignUp?(): void;\n}\n\nexport function SignIn(props: SignInProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, run } = useAction();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const variant = props.variant ?? 'quiet';\n const branded = variant === 'branded';\n const grouped = variant === 'grouped';\n const logo = useBrandLogo(props.logo);\n\n // `quiet` puts this beside the Password label instead of as its own\n // full-width row under the primary button, so the card has only one call\n // to action. `grouped` instead sits it right-aligned below the field\n // group, since there is no per-field label row to share once the inputs\n // are joined into one control.\n const forgotLink = props.onForgotPassword ? (\n <Button variant=\"link\" size=\"xs\" elementKey=\"signIn.forgotLink\" onClick={props.onForgotPassword}>\n {t.signIn.forgotLink}\n </Button>\n ) : null;\n\n const emailField = (\n <Field label={t.signIn.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"signIn.emailField\" grouped={grouped} />\n );\n const passwordField = (\n <Field label={t.signIn.password} type=\"password\" autoComplete=\"current-password\" required\n value={password} onChange={setPassword} elementKey=\"signIn.passwordField\" grouped={grouped}\n labelExtra={grouped ? undefined : forgotLink} />\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('signIn.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => { await auth.signIn(email, password); props.onSuccess?.(); });\n }}\n >\n <CardHeader\n title={t.signIn.title}\n description={branded ? t.signIn.description : undefined}\n titleKey=\"signIn.title\"\n logo={branded ? logo : null}\n logoKey=\"signIn.logo\"\n branded={branded}\n />\n <CardBody>\n {grouped ? <FieldGroup>{emailField}{passwordField}</FieldGroup> : <>{emailField}{passwordField}</>}\n {grouped && forgotLink ? <div className=\"throttle-field-group__forgot\">{forgotLink}</div> : null}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"signIn.submitButton\">\n {t.signIn.submitButton}\n </Button>\n </CardBody>\n {props.onSignUp ? (\n <CardFooter ruled={!branded}>\n <span className=\"throttle-muted\">{t.signIn.switchPrompt} </span>\n <Button variant=\"link\" elementKey=\"signIn.switchLink\" onClick={props.onSignUp}>\n {t.signIn.switchLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useCallback, useRef, useState } from 'react';\nimport { useCopy } from './localization';\n\nexport interface Action {\n submitting: boolean;\n error: string | null;\n notice: string | null;\n run(fn: () => Promise<string | void>): Promise<void>;\n}\n\n/**\n * Submit-once semantics plus localized error copy. Deliberately a separate hook\n * from `../forms/useFormAction`: that one maps errors through `messageForError`\n * with no path to a merchant's `localization.errors`, and `./forms` is a\n * published entry point whose contract is that it does not change.\n */\nexport function useAction(): Action {\n const { errorMessage } = useCopy();\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const inFlight = useRef(false);\n\n const run = useCallback(\n async (fn: () => Promise<string | void>) => {\n if (inFlight.current) return; // a double-click is one attempt, not two\n inFlight.current = true;\n setSubmitting(true);\n setError(null);\n setNotice(null);\n try {\n const message = await fn();\n if (typeof message === 'string') setNotice(message);\n } catch (err) {\n setError(errorMessage(err));\n } finally {\n inFlight.current = false;\n setSubmitting(false);\n }\n },\n [errorMessage],\n );\n\n return { submitting, error, notice, run };\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field, FieldGroup } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface SignUpProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n onSignIn?(): void;\n}\n\nexport function SignUp(props: SignUpProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const variant = props.variant ?? 'quiet';\n const branded = variant === 'branded';\n const grouped = variant === 'grouped';\n const logo = useBrandLogo(props.logo);\n\n const emailField = (\n <Field label={t.signUp.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"signUp.emailField\" grouped={grouped} />\n );\n const passwordField = (\n <Field label={t.signUp.password} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} elementKey=\"signUp.passwordField\" grouped={grouped} />\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('signUp.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n const result = await auth.register(email, password);\n if (result.status === 'active') { props.onSuccess?.(); return; }\n // `pending` covers two different server outcomes — a new account\n // awaiting verification, and a registration onto an address that\n // already has one, which sends nothing. The copy must be true for\n // both, so it says \"if that email is new\" rather than \"we sent\".\n return t.signUp.pendingNotice;\n });\n }}\n >\n <CardHeader\n title={t.signUp.title}\n description={branded ? t.signUp.description : undefined}\n titleKey=\"signUp.title\"\n logo={branded ? logo : null}\n logoKey=\"signUp.logo\"\n branded={branded}\n />\n <CardBody>\n {grouped ? <FieldGroup>{emailField}{passwordField}</FieldGroup> : <>{emailField}{passwordField}</>}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"info\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"signUp.submitButton\">\n {t.signUp.submitButton}\n </Button>\n </CardBody>\n {props.onSignIn ? (\n <CardFooter ruled={!branded}>\n <span className=\"throttle-muted\">{t.signUp.switchPrompt} </span>\n <Button variant=\"link\" elementKey=\"signUp.switchLink\" onClick={props.onSignIn}>\n {t.signUp.switchLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardFooter, CardHeader, Field } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface ForgotPasswordProps {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. A single input, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onBack?(): void;\n}\n\nexport function ForgotPassword(props: ForgotPasswordProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [email, setEmail] = useState('');\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <form\n {...a.el('forgotPassword.root', cardClass)}\n onSubmit={(e) => {\n e.preventDefault();\n // The server answers identically whether or not the address exists,\n // and so must this: a notice that varied would enumerate accounts.\n void run(async () => { await auth.forgotPassword(email); return t.forgotPassword.sentNotice; });\n }}\n >\n <CardHeader\n title={t.forgotPassword.title}\n description={branded ? t.forgotPassword.description : undefined}\n titleKey=\"forgotPassword.title\"\n logo={branded ? logo : null}\n logoKey=\"forgotPassword.logo\"\n branded={branded}\n />\n <CardBody>\n <Field label={t.forgotPassword.email} type=\"email\" autoComplete=\"email\" required\n value={email} onChange={setEmail} elementKey=\"forgotPassword.emailField\" />\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"forgotPassword.submitButton\">\n {t.forgotPassword.submitButton}\n </Button>\n </CardBody>\n {props.onBack ? (\n <CardFooter ruled={!branded}>\n <Button variant=\"link\" elementKey=\"forgotPassword.backLink\" onClick={props.onBack}>\n {t.forgotPassword.backLink}\n </Button>\n </CardFooter>\n ) : null}\n </form>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardHeader, Field } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface ResetPasswordProps {\n token?: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. A single input, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n}\n\nexport function ResetPassword(props: ResetPasswordProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, error, notice, run } = useAction();\n const [password, setPassword] = useState('');\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('resetPassword.root', cardClass)}>\n <CardHeader\n title={t.resetPassword.title}\n titleKey=\"resetPassword.title\"\n logo={branded ? logo : null}\n logoKey=\"resetPassword.logo\"\n branded={branded}\n />\n <CardBody>\n {!props.token ? (\n // No form at all without a token. A submit button that can only\n // fail is worse than an explanation.\n <Alert tone=\"error\">{t.resetPassword.missingToken}</Alert>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n await auth.resetPassword(props.token!, password);\n props.onSuccess?.();\n return t.resetPassword.doneNotice;\n });\n }}\n >\n <div className=\"throttle-stack\">\n <Field label={t.resetPassword.password} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} elementKey=\"resetPassword.passwordField\" />\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"resetPassword.submitButton\">\n {t.resetPassword.submitButton}\n </Button>\n </div>\n </form>\n )}\n </CardBody>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useBrandLogo } from '../branding';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useCardClass } from '../surface';\nimport { useAction } from '../useAction';\nimport { Alert, Button, CardBody, CardHeader, Spinner } from '../primitives';\nimport type { AuthCardVariant } from './SignIn';\n\nexport interface VerifyEmailProps {\n token?: string;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Composition of the card. Default `'quiet'`. This card has no inputs, so `'grouped'` renders the same as `'quiet'`. */\n variant?: AuthCardVariant;\n /** Rendered above the title in the `branded` variant. Falls back to `ThrottleProvider`'s `logo`. */\n logo?: ReactNode;\n onSuccess?(): void;\n}\n\nexport function VerifyEmail(props: VerifyEmailProps) {\n const a = useAppearance(props.appearance);\n const cardClass = useCardClass();\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, errorMessage } = useCopy(props.localization);\n const { auth } = useAuth();\n const { submitting, notice, run } = useAction();\n const [state, setState] = useState<'idle' | 'verifying' | 'done' | 'failed'>(props.token ? 'verifying' : 'idle');\n const [error, setError] = useState<string | null>(null);\n const branded = (props.variant ?? 'quiet') === 'branded';\n const logo = useBrandLogo(props.logo);\n // StrictMode mounts effects twice in development, and a verification token is\n // single-use: a second call would fail with token_already_used and show the\n // buyer an error for a link that worked.\n const attempted = useRef<string | null>(null);\n\n useEffect(() => {\n const token = props.token;\n if (!token || attempted.current === token) return;\n attempted.current = token;\n setState('verifying');\n auth\n .verifyEmail(token)\n .then(() => { setState('done'); props.onSuccess?.(); })\n .catch((err) => { setError(errorMessage(err)); setState('failed'); });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.token, auth]);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('verifyEmail.root', cardClass)}>\n <CardHeader\n title={t.verifyEmail.title}\n titleKey=\"verifyEmail.title\"\n logo={branded ? logo : null}\n logoKey=\"verifyEmail.logo\"\n branded={branded}\n />\n <CardBody>\n {state === 'verifying' ? <p><Spinner /> {t.verifyEmail.verifying}</p> : null}\n {state === 'done' ? <Alert tone=\"success\">{t.verifyEmail.success}</Alert> : null}\n {state === 'failed' && error ? <Alert tone=\"error\">{error}</Alert> : null}\n {state === 'idle' ? <p className=\"throttle-muted\">{t.verifyEmail.instructions}</p> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n {state !== 'done' ? (\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"verifyEmail.resendButton\"\n onClick={() => void run(async () => {\n await auth.resendVerification();\n return t.verifyEmail.resentNotice;\n })}\n >\n {t.verifyEmail.resendButton}\n </Button>\n ) : null}\n </CardBody>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useId } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Modal } from '../primitives';\nimport { AccountDashboard, type AccountTab } from './AccountDashboard';\n\nexport interface AccountModalProps {\n open: boolean;\n onClose(): void;\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n /** Where focus returns on close. See `Modal`'s own doc for why a caller\n * sometimes has to name this rather than let the modal capture it. */\n restoreFocusTo?: Element | null;\n}\n\n/**\n * The account dashboard, reachable without going through `UserButton`'s\n * menu — a merchant can wire this to a \"Settings\" control anywhere. Mirrors\n * `AuthModal`'s shape (a `Modal` hosting the existing card/dashboard), so a\n * merchant who wants to own the open/close state themselves has the same\n * kind of component available for the account surface that they already\n * have for sign-in.\n */\nexport function AccountModal(props: AccountModalProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const titleId = useId();\n\n return (\n <AppearanceProvider value={scoped}>\n <Modal\n open={props.open}\n onClose={props.onClose}\n labelledBy={titleId}\n restoreFocusTo={props.restoreFocusTo}\n overlayKey=\"accountModal.overlay\"\n containerKey=\"accountModal.container\"\n >\n <div {...a.el('accountModal.header', 'throttle-modal__header')}>\n <h2 id={titleId} {...a.el('accountModal.title', 'throttle-modal__title')}>{t.account.title}</h2>\n </div>\n <div {...a.el('accountModal.body', 'throttle-modal__body')}>\n <AccountDashboard tabs={props.tabs} appearance={props.appearance} localization={props.localization} />\n </div>\n </Modal>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useId, useState } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Tabs } from '../primitives';\nimport { VerifyEmailBanner } from './VerifyEmailBanner';\nimport { ACCOUNT_ICONS } from './icons';\nimport { ProfilePanel } from './ProfilePanel';\nimport { AddressesPanel } from './AddressesPanel';\nimport { PaymentMethodsPanel } from './PaymentMethodsPanel';\nimport { OrdersPanel } from './OrdersPanel';\nimport { InvoicesPanel } from './InvoicesPanel';\nimport { SubscriptionsPanel } from './SubscriptionsPanel';\nimport { SecurityPanel } from './SecurityPanel';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport type AccountTab =\n | 'profile' | 'addresses' | 'paymentMethods' | 'orders' | 'invoices' | 'subscriptions' | 'security';\n\nexport const ACCOUNT_TABS: readonly AccountTab[] = [\n 'profile', 'addresses', 'paymentMethods', 'orders', 'invoices', 'subscriptions', 'security',\n];\n\nconst HASH_FOR: Record<AccountTab, string> = {\n profile: '#/profile', addresses: '#/addresses', paymentMethods: '#/payment-methods',\n orders: '#/orders', invoices: '#/invoices', subscriptions: '#/subscriptions', security: '#/security',\n};\nconst TAB_FOR_HASH: Record<string, AccountTab> = Object.fromEntries(\n Object.entries(HASH_FOR).map(([tab, hash]) => [hash, tab as AccountTab]),\n) as Record<string, AccountTab>;\n\nexport interface AccountDashboardProps {\n /** Which panels to show, in order. Defaults to all seven. */\n tabs?: AccountTab[];\n tab?: AccountTab;\n onTabChange?(tab: AccountTab): void;\n routing?: 'virtual' | 'hash';\n /**\n * `'sidebar'` (default) puts the seven panels in a vertical rail beside the\n * content; `'tabs'` is the original horizontal strip above it. Seven is a lot\n * for a strip — at narrow widths most of them sit off-screen behind a scroll\n * with nothing signalling they exist — so the rail is the default. The strip\n * remains for merchants whose surrounding page already has a side nav and\n * would end up with two.\n */\n layout?: 'sidebar' | 'tabs';\n /**\n * Default composition for every panel rendered here. A panel's own\n * `variant` prop cannot be set through the dashboard (it does not expose\n * per-tab overrides), so in practice this is the only source of `variant`\n * each panel receives when rendered through `AccountDashboard` — a panel\n * rendered directly, outside the dashboard, keeps deciding its own default\n * from its own `variant` prop rather than this one.\n */\n panelVariant?: AccountPanelVariant;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}\n\nexport function AccountDashboard(props: AccountDashboardProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { status } = useAuth();\n const shown = props.tabs ?? [...ACCOUNT_TABS];\n const controlled = props.tab !== undefined;\n const [internal, setInternal] = useState<AccountTab>(shown[0] ?? 'profile');\n // Above the signed-out early return: every hook must run on every render.\n const idBase = useId();\n\n useEffect(() => {\n if (props.routing !== 'hash' || typeof window === 'undefined') return;\n const apply = () => {\n // An empty/unrecognized hash (e.g. the browser Back button returning\n // to the pre-navigation URL) falls back to the first shown tab rather\n // than being ignored — otherwise \"Back\" is a dead button once the\n // hash empties out.\n const next = TAB_FOR_HASH[window.location.hash] ?? shown[0];\n // A hash naming a hidden tab is ignored rather than rendering a panel\n // with no tab to go back to.\n if (!next || !shown.includes(next)) return;\n if (controlled) props.onTabChange?.(next);\n else setInternal(next);\n };\n apply();\n window.addEventListener('hashchange', apply);\n return () => window.removeEventListener('hashchange', apply);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.routing, controlled, shown.join(',')]);\n\n // Signed out there is nothing to show; an empty tab shell would be worse\n // than nothing. Pair with <SignedIn> or <Protect> for a fallback.\n if (status !== 'authenticated') return null;\n\n const active = controlled ? props.tab! : internal;\n\n const go = (next: AccountTab) => {\n props.onTabChange?.(next);\n if (!controlled) setInternal(next);\n if (props.routing === 'hash' && typeof window !== 'undefined') window.location.hash = HASH_FOR[next];\n };\n\n const shared = { appearance: props.appearance, localization: props.localization };\n const sidebar = (props.layout ?? 'sidebar') === 'sidebar';\n\n const nav = (\n <Tabs\n idBase={idBase}\n orientation={sidebar ? 'vertical' : 'horizontal'}\n active={active}\n onChange={(id) => go(id as AccountTab)}\n tabs={shown.map((id) => ({\n id,\n label: t.account.tabs[id],\n // Icons ride the rail only. In the horizontal strip they cost\n // horizontal room, which is the scarce axis there.\n icon: sidebar ? ACCOUNT_ICONS[id] : undefined,\n }))}\n />\n );\n\n const panel = (\n <div\n {...a.el('accountDashboard.panel', sidebar ? 'throttle-account__content' : 'throttle-tabs__panel')}\n role=\"tabpanel\"\n id={`${idBase}-panel-${active}`}\n aria-labelledby={`${idBase}-tab-${active}`}\n tabIndex={0}\n >\n {active === 'profile' ? <ProfilePanel {...shared} /> : null}\n {active === 'addresses' ? <AddressesPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'paymentMethods' ? <PaymentMethodsPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'orders' ? (\n <OrdersPanel {...shared} variant={props.panelVariant} onViewSubscription={() => go('subscriptions')} />\n ) : null}\n {active === 'invoices' ? <InvoicesPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'subscriptions' ? <SubscriptionsPanel {...shared} variant={props.panelVariant} /> : null}\n {active === 'security' ? <SecurityPanel {...shared} variant={props.panelVariant} /> : null}\n </div>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('accountDashboard.root', 'throttle-panel throttle-account-root')}>\n <VerifyEmailBanner {...shared} />\n {sidebar ? (\n <div className=\"throttle-account\">\n <div {...a.el('accountDashboard.sidebar')}>{nav}</div>\n {panel}\n </div>\n ) : (\n <>\n <div {...a.el('accountDashboard.tabs')}>{nav}</div>\n {panel}\n </>\n )}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport { useAuth } from '../../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Button } from '../primitives';\n\nconst DISMISS_KEY = 'throttle-auth:verify-banner-dismissed';\n\n/** Every read and write is guarded: a private window or blocked site data\n * makes the accessor itself throw, and a banner must not take the page down. */\nfunction readDismissed(): boolean {\n try { return sessionStorage.getItem(DISMISS_KEY) === '1'; } catch { return false; }\n}\nfunction writeDismissed(): void {\n try { sessionStorage.setItem(DISMISS_KEY, '1'); } catch { /* not worth reporting */ }\n}\n\nexport function VerifyEmailBanner(props: { appearance?: ThrottleAppearance; localization?: ThrottleLocalization }) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, emailVerified } = useAuth();\n const { submitting, notice, error, run } = useAction();\n const [dismissed, setDismissed] = useState(readDismissed);\n\n if (status !== 'authenticated' || emailVerified || dismissed) return null;\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('verifyBanner.root', 'throttle-banner')}>\n <span {...a.el('verifyBanner.message')}>{t.verifyBanner.message}</span>\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <span className=\"throttle-actions\">\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"verifyBanner.resendButton\"\n onClick={() => void run(async () => {\n await auth.resendVerification();\n return t.verifyEmail.resentNotice;\n })}\n >\n {t.verifyBanner.resendButton}\n </Button>\n <Button\n variant=\"link\"\n elementKey=\"verifyBanner.dismissButton\"\n onClick={() => { writeDismissed(); setDismissed(true); }}\n >\n {t.verifyBanner.dismissButton}\n </Button>\n </span>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport type { AccountTab } from './AccountDashboard';\n\n/**\n * One 18px stroked glyph per account tab, drawn inline.\n *\n * Inline rather than an icon dependency because this package ships with no\n * runtime dependencies at all, and stroked rather than filled so a single\n * `currentColor` follows the merchant's own text colour in both themes.\n * `aria-hidden` on every one: the tab's own text is the accessible name, and\n * a second announcement of \"person icon, Profile\" is noise.\n */\nfunction Glyph(props: { children: ReactNode }) {\n return (\n <svg\n className=\"throttle-tabs__railicon\"\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {props.children}\n </svg>\n );\n}\n\nexport const ACCOUNT_ICONS: Record<AccountTab, ReactNode> = {\n profile: (\n <Glyph><circle cx=\"12\" cy=\"8\" r=\"4\" /><path d=\"M4 21c0-4 3.6-6 8-6s8 2 8 6\" /></Glyph>\n ),\n addresses: (\n <Glyph><path d=\"M12 21s7-5.3 7-11a7 7 0 1 0-14 0c0 5.7 7 11 7 11Z\" /><circle cx=\"12\" cy=\"10\" r=\"2.5\" /></Glyph>\n ),\n paymentMethods: (\n <Glyph><rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"2.5\" /><path d=\"M2.5 10h19\" /></Glyph>\n ),\n orders: (\n <Glyph><path d=\"M4 7h16v13H4z\" /><path d=\"M8 7V4h8v3\" /><path d=\"M8 12h8\" /></Glyph>\n ),\n invoices: (\n <Glyph><path d=\"M6 3h12v18l-3-2-3 2-3-2-3 2Z\" /><path d=\"M9 8h6M9 12h6\" /></Glyph>\n ),\n subscriptions: (\n <Glyph><path d=\"M3 12a9 9 0 0 1 15.5-6.2\" /><path d=\"M21 12a9 9 0 0 1-15.5 6.2\" /><path d=\"M18 3v4h-4M6 21v-4h4\" /></Glyph>\n ),\n security: (\n <Glyph><path d=\"M12 3 4 6.5V12c0 5 3.4 8.3 8 9 4.6-.7 8-4 8-9V6.5Z\" /><path d=\"m9 12 2 2 4-4\" /></Glyph>\n ),\n};\n","import { useEffect, useState, useRef } from 'react';\nimport { useAuth } from '../../context';\nimport { useCustomer } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Button, Field } from '../primitives';\nimport { PanelState } from './PanelState';\n\nexport function ProfilePanel(props: { appearance?: ThrottleAppearance; localization?: ThrottleLocalization }) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { status } = useAuth();\n const resource = useCustomer();\n const { submitting, error, notice, run } = useAction();\n\n // No acceptsMarketing here on purpose: the opt-in is not part of this form,\n // and holding a default for it is how a save silently rewrites a preference\n // the buyer set somewhere else.\n const [form, setForm] = useState({ firstName: '', lastName: '', phone: '', company: '' });\n\n // True once the buyer has touched any field, cleared again after a save.\n // Without it, ANY refetch landing mid-edit silently wiped what they had\n // typed — the effect below resets from `resource.data`, and a refetch fires\n // whenever `status`/`emailVerified` change or `update()` completes. Rare in\n // a single tab, certain if verification finishes in another one. It also\n // made the ProfilePanel test flaky: the reset occasionally landed between\n // the keystroke and the submit, so the patch carried '' instead of 'Ada'.\n const edited = useRef(false);\n\n // Reset the form whenever a new profile lands, including after a save — but\n // never on top of edits in progress.\n useEffect(() => {\n const c = resource.data;\n if (!c || edited.current) return;\n setForm({\n firstName: c.firstName ?? '', lastName: c.lastName ?? '',\n phone: c.phone ?? '', company: c.company ?? '',\n });\n }, [resource.data]);\n\n // Mounted standalone (outside <SignedIn>), a signed-out visitor makes\n // useCustomer() resolve to (data: null, error: null) with no network call\n // ever made — a null profile is only genuinely unexpected for a signed-in\n // buyer. Render nothing rather than \"Something went wrong.\" once we know\n // for certain there's no one signed in (not during the initial 'loading'\n // status, which still deserves its skeleton), matching how UserButton\n // already handles being mounted while signed out.\n if (status === 'unauthenticated') return null;\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('profilePanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n isEmpty={(c) => c === null}\n emptyTitle={t.common.somethingWentWrong}\n skeletonRows={4}\n >\n {(customer) => (\n <form\n {...a.el('profilePanel.form', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n void run(async () => {\n // Explicit patch. `email` is not in it — the buyer plane has no\n // email-change route, and sending an unknown field would be\n // rejected rather than silently ignored.\n edited.current = false;\n await resource.update({\n firstName: form.firstName,\n lastName: form.lastName,\n phone: form.phone,\n company: form.company || null,\n });\n return t.profile.savedNotice;\n });\n }}\n >\n <Field label={t.profile.email} type=\"email\" value={customer!.email} onChange={() => {}}\n disabled hint={t.profile.emailReadOnly} />\n <Field label={t.profile.firstName} value={form.firstName} autoComplete=\"given-name\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, firstName: v })); }} />\n <Field label={t.profile.lastName} value={form.lastName} autoComplete=\"family-name\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, lastName: v })); }} />\n <Field label={t.profile.phone} type=\"tel\" value={form.phone} autoComplete=\"tel\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, phone: v })); }} />\n <Field label={t.profile.company} value={form.company} autoComplete=\"organization\"\n onChange={(v) => { edited.current = true; setForm((f) => ({ ...f, company: v })); }} />\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {notice ? <Alert tone=\"success\">{notice}</Alert> : null}\n <Button type=\"submit\" loading={submitting} elementKey=\"profilePanel.submitButton\">\n {t.profile.saveButton}\n </Button>\n </form>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport type { Resource } from '../../hooks';\nimport { useCopy } from '../localization';\nimport { Alert, Button, EmptyState, Skeleton } from '../primitives';\n\nexport interface PanelStateProps<T> {\n resource: Resource<T>;\n /**\n * True when the buyer is unverified AND this resource is behind the claim\n * cutoff. An empty list then means \"withheld\", not \"none\" — see spec §10.\n */\n gated?: boolean;\n gatedDescription?: string;\n isEmpty(data: T): boolean;\n emptyTitle: string;\n emptyDescription?: string;\n skeletonRows?: number;\n children(data: T): ReactNode;\n}\n\nexport function PanelState<T>(props: PanelStateProps<T>) {\n const { t, errorMessage } = useCopy();\n const { data, isLoading, error, refetch } = props.resource;\n const empty = props.isEmpty(data);\n\n // Only skeleton the FIRST load. A refetch that blanked the panel would make\n // every save flash the whole list away and back.\n if (isLoading && empty) return <Skeleton count={props.skeletonRows ?? 3} />;\n\n const errorBanner = error ? (\n <div className=\"throttle-stack\">\n <Alert tone=\"error\">{errorMessage(error)}</Alert>\n <Button variant=\"secondary\" onClick={() => void refetch()}>{t.common.retry}</Button>\n </div>\n ) : null;\n\n // A verification error is not a failure — it is the gate. Routes differ in\n // how they express it: /me/orders is `buyerAuth: 'session'` so an unverified\n // buyer gets an empty 200, while /me/payment-methods is 'session+verified'\n // and returns 403. Same cause, two signals. Without this, one panel tells the\n // buyer to verify their email and its sibling shows a red alert with a Retry\n // button that cannot possibly succeed.\n const gatedByVerification = (error as { code?: string } | null)?.code === 'verification_required';\n if (gatedByVerification && empty) {\n return <EmptyState title={props.emptyTitle} description={props.gatedDescription ?? props.emptyDescription} />;\n }\n\n // An error with nothing behind it is all there is to show. But a resource\n // can hold an error (e.g. a refetch that blipped after a successful write)\n // while `data` still holds good, freshly-saved content — dropping that\n // content here would report a working save as a failure.\n if (error && empty) return errorBanner;\n\n if (empty) {\n return props.gated\n ? <EmptyState title={props.emptyTitle} description={props.gatedDescription} />\n : <EmptyState title={props.emptyTitle} description={props.emptyDescription} />;\n }\n\n return (\n <>\n {errorBanner}\n {props.children(data)}\n </>\n );\n}\n","import { useState } from 'react';\nimport type { Address } from '../../../types';\nimport { useAddresses } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { AddressForm } from './AddressForm';\n\n/**\n * Composition of the list of records a panel renders. `'boxed'` is today's\n * shipped look (each item its own bordered box, outlined action buttons) and\n * must stay byte-for-byte identical to it. `'rows'` separates items with a\n * hairline instead, and renders actions as plain text — the motivation is\n * that the account dashboard is itself a bordered card, so a panel built from\n * bordered boxes is a card inside a card with nothing establishing hierarchy.\n * `'table'` is a real `<table>` with column headers, for merchants who want\n * their buyer's records (especially money) in aligned tabular columns.\n */\nexport type AccountPanelVariant = 'rows' | 'boxed' | 'table';\n\nexport function AddressesPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const resource = useAddresses();\n const { submitting, error, run } = useAction();\n // `null` = closed, 'new' = creating, an Address = editing that one.\n const [editing, setEditing] = useState<Address | 'new' | null>(null);\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const close = () => setEditing(null);\n\n const formatAddress = (address: Address) =>\n [address.addressLine2, address.city, address.stateProvince, address.postalCode, address.countryCode]\n .filter(Boolean).join(', ');\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('addressesPanel.root', 'throttle-panel')}>\n {/*\n Only outside the form: AddressForm renders the same `error` itself,\n and showing it twice would be worse than not at all. Without this,\n a failed delete or make-default produced no feedback anywhere — the\n row simply stayed put and the buyer clicked again. Every sibling\n panel already surfaces its action errors here.\n */}\n {!editing && error ? <Alert tone=\"error\">{error}</Alert> : null}\n {editing ? (\n <AddressForm\n initial={editing === 'new' ? undefined : editing}\n submitting={submitting}\n error={error}\n onCancel={close}\n onSubmit={(input) => void run(async () => {\n if (editing === 'new') await resource.create(input);\n else await resource.update(editing.id, input);\n close();\n })}\n />\n ) : (\n <>\n {/* Wrapped for the same reason the detail Back control is: a\n direct child of the column-flex panel stretches to its full\n width, so this rendered as a panel-wide bar. */}\n <div>\n <Button elementKey=\"addressesPanel.addButton\" variant=\"secondary\" onClick={() => setEditing('new')}>\n {t.addresses.addButton}\n </Button>\n </div>\n <PanelState\n resource={resource}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.addresses.empty}\n emptyDescription={t.addresses.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"addressesPanel.table\"\n rowElementKey=\"addressesPanel.row\"\n rowKey={(address) => address.id}\n rows={rows}\n columns={[\n { key: 'label', label: t.addresses.label, render: (address) => address.label || address.addressLine1 },\n { key: 'address', label: t.addresses.columnAddress, render: (address) => (\n <>\n {address.addressLine1}\n {formatAddress(address) ? `, ${formatAddress(address)}` : ''}\n </>\n ) },\n { key: 'default', label: t.addresses.defaultBadge, render: (address) => (\n address.isDefault ? <Badge tone=\"success\">{t.addresses.defaultBadge}</Badge> : null\n ) },\n { key: 'actions', label: t.common.actions, render: (address) => (\n <div className=\"throttle-actions\">\n {!address.isDefault ? (\n <Button variant=\"secondary\" elementKey=\"addressesPanel.defaultButton\"\n onClick={() => void run(() => resource.update(address.id, { isDefault: true }))}>\n {t.addresses.makeDefault}\n </Button>\n ) : null}\n <Button variant=\"secondary\" elementKey=\"addressesPanel.editButton\"\n onClick={() => setEditing(address)}>\n {t.common.edit}\n </Button>\n <Button\n variant=\"danger\"\n elementKey=\"addressesPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.addresses.deleteConfirm)) return;\n void run(() => resource.remove(address.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n ) },\n ]}\n />\n ) : (\n <div {...a.el('addressesPanel.list', listBase)}>\n {rows.map((address) => (\n <div key={address.id} {...a.el('addressesPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{address.label || address.addressLine1}</strong>\n {address.isDefault ? <Badge tone=\"success\">{t.addresses.defaultBadge}</Badge> : null}\n </div>\n <p className=\"throttle-muted\">\n {/* addressLine1 stays its own text node (not joined into the\n sentence below) so it remains exact-text-matchable on its\n own, the way a merchant's own address list would render it. */}\n {address.addressLine1}\n </p>\n <p className=\"throttle-muted\">\n {formatAddress(address)}\n </p>\n </div>\n <div className=\"throttle-actions\">\n {/* No \"make default\" on the one that already is — a\n control whose only outcome is a no-op is noise. */}\n {!address.isDefault ? (\n <Button variant={actionVariant('secondary')} elementKey=\"addressesPanel.defaultButton\"\n onClick={() => void run(() => resource.update(address.id, { isDefault: true }))}>\n {t.addresses.makeDefault}\n </Button>\n ) : null}\n <Button variant={actionVariant('secondary')} elementKey=\"addressesPanel.editButton\"\n onClick={() => setEditing(address)}>\n {t.common.edit}\n </Button>\n <Button\n variant={actionVariant('danger')}\n elementKey=\"addressesPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.addresses.deleteConfirm)) return;\n void run(() => resource.remove(address.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </>\n )}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport type { Address, AddressInput } from '../../../types';\nimport { useAppearance } from '../appearance';\nimport { useCopy } from '../localization';\nimport { Alert, Button, Field } from '../primitives';\n\nexport function AddressForm(props: {\n initial?: Address;\n submitting: boolean;\n error: string | null;\n onSubmit(input: AddressInput): void;\n onCancel(): void;\n}) {\n const a = useAppearance();\n const { t } = useCopy();\n const i = props.initial;\n const [form, setForm] = useState({\n label: i?.label ?? '', firstName: i?.firstName ?? '', lastName: i?.lastName ?? '',\n company: i?.company ?? '', addressLine1: i?.addressLine1 ?? '', addressLine2: i?.addressLine2 ?? '',\n city: i?.city ?? '', stateProvince: i?.stateProvince ?? '', postalCode: i?.postalCode ?? '',\n countryCode: i?.countryCode ?? '', phone: i?.phone ?? '',\n });\n const set = (key: keyof typeof form) => (value: string) => setForm((f) => ({ ...f, [key]: value }));\n\n return (\n <form\n {...a.el('addressesPanel.form', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n props.onSubmit({\n label: form.label || undefined,\n firstName: form.firstName || undefined,\n lastName: form.lastName || undefined,\n company: form.company || undefined,\n addressLine1: form.addressLine1,\n addressLine2: form.addressLine2 || undefined,\n city: form.city,\n stateProvince: form.stateProvince || undefined,\n postalCode: form.postalCode || undefined,\n // The API wants ISO-3166 alpha-2; uppercase so \"gb\" is not rejected.\n countryCode: form.countryCode.toUpperCase(),\n phone: form.phone || undefined,\n });\n }}\n >\n <Field label={t.addresses.label} value={form.label} onChange={set('label')} />\n <Field label={t.addresses.firstName} value={form.firstName} onChange={set('firstName')} autoComplete=\"given-name\" />\n <Field label={t.addresses.lastName} value={form.lastName} onChange={set('lastName')} autoComplete=\"family-name\" />\n <Field label={t.addresses.company} value={form.company} onChange={set('company')} autoComplete=\"organization\" />\n <Field label={t.addresses.addressLine1} value={form.addressLine1} onChange={set('addressLine1')}\n required autoComplete=\"address-line1\" />\n <Field label={t.addresses.addressLine2} value={form.addressLine2} onChange={set('addressLine2')}\n autoComplete=\"address-line2\" />\n <Field label={t.addresses.city} value={form.city} onChange={set('city')} required autoComplete=\"address-level2\" />\n <Field label={t.addresses.stateProvince} value={form.stateProvince} onChange={set('stateProvince')}\n autoComplete=\"address-level1\" />\n <Field label={t.addresses.postalCode} value={form.postalCode} onChange={set('postalCode')}\n autoComplete=\"postal-code\" />\n <Field label={t.addresses.countryCode} value={form.countryCode} onChange={set('countryCode')}\n required autoComplete=\"country\" hint=\"ISO 3166-1 alpha-2, e.g. GB\" />\n <Field label={t.addresses.phone} type=\"tel\" value={form.phone} onChange={set('phone')} autoComplete=\"tel\" />\n {props.error ? <Alert tone=\"error\">{props.error}</Alert> : null}\n <div className=\"throttle-actions\">\n <Button type=\"submit\" loading={props.submitting}>{t.common.save}</Button>\n <Button variant=\"link\" onClick={props.onCancel}>{t.common.cancel}</Button>\n </div>\n </form>\n );\n}\n","import { useState } from 'react';\nimport { useAuth } from '../../context';\nimport { useSavedCards } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { AddCardDialog } from './AddCardDialog';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\n/**\n * Add, set-default and remove. The card form is hosted by the processor and\n * shown in an iframe by AddCardDialog, so a card number never reaches this\n * component. Adding is verified-only, like listing: what it hands out is the\n * ability to attach a payment instrument to the account.\n */\nexport function PaymentMethodsPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useSavedCards();\n const { submitting, error, run } = useAction();\n const [adding, setAdding] = useState(false);\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const cardLabel = (card: { cardBrand: string | null; methodType: string; cardLastFour: string | null }) =>\n `${(card.cardBrand ?? card.methodType).toUpperCase()} •••• ${card.cardLastFour ?? '____'}`;\n const expiryLabel = (card: { cardExpMonth: number | null; cardExpYear: number | null }) =>\n card.cardExpMonth && card.cardExpYear\n ? `${String(card.cardExpMonth).padStart(2, '0')}/${card.cardExpYear}`\n : '';\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('paymentMethodsPanel.root', 'throttle-panel')}>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {/* Only offered to a verified buyer — the route refuses anyone else,\n and a button that always fails is worse than no button. */}\n {emailVerified ? (\n <div>\n <Button elementKey=\"paymentMethodsPanel.addButton\" variant=\"secondary\" onClick={() => setAdding(true)}>\n {t.paymentMethods.addButton}\n </Button>\n </div>\n ) : null}\n <AddCardDialog\n open={adding}\n onClose={() => setAdding(false)}\n onAdded={() => { void resource.refetch(); }}\n localization={props.localization}\n />\n {/*\n The real GET /me/payment-methods 403s outright for an unverified\n buyer (buyerAuth: 'session+verified'), which PanelState's own\n error branch already renders — this `gated` prop instead covers\n the OTHER empty case every sibling panel (Orders/Invoices/\n Subscriptions) already covers: signed-out entirely (status !==\n 'authenticated'), where the resource resets to empty/no-error\n without ever calling the network. Before this, PaymentMethodsPanel\n was the only one of the four that showed the plain \"No saved\n cards\" copy there instead of matching its siblings.\n */}\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.paymentMethods.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.paymentMethods.empty}\n emptyDescription={t.paymentMethods.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"paymentMethodsPanel.table\"\n rowElementKey=\"paymentMethodsPanel.row\"\n rowKey={(card) => card.id}\n rows={rows}\n columns={[\n { key: 'card', label: t.paymentMethods.columnCard, render: (card) => cardLabel(card) },\n { key: 'expires', label: t.paymentMethods.expires, render: (card) => expiryLabel(card) },\n { key: 'default', label: t.paymentMethods.defaultBadge, render: (card) => (\n card.isDefault ? <Badge tone=\"success\">{t.paymentMethods.defaultBadge}</Badge> : null\n ) },\n { key: 'actions', label: t.common.actions, render: (card) => (\n <div className=\"throttle-actions\">\n {!card.isDefault ? (\n <Button variant=\"secondary\" loading={submitting}\n elementKey=\"paymentMethodsPanel.defaultButton\"\n onClick={() => void run(() => resource.setDefault(card.id))}>\n {t.paymentMethods.makeDefault}\n </Button>\n ) : null}\n <Button\n variant=\"danger\"\n elementKey=\"paymentMethodsPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.paymentMethods.deleteConfirm)) return;\n void run(() => resource.remove(card.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n ) },\n ]}\n />\n ) : (\n <div {...a.el('paymentMethodsPanel.list', listBase)}>\n {rows.map((card) => (\n <div key={card.id} {...a.el('paymentMethodsPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{cardLabel(card)}</strong>\n {card.isDefault ? <Badge tone=\"success\">{t.paymentMethods.defaultBadge}</Badge> : null}\n </div>\n {card.cardExpMonth && card.cardExpYear ? (\n <p className=\"throttle-muted\">\n {t.paymentMethods.expires} {String(card.cardExpMonth).padStart(2, '0')}/{card.cardExpYear}\n </p>\n ) : null}\n </div>\n <div className=\"throttle-actions\">\n {!card.isDefault ? (\n <Button variant={actionVariant('secondary')} loading={submitting}\n elementKey=\"paymentMethodsPanel.defaultButton\"\n onClick={() => void run(() => resource.setDefault(card.id))}>\n {t.paymentMethods.makeDefault}\n </Button>\n ) : null}\n <Button\n variant={actionVariant('danger')}\n elementKey=\"paymentMethodsPanel.deleteButton\"\n disabled={submitting}\n onClick={() => {\n if (!window.confirm(t.paymentMethods.deleteConfirm)) return;\n void run(() => resource.remove(card.id));\n }}\n >\n {t.common.delete}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useEffect, useId, useRef, useState } from 'react';\nimport { useAuth } from '../../context';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Alert, Modal, Spinner } from '../primitives';\nimport { messageForError } from '../../forms/messages';\n\n/**\n * The card form itself is hosted by the processor and shown in an iframe, so a\n * card number never touches this SDK, the merchant's page, or our API. When the\n * card is vaulted the frame posts `throttle.completed`, and the transaction id\n * on that message is what we hand back to record the card.\n */\nexport function AddCardDialog(props: {\n open: boolean;\n onClose(): void;\n onAdded(): void;\n localization?: ThrottleLocalization;\n}) {\n const { account } = useAuth();\n const titleId = useId();\n const { t } = useCopy(props.localization);\n const [src, setSrc] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n // Read inside the message listener without making the listener depend on\n // them — re-subscribing mid-flow would drop the one message that matters.\n const onAdded = useRef(props.onAdded);\n const onClose = useRef(props.onClose);\n onAdded.current = props.onAdded;\n onClose.current = props.onClose;\n\n useEffect(() => {\n if (!props.open) { setSrc(null); setError(null); return; }\n let live = true;\n setError(null);\n account.startCardSetup().then(\n (session) => {\n if (!live) return;\n // The hosted page checks who is embedding it against the merchant's\n // allowed origins, and reads that from `parentOrigin`. Omit it and the\n // frame renders \"Embed not authorized\" — the feature is dead in a real\n // browser while every unit test still passes. Found by driving it.\n let url = session.embedUrl;\n try {\n const u = new URL(session.embedUrl, window.location.origin);\n u.searchParams.set('parentOrigin', window.location.origin);\n url = u.toString();\n } catch {\n // A relative or malformed embedUrl is not worth throwing over; the\n // frame will report the origin problem itself.\n }\n setSrc(url);\n },\n (err) => { if (live) setError(messageForError(err)); },\n );\n return () => { live = false; };\n }, [props.open, account]);\n\n useEffect(() => {\n if (!src) return;\n // Only ever trust messages from the frame we opened. Without this any page\n // could post a transaction id at us and have it recorded as this buyer's\n // card.\n const frameOrigin = (() => { try { return new URL(src).origin; } catch { return null; } })();\n if (!frameOrigin) return;\n\n async function onMessage(event: MessageEvent) {\n if (event.origin !== frameOrigin) return;\n const data = event.data as { type?: string; paymentId?: string; code?: string; message?: string } | null;\n if (!data || typeof data.type !== 'string') return;\n\n if (data.type === 'throttle.completed' && data.paymentId) {\n setBusy(true);\n try {\n await account.confirmCardSetup(data.paymentId);\n onAdded.current();\n onClose.current();\n } catch (err) {\n setError(messageForError(err));\n } finally {\n setBusy(false);\n }\n } else if (data.type === 'throttle.error') {\n setError(data.message || t.common.somethingWentWrong);\n } else if (data.type === 'throttle.cancelled') {\n onClose.current();\n }\n }\n\n window.addEventListener('message', onMessage);\n return () => window.removeEventListener('message', onMessage);\n }, [src, account, t]);\n\n if (!props.open) return null;\n\n return (\n <Modal open onClose={props.onClose} labelledBy={titleId}>\n <h2 id={titleId}>{t.paymentMethods.addTitle}</h2>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n {busy ? (\n <div className=\"throttle-centre\"><Spinner /></div>\n ) : src ? (\n <iframe\n className=\"throttle-cardframe\"\n src={src}\n title={t.paymentMethods.addTitle}\n // The frame needs scripts and same-origin for the processor widget;\n // it does NOT need to navigate this page or open popups.\n sandbox=\"allow-scripts allow-forms allow-same-origin\"\n />\n ) : !error ? (\n <div className=\"throttle-centre\"><Spinner /></div>\n ) : null}\n </Modal>\n );\n}\n","import { useState } from 'react';\nimport { useAuth } from '../../context';\nimport { useOrders } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { OrderDetail } from './OrderDetail';\nimport { OrderStatus } from './OrderStatus';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function OrdersPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n onViewSubscription?(id: string): void;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useOrders();\n const [openId, setOpenId] = useState<string | null>(null);\n // Orders/Invoices already render a DataTable, so `table` stays their default\n // — a merchant configuring nothing keeps money in aligned tabular columns.\n const variant = props.variant ?? 'table';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n\n if (openId) {\n return (\n <OrderDetail\n orderId={openId}\n onBack={() => setOpenId(null)}\n onViewSubscription={props.onViewSubscription}\n appearance={props.appearance}\n localization={props.localization}\n />\n );\n }\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('ordersPanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n // An unverified buyer is behind the claim cutoff: an empty list here\n // means \"withheld\", not \"none\".\n gated={!emailVerified}\n gatedDescription={t.orders.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.orders.empty}\n emptyDescription={t.orders.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"ordersPanel.table\"\n rowElementKey=\"ordersPanel.row\"\n rowKey={(o) => o.id}\n onRowClick={(o) => setOpenId(o.id)}\n rows={rows}\n columns={[\n { key: 'orderNumber', label: t.orders.number },\n { key: 'createdAt', label: t.orders.date, render: (o) => formatDate(o.createdAt, locale) },\n { key: 'status', label: t.orders.status,\n render: (o) => <OrderStatus status={o.status} paymentStatus={o.paymentStatus} t={t} /> },\n { key: 'total', label: t.orders.total,\n render: (o) => <span className=\"throttle-table__money\">{formatMoney(o.total, o.currency, locale)}</span> },\n ]}\n />\n ) : (\n <div {...a.el('ordersPanel.list', listBase)}>\n {rows.map((o) => (\n <div key={o.id} {...a.el('ordersPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{o.orderNumber}</strong>\n <OrderStatus status={o.status} paymentStatus={o.paymentStatus} t={t} />\n </div>\n <p className=\"throttle-muted\">{formatDate(o.createdAt, locale)}</p>\n <p className=\"throttle-muted\">{formatMoney(o.total, o.currency, locale)}</p>\n </div>\n <div className=\"throttle-actions\">\n <Button variant={rowsVariant ? 'link' : 'secondary'} elementKey=\"ordersPanel.viewButton\"\n onClick={() => setOpenId(o.id)}>\n {t.common.view}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","/**\n * The only place minor units become major units. Every amount on the wire is\n * an integer in the currency's smallest unit, and the exponent varies: USD and\n * EUR are 2, JPY and KRW are 0, and a few are 3. `Intl` knows all of them, so\n * ask it rather than hardcoding 100.\n */\nexport function formatMoney(minorUnits: number, currency: string, locale: string): string {\n const code = (currency || 'USD').toUpperCase();\n\n // The exponent is a property of the currency, not of the display locale, so\n // probe it with a fixed locale rather than the caller's — a locale problem\n // must never be able to corrupt the amount.\n let digits = 2;\n try {\n digits = new Intl.NumberFormat('en-US', { style: 'currency', currency: code }).resolvedOptions()\n .maximumFractionDigits ?? 2;\n } catch {\n // Only a malformed code (not 3 letters) reaches here. 2 is a guess for\n // that case, not a rule about currencies in general.\n }\n const major = minorUnits / 10 ** digits;\n\n try {\n return new Intl.NumberFormat(locale, { style: 'currency', currency: code }).format(major);\n } catch {\n try {\n return new Intl.NumberFormat('en-US', { style: 'currency', currency: code }).format(major);\n } catch {\n // Both locales rejected the code outright. Label the amount with the\n // code rather than showing a bare number — a buyer seeing \"US 25.00\"\n // is better served than one seeing an unlabelled \"25\".\n return `${code} ${major.toFixed(digits)}`;\n }\n }\n}\n\nexport function formatDate(value: string | Date, locale: string): string {\n const date = value instanceof Date ? value : new Date(value);\n // An unparseable date must not render the literal text \"Invalid Date\".\n if (Number.isNaN(date.getTime())) return '';\n try {\n return new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date);\n } catch {\n return date.toISOString().slice(0, 10);\n }\n}\n","import { Badge } from '../primitives';\nimport type { ResolvedCopy } from '../localization';\n\n/**\n * An order's status is two facts, not one string: where it is in the\n * fulfilment lifecycle, and — only when there is something to say — what the\n * money is doing. The server models them as two columns for the same reason:\n * fulfilment only moves forward while money moves both ways, so a shipped\n * order can still be refunded.\n *\n * Rendering them as two badges rather than one compound label keeps the common\n * case (paid in full) to a single quiet pill, and keeps the money half legible\n * at table scale instead of truncating \"Fulfilled — Partially refunded\".\n */\n\n/** snake_case on the wire, camelCase in the copy object. */\nfunction copyKey(wire: string): string {\n return wire.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase());\n}\n\n/**\n * The money states a buyer must act on or would want to notice. Everything\n * else stays neutral — a lifecycle state is a fact, not good or bad news, and\n * a table where every row carries a tone teaches buyers to ignore all of them.\n */\nconst ATTENTION_PAYMENT_STATES = new Set(['pending', 'failed', 'disputed', 'expired']);\n\n/**\n * Renders one status value through a copy map, falling back to a readable form\n * of the wire value. Shared by orders, invoices and subscriptions so a status\n * added server-side degrades the same way everywhere instead of leaking\n * snake_case into one panel and not another.\n */\n/**\n * States that are over. They get the quiet outline tier rather than the filled\n * neutral one: a cancelled order and a processing order previously drew the\n * same pill, so a buyer scanning a list could not tell live from finished\n * without reading every row.\n */\nconst TERMINAL_STATUSES = new Set(['cancelled', 'closed', 'void', 'expired', 'voided']);\n\nexport function StatusBadge(props: { status: string; labels: Record<string, string | undefined> }) {\n const label = props.labels[copyKey(props.status)] ?? props.status.replace(/_/g, ' ');\n return <Badge tone={TERMINAL_STATUSES.has(props.status) ? 'muted' : 'neutral'}>{label}</Badge>;\n}\n\nexport function OrderStatus(props: { status: string; paymentStatus?: string | null; t: ResolvedCopy['t'] }) {\n const labels = props.t.orders.statusLabels as Record<string, string | undefined>;\n const payLabels = props.t.orders.paymentLabels as Record<string, string | undefined>;\n\n // An unrecognised status still has to render something a buyer can read, so\n // fall back to the wire value with its underscores removed rather than\n // showing `partially_fulfilled` or an empty pill.\n const lifecycle = labels[copyKey(props.status)] ?? props.status.replace(/_/g, ' ');\n const money = props.paymentStatus ? payLabels[copyKey(props.paymentStatus)] : undefined;\n\n return (\n <>\n <Badge tone={TERMINAL_STATUSES.has(props.status) ? 'muted' : 'neutral'}>{lifecycle}</Badge>\n {money ? (\n <Badge tone={ATTENTION_PAYMENT_STATES.has(props.paymentStatus!) ? 'warning' : 'neutral'}>{money}</Badge>\n ) : null}\n </>\n );\n}\n","import { useOrder } from '../../hooks';\nimport { OrderStatus } from './OrderStatus';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Badge, Button } from '../primitives';\nimport { PanelState } from './PanelState';\n\nfunction Line(props: { label: string; value: string }) {\n return (\n <div className=\"throttle-row\">\n <span className=\"throttle-muted\">{props.label}</span>\n <span>{props.value}</span>\n </div>\n );\n}\n\nexport function OrderDetail(props: {\n orderId: string;\n onBack?(): void;\n onViewSubscription?(id: string): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const resource = useOrder(props.orderId);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('orderDetail.root', 'throttle-panel')}>\n {props.onBack ? (\n // Wrapped on purpose. The panel is a column flex container, so a\n // direct child stretches to its full width however `width: auto`\n // the link variant is — the control rendered 748px wide with a\n // centred label. The wrapper takes the stretch; the button keeps\n // its own width. A CSS fix would need a compound selector, and\n // those outrank the merchant overrides in `appearance.elements`.\n <div>\n <Button variant=\"link\" elementKey=\"orderDetail.backButton\" onClick={props.onBack}>\n {t.common.back}\n </Button>\n </div>\n ) : null}\n\n <PanelState\n resource={resource}\n isEmpty={(o) => o === null}\n emptyTitle={t.orders.empty}\n skeletonRows={5}\n >\n {(order) => (\n <>\n <div className=\"throttle-row\">\n <h3>{order!.orderNumber}</h3>\n <OrderStatus status={order!.status} paymentStatus={order!.paymentStatus} t={t} />\n </div>\n <p className=\"throttle-muted\">{formatDate(order!.createdAt, locale)}</p>\n\n <div {...a.el('orderDetail.lineItems', 'throttle-stack')}>\n {order!.lineItems.map((item) => (\n <div key={item.id} {...a.el('orderDetail.lineItem', 'throttle-lineitem')}>\n {item.imageUrl ? (\n <img className=\"throttle-lineitem__image\" src={item.imageUrl} alt=\"\" />\n ) : null}\n <div style={{ flex: 1 }}>\n <strong>{item.name}</strong>\n {item.description ? <p className=\"throttle-muted\">{item.description}</p> : null}\n <p className=\"throttle-muted\">\n {t.orders.quantity} {item.quantity} × {formatMoney(item.unitPrice, order!.currency, locale)}\n </p>\n </div>\n <span>{formatMoney(item.total, order!.currency, locale)}</span>\n </div>\n ))}\n </div>\n\n <div {...a.el('orderDetail.totals', 'throttle-totals')}>\n <Line label={t.orders.subtotal} value={formatMoney(order!.subtotal, order!.currency, locale)} />\n {order!.discountTotal ? (\n <Line label={t.orders.discount} value={formatMoney(-order!.discountTotal, order!.currency, locale)} />\n ) : null}\n <Line label={t.orders.shipping} value={formatMoney(order!.shippingTotal, order!.currency, locale)} />\n <Line label={t.orders.tax} value={formatMoney(order!.taxTotal, order!.currency, locale)} />\n <Line label={t.orders.total} value={formatMoney(order!.total, order!.currency, locale)} />\n </div>\n\n {order!.subscriptionId && props.onViewSubscription ? (\n <Button variant=\"secondary\" onClick={() => props.onViewSubscription!(order!.subscriptionId!)}>\n {t.orders.viewSubscription}\n </Button>\n ) : null}\n </>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useState } from 'react';\nimport { StatusBadge } from './OrderStatus';\nimport { useAuth } from '../../context';\nimport { useInvoices } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { formatDate, formatMoney } from '../format';\nimport { Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport { InvoiceDetail } from './InvoiceDetail';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function InvoicesPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useInvoices();\n const [openId, setOpenId] = useState<string | null>(null);\n // Orders/Invoices already render a DataTable, so `table` stays their default\n // — a merchant configuring nothing keeps money in aligned tabular columns.\n const variant = props.variant ?? 'table';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n\n if (openId) {\n return (\n <InvoiceDetail invoiceId={openId} onBack={() => setOpenId(null)}\n appearance={props.appearance} localization={props.localization} />\n );\n }\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('invoicesPanel.root', 'throttle-panel')}>\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.invoices.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.invoices.empty}\n emptyDescription={t.invoices.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"invoicesPanel.table\"\n rowElementKey=\"invoicesPanel.row\"\n rowKey={(i) => i.id}\n onRowClick={(i) => setOpenId(i.id)}\n rows={rows}\n columns={[\n { key: 'number', label: t.invoices.number },\n { key: 'issuedAt', label: t.invoices.issued, render: (i) => formatDate(i.issuedAt, locale) },\n { key: 'status', label: t.invoices.status, render: (i) => <StatusBadge status={i.status} labels={t.invoices.statusLabels} /> },\n { key: 'total', label: t.invoices.total,\n render: (i) => <span className=\"throttle-table__money\">{formatMoney(i.total, i.currency, locale)}</span> },\n ]}\n />\n ) : (\n <div {...a.el('invoicesPanel.list', listBase)}>\n {rows.map((i) => (\n <div key={i.id} {...a.el('invoicesPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{i.number}</strong>\n <StatusBadge status={i.status} labels={t.invoices.statusLabels} />\n </div>\n <p className=\"throttle-muted\">{formatDate(i.issuedAt, locale)}</p>\n <p className=\"throttle-muted\">{formatMoney(i.total, i.currency, locale)}</p>\n </div>\n <div className=\"throttle-actions\">\n <Button variant={rowsVariant ? 'link' : 'secondary'} elementKey=\"invoicesPanel.viewButton\"\n onClick={() => setOpenId(i.id)}>\n {t.common.view}\n </Button>\n </div>\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useAuth } from '../../context';\nimport { StatusBadge } from './OrderStatus';\nimport { useInvoice } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate, formatMoney } from '../format';\nimport { Alert, Badge, Button } from '../primitives';\nimport { PanelState } from './PanelState';\n\nfunction Line(props: { label: string; value: string }) {\n return (\n <div className=\"throttle-row\">\n <span className=\"throttle-muted\">{props.label}</span>\n <span>{props.value}</span>\n </div>\n );\n}\n\nexport function InvoiceDetail(props: {\n invoiceId: string;\n onBack?(): void;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { account } = useAuth();\n const resource = useInvoice(props.invoiceId);\n const { submitting, error, run } = useAction();\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('invoiceDetail.root', 'throttle-panel')}>\n {props.onBack ? (\n // Wrapped on purpose. The panel is a column flex container, so a\n // direct child stretches to its full width however `width: auto`\n // the link variant is — the control rendered 748px wide with a\n // centred label. The wrapper takes the stretch; the button keeps\n // its own width. A CSS fix would need a compound selector, and\n // those outrank the merchant overrides in `appearance.elements`.\n <div>\n <Button variant=\"link\" elementKey=\"invoiceDetail.backButton\" onClick={props.onBack}>\n {t.common.back}\n </Button>\n </div>\n ) : null}\n\n <PanelState resource={resource} isEmpty={(i) => i === null} emptyTitle={t.invoices.empty} skeletonRows={4}>\n {(invoice) => (\n <>\n <div className=\"throttle-row\">\n <h3>{invoice!.number}</h3>\n <StatusBadge status={invoice!.status} labels={t.invoices.statusLabels} />\n </div>\n\n <div {...a.el('invoiceDetail.totals', 'throttle-totals')}>\n <Line label={t.invoices.issued} value={formatDate(invoice!.issuedAt, locale)} />\n {invoice!.dueAt ? <Line label={t.invoices.due} value={formatDate(invoice!.dueAt, locale)} /> : null}\n {invoice!.periodStart && invoice!.periodEnd ? (\n <Line\n label={t.invoices.period}\n value={`${formatDate(invoice!.periodStart, locale)} – ${formatDate(invoice!.periodEnd, locale)}`}\n />\n ) : null}\n <Line label={t.invoices.total} value={formatMoney(invoice!.total, invoice!.currency, locale)} />\n {invoice!.amountRefunded ? (\n <Line label={t.invoices.refunded}\n value={formatMoney(invoice!.amountRefunded, invoice!.currency, locale)} />\n ) : null}\n </div>\n\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"invoiceDetail.downloadButton\"\n onClick={() => void run(async () => {\n // Fetched on click, never on render: the signed URL lives 600\n // seconds, so a link prepared when the page loaded would be\n // dead by the time a buyer reading the invoice clicked it.\n const { url } = await account.getInvoicePdfUrl(invoice!.id);\n // The user-activation token does not survive the await, so\n // Safari blocks this popup outright and Chrome does past\n // about a second. window.open then returns null and the\n // buyer saw the spinner stop with nothing else happening.\n // Navigating the current tab always works; the PDF is a\n // terminal destination, so nothing is lost by not opening\n // a new one.\n const opened = window.open(url, '_blank', 'noopener,noreferrer');\n if (!opened) window.location.assign(url);\n })}\n >\n {t.invoices.downloadButton}\n </Button>\n </>\n )}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useAuth } from '../../context';\nimport { StatusBadge } from './OrderStatus';\nimport { useSubscriptions } from '../../hooks';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate, formatMoney } from '../format';\nimport { Alert, Badge, Button, DataTable } from '../primitives';\nimport { PanelState } from './PanelState';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\n// Lifecycle controls only make sense in some states. Acting on a cancelled\n// subscription either 400s or silently no-ops depending on the action, so the\n// controls are hidden rather than shown and allowed to fail.\nconst CAN_PAUSE = new Set(['active', 'trialing']);\nconst CAN_RESUME = new Set(['paused']);\n// 'unpaid' is the terminal dunning state — cancel() does not short-circuit on\n// it (only on 'cancelled'), so a buyer stuck there must still be able to get\n// out rather than being left with no control but \"contact support\".\nconst CAN_CANCEL = new Set(['active', 'trialing', 'paused', 'past_due', 'unpaid']);\n\nexport function SubscriptionsPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale } = useCopy(props.localization);\n const { emailVerified } = useAuth();\n const resource = useSubscriptions();\n const { submitting, error, run } = useAction();\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const listBase = rowsVariant ? 'throttle-rows' : 'throttle-stack';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // A destructive action keeps its danger colour even when the rows variant\n // strips the border. Collapsing both to plain 'link' made Delete pixel-\n // identical to Edit — two blue links, one of them irreversible.\n const actionVariant = (base: 'secondary' | 'danger') =>\n rowsVariant ? (base === 'danger' ? 'linkDanger' : 'link') : base;\n\n const confirmThen = (fn: () => Promise<void>) => () => {\n if (!window.confirm(t.subscriptions.cancelConfirm)) return;\n void run(fn);\n };\n\n const priceLabel = (sub: { amount: number; currency: string; interval: string; quantity: number }) =>\n `${formatMoney(sub.amount, sub.currency, locale)} / ${sub.interval}${sub.quantity > 1 ? ` × ${sub.quantity}` : ''}`;\n\n const renewsLabel = (sub: { status: string; cancelledAt: string | null; currentPeriodEnd: string }) =>\n formatDate(sub.status === 'cancelled' ? (sub.cancelledAt ?? sub.currentPeriodEnd) : sub.currentPeriodEnd, locale);\n\n const lifecycleActions = (\n sub: { id: string; status: string; cancelAtPeriodEnd: boolean },\n variantFor: (base: 'secondary' | 'danger') => 'secondary' | 'danger' | 'link' | 'linkDanger',\n ) => (\n <div className=\"throttle-actions\">\n {CAN_PAUSE.has(sub.status) ? (\n <Button variant={variantFor('secondary')} loading={submitting}\n elementKey=\"subscriptionsPanel.pauseButton\"\n onClick={() => void run(() => resource.pause(sub.id))}>\n {t.subscriptions.pauseButton}\n </Button>\n ) : null}\n {CAN_RESUME.has(sub.status) ? (\n <Button variant={variantFor('secondary')} loading={submitting}\n elementKey=\"subscriptionsPanel.resumeButton\"\n onClick={() => void run(() => resource.resume(sub.id))}>\n {t.subscriptions.resumeButton}\n </Button>\n ) : null}\n {CAN_CANCEL.has(sub.status) && !sub.cancelAtPeriodEnd ? (\n <Button variant={variantFor('secondary')} elementKey=\"subscriptionsPanel.cancelButton\" disabled={submitting}\n onClick={confirmThen(() => resource.cancel(sub.id, { atPeriodEnd: true }))}>\n {t.subscriptions.cancelAtPeriodEnd}\n </Button>\n ) : null}\n {CAN_CANCEL.has(sub.status) ? (\n <Button variant={variantFor('danger')} elementKey=\"subscriptionsPanel.cancelNowButton\" disabled={submitting}\n onClick={confirmThen(() => resource.cancel(sub.id, { atPeriodEnd: false }))}>\n {t.subscriptions.cancelNow}\n </Button>\n ) : null}\n </div>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('subscriptionsPanel.root', 'throttle-panel')}>\n {error ? <Alert tone=\"error\">{error}</Alert> : null}\n <PanelState\n resource={resource}\n gated={!emailVerified}\n gatedDescription={t.subscriptions.gatedDescription}\n isEmpty={(rows) => rows.length === 0}\n emptyTitle={t.subscriptions.empty}\n emptyDescription={t.subscriptions.emptyDescription}\n >\n {(rows) => (variant === 'table' ? (\n <DataTable\n tableKey=\"subscriptionsPanel.table\"\n rowElementKey=\"subscriptionsPanel.row\"\n rowKey={(sub) => sub.id}\n rows={rows}\n columns={[\n { key: 'plan', label: t.subscriptions.columnPlan, render: (sub) => sub.planName ?? sub.planReference },\n { key: 'price', label: t.subscriptions.columnPrice, render: (sub) => (\n <span className=\"throttle-table__money\">{priceLabel(sub)}</span>\n ) },\n { key: 'renews', label: t.subscriptions.columnRenews, render: (sub) => renewsLabel(sub) },\n { key: 'status', label: t.subscriptions.columnStatus, render: (sub) => (\n <div className=\"throttle-row\">\n <StatusBadge status={sub.status} labels={t.subscriptions.statusLabels} />\n {sub.cancelAtPeriodEnd ? <Badge tone=\"warning\">{t.subscriptions.cancelScheduled}</Badge> : null}\n </div>\n ) },\n { key: 'actions', label: t.common.actions, render: (sub) => lifecycleActions(sub, (base) => base) },\n ]}\n />\n ) : (\n <div {...a.el('subscriptionsPanel.list', listBase)}>\n {rows.map((sub) => (\n <div key={sub.id} {...a.el('subscriptionsPanel.item', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{sub.planName ?? sub.planReference}</strong>\n <StatusBadge status={sub.status} labels={t.subscriptions.statusLabels} />\n </div>\n <p className=\"throttle-muted\">\n {formatMoney(sub.amount, sub.currency, locale)} / {sub.interval}\n {sub.quantity > 1 ? ` × ${sub.quantity}` : ''}\n </p>\n {sub.status === 'cancelled' ? (\n <p className=\"throttle-muted\">\n {t.subscriptions.cancelledOn} {formatDate(sub.cancelledAt ?? sub.currentPeriodEnd, locale)}\n </p>\n ) : (\n <p className=\"throttle-muted\">\n {sub.cancelAtPeriodEnd ? t.subscriptions.endsOn : t.subscriptions.renewsOn}{' '}\n {formatDate(sub.currentPeriodEnd, locale)}\n </p>\n )}\n {sub.trialEnd ? (\n <p className=\"throttle-muted\">{t.subscriptions.trialEnds} {formatDate(sub.trialEnd, locale)}</p>\n ) : null}\n {sub.cancelAtPeriodEnd ? (\n <Badge tone=\"warning\">{t.subscriptions.cancelScheduled}</Badge>\n ) : null}\n </div>\n {lifecycleActions(sub, actionVariant)}\n </div>\n ))}\n </div>\n ))}\n </PanelState>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\nimport { useAuth } from '../../context';\nimport type { DeviceSession } from '../../../client';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { formatDate } from '../format';\nimport { describeDevice } from './device';\nimport { Alert, Badge, Button, DataTable, Field, Skeleton } from '../primitives';\nimport type { AccountPanelVariant } from './AddressesPanel';\n\nexport function SecurityPanel(props: {\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n variant?: AccountPanelVariant;\n}) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t, locale, errorMessage } = useCopy(props.localization);\n const { auth } = useAuth();\n const variant = props.variant ?? 'rows';\n const rowsVariant = variant === 'rows';\n const itemBase = rowsVariant ? 'throttle-rowitem' : 'throttle-listitem';\n // Revoking a session is destructive, so it keeps the danger colour even\n // when the rows variant strips the border — matching every other panel.\n // Plain 'link' made it pixel-identical to a neutral action, which is the\n // bug AddressesPanel's comment describes.\n const revokeVariant = rowsVariant ? 'linkDanger' : 'danger';\n\n const [password, setPassword] = useState('');\n const passwordAction = useAction();\n const sessionAction = useAction();\n\n const [sessions, setSessions] = useState<DeviceSession[] | null>(null);\n const [listError, setListError] = useState<string | null>(null);\n\n // `errorMessage` is held in a ref rather than listed as a dependency. It comes\n // from useCopy(props.localization), which re-memoises whenever the merchant\n // passes a fresh object literal — `<AccountDashboard localization={{ … }} />`\n // is the normal way to write it — so depending on it re-created `load` on\n // every parent render and re-fired GET /me/sessions each time. The callback\n // only needs the latest formatter, never a reason to be rebuilt.\n const errorMessageRef = useRef(errorMessage);\n useEffect(() => { errorMessageRef.current = errorMessage; });\n\n const load = useCallback(async () => {\n try {\n setSessions(await auth.listSessions());\n setListError(null);\n } catch (err) {\n setListError(errorMessageRef.current(err));\n }\n }, [auth]);\n\n useEffect(() => { void load(); }, [load]);\n\n const others = (sessions ?? []).filter((s) => !s.current);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('securityPanel.root', 'throttle-panel')}>\n <form\n {...a.el('securityPanel.passwordForm', 'throttle-stack')}\n onSubmit={(e) => {\n e.preventDefault();\n void passwordAction.run(async () => {\n // May raise step_up_required; the core opens the provider's dialog\n // and retries. Nothing to do here but await the result.\n await auth.changePassword(password);\n setPassword('');\n return t.security.changedNotice;\n });\n }}\n >\n <h3>{t.security.passwordTitle}</h3>\n <Field label={t.security.newPassword} type=\"password\" autoComplete=\"new-password\" required\n value={password} onChange={setPassword} />\n {passwordAction.error ? <Alert tone=\"error\">{passwordAction.error}</Alert> : null}\n {passwordAction.notice ? <Alert tone=\"success\">{passwordAction.notice}</Alert> : null}\n <Button type=\"submit\" loading={passwordAction.submitting} elementKey=\"securityPanel.passwordButton\">\n {t.security.changeButton}\n </Button>\n </form>\n\n <div {...a.el('securityPanel.sessionList', 'throttle-stack')}>\n <h3>{t.security.sessionsTitle}</h3>\n {listError ? (\n <>\n <Alert tone=\"error\">{listError}</Alert>\n <Button variant=\"secondary\" onClick={() => void load()}>{t.common.retry}</Button>\n </>\n ) : null}\n {sessionAction.error ? <Alert tone=\"error\">{sessionAction.error}</Alert> : null}\n {sessions === null && !listError ? <Skeleton count={2} /> : null}\n\n {sessions !== null && !listError && variant === 'table' ? (\n <DataTable\n tableKey=\"securityPanel.table\"\n rowElementKey=\"securityPanel.row\"\n rowKey={(session) => session.id}\n rows={sessions}\n columns={[\n { key: 'device', label: t.security.columnDevice, render: (session) => (\n <div className=\"throttle-row\">\n <span>{describeDevice(session.userAgent) || session.ipPrefix || session.id}</span>\n {session.current ? <Badge tone=\"success\">{t.security.thisDevice}</Badge> : null}\n </div>\n ) },\n { key: 'lastActive', label: t.security.lastActive, render: (session) => formatDate(session.lastUsedAt, locale) },\n { key: 'actions', label: t.common.actions, render: (session) => (\n !session.current ? (\n <Button\n variant=\"danger\"\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeButton\"\n onClick={() => void sessionAction.run(async () => {\n await auth.revokeSession(session.id);\n await load();\n })}\n >\n {t.security.revokeButton}\n </Button>\n ) : null\n ) },\n ]}\n />\n ) : (\n (sessions ?? []).map((session) => (\n <div key={session.id} {...a.el('securityPanel.sessionItem', itemBase)}>\n <div>\n <div className=\"throttle-row\">\n <strong>{describeDevice(session.userAgent) || session.ipPrefix || session.id}</strong>\n {session.current ? <Badge tone=\"success\">{t.security.thisDevice}</Badge> : null}\n </div>\n <p className=\"throttle-muted\">\n {t.security.lastActive} {formatDate(session.lastUsedAt, locale)}\n </p>\n </div>\n {/* No revoke on the current session: that is just signing out, and\n a button that logs you out while labelled \"sign out of this\n device\" in a device list is a trap. */}\n {!session.current ? (\n <Button\n variant={revokeVariant}\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeButton\"\n onClick={() => void sessionAction.run(async () => {\n await auth.revokeSession(session.id);\n await load();\n })}\n >\n {t.security.revokeButton}\n </Button>\n ) : null}\n </div>\n ))\n )}\n\n {sessions !== null && others.length === 0 ? (\n <p className=\"throttle-muted\">{t.security.sessionsEmpty}</p>\n ) : null}\n\n {others.length > 0 ? (\n <Button\n variant=\"danger\"\n loading={sessionAction.submitting}\n elementKey=\"securityPanel.revokeAllButton\"\n onClick={() => void sessionAction.run(async () => {\n // Revoke the other sessions individually rather than calling\n // signOutEverywhere(). That posts /auth/logout-all, which\n // revokes EVERY session including this one and then clears\n // local state — so a button labelled \"all other devices\"\n // signed the buyer out of the device they were reading it on\n // and blanked the dashboard with no explanation. Exactly the\n // trap the per-row comment above rejects.\n //\n // `others` is already the list this button is gated on, and\n // the per-row control uses this same endpoint. A session\n // created between the load and the click is missed; that is\n // worth far less than not logging the buyer out by surprise,\n // and the reload below immediately shows any that remain.\n for (const session of others) {\n await auth.revokeSession(session.id);\n }\n await load();\n })}\n >\n {t.security.revokeAllButton}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","/**\n * Turns a session's user agent into something a shopper can recognise.\n *\n * The device list exists so a buyer can spot a session that is not theirs and\n * revoke it. A raw 120-character UA string does not support that decision, so\n * this reduces it to browser + platform. Order matters in both tables: Edge and\n * Opera both carry \"Chrome\", and Chrome carries \"Safari\", so the more specific\n * pattern has to be tested first or every Edge session reads as Chrome.\n */\nconst BROWSERS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\bEdg(?:e|A|iOS)?\\//, 'Edge'],\n [/\\bOPR\\/|\\bOpera\\b/, 'Opera'],\n // No leading \\b: real agents ship prefixed builds (HeadlessChrome), and a\n // word boundary there sends them to the Safari rule instead.\n [/Chrome\\/|CriOS\\//, 'Chrome'],\n [/\\bFirefox\\/|\\bFxiOS\\//, 'Firefox'],\n [/\\bSafari\\//, 'Safari'],\n];\n\nconst PLATFORMS: ReadonlyArray<readonly [RegExp, string]> = [\n [/\\biPhone\\b|\\biPad\\b|\\biPod\\b/, 'iOS'],\n [/\\bAndroid\\b/, 'Android'],\n [/\\bMac OS X\\b|\\bMacintosh\\b/, 'macOS'],\n [/\\bWindows\\b/, 'Windows'],\n [/\\bLinux\\b|\\bX11\\b/, 'Linux'],\n];\n\nfunction first(ua: string, table: ReadonlyArray<readonly [RegExp, string]>) {\n for (const [pattern, label] of table) if (pattern.test(ua)) return label;\n return null;\n}\n\nexport function describeDevice(userAgent: string | null | undefined): string {\n const ua = (userAgent ?? '').trim();\n if (!ua) return '';\n const browser = first(ua, BROWSERS);\n // Nothing recognisable — an API client or a bot. Its own name is the most\n // useful thing we can show, so hand the string back untouched.\n if (!browser) return ua;\n const platform = first(ua, PLATFORMS);\n return platform ? `${browser} on ${platform}` : browser;\n}\n","import { cloneElement, isValidElement, useContext, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Button } from '../primitives';\nimport { ThrottleUIContext } from '../provider';\nimport { AuthModal } from './AuthModal';\nimport type { AuthView } from './AuthFlow';\n\nexport interface SignInButtonProps {\n mode?: 'modal' | 'redirect';\n /** Required when mode is \"redirect\". */\n url?: string;\n initialView?: AuthView;\n asChild?: boolean;\n children?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignIn?(): void;\n}\n\nexport function SignInButton(props: SignInButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n // Mounted under a <ThrottleProvider>, this drives ITS single shared modal\n // instead of opening a second one of our own — see the provider's\n // ThrottleUIContext doc. Falls back to fully local state when there is no\n // provider above (a plain <ThrottleAuthProvider>), so this component keeps\n // working on its own.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n // The shared modal only knows how to open on the plain sign-in/sign-up\n // split; an explicit `initialView` (e.g. straight to forgot-password) is a\n // per-button customization the shared instance cannot represent, so that\n // one case keeps its own local modal even under a provider.\n const useShared = ui !== null && props.initialView === undefined;\n const label = props.children ?? t.signIn.submitButton;\n\n if (props.mode === 'redirect') {\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <a {...a.el('signInButton.root', 'throttle-button throttle-button--primary')} href={props.url ?? '#'}>\n {label}\n </a>\n </span>\n </AppearanceProvider>\n );\n }\n\n const openModal = () => {\n if (useShared) ui!.openSignIn(props.afterSignIn);\n else setLocalOpen(true);\n };\n const closeModal = () => {\n if (useShared) ui!.close();\n else setLocalOpen(false);\n };\n\n const trigger =\n props.asChild && isValidElement(props.children)\n ? cloneElement(props.children as ReactElement<any>, { onClick: openModal })\n : (\n <Button elementKey=\"signInButton.root\" onClick={openModal}>{label}</Button>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n {trigger}\n </span>\n {!useShared ? (\n <AuthModal\n open={localOpen}\n onClose={closeModal}\n initialView={props.initialView}\n appearance={props.appearance}\n localization={props.localization}\n afterSignIn={() => { closeModal(); props.afterSignIn?.(); }}\n />\n ) : null}\n </AppearanceProvider>\n );\n}\n","import { cloneElement, isValidElement, useContext, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { Button } from '../primitives';\nimport { ThrottleUIContext } from '../provider';\nimport { AuthModal } from './AuthModal';\nimport type { AuthView } from './AuthFlow';\n\n/** The twin of `SignInButton`, opening the same flow on the sign-up view. */\nexport interface SignUpButtonProps {\n mode?: 'modal' | 'redirect';\n /** Required when mode is \"redirect\". */\n url?: string;\n initialView?: AuthView;\n asChild?: boolean;\n children?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignUp?(): void;\n}\n\nexport function SignUpButton(props: SignUpButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n // See SignInButton: drives the provider's single shared modal when one is\n // above it, falling back to a fully local modal otherwise.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const useShared = ui !== null && props.initialView === undefined;\n const label = props.children ?? t.signUp.submitButton;\n\n if (props.mode === 'redirect') {\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <a {...a.el('signUpButton.root', 'throttle-button throttle-button--primary')} href={props.url ?? '#'}>\n {label}\n </a>\n </span>\n </AppearanceProvider>\n );\n }\n\n const openModal = () => {\n if (useShared) ui!.openSignUp(props.afterSignUp);\n else setLocalOpen(true);\n };\n const closeModal = () => {\n if (useShared) ui!.close();\n else setLocalOpen(false);\n };\n\n const trigger =\n props.asChild && isValidElement(props.children)\n ? cloneElement(props.children as ReactElement<any>, { onClick: openModal })\n : (\n <Button elementKey=\"signUpButton.root\" onClick={openModal}>{label}</Button>\n );\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n {trigger}\n </span>\n {!useShared ? (\n <AuthModal\n open={localOpen}\n onClose={closeModal}\n initialView={props.initialView ?? 'signUp'}\n appearance={props.appearance}\n localization={props.localization}\n afterSignUp={() => { closeModal(); props.afterSignUp?.(); }}\n />\n ) : null}\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAuth } from '../../context';\nimport { useAppearance } from '../appearance';\nimport { useCopy, type ThrottleLocalization } from '../localization';\nimport { useAction } from '../useAction';\nimport { Button } from '../primitives';\n\nexport interface SignOutButtonProps {\n /** Revokes every session, not just this device. May raise a step-up prompt. */\n everywhere?: boolean;\n children?: ReactNode;\n localization?: ThrottleLocalization;\n onSignedOut?(): void;\n}\n\n// Mountable on its own (not necessarily nested under another root-bearing\n// component), so it declares `.throttle-root` itself — otherwise every\n// `var(--throttle-*)` the shipped Button styles reference resolves to\n// nothing and the button renders unstyled.\nexport function SignOutButton(props: SignOutButtonProps) {\n const a = useAppearance();\n const { auth } = useAuth();\n const { t } = useCopy(props.localization);\n const { submitting, run } = useAction();\n const label = props.children ?? (props.everywhere ? t.userButton.signOutAll : t.userButton.signOut);\n\n return (\n <span {...a.rootProps}>\n <Button\n variant=\"secondary\"\n loading={submitting}\n elementKey=\"signOutButton.root\"\n onClick={() => void run(async () => {\n // signOutEverywhere can return step_up_required; the core opens the\n // provider's dialog and retries, so nothing extra is needed here.\n if (props.everywhere) await auth.signOutEverywhere();\n else await auth.signOut();\n props.onSignedOut?.();\n })}\n >\n {label}\n </Button>\n </span>\n );\n}\n","import type { ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignIn } from './SignIn';\n\nexport interface SignInPageProps {\n /** Rendered above the card. Absent by default. */\n logo?: ReactNode;\n /** Rendered below the card. Absent by default. */\n footer?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n onSuccess?(): void;\n onForgotPassword?(): void;\n onSignUp?(): void;\n}\n\n/**\n * A full-viewport, centred shell around `<SignIn/>` for merchants who drop it\n * directly on a route (e.g. `/sign-in`) and would otherwise get a card stuck\n * at the top of a bare page. `100dvh`, not `100vh` — see styles.ts.\n */\nexport function SignInPage(props: SignInPageProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('signInPage.root', 'throttle-page')}>\n {props.logo ? (\n <div {...a.el('signInPage.logo', 'throttle-page__logo')}>{props.logo}</div>\n ) : null}\n <SignIn\n onSuccess={props.onSuccess}\n onForgotPassword={props.onForgotPassword}\n onSignUp={props.onSignUp}\n appearance={props.appearance}\n localization={props.localization}\n />\n {props.footer ? (\n <div {...a.el('signInPage.footer', 'throttle-page__footer')}>{props.footer}</div>\n ) : null}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from '../appearance';\nimport type { ThrottleLocalization } from '../localization';\nimport { SignUp } from './SignUp';\n\nexport interface SignUpPageProps {\n /** Rendered above the card. Absent by default. */\n logo?: ReactNode;\n /** Rendered below the card. Absent by default. */\n footer?: ReactNode;\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n onSuccess?(): void;\n onSignIn?(): void;\n}\n\n/** The `<SignUp/>` twin of `SignInPage`. */\nexport function SignUpPage(props: SignUpPageProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n\n return (\n <AppearanceProvider value={scoped}>\n <div {...a.rootProps}>\n <div {...a.el('signUpPage.root', 'throttle-page')}>\n {props.logo ? (\n <div {...a.el('signUpPage.logo', 'throttle-page__logo')}>{props.logo}</div>\n ) : null}\n <SignUp\n onSuccess={props.onSuccess}\n onSignIn={props.onSignIn}\n appearance={props.appearance}\n localization={props.localization}\n />\n {props.footer ? (\n <div {...a.el('signUpPage.footer', 'throttle-page__footer')}>{props.footer}</div>\n ) : null}\n </div>\n </div>\n </AppearanceProvider>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useAuth } from '../context';\n\n/**\n * All three render nothing while `status === 'loading'`. A guard that treated\n * loading as signed-out would flash a \"Sign in\" button at a buyer whose\n * session is a few milliseconds from being restored.\n */\nexport function SignedIn(props: { children: ReactNode }) {\n const { status } = useAuth();\n return status === 'authenticated' ? <>{props.children}</> : null;\n}\n\nexport function SignedOut(props: { children: ReactNode }) {\n const { status } = useAuth();\n return status === 'unauthenticated' ? <>{props.children}</> : null;\n}\n\nexport function Protect(props: { requireVerified?: boolean; fallback?: ReactNode; children: ReactNode }) {\n const { status, emailVerified } = useAuth();\n if (status === 'loading') return null;\n if (status !== 'authenticated') return <>{props.fallback ?? null}</>;\n if (props.requireVerified && !emailVerified) return <>{props.fallback ?? null}</>;\n return <>{props.children}</>;\n}\n","import { useContext, useId, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useAuth } from '../context';\nimport { AppearanceProvider, useAppearance, useAppearanceProviderValue, type ThrottleAppearance } from './appearance';\nimport { useCopy, type ThrottleLocalization } from './localization';\nimport { Avatar, Badge, Dropdown, DropdownItem, DropdownSeparator, Modal } from './primitives';\nimport { AccountDashboard, type AccountTab } from './account/AccountDashboard';\nimport { ThrottleUIContext } from './provider';\n\nexport interface UserButtonProps {\n /** \"modal\" opens the dashboard in an overlay; \"navigate\" links to accountUrl. */\n mode?: 'modal' | 'navigate';\n accountUrl?: string;\n /** Forwarded to the dashboard in modal mode. */\n tabs?: AccountTab[];\n appearance?: ThrottleAppearance;\n localization?: ThrottleLocalization;\n afterSignOut?(): void;\n children?: ReactNode;\n}\n\nfunction UserButtonRoot(props: UserButtonProps) {\n const a = useAppearance(props.appearance);\n const scoped = useAppearanceProviderValue(props.appearance);\n const { t } = useCopy(props.localization);\n const { auth, status, customer, emailVerified } = useAuth();\n // Delegate to the provider's single overlay when there is one. Two account\n // modals mounting at once is not cosmetic: each Modal captures the body's\n // overflow on open, so the second captures 'hidden' and restores 'hidden' on\n // close — leaving the merchant's page permanently unscrollable.\n const ui = useContext(ThrottleUIContext);\n const [localOpen, setLocalOpen] = useState(false);\n const accountOpen = ui ? false : localOpen;\n const titleId = useId();\n // \"Manage account\" both opens this modal AND is inside the Dropdown menu,\n // whose own onClick closes the dropdown on any click within it — both\n // state updates land in the same React commit, so the menuitem is removed\n // from the DOM in the same commit that mounts the Modal, and the browser\n // resets document.activeElement to <body> the instant a focused element is\n // removed (before Modal's own effect could ever capture it). Look up the\n // Dropdown's own trigger button instead, which stays mounted throughout —\n // see Modal's `restoreFocusTo` doc.\n const rootRef = useRef<HTMLSpanElement>(null);\n const openerRef = useRef<Element | null>(null);\n const openAccount = () => {\n const opener = rootRef.current?.querySelector('button[aria-haspopup=\"menu\"]') ?? null;\n openerRef.current = opener;\n if (ui) ui.openAccount({ tabs: props.tabs, restoreFocusTo: opener });\n else setLocalOpen(true);\n };\n\n // Nothing to show without a buyer — and nothing while loading either, so a\n // navbar never flickers between states during session restore.\n if (status !== 'authenticated' || !customer) return null;\n\n const name = [customer.firstName, customer.lastName].filter(Boolean).join(' ');\n\n return (\n <AppearanceProvider value={scoped}>\n <span {...a.rootProps}>\n <span ref={rootRef} {...a.el('userButton.root')}>\n <Dropdown\n label={t.userButton.openMenu}\n triggerKey=\"userButton.trigger\"\n menuKey=\"userButton.menu\"\n trigger={<Avatar name={name} email={customer.email} />}\n >\n <div {...a.el('userButton.identity', 'throttle-dropdown__item')}>\n <span>\n <span {...a.el('userButton.email')}>{customer.email}</span>\n <br />\n <Badge tone={emailVerified ? 'success' : 'warning'} elementKey=\"userButton.badge\">\n {emailVerified ? t.userButton.verified : t.userButton.unverified}\n </Badge>\n </span>\n </div>\n <DropdownSeparator />\n\n {props.mode === 'navigate' ? (\n <DropdownItem itemKey=\"userButton.manageButton\" href={props.accountUrl ?? '#'}>\n {t.userButton.manage}\n </DropdownItem>\n ) : (\n <DropdownItem itemKey=\"userButton.manageButton\" onClick={openAccount}>\n {t.userButton.manage}\n </DropdownItem>\n )}\n\n {props.children}\n <DropdownSeparator />\n\n <DropdownItem\n itemKey=\"userButton.signOutButton\"\n onClick={() => void auth.signOut().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOut}\n </DropdownItem>\n <DropdownItem\n itemKey=\"userButton.signOutAllButton\"\n // May raise step_up_required; the core opens the provider's dialog\n // and retries, so no handling is needed here.\n onClick={() => void auth.signOutEverywhere().then(() => props.afterSignOut?.())}\n >\n {t.userButton.signOutAll}\n </DropdownItem>\n </Dropdown>\n\n {props.mode !== 'navigate' && !ui ? (\n <Modal\n open={accountOpen}\n onClose={() => setLocalOpen(false)}\n labelledBy={titleId}\n restoreFocusTo={openerRef.current}\n >\n <h2 id={titleId} style={{ padding: '16px 16px 0', margin: 0 }}>{t.account.title}</h2>\n <div style={{ padding: 16 }}>\n <AccountDashboard\n tabs={props.tabs}\n appearance={props.appearance}\n localization={props.localization}\n />\n </div>\n </Modal>\n ) : null}\n </span>\n </span>\n </AppearanceProvider>\n );\n}\n\n/** `<UserButton.Link href label icon?/>` — a merchant link inside the menu. */\nfunction UserButtonLink(props: { href: string; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" href={props.href}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\n/** `<UserButton.Action onClick label icon?/>` — a merchant action inside the menu. */\nfunction UserButtonAction(props: { onClick(): void; label: string; icon?: ReactNode }) {\n return (\n <DropdownItem itemKey=\"userButton.item\" onClick={props.onClick}>\n {props.icon}{props.label}\n </DropdownItem>\n );\n}\n\nexport const UserButton = Object.assign(UserButtonRoot, {\n Link: UserButtonLink,\n Action: UserButtonAction,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAAA,gBAAe,eAAAC,cAAa,cAAAC,aAAY,WAAAC,UAAS,UAAAC,SAAQ,YAAAC,kBAAgB;;;ACAlF,SAAS,eAAe,YAAY,eAAe;;;ACa5C,IAAM,iBAAiB,EAA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AK,KAAK,kBAAkB,EAAE,KAAK,MAAM,MAAM,eAAe,CAAC;AAAA,cAE7E,YAAE,WAAW;AAAA;AAAA,UAChB;AAAA;AAAA;AAAA,IACF;AAAA,IAEC,MAAM,SAAS,cAAc,CAAC,KAC7B,gBAAAC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,SAAS,MAAM,aAAa,KAAK;AAAA,QACjC,YAAY;AAAA,QACZ,gBAAgB,UAAU;AAAA,QAE1B;AAAA,0BAAAD,MAAC,QAAG,IAAI,SAAS,OAAO,EAAE,SAAS,eAAe,QAAQ,EAAE,GAAI,YAAE,QAAQ,OAAM;AAAA,UAChF,gBAAAA,MAAC,SAAI,OAAO,EAAE,SAAS,GAAG,GACxB,0BAAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM,MAAM;AAAA,cACZ,YAAY,MAAM;AAAA,cAClB,cAAc,MAAM;AAAA;AAAA,UACtB,GACF;AAAA;AAAA;AAAA,IACF,IACE;AAAA,KACN,GACF,GACF;AAEJ;AAGA,SAAS,eAAe,OAA0D;AAChF,SACE,gBAAAC,OAAC,gBAAa,SAAQ,mBAAkB,MAAM,MAAM,MACjD;AAAA,UAAM;AAAA,IAAM,MAAM;AAAA,KACrB;AAEJ;AAGA,SAAS,iBAAiB,OAA6D;AACrF,SACE,gBAAAA,OAAC,gBAAa,SAAQ,mBAAkB,SAAS,MAAM,SACpD;AAAA,UAAM;AAAA,IAAM,MAAM;AAAA,KACrB;AAEJ;AAEO,IAAM,aAAa,OAAO,OAAO,gBAAgB;AAAA,EACtD,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;","names":["createContext","useCallback","useContext","useMemo","useRef","useState","createContext","useContext","jsx","Ctx","createContext","useContext","useMemo","jsx","Ctx","createContext","useContext","useMemo","useEffect","useId","useState","createContext","useContext","jsx","Ctx","jsx","jsx","jsx","jsx","jsxs","jsx","jsxs","jsx","jsx","jsx","jsxs","first","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsx","jsx","jsxs","useState","useId","useEffect","useId","useEffect","useState","useState","useRef","useState","useState","useRef","Fragment","jsx","jsxs","useState","useState","Fragment","jsx","jsxs","useState","useState","jsx","jsxs","useState","useState","jsx","jsxs","useState","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsxs","useState","useEffect","jsx","jsxs","useId","useId","useEffect","useId","useState","useState","jsx","jsxs","useState","jsx","jsxs","useEffect","useState","useRef","Fragment","jsx","jsxs","jsx","jsxs","useState","useRef","useEffect","useState","useState","jsx","jsxs","useState","Fragment","jsx","jsxs","useState","useState","useEffect","useId","useRef","useState","jsx","jsxs","useId","useState","useRef","useEffect","jsx","jsxs","useState","useState","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","useState","useState","Fragment","jsx","jsxs","Line","jsx","jsxs","useState","jsx","jsxs","useCallback","useEffect","useRef","useState","Fragment","jsx","jsxs","useState","useRef","useEffect","useCallback","Fragment","jsx","jsxs","HASH_FOR","useState","useId","useEffect","jsx","jsxs","useId","jsx","jsxs","createContext","useContext","useState","useRef","useCallback","useMemo","useContext","useState","jsx","jsxs","useContext","useState","cloneElement","isValidElement","useContext","useState","jsx","jsxs","useContext","useState","isValidElement","cloneElement","jsx","jsx","jsxs","jsx","jsxs","Fragment","jsx","useContext","useId","useRef","useState","jsx","jsxs","useContext","useState","useId","useRef"]}
|