{"version":3,"file":"injectIntl.mjs","sources":["../../src/common/injectIntl.tsx"],"sourcesContent":["import { useIntl } from 'react-intl';\n\nexport interface WrappedComponentProps {\n  intl: ReturnType<typeof useIntl>;\n}\n\ntype WithIntlProps<P> = Omit<P, keyof WrappedComponentProps>;\n\n/**\n * A higher-order component that injects the `intl` prop into the wrapped component.\n * @deprecated\n * Use the `useIntl` hook instead of the `injectIntl` HOC for functional components. The `injectIntl` HOC is intended for legacy class components\n * @param Component The component to wrap.\n * @returns A new component with the `intl` prop injected.\n */\nexport function injectIntl<T>(Component: React.ComponentType<T>): React.FC<WithIntlProps<T>> {\n  return function WrappedComponent(props: T) {\n    return <Component {...props} intl={useIntl()} />;\n  } as React.FC<WithIntlProps<T>>;\n}\n"],"names":["injectIntl","Component","WrappedComponent","props","_jsx","intl","useIntl"],"mappings":";;;AAeM,SAAUA,UAAUA,CAAIC,SAAiC,EAAA;AAC7D,EAAA,OAAO,SAASC,gBAAgBA,CAACC,KAAQ,EAAA;IACvC,oBAAOC,GAAA,CAACH,SAAS,EAAA;AAAA,MAAA,GAAKE,KAAK;MAAEE,IAAI,EAAEC,OAAO;AAAG,MAAG;EAClD,CAA+B;AACjC;;"}