"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHasLocallyOverriddenFeatureFlags = void 0;
const react_1 = require("react");
const FeatureFlagsContext_1 = require("./FeatureFlagsContext");
const defaultFeatures_1 = require("./defaultFeatures");
/**
 *
 * @returns whether one or more flags are locally overridden
 */
function useHasLocallyOverriddenFeatureFlags() {
    const { getFeature } = (0, FeatureFlagsContext_1.useFeatureFlags)();
    return (0, react_1.useMemo)(() => Object.entries(defaultFeatures_1.DEFAULT_FEATURES).some(([featureId]) => {
        try {
            const val = getFeature(featureId);
            return val?.overridesRemote || val?.overriddenByEnv;
        }
        catch {
            return false;
        }
    }), [getFeature]);
}
exports.useHasLocallyOverriddenFeatureFlags = useHasLocallyOverriddenFeatureFlags;
//# sourceMappingURL=useHasOverriddenFeatureFlags.js.map