{"version":3,"sources":["theme-manager.ts"],"sourcesContent":["import { client_type } from \"datex-core-legacy/utils/constants.ts\";\nimport { UIX_COOKIE, getCookie, setCookie } from \"../session/cookies.ts\";\nimport { Logger } from \"datex-core-legacy/utils/logger.ts\";\nimport { getCallerDir } from \"datex-core-legacy/utils/caller_metadata.ts\";\nimport { Path } from \"datex-core-legacy/utils/path.ts\";\nimport { uixLight } from \"../themes/uix-light.ts\";\nimport { uixDark } from \"../themes/uix-dark.ts\";\nimport { uixLightPlain } from \"../themes/uix-light-plain.ts\";\nimport { uixDarkPlain } from \"../themes/uix-dark-plain.ts\";\n\nconst logger = new Logger(\"uix theme\");\n\nexport interface Theme {\n\t/**\n\t * Unique name for the theme\n\t */\n\tname: string,\n\t/**\n\t * Mode of the theme, if not set, the theme is used for both dark and light mode\n\t */\n\tmode?: \"light\" | \"dark\",\n\t/**\n\t * Css variables for the theme\n\t */\n\tvalues?: Record<string, string>,\n\t/**\n\t * List of stylesheets to use when theme is activated\n\t */\n\tstylesheets?: Readonly<(URL|string)[]>,\n\t/**\n\t * Scripts that are executed when theme is activated\n\t */\n\tscripts?: Readonly<(URL|string)[]>,\n\t/**\n\t * Color used as theme-color when the theme is active\n\t */\n\tappColor?: string,\n\t/**\n\t * Called when theme is activated\n\t */\n\tonActivate?: () => void|Promise<void>,\n\t/**\n\t * Called when theme is deactivated\n\t */\n\tonDeactivate?: () => void|Promise<void>\n\t/**\n\t * Called when theme is registered\n\t */\n\tonRegister?: () => void|Promise<void>\n}\n\ntype themeName = \"uix-dark\" | \"uix-dark-plain\" | \"uix-light\" | \"uix-light-plain\" | (string&{});\ntype darkThemeName = \"uix-dark\" | \"uix-dark-plain\" | (string&{});\ntype lightThemeName = \"uix-light\" | \"uix-light-plain\" | (string&{});\n\nclass ThemeManager  {\n\n\t#loadedThemes = new Map<string, Theme>()\n\n\t#values:{[key:string]:string} = {}\n\n\t#auto_mode = true\n\t#current_mode!: \"dark\"|\"light\"\n\t#current_theme!: string\n\t#waiting_theme?: string;\n\n\t#default_light_theme:Theme = uixLight;\n\t#default_dark_theme:Theme = uixDark;\n\n\treadonly #current_theme_style_sheet = new CSSStyleSheet();\n\t#document_stylesheets_added = false;\n\n\t#themeCustomStylesheets = new Map<string, string[]>()\n\n\t#preferredModeIfThemeAvailable?: \"dark\"|\"light\"\n\n\t#global_style_sheet = new CSSStyleSheet();\n\n\t#themesCSS = new Map<string, string>()\n\n\tget stylesheet() {return this.#global_style_sheet}\n\n\tget mode() {return this.#current_mode} // important!: never reference this.mode inside ThemeManager, getter might be overridden\n\tset mode(name: \"dark\"|\"light\") {this.setMode(name)}\n\tget theme() {return this.#current_theme} // important!: never reference this.theme inside ThemeManager, getter might be overridden\n\tset theme(name: string) {this.setTheme(name)}\n\n\tget defaultDarkTheme() {return this.#default_dark_theme.name}\n\tget defaultLightTheme() {return this.#default_light_theme.name}\n\n\tget values() {return this.#values}\n\n\tget auto_mode() {return this.#auto_mode}\n\tset auto_mode(auto_mode:boolean) {this.#auto_mode = auto_mode}\n\n\tcustomStyleSheets = new Set<string>()\n\n\n\tconstructor() {\n\n\t\t// load themes from embedded style\n\t\tfor (const sheet of document.styleSheets??[]) {\n\t\t\t// themes\n\t\t\tif ((<HTMLStyleElement>sheet.ownerNode)?.classList?.contains(\"uix-themes\")) {\n\t\t\t\tthis.addThemeFromParsedStylesheet(sheet)\n\t\t\t}\n\t\t}\n\t\t\n\t\t// add default themes if not already loaded from html\n\t\tif (!this.getTheme(uixLightPlain.name, true)) this.registerTheme(uixLightPlain);\n\t\tif (!this.getTheme(uixDarkPlain.name, true)) this.registerTheme(uixDarkPlain);\n\t\tif (!this.getTheme(uixDark.name, true)) this.registerTheme(uixDark);\n\t\tif (!this.getTheme(uixLight.name, true)) this.registerTheme(uixLight);\n\n\t\tconst currentModeCookie = client_type == \"browser\" && getCookie(UIX_COOKIE.colorMode) as \"dark\"|\"light\";\n\t\tconst currentMode = currentModeCookie || (client_type == \"browser\" ? (globalThis.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\") : \"light\");\n\t\t\n\t\tconst currentDarkTheme = client_type == \"browser\" ? (getCookie(UIX_COOKIE.themeDark) ?? \"uix-dark\") : \"uix-dark\";\n\t\tconst currentLightTheme = client_type == \"browser\" ? (getCookie(UIX_COOKIE.themeLight) ?? \"uix-light\") : \"uix-light\";\n\n\t\t// set default themes (set by cookies)\n\t\tif (this.getTheme(currentDarkTheme)) this.setDefaultDarkTheme(this.getTheme(currentDarkTheme)!);\n\t\tif (this.getTheme(currentLightTheme)) this.setDefaultLightTheme(this.getTheme(currentLightTheme)!);\n\n\t\t// set current theme if not a parsed theme\n\t\tif (currentMode == \"dark\" && this.getTheme(currentDarkTheme, true)) {\n\t\t\tthis.setTheme(currentDarkTheme, true);\n\t\t}\n\t\telse if (currentMode == \"light\" && this.getTheme(currentLightTheme, true)) {\n\t\t\tthis.setTheme(currentLightTheme, true);\n\t\t}\n\t\telse {\n\t\t\tthis.#current_mode = currentMode;\n\t\t\tthis.#current_theme = currentMode == \"dark\" ? currentDarkTheme : currentLightTheme;\n\t\t}\n\n\t\t// current server-guessed mode does not match client mode, remember preferred theme to enable if a frontend theme is loaded\n\t\tif (!currentModeCookie && this.getTheme(currentDarkTheme, true)?.mode != currentMode) {\n\t\t\tthis.#preferredModeIfThemeAvailable = currentMode;\n\t\t}\n\n\t\t// watch system theme change\n\t\tif (client_type == \"browser\") {\n\t\t\t(window as any).matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {\n\t\t\t\tif (!this.auto_mode) return;\n\t\t\t\tlogger.debug(\"system color scheme change\")\n\t\t\t\tif (event.matches) this.setMode(\"dark\")\n\t\t\t\telse this.setMode(\"light\");\n\t\t\t\tthis.auto_mode = true;\n\t\t\t})\n\t\t}\n\t}\n\n\tpublic getTheme(name: string, ignoreParsed = false) {\n\t\tconst theme = this.#loadedThemes.get(name)\n\t\tif (ignoreParsed && theme?.parsed) return;\n\t\treturn theme;\n\t}\n\n\t/**\n\t * Register a new theme\n\t * @param theme \n\t * @param useAsDefault use as default theme for dark/light mode\n\t */\n\tpublic registerTheme(theme: Theme) {\n\t\tif (theme.stylesheets) {\n\t\t\tconst dir = getCallerDir();\n\t\t\ttheme.stylesheets = theme.stylesheets.map(s => new Path(s, dir))\n\t\t}\n\t\tthis.#loadedThemes.set(theme.name, theme);\n\t\tthis.addGlobalThemeClass(theme);\n\t\tthis.#themeCustomStylesheets.set(theme.name, [...this.#normalizeThemeStylesheets(theme)])\n\n\t\tif (theme.onRegister && client_type == \"deno\") theme.onRegister()\n\t}\n\n\t/**\n\t * Changes the mode to dark or light, selecting the current preferred\n\t * or light theme\n\t */\n\tpublic setMode(mode: \"dark\"|\"light\", force_update = false, persist = true) {\n\t\tif (!force_update && this.#current_mode == mode) return;\n\t\telse {\n\t\t\tif (persist) this.#auto_mode = false; // keep theme even if os changes theme\n\t\t\tlogger.debug(\"mode changed to \" + mode);\n\t\t\tthis.#activateTheme(mode == \"dark\" ? this.#default_dark_theme : this.#default_light_theme);\n\t\t}\n\t}\n\n\t/**\n\t * Sets a new theme (must be registered with registerTheem)\n\t */\n\tprivate setTheme(name: themeName, allowLazyLoad = false) {\n\t\tconst theme = this.getTheme(name)\n\t\tif (!theme) {\n\t\t\tif (allowLazyLoad) {\n\t\t\t\tthis.#waiting_theme = name;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse throw new Error(`Cannot set them \"${name}\", not registered`);\n\t\t}\n\t\tthis.#activateTheme(theme);\n\t}\n\n\t\n\t/**\n\t * Activate multiple themes. All previously activated themes\n\t * are disabled.\n\t * \n\t * The current theme is automatically selected\n\t * from the provided themes, depending on the current dark/light mode\n\t * @param themes \n\t */\n\tpublic useThemes(...themes: (themeName|Theme)[]) {\n\t\tlet hasDarkTheme = false;\n\t\tlet hasLightTheme = false;\n\t\tfor (const nameOrTheme of themes) {\n\t\t\tlet name: string;\n\t\t\tif (typeof nameOrTheme == \"object\") {\n\t\t\t\tthis.registerTheme(nameOrTheme);\n\t\t\t\tname = nameOrTheme.name;\n\t\t\t}\n\t\t\telse name = nameOrTheme;\n\n\t\t\tconst theme = this.getTheme(name);\n\t\t\tif (!theme) logger.warn(`Theme ${name} is not a registered theme`);\n\t\t\telse {\n\t\t\t\tif (!hasDarkTheme && (!theme.mode || theme.mode == \"dark\")) {\n\t\t\t\t\thasDarkTheme = true \n\t\t\t\t\tthis.setDefaultDarkTheme(theme);\n\t\t\t\t}\n\t\t\t\tif (!hasLightTheme && (!theme.mode || theme.mode == \"light\")) {\n\t\t\t\t\thasLightTheme = true;\n\t\t\t\t\tthis.setDefaultLightTheme(theme);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// no custom themes found, activate default themes\n\t\tif (!hasDarkTheme) this.setDefaultDarkTheme(uixDark)\n\t\tif (!hasLightTheme) this.setDefaultLightTheme(uixLight)\n\t}\n\n\t/**\n\t * Activate a theme. All previously activated themes\n\t * are disabled.\n\t * @param themes \n\t */\n\tpublic useTheme(theme: themeName|Theme) {\n\t\treturn this.useThemes(theme)\n\t}\n\n\t/**\n\t * Sets a theme as the preferred dark theme\n\t */\n\tprivate setDefaultDarkTheme(theme: Theme) {\n\t\tif (theme.mode && theme.mode !== \"dark\") throw new Error(`Theme \"${theme.name} is not a dark mode theme\"`)\n\n\t\tthis.#default_dark_theme = theme;\n\t\t// theme matches current mode, immediately apply\n\t\tif (!theme.mode || theme.mode == this.#current_mode) this.#activateTheme(theme);\n\t}\n\n\t/**\n\t * Sets a theme as the preferred light theme\n\t */\n\tprivate setDefaultLightTheme(theme: Theme) {\n\t\tif (theme.mode && theme.mode !== \"light\") throw new Error(`Theme \"${theme.name} is not a light mode theme\"`)\n\n\t\tthis.#default_light_theme = theme;\n\t\t// theme matches current mode, immediately apply\n\t\tif (!theme.mode || theme.mode == this.#current_mode) this.#activateTheme(theme);\n\t}\n\n\t#current_theme_css_text = \"\"\n\n\tgetCurrentThemeCSS(){\n\t\treturn this.#current_theme_css_text;\n\t}\n\n\tgetThemesCSS(){\n\t\treturn [...this.#themesCSS.values()].join(\"\\n\");\n\t}\n\n\t/**\n\t * returns css text for a theme, using .theme-xx selector\n\t * @param name theme name\n\t * @param useRootSelector use :root selector instead of .theme-xx selector\n\t * @returns \n\t */\n\tgetThemeCSS(name: string, useRootSelector = false) {\n\t\tconst css = this.#themesCSS.get(name);\n\t\tif (useRootSelector) return css?.replace('.theme-'+name, ':root') \n\t\telse return css;\n\t}\n\n\t/**\n\t * returns a list of stylesheets for a given theme\n\t * @param name\n\t */\n\tgetThemeStylesheets(name: string) {\n\t\treturn this.#themeCustomStylesheets.get(name);\n\t}\n\n\t// update the current theme (changes immediately)\n\t#activateTheme(theme:Theme) {\n\n\t\tif (this.#current_theme == theme.name) return;\n\n\t\t// deactivate previous theme\n\t\tconst currentTheme = this.getTheme(this.#current_theme) \n\t\tif (currentTheme?.onDeactivate) {\n\t\t\ttry {\n\t\t\t\tcurrentTheme.onDeactivate()\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t}\n\n\t\tthis.#current_theme = theme.name;\n\t\tlogger.debug(`using theme \"${theme.name}\"`)\n\n\t\tif (!theme.mode || theme.mode == \"dark\") setCookie(UIX_COOKIE.themeDark, theme.name);\n\t\telse if (!theme.mode || theme.mode == \"light\") setCookie(UIX_COOKIE.themeLight, theme.name);\n\n\t\tif (theme.mode) setCookie(UIX_COOKIE.colorMode, theme.mode);\n\n\t\tlet text = \":root{\";\n\t\t// iterate over all properties (also from inherited prototypes)\n\t\t// TODO only iterate over allowed properties?\n\t\tconst added_properties = new Set();\n\t\tfor (let o = theme.values??{}; o && o != Object.prototype; o = Object.getPrototypeOf(o)) {\n\t\t\tfor (const [key, value] of Object.entries(o)) {\n\t\t\t\tif (added_properties.has(key)) continue;\n\t\t\t\tadded_properties.add(key);\n\t\t\t\tthis.#values[key] = value;\n\t\t\t\ttext += `--${key}: ${value};` // TODO escape?\n\t\t\t}\n\t\t}\n\n\t\ttext += \"}\";\n\t\tthis.#current_theme_css_text = text;\n\n\t\tthis.updateCurrentThemeStyle()\n\n\t\tconst modeChanged = this.#current_mode != (theme.mode ?? \"light\");\n\t\tthis.#current_mode = theme.mode ?? \"light\"; // only now trigger Theme.mode observers\n\t\t// css global color scheme\n\t\tif (client_type === \"browser\") {\n\t\t\tdocument.documentElement.style.colorScheme = theme.mode ?? \"light\";\n\t\t\tdocument.body.dataset.colorScheme = theme.mode ?? \"light\";\n\t\t}\n\n\t\t// stylesheets not available for parsed themes\n\t\t// stylesheets\n\t\tif (theme.stylesheets) {\t\t\t\n\t\t\tthis.#updateCustomStylesheets(this.#normalizeThemeStylesheets(theme))\n\t\t}\n\t\telse this.#clearCustomStyleSheets();\n\n\t\t// theme-color (TODO: only workaround until meta media query is supported in all browsers)\n\t\tif (theme.appColor) {\n\t\t\tif (client_type === \"browser\") document.querySelector(\"meta[name=theme-color]\")?.setAttribute(\"content\", theme.appColor);\n\t\t}\n\n\t\tif (theme.onActivate) {\n\t\t\ttry {\n\t\t\t\ttheme.onActivate()\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t}\n\n\t\t// call theme/mode change listeners\n\t\tif (modeChanged) for (const observer of this.mode_change_observers) observer(this.#current_mode);\n\t\tfor (const observer of this.theme_change_observers) observer(this.#current_theme);\n\t}\n\n\t#normalizeThemeStylesheets(theme: Theme) {\n\t\tconst customStylesheets = new Set<string>()\n\t\tfor (const url of theme.stylesheets??[]) {\n\t\t\tcustomStylesheets.add(new URL(url).toString())\n\t\t}\n\t\treturn customStylesheets;\n\t}\n\n\t#clearCustomStyleSheets(exclude?: Set<string>) {\n\t\tif (client_type == \"browser\") {\n\t\t\tfor (const link of document.head.querySelectorAll('link.custom-theme') as unknown as HTMLElement[]) {\n\t\t\t\tif (exclude?.has(link.href)) continue;\n\t\t\t\tlink.remove();\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.customStyleSheets.clear();\n\t}\n\n\t#updateCustomStylesheets(customStyleSheets: Set<string>) {\n\t\tif (client_type == \"browser\") {\n\n\t\t\t// remove stylesheets which are not in the new list\n\t\t\tthis.#clearCustomStyleSheets(customStyleSheets);\n\n\t\t\t// add new stylesheets\n\t\t\tfor (const url of customStyleSheets) {\n\t\t\t\tconst existingLink = document.head.querySelector('link.custom-theme');\n\t\t\t\tif (existingLink?.href == url) continue;\n\t\t\t\tconst stylesheet = document.createElement(\"link\");\n\t\t\t\tstylesheet.classList.add(\"custom-theme\");\n\t\t\t\tstylesheet.rel = \"stylesheet\"\n\t\t\t\tstylesheet.href = url.toString()\n\t\t\t\tdocument.head.append(stylesheet)\n\t\t\t}\n\t\t}\n\t\tthis.customStyleSheets = customStyleSheets;\n\t}\n\n\taddGlobalThemeClass(theme: Theme) {\n\t\tlet text = `.theme-${theme.name} {`;\n\t\t// iterate over all properties (also from inherited prototypes)\n\t\t// TODO only iterate over allowed properties?\n\t\tconst added_properties = new Set();\n\t\tfor (let o = theme.values??{}; o && o != Object.prototype; o = Object.getPrototypeOf(o)) {\n\t\t\tfor (const [key, value] of Object.entries(o)) {\n\t\t\t\tif (added_properties.has(key)) continue;\n\t\t\t\tadded_properties.add(key);\n\t\t\t\ttext += `--${key}: ${value};` // TODO escape?\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// update default current text colors\n\t\ttext += `--current_text_color: var(--text);`\n\t\ttext += `--current_text_color_highlight: var(--text_highlight);`\n\t\ttext += `color: var(--current_text_color);`\n\t\t// set color scheme\n\t\tif (theme.mode) text += `color-scheme: ${theme.mode}`\n\n\t\ttext += \"}\";\n\n\t\tthis.#themesCSS.set(theme.name, text);\n\n\t\tthis.updateGlobalThemeStyle(theme.name)\n\t}\n\n\tprivate updateCurrentThemeStyle(){\n\t\tthis.#current_theme_style_sheet.replaceSync?.(this.#current_theme_css_text);\n\n\t\t// add to document\n\t\tif (!this.#document_stylesheets_added) {\n\t\t\tif (client_type === \"browser\") document.adoptedStyleSheets = [...document.adoptedStyleSheets, this.#current_theme_style_sheet, this.#global_style_sheet];\n\t\t\tthis.#document_stylesheets_added = true;\n\t\t}\n\t}\n\n\tprivate updateGlobalThemeStyle(name:string){\n\t\t// set all current style classes global style\n\t\tlet global_style = \"\";\n\t\tfor (const style of this.#themesCSS.values()) {\n\t\t\tglobal_style += style + '\\n';\n\t\t}\n\t\tthis.#global_style_sheet.replaceSync?.(global_style);\n\n\t\t// add to document\n\t\tif (!this.#document_stylesheets_added) {\n\t\t\tif (client_type === \"browser\") document.adoptedStyleSheets = [...document.adoptedStyleSheets, this.#current_theme_style_sheet, this.#global_style_sheet];\n\t\t\tthis.#document_stylesheets_added = true;\n\t\t}\n\t}\n\n\taddThemeFromParsedStylesheet(sheet:CSSStyleSheet) {\n\t\tfor (const rule of <CSSStyleRule[]><any>sheet.cssRules) {\n\t\t\tconst name = rule.selectorText.replace(\".theme-\",\"\")\n\t\t\tconst values:Record<string,string> = {};\n\t\t\tconst mode:\"dark\"|\"light\" = rule.style.getPropertyValue(\"color-scheme\") ?? \"light\";\n\n\t\t\tfor (let i = 0; i < rule.style.length; i++) {\n\t\t\t\tconst prop = rule.style.item(i);\n\t\t\t\tif (!prop.startsWith(\"--\")) continue;\n\t\t\t\tif (prop === \"--current_text_color\" || prop === \"--current_text_color_highlight\") continue;\n\t\t\t\tconst key = prop.replace(\"--\",\"\");\n\t\t\t\tconst val = rule.style.getPropertyValue(prop);\n\t\t\t\tvalues[key] = val;\n\t\t\t}\n\n\t\t\tthis.registerTheme({\n\t\t\t\tname,\n\t\t\t\tmode,\n\t\t\t\tvalues,\n\t\t\t\tstylesheets: [\n\t\t\t\t\t...document.head.querySelectorAll('link.custom-theme') as unknown as HTMLLinkElement[]\n\t\t\t\t].map(l => l.href),\n\t\t\t\tparsed: true\n\t\t\t});\n\t\t}\n\t}\n\n\t// create new theme based on another theme\n\textend(theme:Theme, override:Partial<Theme> & {name: string}): Theme {\n\t\tconst dir = getCallerDir();\n\t\tif (!(\"mode\" in override)) override.mode = theme.mode;\n\t\tif (!(\"name\" in override)) throw new Error(\"Name required\");\n\n\t\tconst overrideValues = override.values ?? {};\n\t\toverride.values = Object.create(theme.values??{});\n\t\tfor (const [key, value] of Object.entries(overrideValues)) {\n\t\t\toverride.values![key] = value;\n\t\t}\n\t\toverride.stylesheets = [...(theme.stylesheets??[]), ...(override.stylesheets?.map(s => new Path(s, dir))??[])]\n\t\t\n\t\treturn override as Theme;\n\t}\n\n\tprivate mode_change_observers = new Set<Function>();\n\tonModeChange(observer:(theme:\"dark\"|\"light\")=>void) {\n\t\tthis.mode_change_observers.add(observer);\n\t}\n\n\tprivate theme_change_observers = new Set<Function>();\n\tonThemeChange(observer:(theme:string)=>void) {\n\t\tthis.theme_change_observers.add(observer);\n\t}\n\n}\n\nlet themeManager:ThemeManager|undefined;\n\nexport function getThemeManager() {\n\tif (!themeManager) themeManager = new ThemeManager();\n\treturn themeManager;\n}\n\nexport type ThemeManagerType = ThemeManager;"],"names":["themeManager","client_type","UIX_COOKIE","getCookie","setCookie","Logger","getCallerDir","Path","uixLight","uixDark","uixLightPlain","uixDarkPlain","logger","ThemeManager","Map","CSSStyleSheet","stylesheet","mode","name","setMode","theme","setTheme","defaultDarkTheme","defaultLightTheme","values","auto_mode","customStyleSheets","Set","constructor","sheet","document","styleSheets","ownerNode","classList","contains","addThemeFromParsedStylesheet","getTheme","registerTheme","currentModeCookie","colorMode","currentMode","globalThis","matchMedia","matches","currentDarkTheme","themeDark","currentLightTheme","themeLight","setDefaultDarkTheme","setDefaultLightTheme","window","addEventListener","event","debug","ignoreParsed","get","parsed","stylesheets","dir","map","s","set","addGlobalThemeClass","onRegister","force_update","persist","allowLazyLoad","Error","useThemes","themes","hasDarkTheme","hasLightTheme","nameOrTheme","warn","useTheme","getCurrentThemeCSS","getThemesCSS","join","getThemeCSS","useRootSelector","css","replace","getThemeStylesheets","currentTheme","onDeactivate","e","console","error","text","added_properties","o","Object","prototype","getPrototypeOf","key","value","entries","has","add","updateCurrentThemeStyle","modeChanged","documentElement","style","colorScheme","body","dataset","appColor","querySelector","setAttribute","onActivate","observer","mode_change_observers","theme_change_observers","customStylesheets","url","URL","toString","exclude","link","head","querySelectorAll","href","remove","clear","existingLink","createElement","rel","append","updateGlobalThemeStyle","replaceSync","adoptedStyleSheets","global_style","rule","cssRules","selectorText","getPropertyValue","i","length","prop","item","startsWith","val","l","extend","override","overrideValues","create","onModeChange","onThemeChange","getThemeManager"],"mappings":"IA+gBIA;AA/gBJ,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,UAAU,EAAEC,SAAS,EAAEC,SAAS,QAAQ,wBAAwB;AACzE,SAASC,MAAM,QAAQ,oCAAoC;AAC3D,SAASC,YAAY,QAAQ,6CAA6C;AAC1E,SAASC,IAAI,QAAQ,kCAAkC;AACvD,SAASC,QAAQ,QAAQ,yBAAyB;AAClD,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,YAAY,QAAQ,8BAA8B;AAE3D,IAAMC,SAAS,IAAIP,OAAO;AA6C1B,IAAA,AAAMQ,eAAN,MAAMA;IAEL,CAAA,YAAa,GAAG,IAAIC,MAAoB;IAExC,CAAA,MAAO,GAAyB,CAAC,EAAC;IAElC,CAAA,SAAU,GAAG,CAAA,EAAI;IACjB,CAAA,YAAa,CAAiB;IAC9B,CAAA,aAAc,CAAS;IACvB,CAAA,aAAc,CAAU;IAExB,CAAA,mBAAoB,GAASN,SAAS;IACtC,CAAA,kBAAmB,GAASC,QAAQ;IAE3B,CAAA,yBAA0B,GAAG,IAAIM,gBAAgB;IAC1D,CAAA,0BAA2B,GAAG,CAAA,EAAM;IAEpC,CAAA,sBAAuB,GAAG,IAAID,MAAuB;IAErD,CAAA,6BAA8B,CAAiB;IAE/C,CAAA,kBAAmB,GAAG,IAAIC,gBAAgB;IAE1C,CAAA,SAAU,GAAG,IAAID,MAAqB;IAEtC,IAAIE,aAAa;QAAC,OAA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