const getFeatureState = ({ self, fromCache, adminPortalConfigError, isFeatureEnabled, hasPermission })=>{
    const hasSelf = !!self;
    const hasAdminPortalConfig = isFeatureEnabled !== undefined;
    if (!hasSelf) {
        return fromCache ? 'loading' : 'notLoggedIn';
    }
    if (adminPortalConfigError) {
        return 'error';
    }
    if (!hasAdminPortalConfig) {
        return 'loading';
    }
    if (hasPermission === undefined) {
        return 'loading';
    }
    if (!isFeatureEnabled) {
        return 'featureNotEnabled';
    }
    if (!hasPermission) {
        return 'noPermission';
    }
    return 'success';
};

export { getFeatureState };
//# sourceMappingURL=getFeatureState.mjs.map
