@usethrottle/auth 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/AccountDashboard-V63ghvjY.d.ts +90 -0
- package/dist/AccountModal-KA54WUFW.js +13 -0
- package/dist/AccountModal-KA54WUFW.js.map +1 -0
- package/dist/AccountModal-pIMgledL.d.ts +141 -0
- package/dist/AuthModal-T2GYI6ZF.js +13 -0
- package/dist/AuthModal-T2GYI6ZF.js.map +1 -0
- package/dist/SignUpPage-BJcMUb2V.d.ts +160 -0
- package/dist/chunk-3B4DNX5T.js +2 -0
- package/dist/chunk-3B4DNX5T.js.map +1 -0
- package/dist/chunk-5EUZYJJL.js +29 -0
- package/dist/chunk-5EUZYJJL.js.map +1 -0
- package/dist/chunk-6WN3J5MM.js +2075 -0
- package/dist/chunk-6WN3J5MM.js.map +1 -0
- package/dist/chunk-CUNMJ2PH.js +1320 -0
- package/dist/chunk-CUNMJ2PH.js.map +1 -0
- package/dist/chunk-ETYOOYYV.js +2 -0
- package/dist/chunk-ETYOOYYV.js.map +1 -0
- package/dist/chunk-JSDZMPCV.js +520 -0
- package/dist/chunk-JSDZMPCV.js.map +1 -0
- package/dist/chunk-QPVS6JXP.js +39 -0
- package/dist/chunk-QPVS6JXP.js.map +1 -0
- package/dist/chunk-RCNUWITB.js +747 -0
- package/dist/chunk-RCNUWITB.js.map +1 -0
- package/dist/{chunk-YY6YATXT.js → chunk-TDQC3LMQ.js} +17 -3
- package/dist/chunk-TDQC3LMQ.js.map +1 -0
- package/dist/{chunk-EFMKBOTL.js → chunk-UFGW76AZ.js} +2 -2
- package/dist/chunk-VDK23T6L.js +230 -0
- package/dist/chunk-VDK23T6L.js.map +1 -0
- package/dist/chunk-X6D35EAX.js +19 -0
- package/dist/chunk-X6D35EAX.js.map +1 -0
- package/dist/client-7LVKfuXO.d.ts +319 -0
- package/dist/hooks-DkpLrEiC.d.ts +148 -0
- package/dist/index.cjs +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/localization-SnIAZXJn.d.ts +389 -0
- package/dist/react/components/account/index.d.ts +37 -0
- package/dist/react/components/account/index.js +44 -0
- package/dist/react/components/account/index.js.map +1 -0
- package/dist/react/components/auth/index.d.ts +17 -0
- package/dist/react/components/auth/index.js +40 -0
- package/dist/react/components/auth/index.js.map +1 -0
- package/dist/react/components/guards.d.ts +21 -0
- package/dist/react/components/guards.js +13 -0
- package/dist/react/components/guards.js.map +1 -0
- package/dist/react/components/index.cjs +3561 -2805
- package/dist/react/components/index.cjs.map +1 -1
- package/dist/react/components/index.d.cts +14 -2
- package/dist/react/components/index.d.ts +14 -821
- package/dist/react/components/index.js +90 -4680
- package/dist/react/components/index.js.map +1 -1
- package/dist/react/components/provider.d.ts +79 -0
- package/dist/react/components/provider.js +18 -0
- package/dist/react/components/provider.js.map +1 -0
- package/dist/react/forms/index.js +1 -1
- package/dist/react/index.cjs +16 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +34 -3
- package/dist/react/index.d.ts +5 -433
- package/dist/react/index.js +3 -2
- package/dist/styles.css +7 -4
- package/package.json +4 -1
- package/dist/chunk-YY6YATXT.js.map +0 -1
- /package/dist/{chunk-EFMKBOTL.js.map → chunk-UFGW76AZ.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/components/appearance.tsx","../src/react/components/contrast.ts","../src/react/components/localization.tsx","../src/react/components/primitives/Modal.tsx","../src/react/components/surface.tsx","../src/react/components/primitives/Confirm.tsx","../src/react/components/primitives/Spinner.tsx","../src/react/components/primitives/Button.tsx","../src/react/components/primitives/Field.tsx","../src/react/components/primitives/Card.tsx","../src/react/components/primitives/FieldRow.tsx","../src/react/components/primitives/Alert.tsx","../src/react/components/primitives/Skeleton.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"],"sourcesContent":["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 // How wide the auth card (sign-in, sign-up, forgot-password) is allowed\n // to grow. It was pinned at 400px, which is narrow for a page that is\n // nothing but that card.\n cardWidth: '--throttle-card-width',\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 'orderDetail.addresses', 'orderDetail.shippingAddress', 'orderDetail.billingAddress',\n 'orderDetail.timeline', 'orderDetail.payButton', 'orderDetail.trackButton',\n 'orderDetail.reorderButton',\n // Two-column detail layout, shared by the order and invoice pages.\n 'orderDetail.layout', 'orderDetail.main', 'orderDetail.rail',\n 'orderDetail.cancelButton', 'orderDetail.returnButton', 'orderDetail.invoiceButton',\n 'orderDetail.subscriptionButton',\n 'orderDetail.actions',\n 'invoiceDetail.layout', 'invoiceDetail.main', 'invoiceDetail.rail',\n 'invoiceDetail.lineItems', 'invoiceDetail.lineItem',\n 'invoiceDetail.orderLink', 'invoiceDetail.subscriptionLink', 'invoiceDetail.payButton',\n 'invoiceDetail.actions',\n 'fieldRow',\n 'confirm.header', 'confirm.title', 'confirm.body',\n 'confirm.confirmButton', 'confirm.cancelButton',\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.changeAddressButton', 'subscriptionsPanel.addressForm',\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, 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 // The dismissive half of a confirmation. \"Cancel\" is ambiguous next to\n // \"Cancel subscription\" — one dismisses the dialog, the other ends the plan.\n keepIt: 'Keep it',\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 deleteConfirmAction: 'Delete address',\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 deleteConfirmAction: 'Remove card',\n columnCard: 'Card',\n },\n orders: {\n shipTo: 'Ship to', billTo: 'Bill to', history: 'History',\n placed: 'Order placed', completed: 'Completed',\n cancelledAt: 'Cancelled', closedAt: 'Closed',\n payNow: 'Pay now', track: 'Track shipment', reorder: 'Order again',\n cancelOrder: 'Cancel order',\n cancelOrderConfirm: 'Cancel this order?',\n cancelOrderBody: 'This cannot be undone. Nothing has been charged, so there is nothing to refund.',\n cancelOrderAction: 'Cancel order',\n requestReturn: 'Request a return',\n requestReturnConfirm: 'Request a return for this order?',\n requestReturnBody: 'The merchant reviews your request and will be in touch. Nothing is refunded until they approve it.',\n requestReturnAction: 'Send request',\n returnRequested: 'Return requested. The merchant will be in touch.',\n downloadInvoice: 'Download invoice',\n summary: 'Summary',\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', viewSubscriptionFor: 'View subscription for',\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 items: 'Items', summary: 'Summary',\n viewOrder: 'View order', viewSubscription: 'View subscription',\n payButton: 'Pay this invoice', billedTo: 'Billed to',\n /** Shown when an invoice bills less than the order, matching the PDF. */\n orderTotal: 'Order total', amountPaid: 'Amount paid', waived: 'Waived',\n amountDue: 'Amount due', balanceDue: 'Balance due',\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 cancelConfirmAction: 'Cancel plan',\n pauseConfirm: 'Pause this subscription?',\n resumeConfirm: 'Resume this subscription?',\n // Distinct from cancelConfirm: ending it now is not the same promise as\n // letting it run to the end of a period the buyer already paid for.\n cancelNowConfirm: 'End this subscription immediately?',\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 installmentProgress: 'Payment {paid} of {total}',\n installmentTotal: '{amount} total',\n installmentNext: 'Next {amount} on {date}',\n /** Spec §5: a varied schedule's dated list; dates are estimates, hence \"~\". */\n upcomingPayments: 'Upcoming payments',\n upcomingPayment: '{amount} · ~{date}',\n cancelButton: 'Cancel', cancelAtPeriodEnd: 'Cancel at period end',\n cancelNow: 'Cancel immediately', pauseButton: 'Pause', resumeButton: 'Resume',\n /** A physical subscription's ship-to, and the control that changes it. */\n shipsTo: 'Ships to', changeAddress: 'Change address',\n changeAddressTitle: 'Change shipping address',\n changeAddressHint: 'Your next box ships here. Orders already placed keep their address.',\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`. `completed` is an installment plan that\n * has taken its last payment.\n */\n statusLabels: {\n active: 'Active', paused: 'Paused', cancelled: 'Cancelled',\n pastDue: 'Payment overdue', trialing: 'Trial', unpaid: 'Unpaid',\n completed: 'Paid in full',\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 { 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 { 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 { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, type ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\nimport { useCopy } from '../localization';\nimport { Button } from './Button';\nimport { Field } from './Field';\nimport { Modal } from './Modal';\n\n/**\n * The one dialog surface for the whole tree.\n *\n * Two things ask the buyer a blocking question: a destructive action wanting\n * \"are you sure?\", and the core wanting a password re-entry (step-up). They\n * used to own a `<Modal>` each. Because step-up is raised by the request the\n * confirmation just authorised, and the account UI itself may already be a\n * modal, the buyer could end up looking at a dialog stacked on a dialog —\n * and step-up additionally drew a full `throttle-card`, border and all,\n * INSIDE the modal shell, so even alone it read as a box in a box.\n *\n * So both render here, in one shell, one backdrop, one focus trap. Step-up\n * wins when both are pending: it is the later question, and the buyer cannot\n * answer the first one until it is resolved.\n *\n * `useConfirm()` returns a function that resolves true or false, so a caller\n * reads as a plain `if (await confirm(...))` rather than a state machine.\n */\nexport interface ConfirmRequest {\n title: string;\n body?: ReactNode;\n /** Defaults to the localized \"Delete\". */\n confirmLabel?: string;\n /** Defaults to the localized \"Keep it\". */\n cancelLabel?: string;\n /** `danger` for anything the buyer cannot undo. */\n tone?: 'danger' | 'neutral';\n}\n\ntype Ask = (request: ConfirmRequest) => Promise<boolean>;\n\nconst ConfirmContext = createContext<Ask | null>(null);\n\nexport function ConfirmProvider({\n children,\n stepUpOpen = false,\n onStepUpResolve,\n}: {\n children: ReactNode;\n /**\n * Raised by the provider when the core reports a step-up challenge. Passed\n * as a prop rather than read from context because the provider that owns\n * the resolver mounts ABOVE this component — it cannot consume a context\n * its own child supplies.\n */\n stepUpOpen?: boolean;\n onStepUpResolve?(password: string | null): void;\n}) {\n const [request, setRequest] = useState<ConfirmRequest | null>(null);\n const [password, setPassword] = useState('');\n const { t } = useCopy();\n const a = useAppearance();\n const titleId = useId();\n // Held in a ref because the promise is created in one call and settled in\n // another; state would be a render behind.\n const settle = useRef<((value: boolean) => void) | null>(null);\n\n // Never let a password linger in state between prompts.\n useEffect(() => { if (!stepUpOpen) setPassword(''); }, [stepUpOpen]);\n\n const answer = useCallback((value: boolean) => {\n settle.current?.(value);\n settle.current = null;\n setRequest(null);\n }, []);\n\n const ask = useCallback<Ask>((next) => {\n // An outstanding question resolves false rather than hanging forever when\n // a second one arrives.\n settle.current?.(false);\n setRequest(next);\n return new Promise<boolean>((resolve) => { settle.current = resolve; });\n }, []);\n\n const showStepUp = stepUpOpen && Boolean(onStepUpResolve);\n const open = showStepUp || request !== null;\n\n const close = () => {\n if (showStepUp) onStepUpResolve!(null);\n else answer(false);\n };\n\n return (\n <ConfirmContext.Provider value={ask}>\n {children}\n {open ? (\n <Modal open onClose={close} labelledBy={titleId} size=\"compact\">\n {showStepUp ? (\n <form onSubmit={(e) => { e.preventDefault(); onStepUpResolve!(password); }}>\n <div {...a.el('confirm.header', 'throttle-modal__header')}>\n <h2 id={titleId} {...a.el('stepUp.title', 'throttle-modal__title')}>{t.stepUp.title}</h2>\n </div>\n <div {...a.el('confirm.body', 'throttle-modal__body')}>\n <p className=\"throttle-muted\">{t.stepUp.description}</p>\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 <div className=\"throttle-actions\">\n <Button type=\"submit\" elementKey=\"stepUp.submitButton\">{t.stepUp.submitButton}</Button>\n <Button\n variant=\"secondary\"\n elementKey=\"stepUp.cancelButton\"\n onClick={() => onStepUpResolve!(null)}\n >\n {t.stepUp.cancelButton}\n </Button>\n </div>\n </div>\n </form>\n ) : (\n <>\n <div {...a.el('confirm.header', 'throttle-modal__header')}>\n <h2 id={titleId} {...a.el('confirm.title', 'throttle-modal__title')}>{request!.title}</h2>\n </div>\n <div {...a.el('confirm.body', 'throttle-modal__body')}>\n {request!.body ? <p className=\"throttle-muted\">{request!.body}</p> : null}\n <div className=\"throttle-actions\">\n <Button\n elementKey=\"confirm.confirmButton\"\n variant={request!.tone === 'danger' ? 'danger' : 'primary'}\n onClick={() => answer(true)}\n >\n {request!.confirmLabel ?? t.common.delete}\n </Button>\n <Button elementKey=\"confirm.cancelButton\" variant=\"secondary\" onClick={() => answer(false)}>\n {request!.cancelLabel ?? t.common.keepIt}\n </Button>\n </div>\n </div>\n </>\n )}\n </Modal>\n ) : null}\n </ConfirmContext.Provider>\n );\n}\n\n/**\n * Falls back to `window.confirm` when no provider is mounted, so a panel\n * rendered standalone still asks rather than acting silently — or crashing.\n */\nexport function useConfirm(): Ask {\n const ask = useContext(ConfirmContext);\n const { t } = useCopy();\n return useMemo<Ask>(\n () => ask ?? (async (request) => window.confirm(request.title || t.common.confirm)),\n [ask, t],\n );\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, 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 type { ReactNode } from 'react';\nimport { useAppearance } from '../appearance';\n\n/**\n * Two fields on one line.\n *\n * Only for fields that genuinely belong together AND are short: a first and\n * last name, a city and its state, a postal code and its country. A street\n * address never goes in one — pairing a long value with a short one just\n * makes the long one too narrow to read what you typed.\n *\n * Collapses to a single column on a narrow container, not a narrow viewport,\n * because the account dashboard can sit in a sidebar on a wide screen.\n */\nexport function FieldRow({ children }: { children: ReactNode }) {\n const a = useAppearance();\n return <div {...a.el('fieldRow', 'throttle-fieldrow')}>{children}</div>;\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 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"],"mappings":";;;;;;AAAA,SAAS,eAAe,YAAY,eAAe;;;ACa5C,IAAM,iBAAiB,EAAE,OAAO,WAAW,MAAM,UAAU;AAG3D,IAAM,6BAA6B,EAAE,OAAO,WAAW,MAAM,UAAU;AAE9E,SAAS,QAAQ,OAAuB;AACtC,QAAM,IAAI,QAAQ;AAClB,SAAO,KAAK,UAAU,IAAI,QAAQ,KAAK,KAAK,IAAI,SAAS,OAAO,GAAG;AACrE;AAIO,SAAS,UAAU,KAA4B;AACpD,QAAM,IAAI,iCAAiC,KAAK,IAAI,KAAK,CAAC;AAC1D,MAAI,CAAC,EAAG,QAAO;AACf,QAAM,IAAI,EAAE,CAAC,EAAE,WAAW,IAAI,EAAE,CAAC,EAAE,QAAQ,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;AACpE,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AACtE,SAAO,SAAS,QAAQ,CAAC,IAAI,SAAS,QAAQ,CAAC,IAAI,SAAS,QAAQ,CAAC;AACvE;AAEO,SAAS,cAAc,GAAW,GAA0B;AACjE,QAAM,KAAK,UAAU,CAAC;AACtB,QAAM,KAAK,UAAU,CAAC;AACtB,MAAI,OAAO,QAAQ,OAAO,KAAM,QAAO;AACvC,UAAQ,KAAK,IAAI,IAAI,EAAE,IAAI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I,cAAc;AACxB,QAAM,OAAO,EAAE,MAAM;AACrB,MAAI,KAAM,QAAO,gBAAAD,MAAC,QAAK,OAAO,MAAM,OAAO,aAAa,MAAM,aAAa;AAC3E,SACE,gBAAAC,MAAC,SAAK,GAAG,EAAE,GAAG,cAAc,gBAAgB,GAC1C;AAAA,oBAAAD,MAAC,OAAG,GAAG,EAAE,GAAG,oBAAoB,uBAAuB,GAAI,gBAAM,OAAM;AAAA,IACtE,MAAM,cACL,gBAAAA,MAAC,OAAG,GAAG,EAAE,GAAG,0BAA0B,6BAA6B,GAAI,gBAAM,aAAY,IACvF;AAAA,KACN;AAEJ;;;ACJmB,gBAAAE,aAAA;AAHZ,SAAS,OAAO,OAAwC;AAC7D,QAAM,IAAI,cAAc;AACxB,QAAM,OAAO,EAAE,MAAM;AACrB,MAAI,KAAM,QAAO,gBAAAA,MAAC,QAAK,MAAM,MAAM,MAAM,OAAO,MAAM,OAAO;AAE7D,QAAM,WACJ,MAAM,KACH,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE,CAAC,CAAC,EAC5B,OAAO,OAAO,EACd,MAAM,GAAG,CAAC,EACV,KAAK,EAAE,KAAK,MAAM,MAAM,KAAK,EAAE,CAAC,KAAK;AAE1C,SAAO,gBAAAA,MAAC,UAAM,GAAG,EAAE,GAAG,UAAU,iBAAiB,GAAG,OAAO,MAAM,OAAQ,mBAAS,YAAY,GAAE;AAClG;;;ACJS,gBAAAC,aAAA;AAdF,SAAS,MAAM,OAUnB;AACD,QAAM,IAAI,cAAc;AACxB,QAAM,OAAO,MAAM,QAAQ;AAC3B,QAAM,OAAO,SAAS,YAAY,mBAAmB,kCAAkC,IAAI;AAC3F,SAAO,gBAAAA,MAAC,UAAM,GAAG,EAAE,GAAG,MAAM,cAAc,SAAS,IAAI,GAAI,gBAAM,UAAS;AAC5E;","names":["createContext","useContext","useMemo","jsx","Ctx","createContext","useContext","useMemo","createContext","useContext","jsx","Ctx","jsx","createContext","useContext","useEffect","useId","useMemo","useRef","useState","jsx","jsx","jsxs","jsx","jsxs","Fragment","jsx","jsxs","createContext","useState","useId","useRef","useEffect","useContext","useMemo","jsx","jsxs","jsxs","jsx","jsx","jsx","jsx","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsx"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|