{"version":3,"file":"fundamental-ngx-core-theming.mjs","sources":["../../../../libs/core/theming/config.ts","../../../../libs/core/theming/standard-themes.ts","../../../../libs/core/theming/tokens.ts","../../../../libs/core/theming/theming.service.ts","../../../../libs/core/theming/provide-theming.ts","../../../../libs/core/theming/theming-initializer.ts","../../../../libs/core/theming/theming.module.ts","../../../../libs/core/theming/fundamental-ngx-core-theming.ts"],"sourcesContent":["import { ThemeDefinition, ThemeStyleLink } from './interfaces/theme.interface';\nimport { ThemingConfig } from './interfaces/theming-config.interface';\n\n/**\n * Theming Configuration.\n */\nexport class BaseThemingConfig implements ThemingConfig {\n    /**\n     * Array of user-defined themes.\n     */\n    customThemes: ThemeDefinition[] = [];\n    /**\n     * Default theme.\n     */\n    defaultTheme = 'sap_horizon';\n    /**\n     * Whether to exclude default themes from the list of available options. By default, false.\n     */\n    excludeDefaultThemes = false;\n\n    /**\n     * URL Query parameter flag to change theme based on the provided parameter.\n     */\n    themeQueryParam = 'theme';\n    /**\n     * Whether to change theme if URL Query parameter flag has been found or changed. Default is true.\n     */\n    changeThemeOnQueryParamChange = true;\n    /**\n     * Identifiers of theme style links.\n     */\n    themeStyleLinkIdentifiers: Record<ThemeStyleLink, string> = {\n        'base-theme': 'base-theme-styles',\n        'custom-theme': 'custom-theme-styles'\n    };\n}\n","import { ThemeDefinition } from './interfaces/theme.interface';\n\nexport const STANDARD_THEMES: ThemeDefinition[] = [\n    {\n        id: 'sap_horizon',\n        name: 'Morning Horizon (Light)'\n    },\n    {\n        id: 'sap_horizon_dark',\n        name: 'Evening Horizon (Dark)'\n    },\n    {\n        id: 'sap_horizon_hcb',\n        name: 'Horizon High Contrast Black',\n        description: 'Optimized contrast and accessibility for extremely bright environments'\n    },\n    {\n        id: 'sap_horizon_hcw',\n        name: 'Horizon High Contrast White',\n        description: 'Optimized contrast and accessibility for extremely dark environments'\n    },\n    {\n        id: 'sap_horizon_set',\n        name: 'Horizon Set'\n    },\n    {\n        id: 'sap_fiori_3',\n        name: 'Quartz Light',\n        description: 'Use in regular office environment'\n    },\n    {\n        id: 'sap_fiori_3_dark',\n        name: 'Quartz Dark',\n        description: 'Use in dimmed environments'\n    },\n    {\n        id: 'sap_fiori_3_hcb',\n        name: 'Quartz High Contrast Black',\n        description: 'Optimized contrast and accessibility for extremely bright environments'\n    },\n    {\n        id: 'sap_fiori_3_hcw',\n        name: 'Quartz High Contrast White',\n        description: 'Optimized contrast and accessibility for extremely dark environments'\n    },\n    {\n        id: 'sap_fiori_3_light_dark',\n        name: 'Quartz Auto (Depending on the OS Settings)'\n    },\n    {\n        id: 'sap_fiori_3_set',\n        name: 'Quartz Set',\n        description: 'Quartz Auto (Depending on the OS Settings)'\n    }\n];\n","import { InjectionToken } from '@angular/core';\nimport { BaseThemingConfig } from './config';\nimport { ThemingConfig } from './interfaces/theming-config.interface';\n\nexport const THEMING_CONFIG_TOKEN = new InjectionToken<Partial<ThemingConfig>>('FdThemingConfig', {\n    factory: () => new BaseThemingConfig()\n});\n","import {\n    DestroyRef,\n    DOCUMENT,\n    inject,\n    Inject,\n    Injectable,\n    isDevMode,\n    Optional,\n    Renderer2,\n    RendererFactory2\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { merge, Nullable, THEME_SWITCHER_ROUTER_MISSING_ERROR } from '@fundamental-ngx/cdk/utils';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { BaseThemingConfig } from './config';\nimport {\n    CompleteThemeDefinition,\n    CompleteThemingResource,\n    ThemeDefinition,\n    ThemeStyleLink\n} from './interfaces/theme.interface';\nimport { ThemingConfig } from './interfaces/theming-config.interface';\nimport { STANDARD_THEMES } from './standard-themes';\nimport { THEMING_CONFIG_TOKEN } from './tokens';\n\n@Injectable()\nexport class ThemingService {\n    /**\n     * Theming configuration.\n     */\n    readonly config = new BaseThemingConfig();\n\n    /**\n     * Observable of the current theme, applied to the application.\n     */\n    get currentTheme(): Observable<CompleteThemeDefinition | null> {\n        return this._currentThemeSubject.asObservable();\n    }\n\n    /** @hidden */\n    private readonly _renderer: Renderer2;\n\n    /** @hidden */\n    private readonly _availableThemes: Map<string, CompleteThemeDefinition>;\n\n    /** @hidden */\n    private readonly _standardThemes: ThemeDefinition[] = [];\n\n    /** @hidden **/\n    private readonly _destroyRef = inject(DestroyRef);\n\n    /** @hidden */\n    private readonly _currentThemeSubject: BehaviorSubject<CompleteThemeDefinition | null> =\n        new BehaviorSubject<CompleteThemeDefinition | null>(null);\n\n    /**\n     * @hidden\n     */\n    constructor(\n        private _rendererFactory: RendererFactory2,\n        @Inject(DOCUMENT) private _document: Document,\n        @Optional() private _activatedRoute: ActivatedRoute,\n        @Optional()\n        @Inject(THEMING_CONFIG_TOKEN)\n        private readonly _providedConfig: Partial<ThemingConfig>\n    ) {\n        this.config = merge(structuredClone(this.config), structuredClone(this._providedConfig));\n\n        this._renderer = this._rendererFactory.createRenderer(this._document, null);\n\n        if (!this.config.excludeDefaultThemes) {\n            this._standardThemes = STANDARD_THEMES;\n        }\n\n        const mergedThemes = this._formatProvidedThemes(this.config.customThemes);\n\n        this._availableThemes = new Map<string, CompleteThemeDefinition>(\n            mergedThemes.map((theme) => [theme.id, theme])\n        );\n\n        const defaultTheme = this._availableThemes.get(this.config.defaultTheme);\n\n        if (!defaultTheme) {\n            return;\n        }\n\n        this._currentThemeSubject.next(defaultTheme);\n    }\n\n    /**\n     * Initiates theme change based on query parameter or provided default theme in config.\n     */\n    init(): void {\n        if (this.config.changeThemeOnQueryParamChange) {\n            this._setThemeByRoute();\n        } else if (this._currentThemeSubject.value?.id) {\n            this.setTheme(this._currentThemeSubject.value.id);\n        }\n    }\n\n    /**\n     * Sets defined theme.\n     * @param themeId ID of theme that needs to be used by the application.\n     */\n    setTheme(themeId: string): boolean {\n        const theme = this._availableThemes.get(themeId);\n\n        if (!theme) {\n            console.warn(\n                `Theme with ID '${themeId}' is not found. Please check if ID is correct or provide custom theme for ThemingModule.`\n            );\n            return false;\n        }\n\n        this._setThemeResource('base-theme', theme.theming.themingBasePath);\n        this._setThemeResource('custom-theme', theme.theming.themePath);\n\n        this._currentThemeSubject.next(theme);\n\n        return true;\n    }\n\n    /**\n     * Returns array of available themes.\n     */\n    getThemes(): CompleteThemeDefinition[] {\n        return [...this._availableThemes].map((entry) => entry[1]);\n    }\n\n    /**\n     * Returns current theme definition.\n     */\n    getCurrentTheme(): Nullable<ThemeDefinition> {\n        return this._currentThemeSubject.value;\n    }\n\n    /**\n     * @hidden\n     * @param type\n     * @param resourceUrl\n     * @private\n     */\n    private _setThemeResource(type: ThemeStyleLink, resourceUrl: string): void {\n        const linkElm = this._getStyleLinkElement(type);\n\n        if (linkElm.getAttribute('href') === resourceUrl) {\n            return;\n        }\n\n        this._renderer.setAttribute(linkElm, 'href', resourceUrl);\n    }\n\n    /**\n     * @hidden\n     * @param type\n     * @private\n     */\n    private _getStyleLinkElement(type: ThemeStyleLink): HTMLLinkElement {\n        const existingLinkElement = this._document.getElementById(this.config.themeStyleLinkIdentifiers[type]);\n\n        if (existingLinkElement) {\n            return existingLinkElement as HTMLLinkElement;\n        }\n\n        const newLinkElement = this._renderer.createElement('link');\n        this._renderer.setAttribute(newLinkElement, 'rel', 'stylesheet');\n        this._renderer.setAttribute(newLinkElement, 'id', this.config.themeStyleLinkIdentifiers[type]);\n        this._renderer.appendChild(this._document.head, newLinkElement);\n\n        return newLinkElement;\n    }\n\n    /**\n     * @hidden\n     * @param themes\n     * @private\n     */\n    private _formatProvidedThemes(themes?: ThemeDefinition[]): CompleteThemeDefinition[] {\n        themes = themes || [];\n        const mergedThemes = [...this._standardThemes, ...themes];\n\n        if (mergedThemes.length === 0 && isDevMode()) {\n            console.error('Error. No themes were provided. Please check your configuration.');\n        }\n\n        return mergedThemes.map((theme) => {\n            theme.theming = this._getThemingResourceConfig(theme);\n            return theme;\n        }) as CompleteThemeDefinition[];\n    }\n\n    /** @hidden */\n    private _getThemingResourceConfig(theme: ThemeDefinition): CompleteThemingResource {\n        const existingConfig = theme.theming || {};\n        const defaultConfig: CompleteThemingResource = {\n            themingBasePath: `assets/theming-base/${theme.id}/css_variables.css`,\n            themePath: `assets/fundamental-styles-theming/${theme.id}.css`\n        };\n\n        return Object.assign(defaultConfig, existingConfig);\n    }\n\n    /** @hidden */\n    private _getNativeParameterByName(paramName: string): string {\n        paramName = paramName.replace(/[[\\\\\\]]/g, '\\\\$&');\n        const regex = new RegExp('[?&]' + paramName + '(=([^&#]*)|&|#|$)'),\n            results = regex.exec(window.location.href);\n        if (!results || !results[2]) {\n            return '';\n        }\n        return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n    }\n\n    /**\n     * @hidden\n     * Set theme according to additional URL parameter.\n     * This parameter can be changed in function argument.\n     **/\n    private _setThemeByRoute(): void {\n        const paramName = this.config.themeQueryParam;\n\n        if (!this._activatedRoute) {\n            throw new Error(THEME_SWITCHER_ROUTER_MISSING_ERROR);\n        }\n\n        this._activatedRoute.queryParams\n            .pipe(\n                takeUntilDestroyed(this._destroyRef),\n                filter((param) => param && param[paramName])\n            )\n            .subscribe((param) => this.setTheme(param[paramName]));\n\n        const nativeTheme = this._getNativeParameterByName(paramName) || this.config.defaultTheme;\n        this.setTheme(nativeTheme);\n    }\n}\n","import { Provider } from '@angular/core';\nimport { ThemingConfig } from './interfaces/theming-config.interface';\nimport { ThemingService } from './theming.service';\nimport { THEMING_CONFIG_TOKEN } from './tokens';\n\n/**\n * Provides theming configuration\n * @param config\n */\nexport function provideTheming(config: Partial<ThemingConfig> = {}): Provider[] {\n    return [\n        ThemingService,\n        {\n            provide: THEMING_CONFIG_TOKEN,\n            useValue: config\n        }\n    ];\n}\n","import { EnvironmentProviders, inject, provideAppInitializer } from '@angular/core';\nimport { ThemingService } from './theming.service';\n\n/**\n * Initializes theming service\n */\nexport function themingInitializer(): EnvironmentProviders {\n    return provideAppInitializer(() => {\n        const initializerFn = (() => {\n            const themingService = inject(ThemingService);\n            return () => themingService.init();\n        })();\n        return initializerFn();\n    });\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { ThemingConfig } from './interfaces/theming-config.interface';\nimport { provideTheming } from './provide-theming';\nimport { ThemingService } from './theming.service';\n\n/**\n * @deprecated\n * Use direct imports of components and directives.\n */\n@NgModule({\n    imports: [],\n    providers: [ThemingService]\n})\nexport class ThemingModule {\n    /** Module with providers */\n    static withConfig(config: Partial<ThemingConfig>): ModuleWithProviders<ThemingModule> {\n        return {\n            ngModule: ThemingModule,\n            providers: [provideTheming(config)]\n        };\n    }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;AAEG;MACU,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;AACI;;AAEG;QACH,IAAA,CAAA,YAAY,GAAsB,EAAE;AACpC;;AAEG;QACH,IAAA,CAAA,YAAY,GAAG,aAAa;AAC5B;;AAEG;QACH,IAAA,CAAA,oBAAoB,GAAG,KAAK;AAE5B;;AAEG;QACH,IAAA,CAAA,eAAe,GAAG,OAAO;AACzB;;AAEG;QACH,IAAA,CAAA,6BAA6B,GAAG,IAAI;AACpC;;AAEG;AACH,QAAA,IAAA,CAAA,yBAAyB,GAAmC;AACxD,YAAA,YAAY,EAAE,mBAAmB;AACjC,YAAA,cAAc,EAAE;SACnB;IACL;AAAC;;ACjCM,MAAM,eAAe,GAAsB;AAC9C,IAAA;AACI,QAAA,EAAE,EAAE,aAAa;AACjB,QAAA,IAAI,EAAE;AACT,KAAA;AACD,IAAA;AACI,QAAA,EAAE,EAAE,kBAAkB;AACtB,QAAA,IAAI,EAAE;AACT,KAAA;AACD,IAAA;AACI,QAAA,EAAE,EAAE,iBAAiB;AACrB,QAAA,IAAI,EAAE,6BAA6B;AACnC,QAAA,WAAW,EAAE;AAChB,KAAA;AACD,IAAA;AACI,QAAA,EAAE,EAAE,iBAAiB;AACrB,QAAA,IAAI,EAAE,6BAA6B;AACnC,QAAA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