import { T as ThBackLinkPref, a as ThAudioPlayerComponent, b as ThPublicationMetadataOrder, c as ThAudioProgressBarVariant, B as BreakpointsMap } from './ui-DnZZhozX.mjs'; import { T as ThThemeKeys, A as ActionKey, a as ThemeTokens, b as AudioContentProtectionConfig, c as ThShortcutsPref, C as CustomizableKeys, D as DefaultKeys, d as ThPreferencesAdapter, e as ThPreferences, W as WeightConfig, V as VariableFontRangeConfig, F as FontCollection } from './ThPreferencesAdapter-B3a-f5v-.mjs'; import { b as ThAudioActionsTokens, c as ThActionsTokens, d as ThCollapsibility, e as ThSheetTypes, f as ThDockingPref, T as ThDockingKeys } from './actions-C33UN3Ji.mjs'; import { d as ThSettingsRangePrefRequired } from './useContrast-Bl08zDTU.mjs'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { ILinkInjectable, IUrlInjectable, IBlobInjectable, ScriptMode } from '@readium/navigator'; declare enum ThAudioActionKeys { toc = "audio.toc", volume = "audio.volume", playbackRate = "audio.playbackRate", sleepTimer = "audio.sleepTimer", remotePlayback = "audio.remotePlayback" } declare enum ThAudioKeys { theme = "theme", volume = "volume", playbackRate = "playbackRate", skipBackwardInterval = "skipBackwardInterval", skipForwardInterval = "skipForwardInterval", skipInterval = "skipInterval", autoPlay = "autoPlay", sleepTimer = "sleepTimer" } declare enum ThSettingsTimerVariant { presetList = "presetList", durationField = "durationField" } type ThSettingsTimerPref = { variant: ThSettingsTimerVariant.presetList; /** Preset durations in minutes, or "endOfResource" to pause at end of track, or "endOfFragment" to pause at end of fragment. */ presets: (number | "endOfResource" | "endOfFragment")[]; } | { variant: ThSettingsTimerVariant.durationField; maxHours?: number; }; type ThAudioSettingsKeys = Exclude; declare const defaultAudioVolume: ThSettingsRangePrefRequired; declare const defaultAudioPlaybackRate: ThSettingsRangePrefRequired; declare const defaultAudioSkipBackwardInterval: ThSettingsRangePrefRequired; declare const defaultAudioSkipForwardInterval: ThSettingsRangePrefRequired; declare const defaultAudioSkipInterval: ThSettingsRangePrefRequired; declare const defaultAudioSleepTimer: ThSettingsTimerPref; declare const defaultAudioSleepTimerPresetList: ThSettingsTimerPref; declare const defaultAudioVolumeAction: ThAudioActionsTokens; declare const defaultAudioPlaybackRateAction: ThAudioActionsTokens; declare const defaultAudioSleepTimerAction: ThAudioActionsTokens; declare const defaultAudioRemotePlaybackAction: ThActionsTokens; declare const defaultAudioTocAction: ThAudioActionsTokens; type AudioCustomizableKeys = { audioAction?: string; audio?: string; theme?: string; }; declare enum ThAudioAffordance { "timeline" = "timeline", "readingOrder" = "readingOrder", "toc" = "toc" } type ThAudioThemeKeys = ThThemeKeys.light | ThThemeKeys.dark; type ThAudioThemeKey = K extends { theme: infer T; } ? T extends string ? ThAudioThemeKeys | T : ThAudioThemeKeys : ThAudioThemeKeys; type AudioDefaultKeys = { audioAction: ThAudioActionKeys; theme: ThAudioThemeKeys; }; type AudioSettingsKey = K extends { audio: infer A; } ? A extends string ? ThAudioKeys | A : ThAudioKeys : ThAudioKeys; type ThAudioSkipIntervalKeys = { [ThAudioKeys.skipInterval]: ThSettingsRangePrefRequired; [ThAudioKeys.skipBackwardInterval]?: never; [ThAudioKeys.skipForwardInterval]?: never; } | { [ThAudioKeys.skipInterval]?: never; [ThAudioKeys.skipBackwardInterval]: ThSettingsRangePrefRequired; [ThAudioKeys.skipForwardInterval]: ThSettingsRangePrefRequired; }; type ThAudioKeyTypes = { [ThAudioKeys.volume]: ThSettingsRangePrefRequired; [ThAudioKeys.playbackRate]: ThSettingsRangePrefRequired; [ThAudioKeys.sleepTimer]: ThSettingsTimerPref; } & ThAudioSkipIntervalKeys & (K extends { audio: infer A; } ? A extends string ? { [key in A]: ThSettingsRangePrefRequired; } : {} : {}); type ThAudioActionKey = K extends { audioAction: infer A; } ? A extends string ? ThAudioActionKeys | A : ThAudioActionKeys : ThAudioActionKeys; /** * Primary zone (media controls bar). Components resolved via the plugin * registry's primaryAudioActions. No ThActionsTokens, no visibility. * Volume and playback rate are primary-only. * * Secondary zone (header collapsible bar). Keys resolved via the plugin * registry's actionsComponentsMap. Visibility applies here (collapse). * Compatible with CollapsiblePref. */ interface ThAudioActionsPref { primary: { displayOrder: Array>; keys: Record; }; secondary: { displayOrder: Array; }> | ThAudioActionKey>; collapse: ThCollapsibility; keys: Record; }; } type ThAudioConstraintKeys = Extract | "cover"; interface ThAudioPreferences { theming: { header?: { backLink?: ThBackLinkPref | null; }; icon: { size: number; tooltipOffset: number; tooltipDelay?: number; }; layout: { compact: { /** Ordered list of player components in the single-column layout. */ order: Array; }; expanded: { /** Components in the inline-start column of the two-column layout. */ start: Array; /** Components in the inline-end column of the two-column layout. */ end: Array; }; publicationMetadata: { /** Ordered list of metadata components (title, subtitle, authors). */ order: ThPublicationMetadataOrder; }; radius: number; spacing: number; progressBar?: { variant?: ThAudioProgressBarVariant; }; defaults: { dockingWidth: number; scrim: string; }; constraints?: { [key in ThAudioConstraintKeys]?: number | null; }; }; breakpoints: BreakpointsMap; themes: { audioOrder: Array | "auto">; systemThemes?: { light: ThAudioThemeKey; dark: ThAudioThemeKey; }; keys: Record, "auto"> & string, ThemeTokens>; }; }; actions: ThAudioActionsPref; settings: { order: Array>; keys: ThAudioKeyTypes; }; contentProtection?: AudioContentProtectionConfig; affordances: { previous: ThAudioAffordance; next: ThAudioAffordance; }; shortcuts: ThShortcutsPref; docking: ThDockingPref; } declare const createAudioPreferences: (params: ThAudioPreferences) => ThAudioPreferences; interface ThAudioPreferencesAdapter { getPreferences(): ThAudioPreferences; setPreferences(prefs: ThAudioPreferences): void; subscribe(callback: (prefs: ThAudioPreferences) => void): void; unsubscribe(callback: (prefs: ThAudioPreferences) => void): void; } type Props = { adapter?: ThPreferencesAdapter; initialPreferences?: ThPreferences; devMode?: boolean; children: React.ReactNode; }; declare function ThPreferencesProvider({ adapter, initialPreferences, devMode, children, }: Props): react_jsx_runtime.JSX.Element; type FontResource = (ILinkInjectable & IUrlInjectable) | (ILinkInjectable & IBlobInjectable); interface InjectableFontResources { allowedDomains: string[]; prepend: FontResource[]; append: FontResource[]; } interface FontMetadata { fontStack: string | null; fontFamily: string | null; weights: WeightConfig | null; widths: VariableFontRangeConfig | null; } declare function usePreferences(): { preferences: ThPreferences; updatePreferences: (prefs: ThPreferences) => void; getFontInjectables: (options?: { language?: string; } | { key?: string; }, optimize?: boolean) => InjectableFontResources | null; getFontsList: (options?: { language?: string; } | { key?: string; }) => FontCollection; getFontMetadata: (fontId: string) => FontMetadata; resolveFontLanguage: (bcp47Tag: string | undefined, scriptMode: ScriptMode) => string; }; export { type AudioDefaultKeys as A, defaultAudioPlaybackRateAction as B, defaultAudioSleepTimerAction as C, defaultAudioRemotePlaybackAction as D, defaultAudioTocAction as E, ThPreferencesProvider as T, type ThAudioPreferences as a, type AudioCustomizableKeys as b, type ThAudioPreferencesAdapter as c, ThAudioAffordance as d, type ThAudioThemeKeys as e, type ThAudioThemeKey as f, type AudioSettingsKey as g, type ThAudioKeyTypes as h, type ThAudioActionKey as i, type ThAudioActionsPref as j, type ThAudioConstraintKeys as k, createAudioPreferences as l, ThAudioActionKeys as m, ThAudioKeys as n, ThSettingsTimerVariant as o, type ThSettingsTimerPref as p, type ThAudioSettingsKeys as q, defaultAudioVolume as r, defaultAudioPlaybackRate as s, defaultAudioSkipBackwardInterval as t, usePreferences as u, defaultAudioSkipForwardInterval as v, defaultAudioSkipInterval as w, defaultAudioSleepTimer as x, defaultAudioSleepTimerPresetList as y, defaultAudioVolumeAction as z };