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AAY,YAAGF,SAASG,iBAAiB,uBAEJ,IAA3C,QACA,IAAK,IAAIC,GAAC,YAAG,GAAGA,EAAIF,EAAaG,SAAUD,EAAI,IAAD,QAC5CpB,EAAe,CAAEE,KAAMgB,EAAaE,QAiCvC9B,IAAAA,EAAAA,MAED0B,SAASC,iBAAiB,sBAd1B,SAAiC9F,GAAI,IAAD,OAClC,OAAgCmE,IAAAA,EAAAA,MAAGnE,EAAEmG,QAA7BpB,EAAR,EAAQA,KAAMC,EAAd,EAAcA,UAAW1E,EAAzB,EAAyBA,MACzB,GAD4C6D,IAAAA,EAAAA,OACvCY,EACH,OADU,IAAD,2BAEV,cAED,IAAMqB,GAAa,YAAGrB,EAAKmB,QAAM/B,IAAAA,EAAAA,GAAAA,KAAGY,EAAK,KAAEZ,IAAAA,EAAAA,GAAAA,KAAGY,IAC9C,GADmDZ,IAAAA,EAAAA,OAC9CiC,EACH,OADmB,IAAD,4BAEnB,2BAEDvB,EAAe,CAAEE,KAAMqB,EAAepB,UAAAA,EAAW1E,MAAAA,OAKnD6D,IAAAA,EAAAA,MAMA0B,SAASC,iBAAiB,sBAAuB9F,SAAAA,GAAO,IAAD,mBACrD0F,EAAAA,uBAAgC1F,EAAEmG,OAAOpB,SAG3C,OAAiBsB,SAjHjB,SAAkBC,GAAa,IAAD,kBAO5B1B,EAAoB,iBAAQA,EAAyB0B,IA0G5BzB,eAAAA","sources":["webpack://StravaModern/./app/javascript/components/shared/FormattedHTMLMessage/index.js","webpack://StravaModern/./app/javascript/utils/I18n.js","webpack://StravaModern/./app/javascript/apps/StravaPackageContextProviders/StravaPackageContextProviders.js","webpack://StravaModern/./app/javascript/apps/StravaPackageContextProviders/index.js","webpack://StravaModern/./app/javascript/utils/react-component-mounter.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst FormattedHTMLMessage = ({ tagName = 'span', message, className, onLinkClick }) => {\n const handleLinkClick = (e) => {\n if (e.target.nodeName === 'A' && !!onLinkClick) {\n onLinkClick(e);\n }\n };\n\n return React.createElement(tagName, {\n className,\n dangerouslySetInnerHTML: {\n __html: message\n },\n onClick: handleLinkClick\n });\n};\n\nFormattedHTMLMessage.propTypes = {\n message: PropTypes.string.isRequired,\n tagName: PropTypes.string,\n className: PropTypes.string,\n onLinkClick: PropTypes.func\n};\n\nexport default FormattedHTMLMessage;\n","import React from 'react';\n\nimport FormattedHTMLMessage from '../components/shared/FormattedHTMLMessage';\n\nfunction t(key, props = {}) {\n return window.Strava.I18n.Locale.t(key, props);\n}\n\nfunction elevationFormatter(unitSystem) {\n return new window.Strava.I18n.ElevationFormatter(unitSystem);\n}\n\nfunction elevationLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelElevationFormatter(unitSystem);\n}\n\nfunction distanceFormatter(unitSystem) {\n return new window.Strava.I18n.DistanceFormatter(unitSystem);\n}\n\nfunction distanceLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelDistanceFormatter(unitSystem);\n}\n\nfunction distancePerTimeFormatter(unitSystem) {\n return new window.Strava.I18n.DistancePerTimeFormatter(unitSystem);\n}\n\nfunction distancePerTimeLabelFormatter(unitSystem) {\n return new window.Strava.I18n.ChartLabelDistancePerTimeFormatter(unitSystem);\n}\n\nfunction percentFormatter() {\n return new window.Strava.I18n.PercentFormatter();\n}\n\nfunction timespanFormatter() {\n return new window.Strava.I18n.TimespanFormatter();\n}\n\nexport default {\n t,\n t_html(key, props = {}, options = {}) {\n return ;\n },\n elevationFormatter,\n elevationLabelFormatter,\n distanceFormatter,\n distanceLabelFormatter,\n distancePerTimeFormatter,\n distancePerTimeLabelFormatter,\n percentFormatter,\n timespanFormatter,\n language() {\n return window.Strava.I18n.Locales.LANGUAGE_CODE;\n },\n measurementUnits() {\n return window.Strava.I18n.UnitSystem.get();\n }\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport I18n from 'utils/I18n';\nimport * as ContainerContext from '@strava/container-context';\nimport {\n logError,\n logMessage,\n setTag,\n setTags,\n setContext,\n withScope\n} from 'utils/sentry';\n\nconst {\n AnalyticsContext,\n ErrorLoggingContext,\n TranslationContext,\n ExperimentContext\n} = ContainerContext;\n\nconst { Provider: AnalyticsProvider } = AnalyticsContext;\nconst { Provider: TranslationProvider } = TranslationContext;\nconst { Provider: ErrorLoggingProvider } = ErrorLoggingContext;\nconst { Provider: ExperimentProvider } = ExperimentContext;\n\nconst analyticsContext = {\n track: (data) => window.Strava.ExternalAnalytics.trackV2(data)\n};\n\nconst translationContext = {\n t: (key, props = {}) => I18n.t(key, props),\n getLanguage: () => I18n.language()\n};\n\nconst errorLoggingContext = {\n logError,\n logMessage,\n setContext,\n setTag,\n setTags,\n withScope\n};\n\n// does not include the branch context\nconst StravaPackageContextProviders = ({ children }) => (\n \n \n \n {} }}>\n {children}\n \n \n \n \n);\n\nStravaPackageContextProviders.propTypes = {\n children: PropTypes.node.isRequired\n};\n\nexport default StravaPackageContextProviders;\n","export { default } from './StravaPackageContextProviders';\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport * as ContainerContext from '@strava/container-context';\nimport { useBranchIO } from '@strava/react-hooks';\nimport StravaPackageContextProviders from '../apps/StravaPackageContextProviders';\nimport { logError, logMessage } from './sentry';\n\nconst { BranchContext } = ContainerContext;\n\nconst { Provider: BranchContextProvider } = BranchContext;\n\nconst BranchContextProxy = ({\n dataSharingOptedOut = false,\n denyNonessentialCookies = true,\n children\n}) => {\n\n const branch = useBranchIO({\n dataSharingOptedOut,\n cookiesAccepted: !denyNonessentialCookies,\n logError\n });\n\n return (\n {children}\n );\n};\n\nBranchContextProxy.propTypes = {\n dataSharingOptedOut: PropTypes.bool.isRequired,\n denyNonessentialCookies: PropTypes.bool.isRequired,\n children: PropTypes.node.isRequired\n};\n\n// Object that stores references to all the registered components\nlet registeredComponents = {};\n\n// Track a single component that should be mounted after the DOM content has loaded\nfunction register(components) {\n // Registered components are passed in as Hash keys (as opposed to individual arguments)\n // in order to preserve their names during JavaScript minification.\n //\n // For example:\n // ReactComponentMounter.register({ Hello });\n\n registeredComponents = { ...registeredComponents, ...components };\n}\n\nfunction mountComponent({ node, component, props }) {\n const className = component || node.getAttribute('data-react-class');\n const reactComponent = registeredComponents[className];\n\n if (!reactComponent) {\n logMessage(`Cannot find a component registered with the name ${className}`);\n return;\n }\n\n const propsJson = node.getAttribute('data-react-props');\n try {\n const reactProps = {\n ...(propsJson && JSON.parse(propsJson)),\n ...props\n };\n\n const { dataSharingOptedOut, denyNonessentialCookies } = reactProps || {};\n\n let reactElement = React.createElement(reactComponent, reactProps);\n\n // react-components imported from published `web` packages\n // these packages are developed locally using MFEs so they need\n // providers from @strava/container-context\n const isPublished = node.getAttribute('data-is-published') === 'true';\n if (isPublished) {\n reactElement = (\n \n \n {reactElement}\n \n \n );\n }\n\n ReactDOM.render(reactElement, node);\n } catch (e) {\n logError(e);\n }\n}\n\n// Allows a page to mount a component right away rather than\n// wait for the DOMContentLoaded event\nfunction inlineMount(node, component) {\n mountComponent({ node, component });\n}\n\n// Search the DOM for all react components to be mounted,\n// and mount them into the DOM\nfunction mountComponents() {\n const nodesToMount = document.querySelectorAll('[data-react-class]');\n // IE does not support NodeList.forEach, so we need to do it the old fashion way\n /* eslint-disable-next-line no-plusplus */\n for (let i = 0; i < nodesToMount.length; ++i) {\n mountComponent({ node: nodesToMount[i] });\n }\n}\n\n// Ensure pages can mount components more specifically\nif (window.stravaInlineMount === undefined) {\n window.stravaInlineMount = inlineMount;\n}\n\n// Add this listener only once, when the module is first imported\ndocument.addEventListener('DOMContentLoaded', mountComponents);\n\n/**\n * Also added once, this listener can be used to render react components\n * that were created after the DOM was loaded via the ruby `react_component` helper\n *\n * example usage:\n *\n * document.dispatchEvent(new CustomEvent('JSCreatedReactNode', {detail: {node: $('#my-react-component')}}))\n * document.dispatchEvent(new CustomEvent('JSCreatedReactNode', {detail: {node: $('#my-react-component')[index]}}))\n */\nfunction mountJSCreatedComponent(e) {\n const { node, component, props } = e.detail;\n if (!node) {\n return;\n }\n\n const unwrappedNode = node.length ? node[0] : node;\n if (!unwrappedNode) {\n return;\n }\n\n mountComponent({ node: unwrappedNode, component, props });\n}\n\ndocument.addEventListener('JSCreatedReactNode', mountJSCreatedComponent);\n\n/**\n * Components mounted using certain erb - jquery setup do not go through their whole\n * lifecyle so they are left unmounted as the athlete interacts on the page.\n *\n * For examples, see interval.js.rb, graph_data_range.js.rb and interval_type.js.rb\n */\ndocument.addEventListener('JSUnmountReactNode', (e) => {\n ReactDOM.unmountComponentAtNode(e.detail.node);\n});\n\nexport default { register, mountComponent };\n"],"names":["cov_26k0eqz9ch","_ref","tagName","message","className","onLinkClick","React","dangerouslySetInnerHTML","__html","onClick","e","target","nodeName","cov_2r1tokpcg7","t","key","props","window","Strava","I18n","Locale","t_html","options","FormattedHTMLMessage","_extends","elevationFormatter","unitSystem","ElevationFormatter","elevationLabelFormatter","ChartLabelElevationFormatter","distanceFormatter","DistanceFormatter","distanceLabelFormatter","ChartLabelDistanceFormatter","distancePerTimeFormatter","DistancePerTimeFormatter","distancePerTimeLabelFormatter","ChartLabelDistancePerTimeFormatter","percentFormatter","PercentFormatter","timespanFormatter","TimespanFormatter","language","Locales","LANGUAGE_CODE","measurementUnits","UnitSystem","get","cov_1nb4yexh4i","ContainerContext","AnalyticsContext","ErrorLoggingContext","TranslationContext","ExperimentContext","AnalyticsProvider","Provider","TranslationProvider","ErrorLoggingProvider","ExperimentProvider","analyticsContext","track","data","ExternalAnalytics","trackV2","translationContext","getLanguage","errorLoggingContext","logError","logMessage","setContext","setTag","setTags","withScope","children","value","getExperiment","cov_2it78ek94o","cov_nd2f96vxg","BranchContext","BranchContextProvider","BranchContextProxy","dataSharingOptedOut","denyNonessentialCookies","branch","useBranchIO","cookiesAccepted","registeredComponents","mountComponent","_ref2","node","component","getAttribute","reactComponent","propsJson","reactProps","JSON","parse","reactElement","isPublished","StravaPackageContextProviders","ReactDOM","undefined","stravaInlineMount","document","addEventListener","nodesToMount","querySelectorAll","i","length","detail","unwrappedNode","register","components"],"sourceRoot":""}