{"version":3,"file":"useDictionaryAsync.cjs","names":["getLocale"],"sources":["../../../src/server/useDictionaryAsync.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type {\n  DeclaredLocales,\n  StrictModeLocaleMap,\n} from '@intlayer/types/module_augmentation';\nimport { useDictionaryAsync as useDictionaryAsyncBase } from 'react-intlayer/server';\nimport { getLocale } from './getLocale';\n\n/**\n * On the server side, Hook that transform a dictionary and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useDictionaryAsync = async <\n  T extends Dictionary,\n  L extends DeclaredLocales = DeclaredLocales,\n>(\n  dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,\n  locale?: L\n): ReturnType<typeof useDictionaryAsyncBase<T, L>> => {\n  const storedLocale = await getLocale();\n\n  return useDictionaryAsyncBase<T, L>(dictionaryPromise, locale, storedLocale);\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,qBAAqB,OAIhC,mBACA,WACoD;CAGpD,qDAAoC,mBAAmB,QAAQ,MAFpCA,mCAAU,CAEsC;AAC7E"}