{"version":3,"file":"c8y-ngx-components-branding-dark-theme.mjs","sources":["../../branding/dark-theme/dark-theme-tab.factory.ts","../../branding/dark-theme/dark-theme.module.ts","../../branding/dark-theme/c8y-ngx-components-branding-dark-theme.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { OptionsService, Tab } from '@c8y/ngx-components';\nimport { BrandingTabFactory } from '@c8y/ngx-components/branding/shared';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nexport const darkThemeTabName = gettext('Dark theme');\n\n/**\n * Factory for creating the dark theme tab.\n * Extends the BrandingTabFactory to provide the dark theme tab.\n */\n@Injectable({ providedIn: 'root' })\nexport class DarkThemeTabFactory extends BrandingTabFactory {\n  constructor(private options: OptionsService) {\n    super();\n  }\n\n  /**\n   * Overrides the `getTabsForVersion` method of `BrandingTabFactory` to provide the dark theme tab.\n   */\n  protected override getTabsForVersion(name: string): Tab[] {\n    return [\n      {\n        path: this.getPathForBranding(name, 'dark'),\n        label: darkThemeTabName,\n        icon: 'moon',\n        priority: 400\n      }\n    ];\n  }\n\n  /**\n   * Overrides the `shouldShowTab$` method of `BrandingTabFactory` to show the dark theme tab only if the dark theme is available.\n   */\n  protected override shouldShowTab$(): Observable<boolean> {\n    return this.options.get$('darkThemeAvailable', false, true).pipe(map(value => !!value));\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { hookTab } from '@c8y/ngx-components';\nimport {\n  BRANDING_EDIT_CHILD_ROUTES,\n  SharedBrandingModule\n} from '@c8y/ngx-components/branding/shared';\nimport { DarkThemeTabFactory, darkThemeTabName } from './dark-theme-tab.factory';\n\nBRANDING_EDIT_CHILD_ROUTES.push({\n  path: 'dark',\n  loadComponent: () =>\n    import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingThemeFormComponent),\n  data: {\n    dark: true,\n    tabName: darkThemeTabName\n  }\n});\n\n@NgModule({\n  imports: [SharedBrandingModule],\n  providers: [hookTab(Dark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