import"./rolldown-runtime-DIIn1E2Q.js";import{D as e,Dt as t,Ot as n,kt as r}from"./vendor-vue-core-DO0afONr.js";import{t as i}from"./types-DPJvCrdo.js";import{Xt as a,r as o}from"./api-Cw7jP9TY.js";var s=r(`unloaded`),c=e(()=>s.value===`authenticated`),l=r({});function configValueOrDefault(e,t,n){return e[t]||n}var u=function(e){return e.SUPPORTS_PREVIEW_METADATA=`supports_preview_metadata`,e.MAX_UPLOAD_SIZE=`max_upload_size`,e.MANAGER_SUPPORTS_V4=`extension.manager.supports_v4`,e.MODEL_UPLOAD_BUTTON_ENABLED=`model_upload_button_enabled`,e.ASSET_RENAME_ENABLED=`asset_rename_enabled`,e.PRIVATE_MODELS_ENABLED=`private_models_enabled`,e.ONBOARDING_SURVEY_ENABLED=`onboarding_survey_enabled`,e.LINEAR_TOGGLE_ENABLED=`linear_toggle_enabled`,e.TEAM_WORKSPACES_ENABLED=`team_workspaces_enabled`,e.USER_SECRETS_ENABLED=`user_secrets_enabled`,e.NODE_REPLACEMENTS=`node_replacements`,e.NODE_LIBRARY_ESSENTIALS_ENABLED=`node_library_essentials_enabled`,e.WORKFLOW_SHARING_ENABLED=`workflow_sharing_enabled`,e.COMFYHUB_UPLOAD_ENABLED=`comfyhub_upload_enabled`,e.COMFYHUB_PROFILE_GATE_ENABLED=`comfyhub_profile_gate_enabled`,e}({});function resolveFlag(e,t,n){let r=a(e);return r===void 0?t??o.getServerFeature(e,n):r}function useFeatureFlags(){let r=t({get supportsPreviewMetadata(){return o.getServerFeature(u.SUPPORTS_PREVIEW_METADATA)},get maxUploadSize(){return o.getServerFeature(u.MAX_UPLOAD_SIZE)},get supportsManagerV4(){return o.getServerFeature(u.MANAGER_SUPPORTS_V4)},get modelUploadButtonEnabled(){return resolveFlag(u.MODEL_UPLOAD_BUTTON_ENABLED,l.value.model_upload_button_enabled,!1)},get assetRenameEnabled(){return resolveFlag(u.ASSET_RENAME_ENABLED,l.value.asset_rename_enabled,!1)},get privateModelsEnabled(){return resolveFlag(u.PRIVATE_MODELS_ENABLED,l.value.private_models_enabled,!1)},get onboardingSurveyEnabled(){return resolveFlag(u.ONBOARDING_SURVEY_ENABLED,l.value.onboarding_survey_enabled,!1)},get linearToggleEnabled(){return resolveFlag(u.LINEAR_TOGGLE_ENABLED,l.value.linear_toggle_enabled,!1)},get teamWorkspacesEnabled(){let e=a(u.TEAM_WORKSPACES_ENABLED);return e===void 0?!i||!c.value?!1:l.value.team_workspaces_enabled??o.getServerFeature(u.TEAM_WORKSPACES_ENABLED,!1):e},get userSecretsEnabled(){return resolveFlag(u.USER_SECRETS_ENABLED,l.value.user_secrets_enabled,!1)},get nodeReplacementsEnabled(){return o.getServerFeature(u.NODE_REPLACEMENTS,!1)},get nodeLibraryEssentialsEnabled(){return l.value.node_library_essentials_enabled??o.getServerFeature(u.NODE_LIBRARY_ESSENTIALS_ENABLED,!1)},get workflowSharingEnabled(){return resolveFlag(u.WORKFLOW_SHARING_ENABLED,l.value.workflow_sharing_enabled,!1)},get comfyHubUploadEnabled(){return resolveFlag(u.COMFYHUB_UPLOAD_ENABLED,l.value.comfyhub_upload_enabled,!1)},get comfyHubProfileGateEnabled(){return resolveFlag(u.COMFYHUB_PROFILE_GATE_ENABLED,l.value.comfyhub_profile_gate_enabled,!1)}}),featureFlag=(t,n)=>e(()=>o.getServerFeature(t,n));return{flags:n(r),featureFlag}}export{s as a,l as i,useFeatureFlags as n,configValueOrDefault as r,u as t};
//# sourceMappingURL=useFeatureFlags-CeS8LuDc.js.map