{"version":3,"file":"safe-string-handler.jsx","sources":["../../../src/react/components/safe-string-handler.tsx"],"sourcesContent":["import type { SafeString } from '@ember/template';\nimport { type ReactElement } from 'react';\n\nexport const isSafeString = (content: unknown): content is SafeString => {\n  return (\n    typeof content === 'object' &&\n    content !== null && // Ensure content is not null\n    'toHTML' in content &&\n    typeof content.toHTML === 'function'\n  );\n};\n\n/**\n * React intl doesn't support HTML content in the message props. It would require using a different system for our translations with tags\n * @deprecated This is a temporary function to translate content that is not yet translated in the new system\n * @param content - The rich content to render\n * @returns A React element with the rendered content\n */\nexport function mapLegacyHTMLTranslatedContent(content: unknown): unknown {\n  return isSafeString(content) ? (\n    <LegacyHTMLTranslatedContent content={content} />\n  ) : (\n    content\n  );\n}\n\nexport function LegacyHTMLTranslatedContent({\n  content,\n}: {\n  content: SafeString;\n}): ReactElement {\n  return <div dangerouslySetInnerHTML={{ __html: content.toHTML() }} />;\n}\n"],"names":["isSafeString","content","toHTML","mapLegacyHTMLTranslatedContent","_jsx","LegacyHTMLTranslatedContent","dangerouslySetInnerHTML","__html"],"mappings":";;;AAGaA,MAAAA,YAAY,GAAIC,OAAgB,IAA4B;AACvE,EAAA,OACE,OAAOA,OAAO,KAAK,QAAQ,IAC3BA,OAAO,KAAK,IAAI;AAAI;EACpB,QAAQ,IAAIA,OAAO,IACnB,OAAOA,OAAO,CAACC,MAAM,KAAK,UAAU,CAAA;AAExC,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,8BAA8BA,CAACF,OAAgB,EAAW;AACxE,EAAA,OAAOD,YAAY,CAACC,OAAO,CAAC,gBAC1BG,GAAA,CAACC,2BAA2B,EAAA;AAACJ,IAAAA,OAAO,EAAEA,OAAAA;GAAU,CAAC,GAEjDA,OACD,CAAA;AACH,CAAA;AAEO,SAASI,2BAA2BA,CAAC;AAC1CJ,EAAAA,OAAAA;AAGF,CAAC,EAAgB;AACf,EAAA,oBAAOG,GAAA,CAAA,KAAA,EAAA;AAAKE,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEN,OAAO,CAACC,MAAM,EAAC;AAAE,KAAA;AAAE,GAAE,CAAC,CAAA;AACvE;;;;"}