import { cmsApi } from './api.js';
export async function fetchPlanInfo() {
    const res = await cmsApi('/plan');
    if (res.error || !res.data)
        return null;
    return res.data;
}
/** When plan info is unavailable, assume full access (self-hosted default). */
export function hasPlanFeature(plan, feature) {
    if (!plan)
        return true;
    return plan.features.includes(feature);
}
export function planFeatureLabel(feature) {
    switch (feature) {
        case 'seo.inlineApply':
            return 'SEO inline apply';
        case 'seo.contentBrief':
            return 'SEO content briefs';
        case 'seo.contentResearch':
            return 'SEO topic research';
        case 'seo.batchContentBriefs':
            return 'SEO batch content briefs';
        default: {
            const _exhaustive = feature;
            return _exhaustive;
        }
    }
}
//# sourceMappingURL=plan.js.map