{"version":3,"file":"condition.mjs","sources":["../../../../../src/services/content-api/permissions/providers/condition.ts"],"sourcesContent":["import { providerFactory } from '@strapi/utils';\n\nexport interface Condition {\n  name: string;\n  [key: string]: unknown;\n}\n\nexport default (options = {}) => {\n  const provider = providerFactory(options);\n\n  return {\n    ...provider,\n\n    async register(condition: Condition) {\n      if (strapi.isLoaded) {\n        throw new Error(`You can't register new conditions outside the bootstrap function.`);\n      }\n\n      return provider.register(condition.name, condition);\n    },\n  };\n};\n"],"names":["options","provider","providerFactory","register","condition","strapi","isLoaded","Error","name"],"mappings":";;AAOA,8BAAe,CAAA,CAACA,OAAAA,GAAU,EAAE,GAAA;AAC1B,IAAA,MAAMC,WAAWC,eAAAA,CAAgBF,OAAAA,CAAAA;IAEjC,OAAO;AACL,QAAA,GAAGC,QAAQ;AAEX,QAAA,MAAME,UAASC,SAAoB,EAAA;YACjC,IAAIC,MAAAA,CAAOC,QAAQ,EAAE;AACnB,gBAAA,MAAM,IAAIC,KAAAA,CAAM,CAAC,iEAAiE,CAAC,CAAA;AACrF,YAAA;AAEA,YAAA,OAAON,QAAAA,CAASE,QAAQ,CAACC,SAAAA,CAAUI,IAAI,EAAEJ,SAAAA,CAAAA;AAC3C,QAAA;AACF,KAAA;AACF,CAAA;;;;"}