{"version":3,"file":"getIntlayer.mjs","names":["getIntlayerCore"],"sources":["../../src/getIntlayer.ts"],"sourcesContent":["import { getIntlayer as getIntlayerCore } from '@intlayer/core/interpreter';\nimport type {\n  DeclaredLocales,\n  DictionaryKeys,\n  DictionaryRegistryResult,\n  DictionarySelectorForKey,\n  ExtractSelectorLocale,\n  LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { type DeepTransformContent, getPlugins } from './plugins';\n\n/**\n * Picks one dictionary by its key and returns its content for the given\n * locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n */\nexport const getIntlayer = <\n  const T extends DictionaryKeys,\n  const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n  key: T,\n  localeOrSelector?: A\n): DeepTransformContent<\n  DictionaryRegistryResult<T, A>,\n  ExtractSelectorLocale<A>\n> => {\n  const locale = (\n    typeof localeOrSelector === 'object' && localeOrSelector !== null\n      ? localeOrSelector.locale\n      : localeOrSelector\n  ) as LocalesValues | undefined;\n\n  return getIntlayerCore(key, localeOrSelector, getPlugins(locale)) as any;\n};\n"],"mappings":";;;;;;;;;AAgBA,MAAa,eAIX,KACA,qBAIG;CACH,MAAM,SACJ,OAAO,qBAAqB,YAAY,qBAAqB,OACzD,iBAAiB,SACjB;CAGN,OAAOA,cAAgB,KAAK,kBAAkB,WAAW,MAAM,CAAC;AAClE"}