{"version":3,"file":"features.mjs","sources":["../../src/services/features.ts"],"sourcesContent":["/**\n * The features service is responsible for managing features within strapi,\n * including interacting with the feature configuration file to know\n * which are enabled and disabled.\n */\n\nimport type { Core, Modules } from '@strapi/types';\n\ntype FeatureName = keyof Modules.Features.FeaturesConfig['future'];\n\nconst createFeaturesService = (strapi: Core.Strapi): Modules.Features.FeaturesService => {\n  const service: Modules.Features.FeaturesService = {\n    get config() {\n      return strapi.config.get<Modules.Features.FeaturesService['config']>('features');\n    },\n    future: {\n      isEnabled(futureFlagName: string): boolean {\n        return service.config?.future?.[futureFlagName as FeatureName] === true;\n      },\n    },\n  };\n\n  return service;\n};\n\nexport { createFeaturesService };\nexport type FeaturesService = Modules.Features.FeaturesService;\n"],"names":["createFeaturesService","strapi","service","config","get","future","isEnabled","futureFlagName"],"mappings":"AAAA;;;;IAUA,MAAMA,wBAAwB,CAACC,MAAAA,GAAAA;AAC7B,IAAA,MAAMC,OAAAA,GAA4C;AAChD,QAAA,IAAIC,MAAAA,CAAAA,GAAS;AACX,YAAA,OAAOF,MAAAA,CAAOE,MAAM,CAACC,GAAG,CAA6C,UAAA,CAAA;AACvE,QAAA,CAAA;QACAC,MAAAA,EAAQ;AACNC,YAAAA,SAAAA,CAAAA,CAAUC,cAAsB,EAAA;AAC9B,gBAAA,OAAOL,QAAQC,MAAM,EAAEE,MAAAA,GAASE,eAA8B,KAAK,IAAA;AACrE,YAAA;AACF;AACF,KAAA;IAEA,OAAOL,OAAAA;AACT;;;;"}