import { __decorate, __metadata } from "tslib";
import { getExtensionPath, } from '@codeblitzjs/ide-sumi-core';
import { Autowired } from '@opensumi/di';
import { ClientAppContribution, Disposable, Domain, PreferenceProvider, PreferenceScope, URI, } from '@opensumi/ide-core-browser';
import { GeneralSettingsId } from '@opensumi/ide-core-common';
import { IThemeService } from '@opensumi/ide-theme';
import { IDETheme } from '../extension/metadata';
let DefaultThemeGuardContribution = class DefaultThemeGuardContribution extends Disposable {
    async initialize() {
        this.themeService.registerThemes(IDETheme.packageJSON.contributes.themes, URI.parse(getExtensionPath(IDETheme.extension, 'public')));
    }
    async onStart(app) {
        // 强制用集成设置的默认主题
        await this.themeService.applyTheme(this.defaultPreferenceProvider.get(GeneralSettingsId.Theme));
    }
};
__decorate([
    Autowired(IThemeService),
    __metadata("design:type", Object)
], DefaultThemeGuardContribution.prototype, "themeService", void 0);
__decorate([
    Autowired(PreferenceProvider, { tag: PreferenceScope.Default }),
    __metadata("design:type", PreferenceProvider)
], DefaultThemeGuardContribution.prototype, "defaultPreferenceProvider", void 0);
DefaultThemeGuardContribution = __decorate([
    Domain(ClientAppContribution)
], DefaultThemeGuardContribution);
export { DefaultThemeGuardContribution };
//# sourceMappingURL=default-theme.provider.js.map