"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.testerTheme = exports.TesterThemeReference = exports.lightnessOptions = void 0;
const react_native_1 = require("react-native");
const android_theme_1 = require("@fluentui-react-native/android-theme");
const apple_theme_1 = require("@fluentui-react-native/apple-theme");
const default_theme_1 = require("@fluentui-react-native/default-theme");
const theme_1 = require("@fluentui-react-native/theme");
const applyBrand_1 = require("./applyBrand");
const applyTheme_1 = require("./applyTheme");
const themeOptions = { paletteName: 'TaskPane', appearance: 'dynamic' };
// Default applies to win32
const baseTheme = react_native_1.Platform.select({
    android: (0, android_theme_1.createAndroidTheme)(themeOptions),
    ios: (0, apple_theme_1.createAppleTheme)(),
    macos: (0, apple_theme_1.createAppleTheme)(),
    default: (0, default_theme_1.createDefaultTheme)(themeOptions),
});
const supportsHighContrastTokens = react_native_1.Platform.select({
    android: false,
    ios: false,
    macos: false,
    default: true,
});
exports.lightnessOptions = [
    { label: 'Auto', value: 'dynamic' },
    { label: 'Light', value: 'light' },
    { label: 'Dark', value: 'dark' },
    supportsHighContrastTokens && { label: 'High Contrast', value: 'highContrast' },
];
class TesterThemeReference extends theme_1.ThemeReference {
    _themeName = react_native_1.Platform.OS === 'win32' ? 'Office' : 'Default';
    _brand = 'Default';
    options;
    baseTheme;
    constructor() {
        super(baseTheme, () => (0, applyTheme_1.applyTheme)(this._themeName, this.options.appearance), (parent) => (0, applyBrand_1.applyBrand)(parent, this._brand));
        this.baseTheme = baseTheme;
        this.options = themeOptions;
    }
    /** get/set the currently active theme */
    get themeName() {
        return this._themeName;
    }
    set themeName(newTheme) {
        if (newTheme !== this._themeName) {
            this._themeName = newTheme;
            this.invalidate();
        }
    }
    /** get/set the theme appearance */
    get appearance() {
        return this.options.appearance;
    }
    set appearance(lightness) {
        if (lightness !== this.options.appearance) {
            this.options.appearance = lightness;
            this.baseTheme.invalidate();
        }
    }
    /** get/set the applied brand */
    get brand() {
        return this._brand;
    }
    set brand(newBrand) {
        if (newBrand !== this._brand) {
            this._brand = newBrand;
            this.invalidate();
        }
    }
}
exports.TesterThemeReference = TesterThemeReference;
exports.testerTheme = new TesterThemeReference();
//# sourceMappingURL=CustomThemes.js.map