{"version":3,"file":"useLocaleBase.cjs","names":["internationalization","useContext","IntlayerClientContext"],"sources":["../../../src/client/useLocaleBase.ts"],"sourcesContent":["'use client';\n\nimport { internationalization } from '@intlayer/config/built';\nimport { useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerProvider';\n\nconst { defaultLocale, locales: availableLocales } = internationalization;\n\n/**\n * On the client side, hook to get the current locale and all related fields\n */\nexport const useLocaleBase = () => {\n  const { locale, setLocale } = useContext(IntlayerClientContext) ?? {};\n\n  return {\n    locale, // Current locale\n    defaultLocale, // Principal locale defined in config\n    availableLocales, // List of the available locales defined in config\n    setLocale, // Function to set the locale\n  };\n};\n"],"mappings":";;;;;;;;AAMA,MAAM,EAAE,eAAe,SAAS,qBAAqBA;;;;AAKrD,MAAa,sBAAsB;CACjC,MAAM,EAAE,QAAQ,kBAAcC,kBAAWC,qDAAqB,KAAK,CAAC;CAEpE,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}