{"version":3,"file":"useIntlayer.cjs","names":["useIntlayerBase","resolveFallbackLocale"],"sources":["../../../src/server/useIntlayer.ts"],"sourcesContent":["import type {\n  DeclaredLocales,\n  DictionaryKeys,\n  DictionarySelectorForKey,\n  LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useIntlayer as useIntlayerBase } from 'react-intlayer/server';\nimport { resolveFallbackLocale } from './ambientLocale';\n\n/**\n * On the server side, hook picking one dictionary by its key and returning the\n * content for the given locale or selector (`{ item }`, `{ variant }`,\n * optionally combined with `locale`).\n *\n * If the locale is not provided, it will use the locale from the server\n * context, falling back to the locale carried by the request.\n */\nexport const useIntlayer = <\n  const T extends DictionaryKeys,\n  const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales,\n>(\n  key: T,\n  localeOrSelector?: A\n): ReturnType<typeof useIntlayerBase<T, A>> =>\n  useIntlayerBase<T, A>(\n    key,\n    localeOrSelector,\n    resolveFallbackLocale(localeOrSelector) as DeclaredLocales | undefined\n  );\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,eAIX,KACA,yBAEAA,mCACE,KACA,kBACAC,mDAAsB,gBAAgB,CACxC"}