{ "version": 3, "sources": ["../../src/modern/features/init/render-components.js"], "sourcesContent": ["import * as React from 'react'\nimport * as ReactDOM from 'react-dom/client'\nimport { BrowserRouter as Router } from 'react-router-dom'\n\nimport { FlashMessage } from '@ulule/owl-kit-components'\n\nimport { Header } from '@ulule/header'\nimport { t } from '@ulule/localize'\nimport { TrackingProvider } from '@owl-nest/shadow'\nimport * as layout from '@owl-nest/layout'\n\nconst FlashMessages = (props) => {\n const [messages, setMessages] = React.useState(props.messages)\n\n return (\n
\n {messages.map((message, index) => (\n {\n setMessages(messages.filter((_, current) => index !== current))\n }}\n closable\n translations={{\n close: t('Close'),\n }}\n >\n
\n \n ))}\n
\n )\n}\n\nexport const renderCommonComponents = () => {\n // Render header\n const headerContainer = document.getElementById('react-ulule-header')\n\n if (headerContainer) {\n const root = ReactDOM.createRoot(headerContainer)\n root.render(\n (window.UFE.user && window.UFE.user.id) || undefined}\n gtmContainerId={window.UFE.gtmKey}\n >\n {/* This is needed as it is a dependency for partnership tracking. Not ideal. */}\n \n
\n \n ,\n )\n }\n\n // render footer\n const footerContainer = document.getElementById('react-ulule-footer')\n\n if (footerContainer) {\n const root = ReactDOM.createRoot(footerContainer)\n root.render()\n }\n\n const flashContainer = document.getElementById('react-flash-message')\n const messages = window.UFE.notifications\n\n if (flashContainer && messages) {\n const root = ReactDOM.createRoot(flashContainer)\n root.render()\n }\n\n const highlightsContainer = document.getElementById('react-highlights')\n const highlights = window.UFE.highlights\n\n if (highlightsContainer && highlights) {\n const root = ReactDOM.createRoot(highlightsContainer)\n root.render()\n }\n}\n\nfunction shouldDisplaySubnav() {\n return (\n document.location.pathname.startsWith('/categories') ||\n document.location.pathname.startsWith('/channels') ||\n document.location.pathname.startsWith('/discover')\n )\n}\n"], "mappings": "4qBAAAA,IAAAC,IAAA,IAAAC,EAAuB,SACvBC,EAA0B,SAM1B,IAAAC,EAAkB,SAIlB,IAAMC,EAAiBC,GAAU,CAC/B,GAAM,CAACC,EAAUC,CAAW,EAAU,W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SAAS,SAAS,SAAS,WAAW,WAAW,CAErD", "names": ["init_define_process_env", "init_sentry_release_injection_stub", "React", "ReactDOM", "import_localize", "FlashMessages", "props", "messages", "setMessages", "message", "index", "FlashMessage_default", "_", "current", "renderCommonComponents", "headerContainer", "TrackingProvider", "BrowserRouter", "Header", "shouldDisplaySubnav", "footerContainer", "Footer", "getNavSectionList", "flashContainer", "highlightsContainer", "highlights"] }