@alfadocs/ui-kit-debug 1.88.1 → 1.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/_chunks/{header-settings-CifwJEKB.js → header-settings-BVhjndtV.js} +188 -168
  2. package/dist/_chunks/header-settings-BVhjndtV.js.map +1 -0
  3. package/dist/_chunks/{locale-picker-QbT1p60X.js → locale-picker-DVvinQXU.js} +339 -310
  4. package/dist/_chunks/locale-picker-DVvinQXU.js.map +1 -0
  5. package/dist/_chunks/{marketplace-app-shell-vON3WhD0.js → marketplace-app-shell-x_abo_ye.js} +2 -2
  6. package/dist/_chunks/{marketplace-app-shell-vON3WhD0.js.map → marketplace-app-shell-x_abo_ye.js.map} +1 -1
  7. package/dist/_chunks/{patient-search-Dy0sxcwv.js → patient-search-BPjP2__L.js} +15 -13
  8. package/dist/_chunks/patient-search-BPjP2__L.js.map +1 -0
  9. package/dist/agent-catalog.json +4 -4
  10. package/dist/agent-i18n/en.json +3 -3
  11. package/dist/components/header-settings/header-settings.d.ts +14 -0
  12. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  13. package/dist/components/header-settings/index.js +1 -1
  14. package/dist/components/locale-picker/index.js +4 -3
  15. package/dist/components/locale-picker/locale-picker.d.ts +31 -1
  16. package/dist/components/locale-picker/locale-picker.d.ts.map +1 -1
  17. package/dist/components/patient-search/index.js +1 -1
  18. package/dist/components/patient-search/patient-search.d.ts.map +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  21. package/package.json +1 -1
  22. package/dist/_chunks/header-settings-CifwJEKB.js.map +0 -1
  23. package/dist/_chunks/locale-picker-QbT1p60X.js.map +0 -1
  24. package/dist/_chunks/patient-search-Dy0sxcwv.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-picker-DVvinQXU.js","sources":["../../src/components/flag/flag-core.ts","../../src/i18n/locale-meta.ts","../../src/components/locale-picker/locale-picker.agent.ts","../../src/components/locale-picker/locale-picker.tsx"],"sourcesContent":["import { createElement, forwardRef } from 'react';\nimport {\n FlagView,\n flagClasses,\n safeFlagGlob,\n type FlagAssetMap,\n} from './flag-view';\nimport type { FlagProps } from './flag';\n\n/* ------------------------------------------------------------------ */\n/* CoreFlag — the locale-chrome flag binding. */\n/* */\n/* Identical component to `Flag` (same props, same FlagView, same DOM, */\n/* same synchronous paint) bound to a SUBSET of the asset set: only the */\n/* countries the kit's own locale chrome can ever ask for. */\n/* */\n/* Why it exists: LocalePicker ships inside HeaderSettings, which ships */\n/* inside MarketplaceAppShell, which is on every route of every */\n/* consumer — including login screens. Importing `Flag` there pulled */\n/* all 530 inlined SVGs (485,552 B of chunk) onto pages that offer a */\n/* three-item language menu. This binding pulls 36 (29,183 B). */\n/* */\n/* The glob pattern below MUST list every `LOCALE_META[…].countryCode`. */\n/* `flag.test.tsx` asserts that (it fails if a locale is added to */\n/* `src/i18n/locale-meta.ts` without its flag), so the two can't drift. */\n/* */\n/* Both patterns are spelled out as string literals (rather than built */\n/* from a shared constant) because `import.meta.glob` is a build macro: */\n/* Vite reads the pattern off the AST, so it must be a literal — an */\n/* interpolated template silently matches nothing. */\n/* ------------------------------------------------------------------ */\n\nconst CORE_RECTANGLE_URL_MAP: FlagAssetMap = safeFlagGlob(() =>\n import.meta.glob<string>(\n '/node_modules/country-flag-icons/3x2/{AL,CN,DE,ES,FR,GB,GR,IN,IT,JP,NL,PL,PT,RO,RU,SA,SE,TR}.svg',\n { query: '?url', import: 'default', eager: true },\n ),\n);\n\nconst CORE_SQUARE_URL_MAP: FlagAssetMap = safeFlagGlob(() =>\n import.meta.glob<string>(\n '/node_modules/country-flag-icons/1x1/{AL,CN,DE,ES,FR,GB,GR,IN,IT,JP,NL,PL,PT,RO,RU,SA,SE,TR}.svg',\n { query: '?url', import: 'default', eager: true },\n ),\n);\n\n/** Country codes bundled with `CoreFlag`. Subset of `FLAG_COUNTRIES`. */\nexport const CORE_FLAG_COUNTRIES: readonly string[] = Object.freeze(\n Object.keys(CORE_RECTANGLE_URL_MAP).sort(),\n);\n\n/** Does `CoreFlag` bundle an asset for this country code? Case-insensitive. */\nexport function hasCoreFlag(country: string): boolean {\n return country.toUpperCase() in CORE_RECTANGLE_URL_MAP;\n}\n\n/**\n * `Flag` restricted to the kit's own locale set. Internal — not exported\n * from `index.ts` or the root barrel. Renders `FlagView` with no JSX so\n * this file stays a `.ts` module alongside the glob it owns.\n */\nexport const CoreFlag = forwardRef<HTMLElement, FlagProps>(\n (\n {\n country,\n label,\n shape = 'rectangle',\n size = 'sm',\n rounded = 'sm',\n className,\n ...rest\n },\n ref,\n ) => {\n const code = country.toUpperCase();\n const urlMap =\n shape === 'square' ? CORE_SQUARE_URL_MAP : CORE_RECTANGLE_URL_MAP;\n\n return createElement(FlagView, {\n ref,\n code,\n src: urlMap[code],\n label,\n className: flagClasses({ shape, size, rounded }, className),\n ...rest,\n });\n },\n);\n\nCoreFlag.displayName = 'CoreFlag';\n","/* -------------------------------------------------------------------- */\n/* Locale metadata registry. */\n/* */\n/* Single source of truth for human-facing locale information — native */\n/* name, English name, flag emoji, and writing direction. Consumed by */\n/* LocalePicker / HeaderSettings to render the language switcher. */\n/* */\n/* Keys must match `LOCALES_WITH_BUNDLES` from `./supported-locales` */\n/* 1:1; the `locale-meta.test.ts` parity check fails the build if a code */\n/* is added to one and not the other. */\n/* */\n/* Flag emojis use the Regional Indicator pair convention — a few of */\n/* the codes are language tags rather than country tags (en, ar, hi); */\n/* the flag chosen is the \"default-region\" the kit ships marketing */\n/* surfaces in. Consumers that need a different region flag (e.g. */\n/* British vs. American English) can override via `LOCALE_META[code]`. */\n/* -------------------------------------------------------------------- */\n\nimport { LOCALES_WITH_BUNDLES } from './supported-locales';\n\n/** Reading direction. Mirrors the shape of `hooks/use-locale.ts#LocaleDir`. */\nexport type LocaleDir = 'ltr' | 'rtl';\n\n/** IETF locale tag from the kit's bundled set. */\nexport type Locale = (typeof LOCALES_WITH_BUNDLES)[number];\n\nexport interface LocaleMetaEntry {\n /** IETF locale tag (matches the key in `LOCALES_WITH_BUNDLES`). */\n code: Locale;\n /** Endonym — the locale's name in its own language (\"Italiano\", \"العربية\"). */\n nativeName: string;\n /** Exonym — the locale's name in English (\"Italian\", \"Arabic\"). */\n englishName: string;\n /**\n * ISO 3166-1 alpha-2 country code for the default-region flag. Feed\n * to the kit's `<Flag country={…} />` component to render the actual\n * flag SVG (NOT the emoji glyph — those don't paint on Windows and\n * lose fidelity at hero sizes). A few language tags here aren't tied\n * to a single country (en, ar, hi); we pick the AlfaDocs default\n * marketing region — consumers needing a different region flag\n * override at the call site.\n */\n countryCode: string;\n /**\n * Regional-indicator flag emoji. Retained as a fallback for non-DOM\n * contexts (terminal logs, plain-text exports) and the rare consumer\n * surface that can't mount the kit's `Flag` component. UI surfaces\n * should always reach for `countryCode` + `<Flag />` instead.\n */\n flag: string;\n /** Reading direction. */\n dir: LocaleDir;\n}\n\n/**\n * Canonical metadata for every locale shipped in `LOCALES_WITH_BUNDLES`.\n * Order matches the bundled-locales array so iteration is stable.\n */\nexport const LOCALE_META: Record<Locale, LocaleMetaEntry> = {\n en: {\n code: 'en',\n nativeName: 'English',\n englishName: 'English',\n countryCode: 'GB',\n flag: '🇬🇧',\n dir: 'ltr',\n },\n it: {\n code: 'it',\n nativeName: 'Italiano',\n englishName: 'Italian',\n countryCode: 'IT',\n flag: '🇮🇹',\n dir: 'ltr',\n },\n de: {\n code: 'de',\n nativeName: 'Deutsch',\n englishName: 'German',\n countryCode: 'DE',\n flag: '🇩🇪',\n dir: 'ltr',\n },\n ar: {\n code: 'ar',\n nativeName: 'العربية',\n englishName: 'Arabic',\n countryCode: 'SA',\n flag: '🇸🇦',\n dir: 'rtl',\n },\n fr: {\n code: 'fr',\n nativeName: 'Français',\n englishName: 'French',\n countryCode: 'FR',\n flag: '🇫🇷',\n dir: 'ltr',\n },\n es: {\n code: 'es',\n nativeName: 'Español',\n englishName: 'Spanish',\n countryCode: 'ES',\n flag: '🇪🇸',\n dir: 'ltr',\n },\n pt: {\n code: 'pt',\n nativeName: 'Português',\n englishName: 'Portuguese',\n countryCode: 'PT',\n flag: '🇵🇹',\n dir: 'ltr',\n },\n nl: {\n code: 'nl',\n nativeName: 'Nederlands',\n englishName: 'Dutch',\n countryCode: 'NL',\n flag: '🇳🇱',\n dir: 'ltr',\n },\n ro: {\n code: 'ro',\n nativeName: 'Română',\n englishName: 'Romanian',\n countryCode: 'RO',\n flag: '🇷🇴',\n dir: 'ltr',\n },\n sq: {\n code: 'sq',\n nativeName: 'Shqip',\n englishName: 'Albanian',\n countryCode: 'AL',\n flag: '🇦🇱',\n dir: 'ltr',\n },\n tr: {\n code: 'tr',\n nativeName: 'Türkçe',\n englishName: 'Turkish',\n countryCode: 'TR',\n flag: '🇹🇷',\n dir: 'ltr',\n },\n pl: {\n code: 'pl',\n nativeName: 'Polski',\n englishName: 'Polish',\n countryCode: 'PL',\n flag: '🇵🇱',\n dir: 'ltr',\n },\n sv: {\n code: 'sv',\n nativeName: 'Svenska',\n englishName: 'Swedish',\n countryCode: 'SE',\n flag: '🇸🇪',\n dir: 'ltr',\n },\n ru: {\n code: 'ru',\n nativeName: 'Русский',\n englishName: 'Russian',\n countryCode: 'RU',\n flag: '🇷🇺',\n dir: 'ltr',\n },\n el: {\n code: 'el',\n nativeName: 'Ελληνικά',\n englishName: 'Greek',\n countryCode: 'GR',\n flag: '🇬🇷',\n dir: 'ltr',\n },\n ja: {\n code: 'ja',\n nativeName: '日本語',\n englishName: 'Japanese',\n countryCode: 'JP',\n flag: '🇯🇵',\n dir: 'ltr',\n },\n zh: {\n code: 'zh',\n nativeName: '中文',\n englishName: 'Chinese',\n countryCode: 'CN',\n flag: '🇨🇳',\n dir: 'ltr',\n },\n hi: {\n code: 'hi',\n nativeName: 'हिन्दी',\n englishName: 'Hindi',\n countryCode: 'IN',\n flag: '🇮🇳',\n dir: 'ltr',\n },\n};\n\n/**\n * Canonical (i18n-parity) order — used when consumers need the same\n * sequence as `LOCALES_WITH_BUNDLES` (e.g. generating fixtures or\n * snapshot keys). Pickers / menus should use `LOCALE_LIST` instead,\n * which sorts alphabetically.\n */\nexport const LOCALE_LIST_CANONICAL: readonly LocaleMetaEntry[] =\n LOCALES_WITH_BUNDLES.map((code) => LOCALE_META[code]);\n\n/**\n * Picker-facing list — sorted alphabetically by English name so the\n * order is deterministic and language-independent. End users searching\n * by native name use the picker's input box to filter; the visible\n * order doesn't depend on the active locale's collation.\n *\n * \"System Default\" (the OS-driven fallback) is rendered separately at\n * the top of `LocalePicker.SearchList` — not in this list — so the\n * alphabetical order here applies to the 18 explicit locale rows only.\n */\nexport const LOCALE_LIST: readonly LocaleMetaEntry[] = [\n ...LOCALES_WITH_BUNDLES.map((code) => LOCALE_META[code]),\n].sort((a, b) => a.englishName.localeCompare(b.englishName, 'en'));\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — LocalePicker. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { LocalePickerHandle } from './locale-picker';\n\nexport const localePickerAgent: AgentAdapter<LocalePickerHandle> = {\n id: 'locale-picker',\n // Persists a single locale choice via the handle's `setLocale` → set_value.\n capabilities: ['set_value'],\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.localePicker.state.locale',\n description:\n 'Resolved IETF tag of the locale currently applied to the page. Read this after `set_locale` — the setter silently drops tags the kit ships no bundle for, so this is the only confirmation the switch landed.',\n read: (handle) => handle.getLocale(),\n },\n isSystemDefault: {\n type: 'boolean',\n descriptionKey: 'ui.agent.localePicker.state.isSystemDefault',\n description:\n 'True when following navigator.language. False for a saved or explicit choice, or when initialLocaleFromHtmlLang or followHtmlLang used the page language. Read alongside locale to distinguish browser detection from a concrete language selection.',\n read: (handle) => handle.getIsSystemDefault(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\"). Unsupported tags are a no-op.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.localePicker.actions.setLocale',\n description:\n 'Switch the active locale to the given IETF tag. Unsupported tags are a silent no-op — read the `locale` state slot afterwards to confirm the switch landed.',\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n invoke: (handle, args: { locale: string }) => {\n // The handle's own implementation gates against\n // `LOCALES_WITH_BUNDLES`, so a tag the kit doesn't ship is a\n // no-op rather than a runtime crash.\n handle.setLocale(args.locale);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'locale-picker',\n description: 'Marks the LocalePicker wrapper.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type HTMLAttributes,\n type Ref,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, Globe, Monitor } from 'lucide-react';\nimport { Command, defaultFilter } from 'cmdk';\nimport { IconButton } from '../button/icon-button';\nimport { Popover } from '../popover/popover';\nimport { CoreFlag, hasCoreFlag } from '../flag/flag-core';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n} from '../_shared/input-surface';\nimport { LOCALE_LIST, LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { LOCALES_WITH_BUNDLES, resolveUiLanguage } from '../../i18n/config';\nimport { useLocale } from '../../hooks/use-locale';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { localePickerAgent } from './locale-picker.agent';\n\n/* ------------------------------------------------------------------ */\n/* Persistence + initial locale detection */\n/* */\n/* Detection runs once per app lifecycle. The first effect chooses */\n/* storage, then (when opted in) html lang, then the browser locale. */\n/* Only an explicit language selection is persisted. The shared */\n/* preference also distinguishes HTML from System Default when both */\n/* leave storage empty, including after menus close and reopen. */\n/* ------------------------------------------------------------------ */\n\nexport const LOCALE_STORAGE_KEY = 'alfadocs-ui.locale';\n\n/**\n * Sentinel value (and Combobox-row key) for \"follow the browser /\n * OS locale\". Mirrors the ThemeToggle's `'system'` preference: the\n * picker doesn't store a concrete locale code; the runtime resolves\n * to `navigator.language` once per app lifecycle, or when selected.\n */\nexport const LOCALE_SYSTEM_DEFAULT = 'system' as const;\nexport type LocalePreference = Locale | typeof LOCALE_SYSTEM_DEFAULT;\n\n/**\n * Reports a language change: the picked preference, and the concrete locale it\n * applied (the browser's for System default, which is what a site navigates to).\n */\nexport type LocaleChangeHandler = (\n next: LocalePreference,\n resolved: Locale,\n) => void;\n\nlet detectionFired = false;\nlet sessionPreference: LocalePreference | undefined;\nconst preferenceListeners = new Set<() => void>();\n\n/** @internal Simulate a fresh app lifecycle after test components unmount. */\nexport function __resetLocalePreferenceForTests(): void {\n detectionFired = false;\n sessionPreference = undefined;\n}\n\nfunction subscribePreference(listener: () => void): () => void {\n preferenceListeners.add(listener);\n return () => {\n preferenceListeners.delete(listener);\n };\n}\n\nfunction getPreference(): LocalePreference {\n if (sessionPreference !== undefined) return sessionPreference;\n const stored = safeReadStorage(LOCALE_STORAGE_KEY);\n if (stored === null) return LOCALE_SYSTEM_DEFAULT;\n // An unsupported stored value still counts as an explicit choice, as before.\n return isSupportedLocale(stored) ? stored : 'en';\n}\n\nfunction updatePreference(next: LocalePreference): void {\n sessionPreference = next;\n preferenceListeners.forEach((listener) => listener());\n}\n\nfunction isSupportedLocale(value: unknown): value is Locale {\n return (\n typeof value === 'string' &&\n (LOCALES_WITH_BUNDLES as readonly string[]).includes(value)\n );\n}\n\nfunction safeReadStorage(key: string): string | null {\n if (typeof window === 'undefined') return null;\n try {\n return window.localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction safeWriteStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* Storage can throw in private mode / when quota is exceeded — the\n in-memory state is the source of truth. Same silent-fail shape\n as use-theme.ts. */\n }\n}\n\nfunction detectBrowserLocale(): Locale {\n if (typeof navigator === 'undefined') return 'en';\n const raw = navigator.language;\n if (!raw) return 'en';\n const base = raw.toLowerCase().split('-')[0];\n return isSupportedLocale(base) ? base : 'en';\n}\n\n/**\n * Calls `onLocaleChange` when a pick changed the language. Picking the language\n * already shown (or System default resolving to it) reports nothing.\n */\nexport function reportLocaleChange(\n onLocaleChange: LocaleChangeHandler | undefined,\n next: LocalePreference,\n previous: Locale,\n): void {\n const resolved =\n next === LOCALE_SYSTEM_DEFAULT ? detectBrowserLocale() : next;\n if (resolved !== previous) onLocaleChange?.(next, resolved);\n}\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* Shared state hook */\n/* */\n/* Centralises the setLocale wrapper so both the standalone picker */\n/* and the inline `LocalePicker.SearchList` share one source of truth: */\n/* 1. delegate to `useLocale().setLocale` (the i18next change) */\n/* 2. set `document.documentElement.dir` + `lang` */\n/* 3. persist to localStorage at `alfadocs-ui.locale` */\n/* ------------------------------------------------------------------ */\n\ninterface LocalePickerState {\n /** Resolved locale actually applied to the page (always concrete). */\n locale: Locale;\n /**\n * True when the resolved locale came from `navigator.language`\n * rather than HTML or an explicit user choice. Marks the\n * \"System Default\" row as the active selection.\n */\n isSystemDefault: boolean;\n /**\n * Switch to a specific locale (persists) OR back to the System\n * Default (clears the localStorage entry and re-detects).\n */\n setLocale: (next: LocalePreference) => void;\n}\n\nfunction safeRemoveStorage(key: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.removeItem(key);\n } catch {\n /* private mode etc. — silent fail per the rest of the file. */\n }\n}\n\n/** Shared persistence for picker selections and HeaderSettings agent actions. */\nexport function persistLocalePreference(next: LocalePreference): void {\n if (next === LOCALE_SYSTEM_DEFAULT) safeRemoveStorage(LOCALE_STORAGE_KEY);\n else safeWriteStorage(LOCALE_STORAGE_KEY, next);\n updatePreference(next);\n}\n\nfunction useLocalePickerState(\n initialLocaleFromHtmlLang = false,\n followHtmlLang = false,\n): LocalePickerState {\n const { locale: rawLocale, setLocale: setLocaleI18n } = useLocale();\n const preference = useSyncExternalStore(\n subscribePreference,\n getPreference,\n () => LOCALE_SYSTEM_DEFAULT,\n );\n\n // Coerce the i18next-reported locale to the supported set so consumers\n // never see an un-bundled tag (e.g. when the host app pre-loads\n // `en-US` before the kit's resources land).\n const locale: Locale = isSupportedLocale(rawLocale) ? rawLocale : 'en';\n\n const setLocale = useCallback(\n (next: LocalePreference) => {\n if (next === LOCALE_SYSTEM_DEFAULT) {\n // Clear persistence + re-resolve to navigator.language.\n persistLocalePreference(LOCALE_SYSTEM_DEFAULT);\n const detected = detectBrowserLocale();\n void setLocaleI18n(detected);\n applyDocumentAttrs(detected);\n return;\n }\n if (!isSupportedLocale(next)) return;\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n persistLocalePreference(next);\n },\n [setLocaleI18n],\n );\n\n useInitialLocale(initialLocaleFromHtmlLang, followHtmlLang);\n\n return {\n locale,\n isSystemDefault: preference === LOCALE_SYSTEM_DEFAULT,\n setLocale,\n };\n}\n\n/**\n * Applies storage, optionally HTML lang, then the browser, once per app lifecycle.\n * With `followHtmlLang`, a supported HTML lang comes first, ahead of storage.\n * Every locale surface calls it on mount (the picker, and HeaderSettings,\n * whose search list only mounts when its flyout opens), so the page starts\n * in the right language and direction whichever one the host renders.\n * The first caller whose mount effect runs decides the option for all surfaces.\n * Pass the same option everywhere; later mounts or prop changes do not re-detect.\n */\nexport function useInitialLocale(\n initialLocaleFromHtmlLang = false,\n followHtmlLang = false,\n): void {\n const { locale: rawLocale, setLocale: setLocaleI18n } = useLocale();\n useEffect(() => {\n if (detectionFired) return;\n detectionFired = true;\n const htmlLocale =\n (initialLocaleFromHtmlLang || followHtmlLang) &&\n typeof document !== 'undefined'\n ? resolveUiLanguage(document.documentElement.lang.trim())\n : undefined;\n const supportedHtmlLocale = isSupportedLocale(htmlLocale)\n ? htmlLocale\n : undefined;\n // One address per language: the page's language wins over a saved\n // choice. Storage is left alone; the page shows its choice as selected.\n if (followHtmlLang && supportedHtmlLocale) {\n if (supportedHtmlLocale !== rawLocale)\n void setLocaleI18n(supportedHtmlLocale);\n applyDocumentAttrs(supportedHtmlLocale);\n updatePreference(supportedHtmlLocale);\n return;\n }\n const stored = safeReadStorage(LOCALE_STORAGE_KEY);\n if (isSupportedLocale(stored)) {\n // User-chosen value persists — keep i18next + document in sync.\n if (stored !== rawLocale) void setLocaleI18n(stored);\n applyDocumentAttrs(stored);\n updatePreference(stored);\n return;\n }\n const detected = supportedHtmlLocale ?? detectBrowserLocale();\n // Keep automatic choices in memory only. Choosing System Default later\n // follows the browser for this session, even when HTML was used initially.\n updatePreference(supportedHtmlLocale ?? LOCALE_SYSTEM_DEFAULT);\n void setLocaleI18n(detected);\n applyDocumentAttrs(detected);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional one-shot detection\n }, []);\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n variant: {\n icon: '',\n compact: '',\n },\n },\n defaultVariants: { variant: 'icon' },\n});\n\nconst compactTriggerClasses = [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)]',\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:bg-transparent ds:text-foreground',\n 'ds:hover:bg-muted',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n 'type-body-sm',\n].join(' ');\n\nconst popoverContentClasses = [\n 'ds:w-[18rem] ds:rounded-[var(--radius-md)]',\n 'ds:bg-background ds:text-foreground ds:border ds:border-border',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:overflow-hidden',\n].join(' ');\n\nconst localeRowClasses = [\n 'ds:relative ds:flex ds:cursor-pointer ds:select-none',\n 'ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:min-h-[var(--min-target-size)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:text-foreground ds:outline-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type LocalePickerVariant = 'icon' | 'compact';\n\nexport interface LocalePickerProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n variant?: LocalePickerVariant;\n /**\n * Controlled escape hatch — when omitted the picker reads/writes\n * `useLocale()` directly so a bare `<LocalePicker />` works with no\n * wiring. Pass both to opt into controlled mode.\n */\n value?: Locale;\n onValueChange?: (next: LocalePreference) => void;\n /** Disable interaction (greys out the trigger). */\n disabled?: boolean;\n /** Mark as busy (kept open / focusable but read-only). */\n loading?: boolean;\n /**\n * With no saved choice, start from the page's HTML lang before falling back\n * to the browser. Defaults to false. The first locale surface's mount effect\n * decides for the app lifecycle; pass the same option to HeaderSettings.\n */\n initialLocaleFromHtmlLang?: boolean;\n /**\n * The page's HTML lang decides the starting locale, ahead of a saved\n * choice. For sites with one address per language, where the address\n * decides. Defaults to false. Pass the same option to HeaderSettings.\n */\n followHtmlLang?: boolean;\n /**\n * Called after the picker (or its agent handle) has applied a selection\n * that changed the language. Uncontrolled mode only: with `onValueChange`\n * it stays silent. A site with one address per language navigates to\n * `resolved` here. Not called for the starting language.\n */\n onLocaleChange?: LocaleChangeHandler;\n /**\n * Side the search popover opens onto, relative to the trigger.\n * Defaults to `bottom` (standard dropdown). Use `end` (inline-end —\n * right in LTR, left in RTL) when nesting the LocalePicker inside\n * another popover/menu so the search surface flies out to the side\n * rather than stacking below.\n */\n popoverSide?: 'top' | 'bottom' | 'start' | 'end';\n}\n\n/**\n * Curated imperative handle for agent / external automation. The\n * `setLocale` parameter is widened to `string` (rather than the\n * narrower `Locale`) so untyped agent inputs don't have to thread the\n * `LOCALES_WITH_BUNDLES` constraint at the call site — the\n * implementation validates internally and no-ops on an unsupported\n * tag.\n */\nexport interface LocalePickerHandle {\n setLocale: (next: string) => void;\n /** Resolved locale tag actually applied to the page (always concrete). */\n getLocale: () => string;\n /**\n * True when the resolved locale came from `navigator.language` rather\n * than HTML or an explicit user choice. Read-back for `set_locale`: the\n * resolved tag alone cannot tell \"the user chose English\" from\n * \"we are following the browser, which happens to be English\".\n */\n getIsSystemDefault: () => boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* LocalePicker.SearchList — the inline searchable list */\n/* */\n/* HeaderSettings renders this directly inside its DropdownMenu so the */\n/* same UX is reused without nesting another popover. Standalone the */\n/* root component renders this same widget inside a Popover. */\n/* ------------------------------------------------------------------ */\n\nexport interface LocalePickerSearchListProps {\n /**\n * Active selection. Either a `Locale` code or the\n * `LOCALE_SYSTEM_DEFAULT` sentinel (when the user hasn't made an\n * explicit choice and the kit is following `navigator.language`).\n * Defaults to the shared store.\n */\n value?: LocalePreference;\n /**\n * Fires after a successful selection. Accepts a concrete `Locale`\n * or `LOCALE_SYSTEM_DEFAULT` (when the user picks the \"System\n * Default\" row at the top of the list).\n *\n * Defaults to the shared setter (delegates to useLocale, persists\n * or clears storage, updates document.dir/lang).\n */\n onValueChange?: (next: LocalePreference) => void;\n /**\n * Called after the shared setter has applied a selection that changed the\n * language (uncontrolled mode only; with `onValueChange` it stays silent).\n * A site with one address per language navigates to `resolved` here.\n */\n onLocaleChange?: LocaleChangeHandler;\n /** Optional id for the search input (axe `aria-labelledby` chain). */\n inputId?: string;\n /** Disable the input + list interactions. */\n disabled?: boolean;\n /** Mark as busy (read-only). */\n loading?: boolean;\n className?: string;\n}\n\nconst searchListVariants = cva('ds:flex ds:flex-col', {\n variants: {\n loading: {\n true: 'ds:opacity-60 ds:pointer-events-none',\n false: '',\n },\n },\n defaultVariants: { loading: false },\n});\n\nexport const LocalePickerSearchList = forwardRef<\n HTMLDivElement,\n LocalePickerSearchListProps\n>(\n (\n {\n value: valueProp,\n onValueChange,\n onLocaleChange,\n inputId: inputIdProp,\n disabled = false,\n loading = false,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const store = useLocalePickerState();\n // Resolved-to-render-with: which locale name to display for\n // \"System Default ({{nativeName}})\". Always a concrete Locale.\n const resolvedLocale = store.locale;\n // Selection-state: the picker's current value is either an\n // explicit Locale or the System Default sentinel.\n const currentSelection: LocalePreference =\n valueProp ??\n (store.isSystemDefault ? LOCALE_SYSTEM_DEFAULT : store.locale);\n const generatedId = useId();\n const inputId = inputIdProp ?? `${generatedId}-search`;\n const [search, setSearch] = useState('');\n\n const handleSelect = useCallback(\n (code: string) => {\n if (disabled || loading) return;\n if (code === LOCALE_SYSTEM_DEFAULT) {\n if (onValueChange) {\n onValueChange(LOCALE_SYSTEM_DEFAULT);\n } else {\n const previous = store.locale;\n store.setLocale(LOCALE_SYSTEM_DEFAULT);\n reportLocaleChange(onLocaleChange, LOCALE_SYSTEM_DEFAULT, previous);\n }\n return;\n }\n if (!isSupportedLocale(code)) return;\n if (onValueChange) {\n onValueChange(code);\n } else {\n const previous = store.locale;\n store.setLocale(code);\n reportLocaleChange(onLocaleChange, code, previous);\n }\n },\n [disabled, loading, onValueChange, onLocaleChange, store],\n );\n\n return (\n <div\n ref={ref}\n className={[searchListVariants({ loading }), className]\n .filter(Boolean)\n .join(' ')}\n data-component=\"locale-picker-search-list\"\n >\n <Command\n label={t('navigation.localePicker.commandLabel')}\n // Defer to cmdk's defaultFilter — it ranks against both the\n // Item's `value` (the locale code) and `keywords` (the\n // native + English names), which is exactly the haystack we\n // want users to be able to match against. The Item's `value`\n // alone wouldn't surface \"jap\" → 日本語 because the code is\n // `ja`; the keyword \"Japanese\" handles that match.\n filter={defaultFilter}\n shouldFilter\n >\n {/* Input chrome borrows the kit's standard INPUT_SURFACE\n tokens (same as Combobox / Autocomplete) so the search\n field reads as a first-class kit input rather than a\n one-off list header. The wrapper carries the border /\n padding / focus-within ring; the inner Command.Input\n keeps its outline-less peer styling. */}\n <div\n className={[\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT.sm,\n INPUT_SURFACE_PADDING_X.sm,\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:m-[var(--spacing-xs)]',\n ].join(' ')}\n >\n <Globe\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-muted-foreground ds:shrink-0\"\n />\n <Command.Input\n id={inputId}\n value={search}\n onValueChange={setSearch}\n placeholder={t('navigation.localePicker.searchPlaceholder')}\n aria-label={t('navigation.localePicker.searchLabel')}\n disabled={disabled || loading}\n className={[\n 'ds:peer ds:flex-1 ds:bg-transparent ds:border-0 ds:outline-none',\n 'ds:placeholder:text-muted-foreground ds:text-foreground',\n 'ds:text-[length:var(--font-size-sm)]',\n ].join(' ')}\n />\n </div>\n <Command.List\n label={t('navigation.localePicker.commandLabel')}\n className={[\n 'ds:max-h-[18rem] ds:overflow-y-auto',\n 'ds:p-[var(--spacing-xs)]',\n ].join(' ')}\n >\n <Command.Empty\n className={[\n 'ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]',\n 'type-body-sm ds:text-muted-foreground',\n ].join(' ')}\n >\n {t('navigation.localePicker.empty')}\n </Command.Empty>\n\n {/* \"System Default\" — always the first row. Selected when\n following the browser; selecting it\n clears the localStorage entry and re-resolves to\n navigator.language. Mirrors the `'system'` value in\n ThemeToggle. */}\n {(() => {\n const isSystemSelected =\n currentSelection === LOCALE_SYSTEM_DEFAULT;\n const resolvedEntry = LOCALE_META[resolvedLocale];\n return (\n <Command.Item\n key={LOCALE_SYSTEM_DEFAULT}\n value={LOCALE_SYSTEM_DEFAULT}\n keywords={[\n 'system',\n 'default',\n 'auto',\n 'browser',\n resolvedEntry.nativeName,\n resolvedEntry.englishName,\n ]}\n disabled={disabled || loading}\n onSelect={handleSelect}\n className={localeRowClasses}\n aria-selected={isSystemSelected || undefined}\n data-current={isSystemSelected ? 'true' : undefined}\n >\n <Monitor\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-muted-foreground ds:shrink-0\"\n />\n <span className=\"ds:flex-1 ds:min-w-0 ds:truncate type-body-sm\">\n {t('navigation.localePicker.systemDefault', {\n locale: resolvedEntry.nativeName,\n })}\n </span>\n {isSystemSelected ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-primary ds:shrink-0\"\n />\n ) : null}\n {isSystemSelected ? (\n <span className=\"ds:sr-only\">\n {t('navigation.localePicker.currentSelection')}\n </span>\n ) : null}\n </Command.Item>\n );\n })()}\n\n {LOCALE_LIST.map((entry) => {\n const isSelected = currentSelection === entry.code;\n return (\n <Command.Item\n key={entry.code}\n value={entry.code}\n keywords={[entry.nativeName, entry.englishName]}\n disabled={disabled || loading}\n onSelect={handleSelect}\n className={localeRowClasses}\n aria-selected={isSelected || undefined}\n data-current={isSelected ? 'true' : undefined}\n // `lang` on the row triggers font-cascade selection\n // so Arabic / Japanese / Devanagari / Greek glyphs\n // paint via the Noto Sans family. Intentionally\n // omits `dir` — the row layout follows the picker\n // surface's direction (LTR menu = LTR row, RTL menu\n // = RTL row). Setting `dir=\"rtl\"` per Arabic row\n // would flip just THAT row inside an LTR menu, which\n // breaks the visual rhythm with neighbouring rows.\n // Arabic text within the row still renders RTL at\n // the character level (script-driven) regardless.\n lang={entry.code}\n >\n {hasCoreFlag(entry.countryCode) ? (\n <CoreFlag\n country={entry.countryCode}\n size=\"sm\"\n shape=\"rectangle\"\n rounded=\"sm\"\n className=\"ds:shrink-0\"\n />\n ) : (\n /* hasCoreFlag fallback: render the emoji glyph only\n when the kit doesn't ship an SVG for this\n country code. All 18 bundled locales currently\n have SVG flags, so this is dead code on the\n canonical set — kept for resilience when\n consumers extend the registry. */\n <span\n aria-hidden=\"true\"\n className=\"ds:text-base ds:shrink-0\"\n >\n {entry.flag}\n </span>\n )}\n <span className=\"ds:flex-1 ds:min-w-0 ds:truncate type-body-sm\">\n {entry.nativeName}\n </span>\n {isSelected ? (\n <Check\n aria-hidden=\"true\"\n className=\"ds:size-4 ds:text-primary ds:shrink-0\"\n />\n ) : null}\n {isSelected ? (\n <span className=\"ds:sr-only\">\n {t('navigation.localePicker.currentSelection')}\n </span>\n ) : null}\n </Command.Item>\n );\n })}\n </Command.List>\n </Command>\n </div>\n );\n },\n);\nLocalePickerSearchList.displayName = 'LocalePicker.SearchList';\n\n/* ------------------------------------------------------------------ */\n/* LocalePicker root — icon + compact trigger variants */\n/* ------------------------------------------------------------------ */\n\ninterface VariantRenderProps {\n state: LocalePickerState;\n selection: LocalePreference;\n rest: HTMLAttributes<HTMLDivElement>;\n forwardedRef: Ref<HTMLDivElement>;\n className?: string;\n disabled: boolean;\n loading: boolean;\n popoverSide: 'top' | 'bottom' | 'start' | 'end';\n}\n\nfunction IconTrigger({\n state,\n selection,\n rest,\n forwardedRef,\n className,\n disabled,\n loading,\n popoverSide,\n}: VariantRenderProps) {\n const { t } = useTranslation('ui');\n const entry = LOCALE_META[state.locale];\n return (\n <div\n ref={forwardedRef}\n data-component=\"locale-picker\"\n data-component-id={rest.id}\n className={wrapperVariants({ variant: 'icon', className })}\n {...rest}\n >\n <Popover.Root>\n <Popover.Trigger asChild>\n <IconButton\n disabled={disabled || loading}\n icon={\n <span className=\"ds:relative ds:inline-flex ds:items-center ds:justify-center\">\n <Globe aria-hidden className=\"ds:size-5\" />\n {hasCoreFlag(entry.countryCode) ? (\n <CoreFlag\n country={entry.countryCode}\n size=\"sm\"\n shape=\"rectangle\"\n rounded=\"sm\"\n className={[\n // Corner chip overlaying the globe glyph.\n // `outline` paints a thin background-coloured\n // ring around the flag so it reads as a chip\n // rather than blending into the globe edge.\n 'ds:absolute ds:bottom-[-3px] ds:end-[-5px]',\n 'ds:outline ds:outline-2 ds:outline-background',\n // Scale down to chip size — Flag's sm tile is\n // larger than the original emoji glyph.\n 'ds:scale-75 ds:origin-bottom-end',\n ].join(' ')}\n />\n ) : null}\n </span>\n }\n aria-label={t('navigation.localePicker.trigger', {\n locale: entry.nativeName,\n })}\n />\n </Popover.Trigger>\n <Popover.Content\n side={popoverSide}\n align=\"start\"\n sideOffset={8}\n className={popoverContentClasses}\n aria-label={t('navigation.localePicker.popupLabel')}\n >\n <LocalePickerSearchList\n value={selection}\n onValueChange={state.setLocale}\n disabled={disabled}\n loading={loading}\n />\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nfunction CompactTrigger({\n state,\n selection,\n rest,\n forwardedRef,\n className,\n disabled,\n loading,\n popoverSide,\n}: VariantRenderProps) {\n const { t } = useTranslation('ui');\n const entry = LOCALE_META[state.locale];\n return (\n <div\n ref={forwardedRef}\n data-component=\"locale-picker\"\n data-component-id={rest.id}\n className={wrapperVariants({ variant: 'compact', className })}\n {...rest}\n >\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n disabled={disabled || loading}\n className={compactTriggerClasses}\n aria-label={t('navigation.localePicker.trigger', {\n locale: entry.nativeName,\n })}\n >\n {hasCoreFlag(entry.countryCode) ? (\n <CoreFlag\n country={entry.countryCode}\n size=\"sm\"\n shape=\"rectangle\"\n rounded=\"sm\"\n className=\"ds:shrink-0\"\n />\n ) : (\n <Globe aria-hidden className=\"ds:size-4 ds:shrink-0\" />\n )}\n <span\n className=\"ds:flex-1 ds:truncate type-body-sm\"\n lang={entry.code}\n >\n {entry.nativeName}\n </span>\n </button>\n </Popover.Trigger>\n <Popover.Content\n side={popoverSide}\n align=\"start\"\n sideOffset={8}\n className={popoverContentClasses}\n aria-label={t('navigation.localePicker.popupLabel')}\n >\n <LocalePickerSearchList\n value={selection}\n onValueChange={state.setLocale}\n disabled={disabled}\n loading={loading}\n />\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n}\n\nconst LocalePickerRoot = forwardRef<HTMLDivElement, LocalePickerProps>(\n (props, ref) => {\n const {\n variant = 'icon',\n value,\n onValueChange,\n disabled = false,\n loading = false,\n initialLocaleFromHtmlLang = false,\n followHtmlLang = false,\n onLocaleChange,\n popoverSide = 'bottom',\n className,\n id,\n ...rest\n } = props as LocalePickerProps & { id?: string };\n\n const store = useLocalePickerState(\n initialLocaleFromHtmlLang,\n followHtmlLang,\n );\n const resolvedLocale = value ?? store.locale;\n\n // Controlled overlay: when a consumer passes `onValueChange`, route\n // selections to them instead of the shared store. Document attrs +\n // localStorage are still updated so the picker behaves consistently\n // either way.\n const setLocale = useCallback(\n (next: LocalePreference) => {\n if (onValueChange) {\n onValueChange(next);\n // Side-effects in controlled mode: still write through to\n // the persistence + document attrs so the rest of the page\n // re-renders even though we're routing state to the consumer.\n if (next === LOCALE_SYSTEM_DEFAULT) {\n persistLocalePreference(LOCALE_SYSTEM_DEFAULT);\n const detected = detectBrowserLocale();\n applyDocumentAttrs(detected);\n } else if (isSupportedLocale(next)) {\n applyDocumentAttrs(next);\n persistLocalePreference(next);\n }\n return;\n }\n const previous = store.locale;\n store.setLocale(next);\n reportLocaleChange(onLocaleChange, next, previous);\n },\n [onValueChange, onLocaleChange, store],\n );\n\n const state: LocalePickerState = useMemo(\n () => ({\n locale: resolvedLocale,\n isSystemDefault: store.isSystemDefault,\n setLocale,\n }),\n [resolvedLocale, store.isSystemDefault, setLocale],\n );\n // Preserve the existing standalone selection display unless opted in.\n // A controlled value always marks the locale supplied by the host.\n const selection =\n (initialLocaleFromHtmlLang || followHtmlLang) &&\n value === undefined &&\n store.isSystemDefault\n ? LOCALE_SYSTEM_DEFAULT\n : resolvedLocale;\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n const stateRef = useRef(state);\n stateRef.current = state;\n const agentHandle = useMemo<LocalePickerHandle>(\n () => ({\n setLocale: (next: string) => {\n if (isSupportedLocale(next)) {\n stateRef.current.setLocale(next);\n }\n },\n // Read-back for `set_locale` — the setter swallows unsupported\n // tags, so these are the only way an agent can tell a switch\n // landed from one that was dropped.\n getLocale: () => stateRef.current.locale,\n getIsSystemDefault: () => stateRef.current.isSystemDefault,\n }),\n [],\n );\n useAgentRegistration(localePickerAgent, agentHandle, id);\n\n if (variant === 'compact') {\n return (\n <CompactTrigger\n state={state}\n selection={selection}\n rest={rest}\n forwardedRef={forwardedRef}\n className={className}\n disabled={disabled}\n loading={loading}\n popoverSide={popoverSide}\n />\n );\n }\n return (\n <IconTrigger\n state={state}\n selection={selection}\n rest={rest}\n forwardedRef={forwardedRef}\n className={className}\n disabled={disabled}\n loading={loading}\n popoverSide={popoverSide}\n />\n );\n },\n);\nLocalePickerRoot.displayName = 'LocalePicker';\n\nexport const LocalePicker = Object.assign(LocalePickerRoot, {\n SearchList: LocalePickerSearchList,\n});\n"],"names":["CORE_RECTANGLE_URL_MAP","safeFlagGlob","__vite_glob_0_0","__vite_glob_0_1","__vite_glob_0_2","__vite_glob_0_3","__vite_glob_0_4","__vite_glob_0_5","__vite_glob_0_6","__vite_glob_0_7","__vite_glob_0_8","__vite_glob_0_9","__vite_glob_0_10","__vite_glob_0_11","__vite_glob_0_12","__vite_glob_0_13","__vite_glob_0_14","__vite_glob_0_15","__vite_glob_0_16","__vite_glob_0_17","CORE_SQUARE_URL_MAP","__vite_glob_1_0","__vite_glob_1_1","__vite_glob_1_2","__vite_glob_1_3","__vite_glob_1_4","__vite_glob_1_5","__vite_glob_1_6","__vite_glob_1_7","__vite_glob_1_8","__vite_glob_1_9","__vite_glob_1_10","__vite_glob_1_11","__vite_glob_1_12","__vite_glob_1_13","__vite_glob_1_14","__vite_glob_1_15","__vite_glob_1_16","__vite_glob_1_17","hasCoreFlag","country","CoreFlag","forwardRef","label","shape","size","rounded","className","rest","ref","code","createElement","FlagView","flagClasses","LOCALE_META","LOCALES_WITH_BUNDLES","LOCALE_LIST","a","b","localePickerAgent","handle","args","LOCALE_STORAGE_KEY","LOCALE_SYSTEM_DEFAULT","detectionFired","sessionPreference","preferenceListeners","subscribePreference","listener","getPreference","stored","safeReadStorage","isSupportedLocale","updatePreference","next","value","key","safeWriteStorage","detectBrowserLocale","raw","base","reportLocaleChange","onLocaleChange","previous","resolved","applyDocumentAttrs","locale","root","safeRemoveStorage","persistLocalePreference","useLocalePickerState","initialLocaleFromHtmlLang","followHtmlLang","rawLocale","setLocaleI18n","useLocale","preference","useSyncExternalStore","setLocale","useCallback","detected","useInitialLocale","useEffect","htmlLocale","resolveUiLanguage","supportedHtmlLocale","wrapperVariants","cva","compactTriggerClasses","popoverContentClasses","localeRowClasses","MENU_ROW_HIGHLIGHT","searchListVariants","LocalePickerSearchList","valueProp","onValueChange","inputIdProp","disabled","loading","t","useTranslation","store","resolvedLocale","currentSelection","generatedId","useId","inputId","search","setSearch","useState","handleSelect","jsx","jsxs","Command","defaultFilter","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","Globe","isSystemSelected","resolvedEntry","Monitor","Check","entry","isSelected","IconTrigger","state","selection","forwardedRef","popoverSide","Popover","IconButton","CompactTrigger","LocalePickerRoot","props","variant","id","useMemo","useRef","useImperativeHandle","stateRef","agentHandle","useAgentRegistration","LocalePicker"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAMA,IAAuCC;AAAA,EAAa,MACxD,uBAAA,OAAA;AAAA,IAAA,+CAAAC;AAAA,IAAA,+CAAAC;AAAA,IAAA,+CAAAC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,cAAAoG;AAAA,QACA,WAAArG;AAAA,QACA,UAAAsE;AAAA,QACA,SAAAC;AAAA,QACA,aAAA+B;AAAA,MAAA;AAAA,IAAA,IAKJ,gBAAAlB;AAAA,MAACc;AAAA,MAAA;AAAA,QACC,OAAAC;AAAA,QACA,WAAAC;AAAA,QACA,MAAAnG;AAAA,QACA,cAAAoG;AAAA,QACA,WAAArG;AAAA,QACA,UAAAsE;AAAA,QACA,SAAAC;AAAA,QACA,aAAA+B;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAI,GAAiB,cAAc;AAExB,MAAMU,KAAe,OAAO,OAAOV,IAAkB;AAAA,EAC1D,YAAYxC;AACd,CAAC;"}
@@ -9,7 +9,7 @@ import { C as U } from "./card-BA4Ig_kn.js";
9
9
  import { D as u } from "./dropdown-menu-D1we7oAY.js";
10
10
  import { T as ke } from "./tab-bar-BEODTG6k.js";
11
11
  import { a as Y, H as we, g as Ne, f as G, e as ye, c as Se, d as Ce } from "./header-l_B8MV0g.js";
12
- import { H as Ae } from "./header-settings-CifwJEKB.js";
12
+ import { H as Ae } from "./header-settings-BVhjndtV.js";
13
13
  import { S as Te } from "./sign-in-with-alfadocs-button-DzrNgbWv.js";
14
14
  import { S as Ee, a as ee, v as ze, h as Ie, c as Me, r as Le, b as He, l as Ve, m as Be, k as Re, j as J } from "./sidebar-BS24EnYd.js";
15
15
  import { N as De } from "./navigation-dismiss-B1mcW1CT.js";
@@ -656,4 +656,4 @@ export {
656
656
  na as M,
657
657
  y as P
658
658
  };
659
- //# sourceMappingURL=marketplace-app-shell-vON3WhD0.js.map
659
+ //# sourceMappingURL=marketplace-app-shell-x_abo_ye.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marketplace-app-shell-vON3WhD0.js","sources":["../../src/brand/product-lockup/product-lockup.tsx","../../src/patterns/marketplace-app-shell/marketplace-app-shell.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { Logo } from '../../components/logo/logo';\nimport { AlfadocsLogoMark, AlfadocsLogoNeg } from '../logo-asset';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\n// Outer lockup row. ~4px logical gap between the wordmark and the product\n// name (`--spacing-xs`), centre-aligned so the name's cap height sits\n// against the wordmark's letterforms.\nconst lockup = cva('ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]');\n\n// The product name. Marketing serif (Fraunces, `--font-serif`) — permitted\n// here because this file lives under `src/brand/`, never in `src/components/`\n// or `src/patterns/` (constraint 10). Sized to ~95% of the wordmark height so\n// its cap height matches the logo letterforms across every size and theme\n// (the `--logo-size-*` tokens shift up in the accessible themes; the calc\n// keeps the name proportional for free).\nconst productName = cva(\n [\n 'ds:[font-family:var(--font-serif)]',\n 'ds:font-semibold',\n 'ds:leading-none',\n 'ds:tracking-[0.01em]',\n 'ds:whitespace-nowrap',\n // Forced-colors: drop the transparent text-fill and paint the label\n // as solid CanvasText so it never disappears under Windows HCM —\n // a gradient/transparent fill has no meaning there.\n 'ds:forced-colors:text-[CanvasText]',\n 'ds:forced-colors:[-webkit-text-fill-color:CanvasText]',\n ],\n {\n variants: {\n size: {\n sm: 'ds:text-[calc(var(--logo-size-sm)*0.95)]',\n md: 'ds:text-[calc(var(--logo-size-md)*0.95)]',\n lg: 'ds:text-[calc(var(--logo-size-lg)*0.95)]',\n xl: 'ds:text-[calc(var(--logo-size-xl)*0.95)]',\n },\n tone: {\n // Brand gradient filled into the glyphs via background-clip:text.\n // `--gradient-wordmark` rides the theme aliases, so it stays\n // AA-safe and adapts per theme on its own (and flattens to a solid\n // ink in the accessible / forced-colors blocks — see tokens).\n gradient: [\n 'ds:italic',\n 'ds:bg-[image:var(--gradient-wordmark)]',\n 'ds:bg-clip-text',\n 'ds:text-transparent',\n 'ds:[-webkit-text-fill-color:transparent]',\n ],\n // Monochrome: solid currentColor ink, upright, no gradient — for\n // print, single-colour work, and coloured chrome (e.g. app-shell\n // headers) where the lockup must ride the surrounding ink.\n solid: 'ds:text-current',\n },\n },\n defaultVariants: { size: 'md', tone: 'gradient' },\n },\n);\n\n// Maker lockup root. Sets a single `--lockup-unit` custom property to the\n// matching `--logo-size-*` token; every maker sub-element (mark, name, the\n// \"by Alfadocs\" tag) sizes off `var(--lockup-unit)`, so there's one per-size\n// source of truth that shifts up with the accessible themes for free.\n// `whitespace-nowrap` keeps \"[mark] Name by Alfadocs\" on one line.\nconst makerRoot = cva('ds:whitespace-nowrap', {\n variants: {\n size: {\n sm: 'ds:[--lockup-unit:var(--logo-size-sm)]',\n md: 'ds:[--lockup-unit:var(--logo-size-md)]',\n lg: 'ds:[--lockup-unit:var(--logo-size-lg)]',\n xl: 'ds:[--lockup-unit:var(--logo-size-xl)]',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ntype LockupSize = NonNullable<VariantProps<typeof productName>['size']>;\n\nexport type ProductLockupProps = {\n /**\n * The product name. Passed verbatim (product names are not translated).\n *\n * - `variant=\"standard\"` (default): renders as \"Alfadocs <name>\" with the\n * wordmark; accessible name is `Alfadocs <name>`.\n * - `variant=\"maker\"`: renders as \"[mark] <name> by Alfadocs\"; accessible\n * name is `<name> by Alfadocs`.\n */\n name: string;\n /**\n * Which lockup composition to use.\n *\n * - `'standard'` (default) — Alfadocs wordmark + product name (\"Alfadocs\n * Builders\"). Use for **internal** Alfadocs products (Alfadocs Builders,\n * Alfadocs API) where the product is part of the Alfadocs family.\n * - `'maker'` — \"<name> by Alfadocs\" with the four-pillar mark and the name\n * as the prominent element. Use for **external** marketplace extensions\n * (\"Scribe by Alfadocs\") where the extension's own name leads and\n * \"by Alfadocs\" is the maker attribution.\n */\n variant?: 'standard' | 'maker';\n /**\n * Render the name as a solid `--foreground` ink, upright (no gradient, no\n * italic), and pair it with the monochrome wordmark. Use for print,\n * single-colour reproductions, or any constrained context where the\n * gradient/serif treatment is inappropriate.\n */\n monochrome?: boolean;\n /**\n * Ink resolution. `'auto'` (default) uses the lockup's intended ink\n * (`--foreground` for monochrome). `'inherit'` makes the whole lockup ride\n * `currentColor` — use it with `monochrome` on a coloured brand surface (a\n * tinted header or split-login panel) so the wordmark + name both take the\n * surface's text colour rather than clashing with a fixed `--foreground`.\n */\n tone?: 'auto' | 'inherit';\n /** Lockup size. Drives both the wordmark and the name's cap height. */\n size?: LockupSize;\n className?: string;\n} & Omit<\n ComponentPropsWithoutRef<'span'>,\n 'role' | 'aria-label' | 'aria-hidden' | 'children' | 'className'\n>;\n\n/* ------------------------------------------------------------------ */\n/* ProductLockup */\n/* ------------------------------------------------------------------ */\n\n/**\n * Pairs a product name with the Alfadocs brand. Two compositions:\n *\n * - `variant=\"standard\"` (default) — the Alfadocs wordmark + product name\n * (\"Alfadocs Builders\"). For internal Alfadocs products. Exposed to\n * assistive tech as a single `img` named `Alfadocs <name>`.\n * - `variant=\"maker\"` — \"[mark] <name> by Alfadocs\". For external marketplace\n * extensions where the extension's name leads. Exposed as a single `img`\n * named `<name> by Alfadocs`.\n *\n * In both cases the inner wordmark/mark and the visible name are decorative so\n * the brand isn't announced twice. Every marketplace app should use this\n * rather than hand-rolling a wordmark + typed span.\n */\nexport const ProductLockup = forwardRef<HTMLSpanElement, ProductLockupProps>(\n (\n {\n name,\n variant = 'standard',\n monochrome = false,\n tone = 'auto',\n size = 'md',\n className,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n if (import.meta.env.DEV && !name.trim()) {\n console.warn(\n '[ProductLockup] `name` is empty — the lockup will render the bare wordmark with no product name. Pass the product name (e.g. \"Builders\").',\n );\n }\n\n if (variant === 'maker') {\n // Ink matrix mirrors the standard variant's tone/monochrome model:\n // - tone=\"inherit\": every element rides currentColor (no explicit ink),\n // for coloured surfaces.\n // - monochrome (tone auto): foreground ink, with the attribution muted.\n // - default (colour, tone auto): the name + mark take --primary; the\n // wordmark lettering stays --foreground; the attribution is muted.\n const inherit = tone === 'inherit';\n const markInk = inherit\n ? ''\n : monochrome\n ? 'ds:text-[color:var(--foreground)]'\n : 'ds:text-[color:var(--primary)]';\n const nameInk = inherit\n ? ''\n : monochrome\n ? 'ds:text-[color:var(--foreground)]'\n : 'ds:text-[color:var(--primary)]';\n const byInk = inherit ? '' : 'ds:text-[color:var(--muted-foreground)]';\n const letteringInk = inherit ? '' : 'ds:text-[color:var(--foreground)]';\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={t('productLockup.makerLabel', { name: name.trim() })}\n className={makerRoot({ size, className })}\n data-component=\"product-lockup\"\n {...props}\n >\n {/* Pillar mark sized close to the app name (≈0.88 of the serif em),\n vertically centred on it. Inline (not flex) so the maker tag can\n use vertical-align. */}\n <AlfadocsLogoMark\n aria-hidden\n className={`ds:inline-block ds:align-middle ds:me-[var(--spacing-sm)] ds:h-[calc(var(--lockup-unit)*0.88)] ds:w-auto ds:forced-colors:text-[CanvasText] ${markInk}`}\n />\n <span\n aria-hidden\n className={`ds:align-middle ds:[font-family:var(--font-serif)] ds:font-semibold ds:italic ds:leading-none ds:tracking-[0.01em] ${nameInk} ds:text-[calc(var(--lockup-unit)*0.95)]`}\n >\n {name}\n </span>\n {/* Maker tag — superscript style, its top aligned to the app name's\n cap-height via vertical-align: text-top. */}\n <span\n aria-hidden\n className={`ds:align-text-top ds:ms-[var(--spacing-sm)] ds:inline-flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ${byInk}`}\n >\n <Trans\n ns=\"ui\"\n t={t}\n i18nKey=\"productLockup.attribution\"\n components={{\n text: (\n <span className=\"ds:text-[calc(var(--lockup-unit)*0.4)] ds:leading-none\" />\n ),\n brand: (\n <AlfadocsLogoNeg\n aria-hidden\n viewBox=\"168 0 637 125\"\n className={`ds:h-[calc(var(--lockup-unit)*0.45)] ds:w-auto ds:forced-colors:text-[CanvasText] ${letteringInk}`}\n />\n ),\n }}\n />\n </span>\n </span>\n );\n }\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={`Alfadocs ${name}`.trim()}\n className={lockup({ className })}\n data-component=\"product-lockup\"\n {...props}\n >\n <Logo\n variant={monochrome ? 'monochrome' : 'wordmark'}\n tone={tone}\n size={size}\n decorative\n />\n <span\n aria-hidden\n className={productName({\n size,\n tone: monochrome ? 'solid' : 'gradient',\n })}\n >\n {name}\n </span>\n </span>\n );\n },\n);\nProductLockup.displayName = 'ProductLockup';\n","/**\n * Marketplace App Shell — the standard chrome for an app built on top of\n * AlfaDocs (the kind a partner scaffolds with Claude Code, Lovable, etc.).\n *\n * It is a thin, opinionated composition of kit primitives: an `AppFrame` with\n * a branded `Header` (the maker `ProductLockup` — \"<Product> by Alfadocs\" —\n * rendered `monochrome` so it rides the header's ink; maker is the lockup\n * style for external marketplace extensions), a `Sidebar` for app\n * navigation, `HeaderSettings` (theme/locale/accessibility), and a bare-avatar\n * account menu (fullscreen + sign-out) matching the main app shell. An\n * optional `endSidebar` docks a tool rail (for example Alia) on the inline-end.\n * `sidebarContent`, `sidebarHeader` and `sidebarActions` let the host build\n * the sidebar from the kit's Sidebar parts instead of the flat `nav`.\n * `ConnectWithAlfadocs` is the matching pre-auth screen, with the full-colour\n * maker lockup and `SignInWithAlfadocsButton`.\n *\n * Like `AliaSidebar`, this pattern ships a RUNTIME component (surfaced via\n * `src/patterns/index.ts` and the library bundle) because consuming apps mount\n * it in production rather than copying the source.\n *\n * Auth is intentionally decoupled: the shell takes the signed-in `user` and an\n * `onSignOut` callback as props, and `ConnectWithAlfadocs` takes a `status` +\n * `onConnect`. Wire them to `@alfadocs/auth/react`'s `useAlfadocsAuth()` in the\n * consuming app — the kit never touches OAuth or secrets (those live in the\n * server-side `@alfadocs/auth` BFF).\n *\n * All user-visible copy is consumer-provided (props) so each app localises in\n * its own i18n; the only kit-owned strings reuse existing translated `ui.*`\n * keys (sidebar label, skip link, menu button).\n */\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { LogOut, Maximize2 } from 'lucide-react';\n\nimport { AppFrame } from '../../components/app-frame';\nimport { Avatar } from '../../components/avatar';\nimport { Alert } from '../../components/alert';\nimport { Card } from '../../components/card';\nimport { DropdownMenu } from '../../components/dropdown-menu';\nimport { TabBar } from '../../components/tab-bar';\nimport {\n Header,\n HeaderBrand,\n HeaderCenter,\n HeaderEnd,\n HeaderMenuButton,\n HeaderSkipLink,\n HeaderStart,\n} from '../../components/header';\nimport { HeaderSettings } from '../../components/header-settings';\nimport { ProductLockup } from '../../brand/product-lockup';\nimport { SignInWithAlfadocsButton } from '../../components/sign-in-with-alfadocs-button';\nimport {\n Sidebar,\n SidebarBody,\n SidebarCloseTrigger,\n SidebarCollapseTrigger,\n SidebarHeader,\n SidebarItem,\n SidebarItemBadge,\n SidebarItemIcon,\n SidebarItemLabel,\n SidebarSectionsToggle,\n useSidebar,\n type SidebarItemMove,\n type SidebarMode,\n} from '../../components/sidebar';\nimport { NavigationDismissContext } from '../../components/_shared/navigation-dismiss';\nimport { ThemeRoot } from '../../components/theme-root';\nimport { TooltipProvider } from '../../components/tooltip';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useMediaQuery } from '../../hooks/use-media-query';\n\n// Below AppFrame's `md` (768px, --breakpoint-md), where it hides the rail.\nconst PHONE_QUERY = '(max-width: 767.98px)';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* ------------------------------------------------------------------ */\n\nexport interface MarketplaceNavItem {\n id: string;\n /** Pre-translated label — apps localise their own nav copy. */\n label: string;\n href: string;\n /** Optional leading icon (a lucide-react element or equivalent). */\n icon?: ReactNode;\n /** Optional unseen-item count rendered as a pill badge. */\n badgeCount?: number;\n /** Mark the item as the current page (`aria-current='page'`). */\n isActive?: boolean;\n /**\n * Optional click handler threaded onto the nav link's `<a>`. The lightweight\n * alternative to `renderLink`: intercept a same-origin click (call\n * `event.preventDefault()`) and route client-side without a full page load —\n * no router `<Link>` needed. Applies to both the standalone sidebar item and\n * the embedded tab. When `renderLink` is supplied it's handed through to the\n * consumer's link element instead.\n */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\n/**\n * Props the shell hands to `renderLink` for each nav item. The consumer returns\n * their router's `<Link to={href}>` carrying the same `className` (the kit's\n * active styling) and `aria-current` (`'page'` on the active item) so a tab /\n * sidebar-item click is a client-side route change, not a full page reload.\n */\nexport interface MarketplaceRenderLinkProps {\n /** The item's destination — feed it to your router's `to` / `href`. */\n href: string;\n /** The kit's classes — apply verbatim to the link element. */\n className?: string;\n /** Icon + label + badge — render as the link's children. */\n children: ReactNode;\n /** `'page'` on the active item, otherwise omitted — forward to the link. */\n 'aria-current'?: 'page';\n /**\n * The item's stable id, as the agent / automation DOM hook. Spread it onto\n * your router link so the item stays addressable by `[data-tab-id]` — see\n * PRS §26 §6. Only supplied on the bottom-tab-bar path.\n */\n 'data-tab-id'?: string;\n}\n\n/**\n * Render a nav item through the consumer's router instead of the kit's own\n * `<a>`. Returned by the consumer; the shell forwards `href`, the kit's\n * `className`, the item children, and `aria-current` so the active styling and\n * the `aria-current=\"page\"` marker survive a client-side route change.\n */\nexport type MarketplaceRenderLink = (\n props: MarketplaceRenderLinkProps,\n) => ReactNode;\n\nexport interface MarketplaceAppUser {\n /** Display name — drives the avatar initials + the account-menu header. */\n name: string;\n /** Optional email shown under the name in the account menu. */\n email?: string;\n /** Optional avatar image URL. */\n avatarSrc?: string;\n}\n\nexport interface MarketplaceAppShellLabels {\n /** Accessible name for the account-menu trigger, e.g. \"Account menu\". */\n accountMenu: string;\n /** The sign-out menu item, e.g. \"Sign out\". */\n signOut: string;\n /**\n * Optional fullscreen menu item label, e.g. \"Toggle fullscreen\". The item\n * renders whenever `onToggleFullscreen` is supplied; when this label is\n * omitted it falls back to the translated `ui.*` \"Toggle fullscreen\" string.\n */\n fullscreen?: string;\n}\n\nexport interface MarketplaceAppShellProps {\n /** Extension name — renders as the maker lockup \"<productName> by Alfadocs\". */\n productName: string;\n /** Link target for the brand lockup. Default `'/'`. */\n productHref?: string;\n /**\n * Nav items, in order. Standalone ignores them when `sidebarContent` is set;\n * the embedded tab strip always uses them. Never-embedded apps can pass `[]`.\n */\n nav: MarketplaceNavItem[];\n /**\n * Standalone sidebar body built from the kit's Sidebar parts. When set, even\n * to `null`, it replaces the flat `nav` in every mode, inside the shell's own\n * `SidebarBody` and `<nav>`. Ignored in `'embedded'`.\n */\n sidebarContent?: ReactNode;\n /**\n * Extra standalone sidebar header content, such as an inline `SearchBar`,\n * below the collapse trigger and any `sidebarActions`. Hidden in the icon\n * rail. Ignored in `'embedded'`.\n */\n sidebarHeader?: ReactNode;\n /**\n * Header tools, usually `SidebarHeaderAction`s, in the collapse trigger's\n * row after it (and after the sections toggle), above `sidebarHeader`.\n * Stacked under the expand button in the icon rail; beside the close\n * button in the phone overlay. Ignored in `'embedded'`.\n */\n sidebarActions?: ReactNode;\n /**\n * Adds `SidebarSectionsToggle` to that row, right after the collapse\n * trigger: it folds or unfolds every section in `sidebarContent`, and hides\n * itself while there are none. @default false\n */\n sidebarSectionsToggle?: boolean;\n /**\n * One call when the sections toggle folds or unfolds every section, with\n * their `sectionId`s, in place of each section's `onOpenChange`; see\n * `Sidebar`'s `onSetAllSectionsOpen`.\n */\n onSetAllSidebarSectionsOpen?: (open: boolean, sectionIds: string[]) => void;\n /**\n * Lets users move `sidebarContent` items between sections, by drag and drop\n * or keyboard; see `Sidebar`'s `onMoveItem`. Apply each move and re-render.\n * Off when omitted, in the icon rail, and in `'embedded'`.\n */\n onMoveSidebarItem?: (move: SidebarItemMove) => void;\n /**\n * Render nav items (and the brand lockup) through the consumer's router so a\n * tab / item click is a client-side route change with **no full-page reload\n * or session flash**. Wire it to your router's `<Link>`:\n *\n * ```tsx\n * import { Link } from '@tanstack/react-router';\n * <MarketplaceAppShell\n * nav={nav}\n * renderLink={({ href, className, children, ...rest }) => (\n * <Link to={href} className={className} {...rest}>{children}</Link>\n * )}\n * />\n * ```\n *\n * Threaded to the standalone sidebar items, the embedded top tab strip, and\n * the brand lockup. The kit forwards the same `className` + `aria-current` so\n * the active styling and the `aria-current=\"page\"` marker survive in both\n * modes. Omit it to render the plain `<a href>` exactly as before — non-routed\n * consumers are byte-for-byte unaffected. A per-item `onClick` (a\n * click-interceptor shim) is the lighter alternative when you don't want to\n * thread a router `<Link>`.\n */\n renderLink?: MarketplaceRenderLink;\n /** The signed-in user shown in the account menu. */\n user: MarketplaceAppUser;\n /** Consumer-localised chrome labels owned by the shell. */\n labels: MarketplaceAppShellLabels;\n /** Fires when the user picks \"Sign out\". Wire to `useAlfadocsAuth().signOut`. */\n onSignOut?: () => void;\n /** Fires when the user toggles fullscreen. Omit to hide the fullscreen item. */\n onToggleFullscreen?: () => void;\n /**\n * Force the sidebar into a specific mode. Leave it undefined and the shell\n * uses the menu-button drawer below `md` by itself, and the user's saved\n * mode (expanded unless they collapsed it) above.\n */\n sidebarState?: SidebarMode;\n /**\n * Render a collapse/expand toggle in the sidebar header, letting the user\n * shrink the standalone sidebar (the flat `nav` or your `sidebarContent`)\n * to an icon rail. The chosen mode persists\n * per-user (the underlying `Sidebar` stores it) and survives reloads. Opt-in\n * so existing consumers are unaffected; ignored when `sidebarState` forces a\n * mode or in the `'embedded'` variant (no sidebar). @default false\n */\n collapsibleSidebar?: boolean;\n /** Override the accessible name of the `<main>` landmark. */\n mainAriaLabel?: string;\n /**\n * Chrome variant. `'standalone'` (default) renders the full shell — branded\n * Header, Sidebar, and account menu. `'embedded'` is for apps running INSIDE\n * the AlfaDocs platform iframe (consumers detect this with\n * `window !== window.top`): it drops the Header, Sidebar, account menu, and\n * product lockup — the platform already brands and identifies the session\n * around the iframe — and renders the `nav` items as a single slim top tab\n * strip. `onSignOut`, `onToggleFullscreen`, `productName`, `productHref`,\n * `sidebarState`, `sidebarContent` and `sidebarHeader` are ignored in\n * `'embedded'`; the `<main>` landmark, `mainAriaLabel`, the skip link and\n * `endSidebar` are kept.\n */\n variant?: 'standalone' | 'embedded';\n /** Inline-end panel (e.g. a `ControlRoomRail`) forwarded to `AppFrame` in both variants.\n * Hidden below `md`: keep it mounted and add `AliaPopout` there. In `'embedded'` it\n * pins the tab strip and scrolls `<main>` beside it; omitted, embedded is unchanged. */\n endSidebar?: ReactNode;\n /** The narrowest `<main>` may get, px, passed to `AppFrame` in both\n * variants: an open `endSidebar` panel shows over the content instead. */\n minMainWidth?: number;\n /** Children render inside the main content region. */\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Internals */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\nfunction AccountMenu({\n user,\n labels,\n onSignOut,\n onToggleFullscreen,\n}: {\n user: MarketplaceAppUser;\n labels: MarketplaceAppShellLabels;\n onSignOut?: () => void;\n onToggleFullscreen?: () => void;\n}) {\n const { t } = useTranslation('ui');\n // Default to the translated `ui.*` label so a consumer that wires\n // `onToggleFullscreen` but omits the label still gets a localised item.\n const fullscreenLabel =\n labels.fullscreen ?? t('marketplaceAppShell.settings.fullscreen');\n return (\n // Non-modal: an account menu shouldn't inert/aria-hide the whole shell\n // behind it (which leaves the still-focusable chrome inside an\n // aria-hidden region — an `aria-hidden-focus` violation).\n <DropdownMenu.Root modal={false}>\n <DropdownMenu.Trigger asChild>\n {/* Bare avatar circle — matches the main app shell's account\n trigger. The name lives inside the menu, not beside the avatar. */}\n <button\n type=\"button\"\n aria-label={labels.accountMenu}\n data-testid=\"marketplace-account-trigger\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0 ds:size-10 ds:rounded-[var(--radius-full)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]\"\n >\n <span aria-hidden=\"true\">\n <Avatar name={user.name} src={user.avatarSrc} size=\"md\" />\n </span>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\" collisionPadding={16}>\n {/* GitHub-style identity header — small avatar + name + secondary\n line, matching the main app shell's account menu. */}\n <DropdownMenu.Label>\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span aria-hidden=\"true\">\n <Avatar name={user.name} src={user.avatarSrc} size=\"sm\" />\n </span>\n <span className=\"ds:flex ds:flex-col ds:min-w-0\">\n <span className=\"type-label ds:text-[color:var(--foreground)] ds:truncate\">\n {user.name}\n </span>\n {user.email ? (\n <span className=\"type-meta ds:truncate\">{user.email}</span>\n ) : null}\n </span>\n </span>\n </DropdownMenu.Label>\n {onToggleFullscreen ? (\n <>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<Maximize2 aria-hidden />}\n onSelect={onToggleFullscreen}\n data-testid=\"marketplace-fullscreen\"\n >\n {fullscreenLabel}\n </DropdownMenu.Item>\n </>\n ) : null}\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<LogOut aria-hidden />}\n onSelect={onSignOut}\n data-testid=\"marketplace-sign-out\"\n >\n {labels.signOut}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\nfunction MarketplaceSidebarNav({\n nav,\n renderLink,\n}: {\n nav: MarketplaceNavItem[];\n renderLink?: MarketplaceRenderLink;\n}) {\n return (\n <SidebarBody>\n {nav.map((item) => {\n const badge =\n typeof item.badgeCount === 'number' && item.badgeCount > 0\n ? item.badgeCount\n : undefined;\n const inner = (\n <>\n {item.icon ? <SidebarItemIcon>{item.icon}</SidebarItemIcon> : null}\n <SidebarItemLabel>{item.label}</SidebarItemLabel>\n {badge !== undefined ? (\n <SidebarItemBadge>{formatBadgeCount(badge)}</SidebarItemBadge>\n ) : null}\n </>\n );\n\n // Consumer-router mode: render the item through Radix `Slot`\n // (`SidebarItem asChild`) so the consumer's `<Link>` takes over the\n // anchor while keeping the kit's item styling + `aria-current=\"page\"`.\n // Clicking routes client-side — no full-page reload.\n if (renderLink) {\n return (\n <SidebarItem key={item.id} asChild isActive={item.isActive}>\n {renderLink({\n href: item.href,\n children: inner,\n 'aria-current': item.isActive ? 'page' : undefined,\n })}\n </SidebarItem>\n );\n }\n\n // Default: plain anchor — byte-identical to before when no per-item\n // `onClick` is supplied (it's omitted entirely, not passed as\n // undefined, so the rendered `<a>` is unchanged).\n return (\n <SidebarItem\n key={item.id}\n href={item.href}\n aria-label={item.label}\n isActive={item.isActive}\n {...(item.onClick ? { onClick: item.onClick } : {})}\n >\n {inner}\n </SidebarItem>\n );\n })}\n </SidebarBody>\n );\n}\n\n// The tool row: the collapse trigger, the sections toggle, then the host's\n// actions; the drawer ends it with the close button. The rail stacks it.\n// One tree in every mode, so the collapse trigger keeps focus.\nconst sidebarHeaderStackVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n {\n variants: {\n mode: {\n expanded: 'ds:min-w-0 ds:flex-1',\n icon: 'ds:items-center',\n overlay: 'ds:min-w-0 ds:flex-1',\n },\n },\n defaultVariants: { mode: 'expanded' },\n },\n);\nconst sidebarHeaderRowVariants = cva(\n // Wraps rather than push a tool off the edge at the accessible size. Empty\n // when the sections toggle, alone in it, finds no section.\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:empty:hidden',\n {\n variants: {\n mode: {\n expanded: '',\n icon: 'ds:flex-col',\n overlay: 'ds:justify-end',\n },\n },\n defaultVariants: { mode: 'expanded' },\n },\n);\n\nconst hasNode = (node: ReactNode) =>\n node !== undefined && node !== null && typeof node !== 'boolean';\n\nfunction MarketplaceSidebarHeader({\n collapseTrigger,\n sectionsToggle,\n actions,\n content,\n}: {\n collapseTrigger: boolean;\n sectionsToggle: boolean;\n actions: ReactNode;\n content: ReactNode;\n}) {\n const { mode } = useSidebar();\n const hasActions = hasNode(actions);\n const overlay = mode === 'overlay';\n // SidebarCollapseTrigger renders nothing in the overlay, so skip it there.\n const showTrigger = collapseTrigger && !overlay;\n const showContent = hasNode(content) && mode !== 'icon';\n const showRow = showTrigger || sectionsToggle || hasActions || overlay;\n if (!showRow && !showContent) return null;\n return (\n // With nothing below it, an empty row hides the whole band too.\n <SidebarHeader\n className={\n showContent\n ? undefined\n : 'ds:has-[[data-sidebar-header-row]:empty]:hidden'\n }\n >\n <div className={sidebarHeaderStackVariants({ mode })}>\n {showRow ? (\n <div\n data-sidebar-header-row=\"\"\n className={sidebarHeaderRowVariants({ mode })}\n >\n {showTrigger ? <SidebarCollapseTrigger /> : null}\n {sectionsToggle ? <SidebarSectionsToggle /> : null}\n {hasActions ? actions : null}\n {overlay ? <SidebarCloseTrigger /> : null}\n </div>\n ) : null}\n {showContent ? content : null}\n </div>\n </SidebarHeader>\n );\n}\n\n/* CVA for the chrome variant — drives the `<main>` surface; the structural\n header/sidebar-vs-tab-strip difference is conditional in the render.\n\n The `standalone` `<main>` gets its content inset from AppFrame's own\n `mainVariants({ padded: true })` (`--spacing-md` on every logical side), so\n this variant only carries the canvas colour there. The `embedded` `<main>`\n is a plain element (no AppFrame), so it has to supply its own inset:\n `--spacing-md` inline + block-end to match the standalone inset, and a\n larger `--spacing-lg` block-start so content clears the floating tab strip's\n pill instead of butting up against it. All logical — RTL mirrors for free. */\nconst EMBEDDED_CONTENT_INSET = [\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:pt-[var(--spacing-lg)] ds:pb-[var(--spacing-md)]',\n].join(' ');\n\nconst shellMainVariants = cva('ds:bg-[color:var(--app-shell-background)]', {\n variants: {\n variant: {\n standalone: '',\n embedded: `ds:flex-1 ${EMBEDDED_CONTENT_INSET}`,\n },\n },\n defaultVariants: { variant: 'standalone' },\n});\n\n// Embedded with an end panel: the strip sits in AppFrame's header slot, so it\n// carries the shell canvas itself rather than AppFrame's `--background`.\nconst EMBEDDED_DOCKED_CHROME =\n 'ds:shrink-0 ds:bg-[color:var(--app-shell-background)]';\n\n/**\n * Embedded chrome: the slim floating tab strip (no Header / Sidebar / account\n * menu) for apps running inside the AlfaDocs platform iframe. It's the shared\n * {@link TabBar} fed the shell's nav items — the platform brands and identifies\n * the session around the iframe, so the strip is the only chrome. The\n * `MarketplaceNavItem` shape is structurally a `TabBarItem`, so the nav passes\n * straight through.\n */\nfunction EmbeddedTabStrip({\n nav,\n ariaLabel,\n renderLink,\n}: {\n nav: MarketplaceNavItem[];\n ariaLabel: string;\n renderLink?: MarketplaceRenderLink;\n}) {\n // Adapt the shell's `renderLink` to TabBar's `renderLink` signature — TabBar\n // also offers the per-item `onClick`, but in consumer-router mode the\n // `<Link>` owns navigation (matching the standalone sidebar), so we forward\n // only `href` / `className` / `children` / `aria-current`. With `renderLink`\n // omitted, TabBar renders its own plain `<a href>` exactly as before, and a\n // per-item `onClick` rides through `nav` → `TabBarItem` untouched.\n const tabRenderLink = renderLink\n ? ({\n href,\n className,\n children,\n 'aria-current': ariaCurrent,\n 'data-tab-id': tabId,\n }: {\n href: string;\n className: string;\n children: ReactNode;\n 'aria-current'?: 'page';\n 'data-tab-id'?: string;\n }) =>\n renderLink({\n href,\n className,\n children,\n 'aria-current': ariaCurrent,\n // Forward the agent DOM hook — without it a consumer-router tab is\n // invisible to `[data-tab-id]` lookups (PRS §26 §6).\n 'data-tab-id': tabId,\n })\n : undefined;\n\n return (\n <TabBar\n items={nav}\n ariaLabel={ariaLabel}\n {...(tabRenderLink ? { renderLink: tabRenderLink } : {})}\n />\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* MarketplaceAppShell */\n/* ------------------------------------------------------------------ */\n\nexport const MarketplaceAppShell = forwardRef<\n HTMLDivElement,\n MarketplaceAppShellProps\n>(\n (\n {\n productName,\n productHref = '/',\n nav,\n renderLink,\n user,\n labels,\n onSignOut,\n onToggleFullscreen,\n sidebarState,\n collapsibleSidebar = false,\n sidebarContent,\n sidebarHeader,\n sidebarActions,\n sidebarSectionsToggle = false,\n onSetAllSidebarSectionsOpen,\n onMoveSidebarItem,\n mainAriaLabel,\n variant = 'standalone',\n endSidebar,\n minMainWidth,\n children,\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n\n // The brand lockup as a consumer-router link: when `renderLink` is\n // supplied, the brand anchor routes client-side too (no session flash when\n // jumping home). The maker lockup's \"<productName> by Alfadocs\" supplies\n // the link's accessible name, matching the default `HeaderBrand` anchor.\n const headerBrand = renderLink ? (\n <HeaderBrand asChild>\n {renderLink({\n href: productHref,\n children: (\n <ProductLockup\n name={productName}\n size=\"md\"\n monochrome\n variant=\"maker\"\n />\n ),\n })}\n </HeaderBrand>\n ) : (\n <HeaderBrand\n href={productHref}\n logo={\n <ProductLockup\n name={productName}\n size=\"md\"\n monochrome\n variant=\"maker\"\n />\n }\n />\n );\n\n // Only wrap in a nested ThemeRoot when the user has an\n // explicit theme/accessibility override, so we don't clobber the consuming\n // app's (or Storybook's) outer theme cascade.\n const { theme: themePref, accessibility, resolvedTheme } = useTheme();\n const hasExplicitOverride =\n themePref !== 'system' || accessibility !== 'system';\n const themeBase = resolvedTheme.startsWith('dark') ? 'dark' : 'light';\n const themeAccessible = resolvedTheme.endsWith('-accessible');\n\n // Below `md` AppFrame hides the docked sidebar and HeaderMenuButton\n // shows, so the shell switches to the drawer there by itself. An explicit\n // `sidebarState` wins; above `md` the user's saved mode stays.\n const isPhone = useMediaQuery(PHONE_QUERY);\n const effectiveSidebarState =\n sidebarState ?? (isPhone ? ('overlay' as const) : undefined);\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const closeSidebar = useCallback(() => setSidebarOpen(false), []);\n\n // Leaving the drawer (a phone turned to landscape past `md`) shuts it,\n // so it never reopens, taking focus, on the way back.\n useEffect(() => {\n if (effectiveSidebarState !== 'overlay') setSidebarOpen(false);\n }, [effectiveSidebarState]);\n\n // The drawer closes when the route changes, however the host changed it:\n // the URL, or the item marked current. No router needed. The flat `nav`\n // says which item that is; custom content is read from the open drawer.\n const sidebarRef = useRef<HTMLElement>(null);\n const routeRef = useRef<{\n open: boolean;\n url: string;\n current: string | null;\n } | null>(null);\n const navCurrent =\n sidebarContent === undefined\n ? (nav.find((item) => item.isActive)?.id ?? '')\n : undefined;\n useIsomorphicLayoutEffect(() => {\n const url = window.location.href;\n let current: string | null = navCurrent ?? null;\n if (navCurrent === undefined && sidebarRef.current) {\n const node = sidebarRef.current.querySelector('[aria-current=\"page\"]');\n current = node?.getAttribute('href') ?? node?.textContent ?? '';\n }\n const previous = routeRef.current;\n routeRef.current = { open: sidebarOpen, url, current };\n if (!previous?.open || !sidebarOpen) return;\n // A side not read (the drawer's portal mounts a commit late) says\n // nothing about the route, so only two real readings are compared.\n const changedItem =\n previous.current !== null &&\n current !== null &&\n previous.current !== current;\n if (previous.url !== url || changedItem) setSidebarOpen(false);\n });\n useEffect(() => {\n if (!sidebarOpen) return undefined;\n window.addEventListener('popstate', closeSidebar);\n window.addEventListener('hashchange', closeSidebar);\n return () => {\n window.removeEventListener('popstate', closeSidebar);\n window.removeEventListener('hashchange', closeSidebar);\n };\n }, [sidebarOpen, closeSidebar]);\n\n const shell = (\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n mainClassName={shellMainVariants({ variant: 'standalone' })}\n header={\n <Header>\n <HeaderStart>\n <HeaderSkipLink href=\"#main-content\" />\n <HeaderMenuButton onMenuOpen={() => setSidebarOpen(true)} />\n {headerBrand}\n </HeaderStart>\n <HeaderCenter />\n <HeaderEnd>\n <HeaderSettings size=\"sm\" />\n <AccountMenu\n user={user}\n labels={labels}\n onSignOut={onSignOut}\n onToggleFullscreen={onToggleFullscreen}\n />\n </HeaderEnd>\n </Header>\n }\n sidebar={\n <Sidebar\n ref={sidebarRef}\n {...(effectiveSidebarState !== undefined\n ? { state: effectiveSidebarState }\n : { defaultState: 'expanded' as const })}\n open={sidebarOpen}\n onOpenChange={setSidebarOpen}\n onMoveItem={onMoveSidebarItem}\n onSetAllSectionsOpen={onSetAllSidebarSectionsOpen}\n // A link tapped in the phone drawer navigates, so the drawer\n // closes, whether the link is the flat nav's or the host's.\n onClick={(event) => {\n if (\n event.target instanceof Element &&\n event.target.closest('a[href]')\n ) {\n closeSidebar();\n }\n }}\n aria-label={t('navigation.sidebar.label')}\n data-testid=\"marketplace-app-shell-sidebar\"\n >\n {/* So does a pick that navigates without a link, such as a\n SearchBar result. */}\n <NavigationDismissContext.Provider value={closeSidebar}>\n <MarketplaceSidebarHeader\n collapseTrigger={\n collapsibleSidebar && effectiveSidebarState === undefined\n }\n sectionsToggle={sidebarSectionsToggle}\n actions={sidebarActions}\n content={sidebarHeader}\n />\n {sidebarContent !== undefined ? (\n <SidebarBody>{sidebarContent}</SidebarBody>\n ) : (\n <MarketplaceSidebarNav nav={nav} renderLink={renderLink} />\n )}\n </NavigationDismissContext.Provider>\n </Sidebar>\n }\n endSidebar={endSidebar}\n minMainWidth={minMainWidth}\n >\n {children}\n </AppFrame>\n </TooltipProvider>\n );\n\n const embeddedChrome = (\n <>\n <HeaderSkipLink href=\"#main-content\" />\n <EmbeddedTabStrip\n nav={nav}\n ariaLabel={t('navigation.sidebar.label')}\n renderLink={renderLink}\n />\n </>\n );\n\n // An end panel needs a height-bounded row to dock in, which AppFrame owns.\n // The inset moves inside its scroll area, so `<main>` reads as it does\n // without the panel. No sidebar: the tab strip stays the only nav.\n const embeddedDocked = (\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n mainClassName={shellMainVariants({ variant: 'standalone' })}\n padded={false}\n header={\n <div className={EMBEDDED_DOCKED_CHROME}>{embeddedChrome}</div>\n }\n sidebar={null}\n endSidebar={endSidebar}\n minMainWidth={minMainWidth}\n >\n <div className={EMBEDDED_CONTENT_INSET}>{children}</div>\n </AppFrame>\n </TooltipProvider>\n );\n\n const embedded = (\n // The shell owns the warm-grey canvas; TabBar's strip is transparent and\n // floats its pill on it, and `<main>` continues the same surface.\n <div className=\"ds:flex ds:min-h-dvh ds:flex-col ds:bg-[color:var(--app-shell-background)]\">\n {embeddedChrome}\n <main\n id=\"main-content\"\n tabIndex={-1}\n aria-label={\n mainAriaLabel ?? t('navigation.main.label', 'Main content')\n }\n className={shellMainVariants({ variant: 'embedded' })}\n >\n {children}\n </main>\n </div>\n );\n\n const content =\n variant === 'embedded' ? (endSidebar ? embeddedDocked : embedded) : shell;\n\n if (!hasExplicitOverride) {\n return (\n <div\n ref={ref}\n className=\"ds:contents\"\n data-component=\"marketplace-app-shell\"\n >\n {content}\n </div>\n );\n }\n\n return (\n <ThemeRoot\n ref={ref}\n theme={themeBase}\n accessible={themeAccessible}\n className=\"ds:contents\"\n data-component=\"marketplace-app-shell\"\n >\n {content}\n </ThemeRoot>\n );\n },\n);\n\nMarketplaceAppShell.displayName = 'MarketplaceAppShell';\n\n/* ------------------------------------------------------------------ */\n/* ConnectWithAlfadocs */\n/* ------------------------------------------------------------------ */\n\nexport type ConnectStatus = 'idle' | 'connecting' | 'error';\n\nexport interface ConnectWithAlfadocsProps {\n /** Product name shown next to the wordmark at the top of the card. */\n productName: string;\n /** Heading, e.g. \"Connect your AlfaDocs account\". */\n title: string;\n /** Supporting copy below the heading. */\n description: ReactNode;\n /** The connect button label, e.g. \"Connect with AlfaDocs\". */\n connectLabel: string;\n /** Connection lifecycle. `connecting` shows a loading button; `error` shows the alert. */\n status?: ConnectStatus;\n /** Error message shown (as an alert) when `status === 'error'`. */\n error?: ReactNode;\n /** Fires when the connect button is pressed. Wire to `useAlfadocsAuth().connect`. */\n onConnect?: () => void;\n /** Optional footer content below the button (e.g. a \"what's this?\" link). */\n footer?: ReactNode;\n /**\n * Visual layout. `'card'` (default) is the centred card on the warm-grey\n * canvas — unchanged. `'split'` adds, at `lg:` and up, a two-panel desktop\n * layout: a brand panel on the inline-start and the connect card on the\n * inline-end. Below `lg:`, `'split'` collapses to exactly the card layout —\n * so it falls back gracefully inside iframes / embeds that never reach\n * desktop width. Use `'split'` for full-page desktop logins.\n */\n layout?: 'card' | 'split';\n /**\n * Optional content shown under the lockup in the `'split'` brand panel (a\n * tagline, value props, an illustration). Ignored in `'card'` and below `lg:`.\n */\n brandPanel?: ReactNode;\n className?: string;\n}\n\n/* Split-layout CVAs (lg+ two-panel; collapses to the centred card below lg). */\nconst connectRootVariants = cva(\n 'ds:flex ds:min-h-dvh ds:bg-[color:var(--app-shell-background)]',\n {\n variants: {\n layout: {\n card: '',\n split: 'ds:flex-col ds:lg:flex-row',\n },\n },\n defaultVariants: { layout: 'card' },\n },\n);\n\nconst connectCardWidthVariants = cva('ds:w-full', {\n variants: {\n layout: {\n card: 'ds:max-w-[400px]',\n split: 'ds:max-w-[400px] ds:lg:max-w-[480px]',\n },\n },\n defaultVariants: { layout: 'card' },\n});\n\n// The card's own lockup hides at lg+ in `split` (the brand panel shows it there).\nconst connectCardLockupVariants = cva('', {\n variants: {\n layout: { card: '', split: 'ds:lg:hidden' },\n },\n defaultVariants: { layout: 'card' },\n});\n\n/**\n * The pre-auth \"Connect with AlfaDocs\" screen. Centred white card on the\n * warm-grey canvas with the AlfaDocs wordmark + product name, copy, an error\n * slot, and the primary connect CTA. An opt-in `layout=\"split\"` adds a desktop\n * two-panel brand layout (lg+). Presentational — `onConnect` should call\n * `useAlfadocsAuth().connect()`, which redirects the browser to the server-side\n * BFF that runs the real OAuth2 + PKCE flow.\n */\nexport const ConnectWithAlfadocs = forwardRef<\n HTMLDivElement,\n ConnectWithAlfadocsProps\n>(\n (\n {\n productName,\n title,\n description,\n connectLabel,\n status = 'idle',\n error,\n onConnect,\n footer,\n layout = 'card',\n brandPanel,\n className,\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n data-component=\"connect-with-alfadocs\"\n className={`${connectRootVariants({ layout })} ${className ?? ''}`}\n >\n {layout === 'split' ? (\n // Desktop brand panel (lg+ only): a bold `--primary` surface with the\n // monochrome lockup riding the `--primary-foreground` ink, plus an\n // optional `brandPanel` slot. Decorative — the card carries the real\n // heading + CTA, and shows its own lockup below `lg:`.\n <div className=\"ds:hidden ds:lg:flex ds:lg:w-[55%] ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:ps-[var(--spacing-2xl)] ds:pe-[var(--spacing-2xl)] ds:pt-[var(--spacing-2xl)] ds:pb-[var(--spacing-2xl)] ds:text-start\">\n <ProductLockup\n name={productName}\n size=\"lg\"\n monochrome\n tone=\"inherit\"\n variant=\"maker\"\n />\n {brandPanel ? (\n <div className=\"type-body ds:max-w-[28rem] ds:text-start\">\n {brandPanel}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className=\"ds:flex ds:flex-1 ds:items-center ds:justify-center ds:p-[var(--spacing-lg)]\">\n <Card className={connectCardWidthVariants({ layout })}>\n <Card.Body className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center\">\n <ProductLockup\n name={productName}\n size=\"lg\"\n variant=\"maker\"\n className={connectCardLockupVariants({ layout })}\n />\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <h1 className=\"type-title-card\">{title}</h1>\n <p className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {description}\n </p>\n </div>\n {status === 'error' && error ? (\n <Alert variant=\"error\" className=\"ds:w-full ds:text-start\">\n {error}\n </Alert>\n ) : null}\n <SignInWithAlfadocsButton\n intent=\"primary\"\n className=\"ds:w-full\"\n loading={status === 'connecting'}\n onClick={onConnect}\n label={connectLabel}\n data-testid=\"connect-with-alfadocs-button\"\n />\n {footer ? (\n <div className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {footer}\n </div>\n ) : null}\n </Card.Body>\n </Card>\n </div>\n </div>\n );\n },\n);\n\nConnectWithAlfadocs.displayName = 'ConnectWithAlfadocs';\n"],"names":["lockup","cva","productName","makerRoot","ProductLockup","forwardRef","name","variant","monochrome","tone","size","className","props","ref","t","useTranslation","inherit","markInk","nameInk","byInk","letteringInk","jsxs","jsx","AlfadocsLogoMark","Trans","AlfadocsLogoNeg","Logo","PHONE_QUERY","formatBadgeCount","count","AccountMenu","user","labels","onSignOut","onToggleFullscreen","fullscreenLabel","DropdownMenu","Avatar","Fragment","Maximize2","LogOut","MarketplaceSidebarNav","nav","renderLink","SidebarBody","item","badge","inner","SidebarItemIcon","SidebarItemLabel","SidebarItemBadge","SidebarItem","sidebarHeaderStackVariants","sidebarHeaderRowVariants","hasNode","node","MarketplaceSidebarHeader","collapseTrigger","sectionsToggle","actions","content","mode","useSidebar","hasActions","overlay","showTrigger","showContent","showRow","SidebarHeader","SidebarCollapseTrigger","SidebarSectionsToggle","SidebarCloseTrigger","EMBEDDED_CONTENT_INSET","shellMainVariants","EMBEDDED_DOCKED_CHROME","EmbeddedTabStrip","ariaLabel","tabRenderLink","href","children","ariaCurrent","tabId","TabBar","MarketplaceAppShell","productHref","sidebarState","collapsibleSidebar","sidebarContent","sidebarHeader","sidebarActions","sidebarSectionsToggle","onSetAllSidebarSectionsOpen","onMoveSidebarItem","mainAriaLabel","endSidebar","minMainWidth","headerBrand","HeaderBrand","themePref","accessibility","resolvedTheme","useTheme","hasExplicitOverride","themeBase","themeAccessible","isPhone","useMediaQuery","effectiveSidebarState","sidebarOpen","setSidebarOpen","useState","closeSidebar","useCallback","useEffect","sidebarRef","useRef","routeRef","navCurrent","_a","useIsomorphicLayoutEffect","url","current","previous","changedItem","shell","TooltipProvider","AppFrame","Header","HeaderStart","HeaderSkipLink","HeaderMenuButton","HeaderCenter","HeaderEnd","HeaderSettings","Sidebar","event","NavigationDismissContext","embeddedChrome","embeddedDocked","embedded","ThemeRoot","connectRootVariants","connectCardWidthVariants","connectCardLockupVariants","ConnectWithAlfadocs","title","description","connectLabel","status","error","onConnect","footer","layout","brandPanel","Card","Alert","SignInWithAlfadocsButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,KAASC,EAAI,2DAA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../../src/brand/product-lockup/product-lockup.tsx","../../src/patterns/marketplace-app-shell/marketplace-app-shell.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { Logo } from '../../components/logo/logo';\nimport { AlfadocsLogoMark, AlfadocsLogoNeg } from '../logo-asset';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\n// Outer lockup row. ~4px logical gap between the wordmark and the product\n// name (`--spacing-xs`), centre-aligned so the name's cap height sits\n// against the wordmark's letterforms.\nconst lockup = cva('ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]');\n\n// The product name. Marketing serif (Fraunces, `--font-serif`) — permitted\n// here because this file lives under `src/brand/`, never in `src/components/`\n// or `src/patterns/` (constraint 10). Sized to ~95% of the wordmark height so\n// its cap height matches the logo letterforms across every size and theme\n// (the `--logo-size-*` tokens shift up in the accessible themes; the calc\n// keeps the name proportional for free).\nconst productName = cva(\n [\n 'ds:[font-family:var(--font-serif)]',\n 'ds:font-semibold',\n 'ds:leading-none',\n 'ds:tracking-[0.01em]',\n 'ds:whitespace-nowrap',\n // Forced-colors: drop the transparent text-fill and paint the label\n // as solid CanvasText so it never disappears under Windows HCM —\n // a gradient/transparent fill has no meaning there.\n 'ds:forced-colors:text-[CanvasText]',\n 'ds:forced-colors:[-webkit-text-fill-color:CanvasText]',\n ],\n {\n variants: {\n size: {\n sm: 'ds:text-[calc(var(--logo-size-sm)*0.95)]',\n md: 'ds:text-[calc(var(--logo-size-md)*0.95)]',\n lg: 'ds:text-[calc(var(--logo-size-lg)*0.95)]',\n xl: 'ds:text-[calc(var(--logo-size-xl)*0.95)]',\n },\n tone: {\n // Brand gradient filled into the glyphs via background-clip:text.\n // `--gradient-wordmark` rides the theme aliases, so it stays\n // AA-safe and adapts per theme on its own (and flattens to a solid\n // ink in the accessible / forced-colors blocks — see tokens).\n gradient: [\n 'ds:italic',\n 'ds:bg-[image:var(--gradient-wordmark)]',\n 'ds:bg-clip-text',\n 'ds:text-transparent',\n 'ds:[-webkit-text-fill-color:transparent]',\n ],\n // Monochrome: solid currentColor ink, upright, no gradient — for\n // print, single-colour work, and coloured chrome (e.g. app-shell\n // headers) where the lockup must ride the surrounding ink.\n solid: 'ds:text-current',\n },\n },\n defaultVariants: { size: 'md', tone: 'gradient' },\n },\n);\n\n// Maker lockup root. Sets a single `--lockup-unit` custom property to the\n// matching `--logo-size-*` token; every maker sub-element (mark, name, the\n// \"by Alfadocs\" tag) sizes off `var(--lockup-unit)`, so there's one per-size\n// source of truth that shifts up with the accessible themes for free.\n// `whitespace-nowrap` keeps \"[mark] Name by Alfadocs\" on one line.\nconst makerRoot = cva('ds:whitespace-nowrap', {\n variants: {\n size: {\n sm: 'ds:[--lockup-unit:var(--logo-size-sm)]',\n md: 'ds:[--lockup-unit:var(--logo-size-md)]',\n lg: 'ds:[--lockup-unit:var(--logo-size-lg)]',\n xl: 'ds:[--lockup-unit:var(--logo-size-xl)]',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\ntype LockupSize = NonNullable<VariantProps<typeof productName>['size']>;\n\nexport type ProductLockupProps = {\n /**\n * The product name. Passed verbatim (product names are not translated).\n *\n * - `variant=\"standard\"` (default): renders as \"Alfadocs <name>\" with the\n * wordmark; accessible name is `Alfadocs <name>`.\n * - `variant=\"maker\"`: renders as \"[mark] <name> by Alfadocs\"; accessible\n * name is `<name> by Alfadocs`.\n */\n name: string;\n /**\n * Which lockup composition to use.\n *\n * - `'standard'` (default) — Alfadocs wordmark + product name (\"Alfadocs\n * Builders\"). Use for **internal** Alfadocs products (Alfadocs Builders,\n * Alfadocs API) where the product is part of the Alfadocs family.\n * - `'maker'` — \"<name> by Alfadocs\" with the four-pillar mark and the name\n * as the prominent element. Use for **external** marketplace extensions\n * (\"Scribe by Alfadocs\") where the extension's own name leads and\n * \"by Alfadocs\" is the maker attribution.\n */\n variant?: 'standard' | 'maker';\n /**\n * Render the name as a solid `--foreground` ink, upright (no gradient, no\n * italic), and pair it with the monochrome wordmark. Use for print,\n * single-colour reproductions, or any constrained context where the\n * gradient/serif treatment is inappropriate.\n */\n monochrome?: boolean;\n /**\n * Ink resolution. `'auto'` (default) uses the lockup's intended ink\n * (`--foreground` for monochrome). `'inherit'` makes the whole lockup ride\n * `currentColor` — use it with `monochrome` on a coloured brand surface (a\n * tinted header or split-login panel) so the wordmark + name both take the\n * surface's text colour rather than clashing with a fixed `--foreground`.\n */\n tone?: 'auto' | 'inherit';\n /** Lockup size. Drives both the wordmark and the name's cap height. */\n size?: LockupSize;\n className?: string;\n} & Omit<\n ComponentPropsWithoutRef<'span'>,\n 'role' | 'aria-label' | 'aria-hidden' | 'children' | 'className'\n>;\n\n/* ------------------------------------------------------------------ */\n/* ProductLockup */\n/* ------------------------------------------------------------------ */\n\n/**\n * Pairs a product name with the Alfadocs brand. Two compositions:\n *\n * - `variant=\"standard\"` (default) — the Alfadocs wordmark + product name\n * (\"Alfadocs Builders\"). For internal Alfadocs products. Exposed to\n * assistive tech as a single `img` named `Alfadocs <name>`.\n * - `variant=\"maker\"` — \"[mark] <name> by Alfadocs\". For external marketplace\n * extensions where the extension's name leads. Exposed as a single `img`\n * named `<name> by Alfadocs`.\n *\n * In both cases the inner wordmark/mark and the visible name are decorative so\n * the brand isn't announced twice. Every marketplace app should use this\n * rather than hand-rolling a wordmark + typed span.\n */\nexport const ProductLockup = forwardRef<HTMLSpanElement, ProductLockupProps>(\n (\n {\n name,\n variant = 'standard',\n monochrome = false,\n tone = 'auto',\n size = 'md',\n className,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n if (import.meta.env.DEV && !name.trim()) {\n console.warn(\n '[ProductLockup] `name` is empty — the lockup will render the bare wordmark with no product name. Pass the product name (e.g. \"Builders\").',\n );\n }\n\n if (variant === 'maker') {\n // Ink matrix mirrors the standard variant's tone/monochrome model:\n // - tone=\"inherit\": every element rides currentColor (no explicit ink),\n // for coloured surfaces.\n // - monochrome (tone auto): foreground ink, with the attribution muted.\n // - default (colour, tone auto): the name + mark take --primary; the\n // wordmark lettering stays --foreground; the attribution is muted.\n const inherit = tone === 'inherit';\n const markInk = inherit\n ? ''\n : monochrome\n ? 'ds:text-[color:var(--foreground)]'\n : 'ds:text-[color:var(--primary)]';\n const nameInk = inherit\n ? ''\n : monochrome\n ? 'ds:text-[color:var(--foreground)]'\n : 'ds:text-[color:var(--primary)]';\n const byInk = inherit ? '' : 'ds:text-[color:var(--muted-foreground)]';\n const letteringInk = inherit ? '' : 'ds:text-[color:var(--foreground)]';\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={t('productLockup.makerLabel', { name: name.trim() })}\n className={makerRoot({ size, className })}\n data-component=\"product-lockup\"\n {...props}\n >\n {/* Pillar mark sized close to the app name (≈0.88 of the serif em),\n vertically centred on it. Inline (not flex) so the maker tag can\n use vertical-align. */}\n <AlfadocsLogoMark\n aria-hidden\n className={`ds:inline-block ds:align-middle ds:me-[var(--spacing-sm)] ds:h-[calc(var(--lockup-unit)*0.88)] ds:w-auto ds:forced-colors:text-[CanvasText] ${markInk}`}\n />\n <span\n aria-hidden\n className={`ds:align-middle ds:[font-family:var(--font-serif)] ds:font-semibold ds:italic ds:leading-none ds:tracking-[0.01em] ${nameInk} ds:text-[calc(var(--lockup-unit)*0.95)]`}\n >\n {name}\n </span>\n {/* Maker tag — superscript style, its top aligned to the app name's\n cap-height via vertical-align: text-top. */}\n <span\n aria-hidden\n className={`ds:align-text-top ds:ms-[var(--spacing-sm)] ds:inline-flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ${byInk}`}\n >\n <Trans\n ns=\"ui\"\n t={t}\n i18nKey=\"productLockup.attribution\"\n components={{\n text: (\n <span className=\"ds:text-[calc(var(--lockup-unit)*0.4)] ds:leading-none\" />\n ),\n brand: (\n <AlfadocsLogoNeg\n aria-hidden\n viewBox=\"168 0 637 125\"\n className={`ds:h-[calc(var(--lockup-unit)*0.45)] ds:w-auto ds:forced-colors:text-[CanvasText] ${letteringInk}`}\n />\n ),\n }}\n />\n </span>\n </span>\n );\n }\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={`Alfadocs ${name}`.trim()}\n className={lockup({ className })}\n data-component=\"product-lockup\"\n {...props}\n >\n <Logo\n variant={monochrome ? 'monochrome' : 'wordmark'}\n tone={tone}\n size={size}\n decorative\n />\n <span\n aria-hidden\n className={productName({\n size,\n tone: monochrome ? 'solid' : 'gradient',\n })}\n >\n {name}\n </span>\n </span>\n );\n },\n);\nProductLockup.displayName = 'ProductLockup';\n","/**\n * Marketplace App Shell — the standard chrome for an app built on top of\n * AlfaDocs (the kind a partner scaffolds with Claude Code, Lovable, etc.).\n *\n * It is a thin, opinionated composition of kit primitives: an `AppFrame` with\n * a branded `Header` (the maker `ProductLockup` — \"<Product> by Alfadocs\" —\n * rendered `monochrome` so it rides the header's ink; maker is the lockup\n * style for external marketplace extensions), a `Sidebar` for app\n * navigation, `HeaderSettings` (theme/locale/accessibility), and a bare-avatar\n * account menu (fullscreen + sign-out) matching the main app shell. An\n * optional `endSidebar` docks a tool rail (for example Alia) on the inline-end.\n * `sidebarContent`, `sidebarHeader` and `sidebarActions` let the host build\n * the sidebar from the kit's Sidebar parts instead of the flat `nav`.\n * `ConnectWithAlfadocs` is the matching pre-auth screen, with the full-colour\n * maker lockup and `SignInWithAlfadocsButton`.\n *\n * Like `AliaSidebar`, this pattern ships a RUNTIME component (surfaced via\n * `src/patterns/index.ts` and the library bundle) because consuming apps mount\n * it in production rather than copying the source.\n *\n * Auth is intentionally decoupled: the shell takes the signed-in `user` and an\n * `onSignOut` callback as props, and `ConnectWithAlfadocs` takes a `status` +\n * `onConnect`. Wire them to `@alfadocs/auth/react`'s `useAlfadocsAuth()` in the\n * consuming app — the kit never touches OAuth or secrets (those live in the\n * server-side `@alfadocs/auth` BFF).\n *\n * All user-visible copy is consumer-provided (props) so each app localises in\n * its own i18n; the only kit-owned strings reuse existing translated `ui.*`\n * keys (sidebar label, skip link, menu button).\n */\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { LogOut, Maximize2 } from 'lucide-react';\n\nimport { AppFrame } from '../../components/app-frame';\nimport { Avatar } from '../../components/avatar';\nimport { Alert } from '../../components/alert';\nimport { Card } from '../../components/card';\nimport { DropdownMenu } from '../../components/dropdown-menu';\nimport { TabBar } from '../../components/tab-bar';\nimport {\n Header,\n HeaderBrand,\n HeaderCenter,\n HeaderEnd,\n HeaderMenuButton,\n HeaderSkipLink,\n HeaderStart,\n} from '../../components/header';\nimport { HeaderSettings } from '../../components/header-settings';\nimport { ProductLockup } from '../../brand/product-lockup';\nimport { SignInWithAlfadocsButton } from '../../components/sign-in-with-alfadocs-button';\nimport {\n Sidebar,\n SidebarBody,\n SidebarCloseTrigger,\n SidebarCollapseTrigger,\n SidebarHeader,\n SidebarItem,\n SidebarItemBadge,\n SidebarItemIcon,\n SidebarItemLabel,\n SidebarSectionsToggle,\n useSidebar,\n type SidebarItemMove,\n type SidebarMode,\n} from '../../components/sidebar';\nimport { NavigationDismissContext } from '../../components/_shared/navigation-dismiss';\nimport { ThemeRoot } from '../../components/theme-root';\nimport { TooltipProvider } from '../../components/tooltip';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useMediaQuery } from '../../hooks/use-media-query';\n\n// Below AppFrame's `md` (768px, --breakpoint-md), where it hides the rail.\nconst PHONE_QUERY = '(max-width: 767.98px)';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* ------------------------------------------------------------------ */\n\nexport interface MarketplaceNavItem {\n id: string;\n /** Pre-translated label — apps localise their own nav copy. */\n label: string;\n href: string;\n /** Optional leading icon (a lucide-react element or equivalent). */\n icon?: ReactNode;\n /** Optional unseen-item count rendered as a pill badge. */\n badgeCount?: number;\n /** Mark the item as the current page (`aria-current='page'`). */\n isActive?: boolean;\n /**\n * Optional click handler threaded onto the nav link's `<a>`. The lightweight\n * alternative to `renderLink`: intercept a same-origin click (call\n * `event.preventDefault()`) and route client-side without a full page load —\n * no router `<Link>` needed. Applies to both the standalone sidebar item and\n * the embedded tab. When `renderLink` is supplied it's handed through to the\n * consumer's link element instead.\n */\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n}\n\n/**\n * Props the shell hands to `renderLink` for each nav item. The consumer returns\n * their router's `<Link to={href}>` carrying the same `className` (the kit's\n * active styling) and `aria-current` (`'page'` on the active item) so a tab /\n * sidebar-item click is a client-side route change, not a full page reload.\n */\nexport interface MarketplaceRenderLinkProps {\n /** The item's destination — feed it to your router's `to` / `href`. */\n href: string;\n /** The kit's classes — apply verbatim to the link element. */\n className?: string;\n /** Icon + label + badge — render as the link's children. */\n children: ReactNode;\n /** `'page'` on the active item, otherwise omitted — forward to the link. */\n 'aria-current'?: 'page';\n /**\n * The item's stable id, as the agent / automation DOM hook. Spread it onto\n * your router link so the item stays addressable by `[data-tab-id]` — see\n * PRS §26 §6. Only supplied on the bottom-tab-bar path.\n */\n 'data-tab-id'?: string;\n}\n\n/**\n * Render a nav item through the consumer's router instead of the kit's own\n * `<a>`. Returned by the consumer; the shell forwards `href`, the kit's\n * `className`, the item children, and `aria-current` so the active styling and\n * the `aria-current=\"page\"` marker survive a client-side route change.\n */\nexport type MarketplaceRenderLink = (\n props: MarketplaceRenderLinkProps,\n) => ReactNode;\n\nexport interface MarketplaceAppUser {\n /** Display name — drives the avatar initials + the account-menu header. */\n name: string;\n /** Optional email shown under the name in the account menu. */\n email?: string;\n /** Optional avatar image URL. */\n avatarSrc?: string;\n}\n\nexport interface MarketplaceAppShellLabels {\n /** Accessible name for the account-menu trigger, e.g. \"Account menu\". */\n accountMenu: string;\n /** The sign-out menu item, e.g. \"Sign out\". */\n signOut: string;\n /**\n * Optional fullscreen menu item label, e.g. \"Toggle fullscreen\". The item\n * renders whenever `onToggleFullscreen` is supplied; when this label is\n * omitted it falls back to the translated `ui.*` \"Toggle fullscreen\" string.\n */\n fullscreen?: string;\n}\n\nexport interface MarketplaceAppShellProps {\n /** Extension name — renders as the maker lockup \"<productName> by Alfadocs\". */\n productName: string;\n /** Link target for the brand lockup. Default `'/'`. */\n productHref?: string;\n /**\n * Nav items, in order. Standalone ignores them when `sidebarContent` is set;\n * the embedded tab strip always uses them. Never-embedded apps can pass `[]`.\n */\n nav: MarketplaceNavItem[];\n /**\n * Standalone sidebar body built from the kit's Sidebar parts. When set, even\n * to `null`, it replaces the flat `nav` in every mode, inside the shell's own\n * `SidebarBody` and `<nav>`. Ignored in `'embedded'`.\n */\n sidebarContent?: ReactNode;\n /**\n * Extra standalone sidebar header content, such as an inline `SearchBar`,\n * below the collapse trigger and any `sidebarActions`. Hidden in the icon\n * rail. Ignored in `'embedded'`.\n */\n sidebarHeader?: ReactNode;\n /**\n * Header tools, usually `SidebarHeaderAction`s, in the collapse trigger's\n * row after it (and after the sections toggle), above `sidebarHeader`.\n * Stacked under the expand button in the icon rail; beside the close\n * button in the phone overlay. Ignored in `'embedded'`.\n */\n sidebarActions?: ReactNode;\n /**\n * Adds `SidebarSectionsToggle` to that row, right after the collapse\n * trigger: it folds or unfolds every section in `sidebarContent`, and hides\n * itself while there are none. @default false\n */\n sidebarSectionsToggle?: boolean;\n /**\n * One call when the sections toggle folds or unfolds every section, with\n * their `sectionId`s, in place of each section's `onOpenChange`; see\n * `Sidebar`'s `onSetAllSectionsOpen`.\n */\n onSetAllSidebarSectionsOpen?: (open: boolean, sectionIds: string[]) => void;\n /**\n * Lets users move `sidebarContent` items between sections, by drag and drop\n * or keyboard; see `Sidebar`'s `onMoveItem`. Apply each move and re-render.\n * Off when omitted, in the icon rail, and in `'embedded'`.\n */\n onMoveSidebarItem?: (move: SidebarItemMove) => void;\n /**\n * Render nav items (and the brand lockup) through the consumer's router so a\n * tab / item click is a client-side route change with **no full-page reload\n * or session flash**. Wire it to your router's `<Link>`:\n *\n * ```tsx\n * import { Link } from '@tanstack/react-router';\n * <MarketplaceAppShell\n * nav={nav}\n * renderLink={({ href, className, children, ...rest }) => (\n * <Link to={href} className={className} {...rest}>{children}</Link>\n * )}\n * />\n * ```\n *\n * Threaded to the standalone sidebar items, the embedded top tab strip, and\n * the brand lockup. The kit forwards the same `className` + `aria-current` so\n * the active styling and the `aria-current=\"page\"` marker survive in both\n * modes. Omit it to render the plain `<a href>` exactly as before — non-routed\n * consumers are byte-for-byte unaffected. A per-item `onClick` (a\n * click-interceptor shim) is the lighter alternative when you don't want to\n * thread a router `<Link>`.\n */\n renderLink?: MarketplaceRenderLink;\n /** The signed-in user shown in the account menu. */\n user: MarketplaceAppUser;\n /** Consumer-localised chrome labels owned by the shell. */\n labels: MarketplaceAppShellLabels;\n /** Fires when the user picks \"Sign out\". Wire to `useAlfadocsAuth().signOut`. */\n onSignOut?: () => void;\n /** Fires when the user toggles fullscreen. Omit to hide the fullscreen item. */\n onToggleFullscreen?: () => void;\n /**\n * Force the sidebar into a specific mode. Leave it undefined and the shell\n * uses the menu-button drawer below `md` by itself, and the user's saved\n * mode (expanded unless they collapsed it) above.\n */\n sidebarState?: SidebarMode;\n /**\n * Render a collapse/expand toggle in the sidebar header, letting the user\n * shrink the standalone sidebar (the flat `nav` or your `sidebarContent`)\n * to an icon rail. The chosen mode persists\n * per-user (the underlying `Sidebar` stores it) and survives reloads. Opt-in\n * so existing consumers are unaffected; ignored when `sidebarState` forces a\n * mode or in the `'embedded'` variant (no sidebar). @default false\n */\n collapsibleSidebar?: boolean;\n /** Override the accessible name of the `<main>` landmark. */\n mainAriaLabel?: string;\n /**\n * Chrome variant. `'standalone'` (default) renders the full shell — branded\n * Header, Sidebar, and account menu. `'embedded'` is for apps running INSIDE\n * the AlfaDocs platform iframe (consumers detect this with\n * `window !== window.top`): it drops the Header, Sidebar, account menu, and\n * product lockup — the platform already brands and identifies the session\n * around the iframe — and renders the `nav` items as a single slim top tab\n * strip. `onSignOut`, `onToggleFullscreen`, `productName`, `productHref`,\n * `sidebarState`, `sidebarContent` and `sidebarHeader` are ignored in\n * `'embedded'`; the `<main>` landmark, `mainAriaLabel`, the skip link and\n * `endSidebar` are kept.\n */\n variant?: 'standalone' | 'embedded';\n /** Inline-end panel (e.g. a `ControlRoomRail`) forwarded to `AppFrame` in both variants.\n * Hidden below `md`: keep it mounted and add `AliaPopout` there. In `'embedded'` it\n * pins the tab strip and scrolls `<main>` beside it; omitted, embedded is unchanged. */\n endSidebar?: ReactNode;\n /** The narrowest `<main>` may get, px, passed to `AppFrame` in both\n * variants: an open `endSidebar` panel shows over the content instead. */\n minMainWidth?: number;\n /** Children render inside the main content region. */\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Internals */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\nfunction AccountMenu({\n user,\n labels,\n onSignOut,\n onToggleFullscreen,\n}: {\n user: MarketplaceAppUser;\n labels: MarketplaceAppShellLabels;\n onSignOut?: () => void;\n onToggleFullscreen?: () => void;\n}) {\n const { t } = useTranslation('ui');\n // Default to the translated `ui.*` label so a consumer that wires\n // `onToggleFullscreen` but omits the label still gets a localised item.\n const fullscreenLabel =\n labels.fullscreen ?? t('marketplaceAppShell.settings.fullscreen');\n return (\n // Non-modal: an account menu shouldn't inert/aria-hide the whole shell\n // behind it (which leaves the still-focusable chrome inside an\n // aria-hidden region — an `aria-hidden-focus` violation).\n <DropdownMenu.Root modal={false}>\n <DropdownMenu.Trigger asChild>\n {/* Bare avatar circle — matches the main app shell's account\n trigger. The name lives inside the menu, not beside the avatar. */}\n <button\n type=\"button\"\n aria-label={labels.accountMenu}\n data-testid=\"marketplace-account-trigger\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0 ds:size-10 ds:rounded-[var(--radius-full)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]\"\n >\n <span aria-hidden=\"true\">\n <Avatar name={user.name} src={user.avatarSrc} size=\"md\" />\n </span>\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\" collisionPadding={16}>\n {/* GitHub-style identity header — small avatar + name + secondary\n line, matching the main app shell's account menu. */}\n <DropdownMenu.Label>\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span aria-hidden=\"true\">\n <Avatar name={user.name} src={user.avatarSrc} size=\"sm\" />\n </span>\n <span className=\"ds:flex ds:flex-col ds:min-w-0\">\n <span className=\"type-label ds:text-[color:var(--foreground)] ds:truncate\">\n {user.name}\n </span>\n {user.email ? (\n <span className=\"type-meta ds:truncate\">{user.email}</span>\n ) : null}\n </span>\n </span>\n </DropdownMenu.Label>\n {onToggleFullscreen ? (\n <>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<Maximize2 aria-hidden />}\n onSelect={onToggleFullscreen}\n data-testid=\"marketplace-fullscreen\"\n >\n {fullscreenLabel}\n </DropdownMenu.Item>\n </>\n ) : null}\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<LogOut aria-hidden />}\n onSelect={onSignOut}\n data-testid=\"marketplace-sign-out\"\n >\n {labels.signOut}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\nfunction MarketplaceSidebarNav({\n nav,\n renderLink,\n}: {\n nav: MarketplaceNavItem[];\n renderLink?: MarketplaceRenderLink;\n}) {\n return (\n <SidebarBody>\n {nav.map((item) => {\n const badge =\n typeof item.badgeCount === 'number' && item.badgeCount > 0\n ? item.badgeCount\n : undefined;\n const inner = (\n <>\n {item.icon ? <SidebarItemIcon>{item.icon}</SidebarItemIcon> : null}\n <SidebarItemLabel>{item.label}</SidebarItemLabel>\n {badge !== undefined ? (\n <SidebarItemBadge>{formatBadgeCount(badge)}</SidebarItemBadge>\n ) : null}\n </>\n );\n\n // Consumer-router mode: render the item through Radix `Slot`\n // (`SidebarItem asChild`) so the consumer's `<Link>` takes over the\n // anchor while keeping the kit's item styling + `aria-current=\"page\"`.\n // Clicking routes client-side — no full-page reload.\n if (renderLink) {\n return (\n <SidebarItem key={item.id} asChild isActive={item.isActive}>\n {renderLink({\n href: item.href,\n children: inner,\n 'aria-current': item.isActive ? 'page' : undefined,\n })}\n </SidebarItem>\n );\n }\n\n // Default: plain anchor — byte-identical to before when no per-item\n // `onClick` is supplied (it's omitted entirely, not passed as\n // undefined, so the rendered `<a>` is unchanged).\n return (\n <SidebarItem\n key={item.id}\n href={item.href}\n aria-label={item.label}\n isActive={item.isActive}\n {...(item.onClick ? { onClick: item.onClick } : {})}\n >\n {inner}\n </SidebarItem>\n );\n })}\n </SidebarBody>\n );\n}\n\n// The tool row: the collapse trigger, the sections toggle, then the host's\n// actions; the drawer ends it with the close button. The rail stacks it.\n// One tree in every mode, so the collapse trigger keeps focus.\nconst sidebarHeaderStackVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n {\n variants: {\n mode: {\n expanded: 'ds:min-w-0 ds:flex-1',\n icon: 'ds:items-center',\n overlay: 'ds:min-w-0 ds:flex-1',\n },\n },\n defaultVariants: { mode: 'expanded' },\n },\n);\nconst sidebarHeaderRowVariants = cva(\n // Wraps rather than push a tool off the edge at the accessible size. Empty\n // when the sections toggle, alone in it, finds no section.\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:empty:hidden',\n {\n variants: {\n mode: {\n expanded: '',\n icon: 'ds:flex-col',\n overlay: 'ds:justify-end',\n },\n },\n defaultVariants: { mode: 'expanded' },\n },\n);\n\nconst hasNode = (node: ReactNode) =>\n node !== undefined && node !== null && typeof node !== 'boolean';\n\nfunction MarketplaceSidebarHeader({\n collapseTrigger,\n sectionsToggle,\n actions,\n content,\n}: {\n collapseTrigger: boolean;\n sectionsToggle: boolean;\n actions: ReactNode;\n content: ReactNode;\n}) {\n const { mode } = useSidebar();\n const hasActions = hasNode(actions);\n const overlay = mode === 'overlay';\n // SidebarCollapseTrigger renders nothing in the overlay, so skip it there.\n const showTrigger = collapseTrigger && !overlay;\n const showContent = hasNode(content) && mode !== 'icon';\n const showRow = showTrigger || sectionsToggle || hasActions || overlay;\n if (!showRow && !showContent) return null;\n return (\n // With nothing below it, an empty row hides the whole band too.\n <SidebarHeader\n className={\n showContent\n ? undefined\n : 'ds:has-[[data-sidebar-header-row]:empty]:hidden'\n }\n >\n <div className={sidebarHeaderStackVariants({ mode })}>\n {showRow ? (\n <div\n data-sidebar-header-row=\"\"\n className={sidebarHeaderRowVariants({ mode })}\n >\n {showTrigger ? <SidebarCollapseTrigger /> : null}\n {sectionsToggle ? <SidebarSectionsToggle /> : null}\n {hasActions ? actions : null}\n {overlay ? <SidebarCloseTrigger /> : null}\n </div>\n ) : null}\n {showContent ? content : null}\n </div>\n </SidebarHeader>\n );\n}\n\n/* CVA for the chrome variant — drives the `<main>` surface; the structural\n header/sidebar-vs-tab-strip difference is conditional in the render.\n\n The `standalone` `<main>` gets its content inset from AppFrame's own\n `mainVariants({ padded: true })` (`--spacing-md` on every logical side), so\n this variant only carries the canvas colour there. The `embedded` `<main>`\n is a plain element (no AppFrame), so it has to supply its own inset:\n `--spacing-md` inline + block-end to match the standalone inset, and a\n larger `--spacing-lg` block-start so content clears the floating tab strip's\n pill instead of butting up against it. All logical — RTL mirrors for free. */\nconst EMBEDDED_CONTENT_INSET = [\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:pt-[var(--spacing-lg)] ds:pb-[var(--spacing-md)]',\n].join(' ');\n\nconst shellMainVariants = cva('ds:bg-[color:var(--app-shell-background)]', {\n variants: {\n variant: {\n standalone: '',\n embedded: `ds:flex-1 ${EMBEDDED_CONTENT_INSET}`,\n },\n },\n defaultVariants: { variant: 'standalone' },\n});\n\n// Embedded with an end panel: the strip sits in AppFrame's header slot, so it\n// carries the shell canvas itself rather than AppFrame's `--background`.\nconst EMBEDDED_DOCKED_CHROME =\n 'ds:shrink-0 ds:bg-[color:var(--app-shell-background)]';\n\n/**\n * Embedded chrome: the slim floating tab strip (no Header / Sidebar / account\n * menu) for apps running inside the AlfaDocs platform iframe. It's the shared\n * {@link TabBar} fed the shell's nav items — the platform brands and identifies\n * the session around the iframe, so the strip is the only chrome. The\n * `MarketplaceNavItem` shape is structurally a `TabBarItem`, so the nav passes\n * straight through.\n */\nfunction EmbeddedTabStrip({\n nav,\n ariaLabel,\n renderLink,\n}: {\n nav: MarketplaceNavItem[];\n ariaLabel: string;\n renderLink?: MarketplaceRenderLink;\n}) {\n // Adapt the shell's `renderLink` to TabBar's `renderLink` signature — TabBar\n // also offers the per-item `onClick`, but in consumer-router mode the\n // `<Link>` owns navigation (matching the standalone sidebar), so we forward\n // only `href` / `className` / `children` / `aria-current`. With `renderLink`\n // omitted, TabBar renders its own plain `<a href>` exactly as before, and a\n // per-item `onClick` rides through `nav` → `TabBarItem` untouched.\n const tabRenderLink = renderLink\n ? ({\n href,\n className,\n children,\n 'aria-current': ariaCurrent,\n 'data-tab-id': tabId,\n }: {\n href: string;\n className: string;\n children: ReactNode;\n 'aria-current'?: 'page';\n 'data-tab-id'?: string;\n }) =>\n renderLink({\n href,\n className,\n children,\n 'aria-current': ariaCurrent,\n // Forward the agent DOM hook — without it a consumer-router tab is\n // invisible to `[data-tab-id]` lookups (PRS §26 §6).\n 'data-tab-id': tabId,\n })\n : undefined;\n\n return (\n <TabBar\n items={nav}\n ariaLabel={ariaLabel}\n {...(tabRenderLink ? { renderLink: tabRenderLink } : {})}\n />\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* MarketplaceAppShell */\n/* ------------------------------------------------------------------ */\n\nexport const MarketplaceAppShell = forwardRef<\n HTMLDivElement,\n MarketplaceAppShellProps\n>(\n (\n {\n productName,\n productHref = '/',\n nav,\n renderLink,\n user,\n labels,\n onSignOut,\n onToggleFullscreen,\n sidebarState,\n collapsibleSidebar = false,\n sidebarContent,\n sidebarHeader,\n sidebarActions,\n sidebarSectionsToggle = false,\n onSetAllSidebarSectionsOpen,\n onMoveSidebarItem,\n mainAriaLabel,\n variant = 'standalone',\n endSidebar,\n minMainWidth,\n children,\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n\n // The brand lockup as a consumer-router link: when `renderLink` is\n // supplied, the brand anchor routes client-side too (no session flash when\n // jumping home). The maker lockup's \"<productName> by Alfadocs\" supplies\n // the link's accessible name, matching the default `HeaderBrand` anchor.\n const headerBrand = renderLink ? (\n <HeaderBrand asChild>\n {renderLink({\n href: productHref,\n children: (\n <ProductLockup\n name={productName}\n size=\"md\"\n monochrome\n variant=\"maker\"\n />\n ),\n })}\n </HeaderBrand>\n ) : (\n <HeaderBrand\n href={productHref}\n logo={\n <ProductLockup\n name={productName}\n size=\"md\"\n monochrome\n variant=\"maker\"\n />\n }\n />\n );\n\n // Only wrap in a nested ThemeRoot when the user has an\n // explicit theme/accessibility override, so we don't clobber the consuming\n // app's (or Storybook's) outer theme cascade.\n const { theme: themePref, accessibility, resolvedTheme } = useTheme();\n const hasExplicitOverride =\n themePref !== 'system' || accessibility !== 'system';\n const themeBase = resolvedTheme.startsWith('dark') ? 'dark' : 'light';\n const themeAccessible = resolvedTheme.endsWith('-accessible');\n\n // Below `md` AppFrame hides the docked sidebar and HeaderMenuButton\n // shows, so the shell switches to the drawer there by itself. An explicit\n // `sidebarState` wins; above `md` the user's saved mode stays.\n const isPhone = useMediaQuery(PHONE_QUERY);\n const effectiveSidebarState =\n sidebarState ?? (isPhone ? ('overlay' as const) : undefined);\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const closeSidebar = useCallback(() => setSidebarOpen(false), []);\n\n // Leaving the drawer (a phone turned to landscape past `md`) shuts it,\n // so it never reopens, taking focus, on the way back.\n useEffect(() => {\n if (effectiveSidebarState !== 'overlay') setSidebarOpen(false);\n }, [effectiveSidebarState]);\n\n // The drawer closes when the route changes, however the host changed it:\n // the URL, or the item marked current. No router needed. The flat `nav`\n // says which item that is; custom content is read from the open drawer.\n const sidebarRef = useRef<HTMLElement>(null);\n const routeRef = useRef<{\n open: boolean;\n url: string;\n current: string | null;\n } | null>(null);\n const navCurrent =\n sidebarContent === undefined\n ? (nav.find((item) => item.isActive)?.id ?? '')\n : undefined;\n useIsomorphicLayoutEffect(() => {\n const url = window.location.href;\n let current: string | null = navCurrent ?? null;\n if (navCurrent === undefined && sidebarRef.current) {\n const node = sidebarRef.current.querySelector('[aria-current=\"page\"]');\n current = node?.getAttribute('href') ?? node?.textContent ?? '';\n }\n const previous = routeRef.current;\n routeRef.current = { open: sidebarOpen, url, current };\n if (!previous?.open || !sidebarOpen) return;\n // A side not read (the drawer's portal mounts a commit late) says\n // nothing about the route, so only two real readings are compared.\n const changedItem =\n previous.current !== null &&\n current !== null &&\n previous.current !== current;\n if (previous.url !== url || changedItem) setSidebarOpen(false);\n });\n useEffect(() => {\n if (!sidebarOpen) return undefined;\n window.addEventListener('popstate', closeSidebar);\n window.addEventListener('hashchange', closeSidebar);\n return () => {\n window.removeEventListener('popstate', closeSidebar);\n window.removeEventListener('hashchange', closeSidebar);\n };\n }, [sidebarOpen, closeSidebar]);\n\n const shell = (\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n mainClassName={shellMainVariants({ variant: 'standalone' })}\n header={\n <Header>\n <HeaderStart>\n <HeaderSkipLink href=\"#main-content\" />\n <HeaderMenuButton onMenuOpen={() => setSidebarOpen(true)} />\n {headerBrand}\n </HeaderStart>\n <HeaderCenter />\n <HeaderEnd>\n <HeaderSettings size=\"sm\" />\n <AccountMenu\n user={user}\n labels={labels}\n onSignOut={onSignOut}\n onToggleFullscreen={onToggleFullscreen}\n />\n </HeaderEnd>\n </Header>\n }\n sidebar={\n <Sidebar\n ref={sidebarRef}\n {...(effectiveSidebarState !== undefined\n ? { state: effectiveSidebarState }\n : { defaultState: 'expanded' as const })}\n open={sidebarOpen}\n onOpenChange={setSidebarOpen}\n onMoveItem={onMoveSidebarItem}\n onSetAllSectionsOpen={onSetAllSidebarSectionsOpen}\n // A link tapped in the phone drawer navigates, so the drawer\n // closes, whether the link is the flat nav's or the host's.\n onClick={(event) => {\n if (\n event.target instanceof Element &&\n event.target.closest('a[href]')\n ) {\n closeSidebar();\n }\n }}\n aria-label={t('navigation.sidebar.label')}\n data-testid=\"marketplace-app-shell-sidebar\"\n >\n {/* So does a pick that navigates without a link, such as a\n SearchBar result. */}\n <NavigationDismissContext.Provider value={closeSidebar}>\n <MarketplaceSidebarHeader\n collapseTrigger={\n collapsibleSidebar && effectiveSidebarState === undefined\n }\n sectionsToggle={sidebarSectionsToggle}\n actions={sidebarActions}\n content={sidebarHeader}\n />\n {sidebarContent !== undefined ? (\n <SidebarBody>{sidebarContent}</SidebarBody>\n ) : (\n <MarketplaceSidebarNav nav={nav} renderLink={renderLink} />\n )}\n </NavigationDismissContext.Provider>\n </Sidebar>\n }\n endSidebar={endSidebar}\n minMainWidth={minMainWidth}\n >\n {children}\n </AppFrame>\n </TooltipProvider>\n );\n\n const embeddedChrome = (\n <>\n <HeaderSkipLink href=\"#main-content\" />\n <EmbeddedTabStrip\n nav={nav}\n ariaLabel={t('navigation.sidebar.label')}\n renderLink={renderLink}\n />\n </>\n );\n\n // An end panel needs a height-bounded row to dock in, which AppFrame owns.\n // The inset moves inside its scroll area, so `<main>` reads as it does\n // without the panel. No sidebar: the tab strip stays the only nav.\n const embeddedDocked = (\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n mainClassName={shellMainVariants({ variant: 'standalone' })}\n padded={false}\n header={\n <div className={EMBEDDED_DOCKED_CHROME}>{embeddedChrome}</div>\n }\n sidebar={null}\n endSidebar={endSidebar}\n minMainWidth={minMainWidth}\n >\n <div className={EMBEDDED_CONTENT_INSET}>{children}</div>\n </AppFrame>\n </TooltipProvider>\n );\n\n const embedded = (\n // The shell owns the warm-grey canvas; TabBar's strip is transparent and\n // floats its pill on it, and `<main>` continues the same surface.\n <div className=\"ds:flex ds:min-h-dvh ds:flex-col ds:bg-[color:var(--app-shell-background)]\">\n {embeddedChrome}\n <main\n id=\"main-content\"\n tabIndex={-1}\n aria-label={\n mainAriaLabel ?? t('navigation.main.label', 'Main content')\n }\n className={shellMainVariants({ variant: 'embedded' })}\n >\n {children}\n </main>\n </div>\n );\n\n const content =\n variant === 'embedded' ? (endSidebar ? embeddedDocked : embedded) : shell;\n\n if (!hasExplicitOverride) {\n return (\n <div\n ref={ref}\n className=\"ds:contents\"\n data-component=\"marketplace-app-shell\"\n >\n {content}\n </div>\n );\n }\n\n return (\n <ThemeRoot\n ref={ref}\n theme={themeBase}\n accessible={themeAccessible}\n className=\"ds:contents\"\n data-component=\"marketplace-app-shell\"\n >\n {content}\n </ThemeRoot>\n );\n },\n);\n\nMarketplaceAppShell.displayName = 'MarketplaceAppShell';\n\n/* ------------------------------------------------------------------ */\n/* ConnectWithAlfadocs */\n/* ------------------------------------------------------------------ */\n\nexport type ConnectStatus = 'idle' | 'connecting' | 'error';\n\nexport interface ConnectWithAlfadocsProps {\n /** Product name shown next to the wordmark at the top of the card. */\n productName: string;\n /** Heading, e.g. \"Connect your AlfaDocs account\". */\n title: string;\n /** Supporting copy below the heading. */\n description: ReactNode;\n /** The connect button label, e.g. \"Connect with AlfaDocs\". */\n connectLabel: string;\n /** Connection lifecycle. `connecting` shows a loading button; `error` shows the alert. */\n status?: ConnectStatus;\n /** Error message shown (as an alert) when `status === 'error'`. */\n error?: ReactNode;\n /** Fires when the connect button is pressed. Wire to `useAlfadocsAuth().connect`. */\n onConnect?: () => void;\n /** Optional footer content below the button (e.g. a \"what's this?\" link). */\n footer?: ReactNode;\n /**\n * Visual layout. `'card'` (default) is the centred card on the warm-grey\n * canvas — unchanged. `'split'` adds, at `lg:` and up, a two-panel desktop\n * layout: a brand panel on the inline-start and the connect card on the\n * inline-end. Below `lg:`, `'split'` collapses to exactly the card layout —\n * so it falls back gracefully inside iframes / embeds that never reach\n * desktop width. Use `'split'` for full-page desktop logins.\n */\n layout?: 'card' | 'split';\n /**\n * Optional content shown under the lockup in the `'split'` brand panel (a\n * tagline, value props, an illustration). Ignored in `'card'` and below `lg:`.\n */\n brandPanel?: ReactNode;\n className?: string;\n}\n\n/* Split-layout CVAs (lg+ two-panel; collapses to the centred card below lg). */\nconst connectRootVariants = cva(\n 'ds:flex ds:min-h-dvh ds:bg-[color:var(--app-shell-background)]',\n {\n variants: {\n layout: {\n card: '',\n split: 'ds:flex-col ds:lg:flex-row',\n },\n },\n defaultVariants: { layout: 'card' },\n },\n);\n\nconst connectCardWidthVariants = cva('ds:w-full', {\n variants: {\n layout: {\n card: 'ds:max-w-[400px]',\n split: 'ds:max-w-[400px] ds:lg:max-w-[480px]',\n },\n },\n defaultVariants: { layout: 'card' },\n});\n\n// The card's own lockup hides at lg+ in `split` (the brand panel shows it there).\nconst connectCardLockupVariants = cva('', {\n variants: {\n layout: { card: '', split: 'ds:lg:hidden' },\n },\n defaultVariants: { layout: 'card' },\n});\n\n/**\n * The pre-auth \"Connect with AlfaDocs\" screen. Centred white card on the\n * warm-grey canvas with the AlfaDocs wordmark + product name, copy, an error\n * slot, and the primary connect CTA. An opt-in `layout=\"split\"` adds a desktop\n * two-panel brand layout (lg+). Presentational — `onConnect` should call\n * `useAlfadocsAuth().connect()`, which redirects the browser to the server-side\n * BFF that runs the real OAuth2 + PKCE flow.\n */\nexport const ConnectWithAlfadocs = forwardRef<\n HTMLDivElement,\n ConnectWithAlfadocsProps\n>(\n (\n {\n productName,\n title,\n description,\n connectLabel,\n status = 'idle',\n error,\n onConnect,\n footer,\n layout = 'card',\n brandPanel,\n className,\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n data-component=\"connect-with-alfadocs\"\n className={`${connectRootVariants({ layout })} ${className ?? ''}`}\n >\n {layout === 'split' ? (\n // Desktop brand panel (lg+ only): a bold `--primary` surface with the\n // monochrome lockup riding the `--primary-foreground` ink, plus an\n // optional `brandPanel` slot. Decorative — the card carries the real\n // heading + CTA, and shows its own lockup below `lg:`.\n <div className=\"ds:hidden ds:lg:flex ds:lg:w-[55%] ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-lg)] ds:bg-[color:var(--primary)] ds:text-[color:var(--primary-foreground)] ds:ps-[var(--spacing-2xl)] ds:pe-[var(--spacing-2xl)] ds:pt-[var(--spacing-2xl)] ds:pb-[var(--spacing-2xl)] ds:text-start\">\n <ProductLockup\n name={productName}\n size=\"lg\"\n monochrome\n tone=\"inherit\"\n variant=\"maker\"\n />\n {brandPanel ? (\n <div className=\"type-body ds:max-w-[28rem] ds:text-start\">\n {brandPanel}\n </div>\n ) : null}\n </div>\n ) : null}\n <div className=\"ds:flex ds:flex-1 ds:items-center ds:justify-center ds:p-[var(--spacing-lg)]\">\n <Card className={connectCardWidthVariants({ layout })}>\n <Card.Body className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center\">\n <ProductLockup\n name={productName}\n size=\"lg\"\n variant=\"maker\"\n className={connectCardLockupVariants({ layout })}\n />\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <h1 className=\"type-title-card\">{title}</h1>\n <p className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {description}\n </p>\n </div>\n {status === 'error' && error ? (\n <Alert variant=\"error\" className=\"ds:w-full ds:text-start\">\n {error}\n </Alert>\n ) : null}\n <SignInWithAlfadocsButton\n intent=\"primary\"\n className=\"ds:w-full\"\n loading={status === 'connecting'}\n onClick={onConnect}\n label={connectLabel}\n data-testid=\"connect-with-alfadocs-button\"\n />\n {footer ? (\n <div className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {footer}\n </div>\n ) : null}\n </Card.Body>\n </Card>\n </div>\n </div>\n );\n },\n);\n\nConnectWithAlfadocs.displayName = 'ConnectWithAlfadocs';\n"],"names":["lockup","cva","productName","makerRoot","ProductLockup","forwardRef","name","variant","monochrome","tone","size","className","props","ref","t","useTranslation","inherit","markInk","nameInk","byInk","letteringInk","jsxs","jsx","AlfadocsLogoMark","Trans","AlfadocsLogoNeg","Logo","PHONE_QUERY","formatBadgeCount","count","AccountMenu","user","labels","onSignOut","onToggleFullscreen","fullscreenLabel","DropdownMenu","Avatar","Fragment","Maximize2","LogOut","MarketplaceSidebarNav","nav","renderLink","SidebarBody","item","badge","inner","SidebarItemIcon","SidebarItemLabel","SidebarItemBadge","SidebarItem","sidebarHeaderStackVariants","sidebarHeaderRowVariants","hasNode","node","MarketplaceSidebarHeader","collapseTrigger","sectionsToggle","actions","content","mode","useSidebar","hasActions","overlay","showTrigger","showContent","showRow","SidebarHeader","SidebarCollapseTrigger","SidebarSectionsToggle","SidebarCloseTrigger","EMBEDDED_CONTENT_INSET","shellMainVariants","EMBEDDED_DOCKED_CHROME","EmbeddedTabStrip","ariaLabel","tabRenderLink","href","children","ariaCurrent","tabId","TabBar","MarketplaceAppShell","productHref","sidebarState","collapsibleSidebar","sidebarContent","sidebarHeader","sidebarActions","sidebarSectionsToggle","onSetAllSidebarSectionsOpen","onMoveSidebarItem","mainAriaLabel","endSidebar","minMainWidth","headerBrand","HeaderBrand","themePref","accessibility","resolvedTheme","useTheme","hasExplicitOverride","themeBase","themeAccessible","isPhone","useMediaQuery","effectiveSidebarState","sidebarOpen","setSidebarOpen","useState","closeSidebar","useCallback","useEffect","sidebarRef","useRef","routeRef","navCurrent","_a","useIsomorphicLayoutEffect","url","current","previous","changedItem","shell","TooltipProvider","AppFrame","Header","HeaderStart","HeaderSkipLink","HeaderMenuButton","HeaderCenter","HeaderEnd","HeaderSettings","Sidebar","event","NavigationDismissContext","embeddedChrome","embeddedDocked","embedded","ThemeRoot","connectRootVariants","connectCardWidthVariants","connectCardLockupVariants","ConnectWithAlfadocs","title","description","connectLabel","status","error","onConnect","footer","layout","brandPanel","Card","Alert","SignInWithAlfadocsButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,KAASC,EAAI,2DAA2D,GAQxEC,KAAcD;AAAA,EAClB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,QAKJ,UAAU;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA;AAAA;AAAA;AAAA,QAKF,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB,EAAE,MAAM,MAAM,MAAM,WAAA;AAAA,EAAW;AAEpD,GAOME,KAAYF,EAAI,wBAAwB;AAAA,EAC5C,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,KAAA;AAC3B,CAAC,GAuEYG,IAAgBC;AAAA,EAC3B,CACE;AAAA,IACE,MAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,MAAAC,IAAO;AAAA,IACP,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,IAAI;AAOjC,QAAIR,MAAY,SAAS;AAOvB,YAAMS,IAAUP,MAAS,WACnBQ,IAAUD,IACZ,KACAR,IACE,sCACA,kCACAU,IAAU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