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ACC,GACf,MAA6B7I,OAAO8I,SAA5BC,EAAR,EAAQA,SAAUC,EAAlB,EAAkBA,OACZC,EAAqBzB,EAAoBd,SAASqC,GACxD,OAAO,UACFF,EADL,CAEEK,KAAMD,EAAqBF,EAASI,OAAOH,GAAUD,QAK7DK,SAAU,CAER,gBACA,iBAEFC,iBAAkBjB,EAClBC,MAAAA,EACAiB,kBAAkB,EAClBrB,QAAAA,EACAsB,aAAc,CACZC,KAAM,CAAEC,GAAIvB,IAEdF,YAAAA,EACA0B,WAAY,SAAC9C,EAAOL,GAClB,OACED,EAAsCC,IACtCI,EAAmCC,IACnCI,EAAuCJ,IACX,aAAxB,MAAJL,OAAA,EAAAA,EAAMC,mBAEC,KAEFI,QAMR,IAAMxF,EAAW,SAACuI,IACnB7F,EAAAA,EAAAA,MAEFK,QAAQyF,MAAM,eAAgBD,GAGhCpB,EAAAA,GAAwBoB,IAGbjL,EAAa,SAACkD,IACrBkC,EAAAA,EAAAA,MAEFK,QAAQC,IAAI,iBAAkBxC,GAGhC2G,EAAAA,GAAsB3G","sources":["webpack://StravaModern/./app/javascript/apps/Microfrontend/styles.scss?dd46","webpack://StravaModern/./app/javascript/apps/Microfrontend/Microfrontend.js","webpack://StravaModern/./app/javascript/coreLibraries.js","webpack://StravaModern/./app/javascript/globalLibraries.js","webpack://StravaModern/./app/javascript/components/shared/FormattedHTMLMessage/index.js","webpack://StravaModern/./app/javascript/utils/I18n.js","webpack://StravaModern/./app/javascript/utils/devUtils.js","webpack://StravaModern/./app/javascript/utils/public-service-env.js","webpack://StravaModern/./app/javascript/utils/react-component-mounter.js","webpack://StravaModern/./app/javascript/utils/sentry.helper.js","webpack://StravaModern/./app/javascript/utils/sentry.js"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport default {\"mfcontainer\":\"Microfrontend--mfcontainer--Sw1H-\"};","import React from 'react';\nimport {\n TranslationContext,\n AnalyticsContext,\n ErrorLoggingContext\n} from '@strava/container-context';\nimport { logError, logMessage } from '../../utils/sentry';\nimport I18n from '../../utils/I18n';\nimport styles from './styles.scss';\nimport { devLog } from '../../utils/devUtils';\n\n// We want to track each url that we use to load a remote entry,\n// because we want to check if we've already downloaded and avoid\n// downloading the same remote multiple times.\nconst remoteUrls = {};\n\n// We want to initialize the 'scope' (remote entry code) a single time,\n// and not many times for many different components.\n// Specifically, we only want to call this line once:\n// `containerResolve(window[scope].init(legacyShareScope));`\nconst initializedScopes = {};\n\nconst cleanup = (scriptElement) => {\n if (scriptElement.parentNode) {\n scriptElement.parentNode.removeChild(scriptElement);\n }\n};\n\nconst loadDynamicScript = (url) => {\n if (remoteUrls[url] == null) {\n remoteUrls[url] = new Promise((resolve, reject) => {\n // insert remote script into document and add\n // onerror and onload listeners that will finalize\n // installation\n const element = document.createElement('script');\n element.src = url;\n element.type = 'text/javascript';\n element.async = true;\n\n element.onload = () => {\n devLog(`Dynamic Script Loaded: ${url}`);\n resolve(element);\n };\n\n element.onerror = () => {\n logMessage(`Dynamic Script Error: ${url}`);\n reject(element);\n };\n\n document.head.appendChild(element);\n });\n }\n\n return remoteUrls[url];\n};\n\nconst cleanupScript = (url) => {\n if (remoteUrls[url]) {\n remoteUrls[url].then(cleanup, cleanup);\n }\n};\n\n// TODO: remove once we've upgraded to webpacker 6 (webpack 5)\n// The code here only supports consumption of federated modules\n// and does not allow hosting federated modules\n// copied from\n// https://github.com/module-federation/practical-module-federation/blob/master/chapter7/packages/home-wp4/src/App.jsx\nconst useDynamicScript = (url) => {\n const [isLoading, setIsLoading] = React.useState(true);\n const [failed, setFailed] = React.useState(false);\n\n React.useEffect(() => {\n if (!url) {\n return;\n }\n\n const promise = loadDynamicScript(url);\n\n setIsLoading(true);\n setFailed(false);\n\n promise.then(\n () => {\n devLog(`Dynamic Script Loaded: ${url}`);\n setIsLoading(false);\n },\n () => {\n logMessage(`Dynamic Script Error: ${url}`);\n setIsLoading(false);\n setFailed(true);\n }\n );\n\n // eslint-disable-next-line consistent-return\n return () => {\n // cleanup code to remove script added as part of loading\n // the remote federated module. This code is ran before\n // another execution of this useEffect is ran before\n // rendering and when the component unmounts\n devLog(`Dynamic Script Removed: ${url}`);\n cleanupScript(url);\n };\n }, [url]);\n\n return {\n isLoading,\n failed\n };\n};\n\n// eslint-disable-next-line react/prop-types\nconst DynamicWidget = ({ url, scope, component, appContext }) => {\n const { isLoading, failed } = useDynamicScript(url);\n\n if (isLoading) {\n return null;\n }\n\n if (failed) {\n return

Failed to load dynamic script: {url}

;\n }\n\n const Component = React.lazy(\n () =>\n // moduleResolve is the reference to use to mark this\n // promise as completed/resolved.\n new Promise((moduleResolve) => {\n // signal webpacker to load the pages react\n // and create a share scope to initialize with\n // the component.\n // eslint-disable-next-line global-require\n const react = require('react');\n\n // eslint-disable-next-line global-require\n const translationscontext = require('@strava/container-context');\n\n const legacyShareScope = {\n react: {\n [react.version]: {\n get: () => {\n return () => react;\n },\n singleton: true,\n loaded: true,\n from: 'webpack4'\n }\n },\n // the context provider needs to be a singleton for the\n // shared info to be the same between container and MFE\n '@strava/container-context': {\n [translationscontext.version]: {\n get: () => {\n return () => translationscontext;\n },\n singleton: true,\n loaded: true,\n from: 'webpack4'\n }\n }\n };\n new Promise((containerResolve) => {\n // when we load the remoteEntry.js, it creates the scope\n // defined in the remote exposed components. We use the\n // pages shared scope to compare the react version on the\n // page vs the one of the remote component\n\n // Initialize a remote once even when multiple components use it\n if (initializedScopes[scope]) {\n containerResolve();\n } else {\n initializedScopes[scope] = true;\n containerResolve(window[scope].init(legacyShareScope));\n }\n }).then(() => {\n // finally, load the component/module and resolve\n // topmost promise\n window[scope].get(component).then((factory) => {\n moduleResolve(factory());\n });\n });\n })\n );\n\n return (\n \n \n \n );\n};\n\n// eslint-disable-next-line no-unused-vars,react/prop-types\nconst Microfrontend = ({ url, scope, component, appContext }) => (\n
\n {\n return window.Strava.ExternalAnalytics.trackV2(data);\n }\n }}\n >\n {\n return I18n.t(key, props);\n },\n getLanguage: () => {\n return I18n.language();\n }\n }}\n >\n \n \n \n \n \n
\n);\n\nexport default Microfrontend;\n","//\n// This file contains imports, such as React and other 3rd party libraries,\n// that do not change frequently.\n//\n// adding random string to force recompile:\n// A998D3152224818D225A880A9B627F1FB4484DD7E408EACA1B243326ED4AA01B\n// General polifyll's\nimport 'core-js/es6/array';\n// React polifyll's\nimport 'core-js/es6/promise'; // for IE 11 and below\nimport 'core-js/es6/map';\nimport 'core-js/es6/set';\nimport 'core-js/modules/es6.object.assign';\nimport 'core-js/es6/string';\nimport 'raf/polyfill';\n// React core\nimport 'react';\nimport 'react-dom';\n/* eslint-disable no-unused-vars */\nimport PropTypes from 'prop-types';\n// Utils\nimport ReactComponentMounter from './utils/react-component-mounter';\nimport Microfrontend from './apps/Microfrontend';\n\nReactComponentMounter.register({\n Microfrontend\n});\n","// This file is deprecated and only used to move node_modules accessed in the\n// sprockets asset pipeline to webpack entry points\n// adding random string to force recompile:\n// A998D3152224818D225A880A9B627F1FB4484DD7E408EACA1B243326ED4AA01B\n\n// importing jquery using script-loader to mimic adding jQuery via a script tag\n/* eslint-disable no-unused-vars,import/extensions */\nimport 'jquery/dist/jquery.min.js';\nimport 'leaflet/dist/leaflet.js';\nimport 'dexie/dist/dexie.min.js';\nimport 'intersection-observer/intersection-observer.js';\nimport '@strava/clio/dist/strava_analytics.min.js';\nimport '@strava/autotrack/autotrack.js';\nimport 'dropzone/dist/dropzone.js';\nimport 'blueimp-load-image/js/load-image.all.min.js';\nimport 'dropzone/dist/min/dropzone.min.css';\n\nimport { setPublicServiceEnv } from './utils/public-service-env';\nimport { devLog } from './utils/devUtils';\n\n// Expose method on global scope that sets public keys that are commonly passed\n// to 3rd party libs or tooling.\nif (window.stravaPublicServiceEnv === undefined) {\n window.stravaPublicServiceEnv = setPublicServiceEnv;\n}\n\ndevLog('loading global libraries');\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst FormattedHTMLMessage = ({ tagName, 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\nFormattedHTMLMessage.defaultProps = {\n tagName: 'span',\n className: null,\n onLinkClick: null\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","/**\n * dev utils to make local development easier (dynamically-imported mock data,\n * dev-only console logs, etc.)\n */\n\nexport const isDev = () => {\n return process.env.NODE_ENV === 'development';\n};\n\nexport const isTest = () => process.env.NODE_ENV === 'test';\n\nexport const devLog = (string) => {\n if (isDev() || window?.StravaDevTools?.enabled) {\n // eslint-disable-next-line no-console\n console.log(string);\n }\n};\n\nexport const timeout = (ms) => {\n return new Promise((resolve) => setTimeout(resolve, ms));\n};\n\nexport default { isDev, devLog, timeout };\n","// Object containing no secret key value pairs that are expected to be seen and\n// used in the browser. This keys are commonly passed to 3rd party libs or tooling.\n//\n// Data that gets set to this object is set in the following file:\n// app/views/common/_react_public_service_env.haml\n//\n// Do not set values directly into this object here as that is not intended use\nconst publicServiceEnv = {};\n\n/**\n * Sets data to an object and freezes it on the initial call.\n * @param {Object} envData Object containing key value pairs that are not nested objects\n */\nfunction setPublicServiceEnv(envData) {\n // Only update the object if it's empty as we do not want to allow any updated\n // after the initial call to this method\n if (Object.keys(publicServiceEnv).length === 0) {\n const keys = Object.keys(envData);\n\n if (keys.length > 0) {\n keys.forEach((value) => {\n publicServiceEnv[value] = envData[value];\n });\n\n // Freeze object so that it can not be updated or changed\n Object.freeze(publicServiceEnv);\n }\n }\n}\n\nexport { publicServiceEnv, setPublicServiceEnv };\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { logMessage } from './sentry';\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 reactElement = React.createElement(reactComponent, reactProps);\n ReactDOM.render(reactElement, node);\n } catch (e) {\n logMessage(\n `Could not parse props for component registered with the name ${className}`\n );\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","const BROWSER_EXTENSION = '-extension://';\nconst ANONYMOUS = '';\n\n// see https://github.com/thomaschampagne/elevate/blob/fc5772a12327c0d5015fb0fec64aba1cec6756c7/webextension/scripts/processors/activities-synchronize.ts\nconst ELEVATE_APP_CONSOLE_LOGS = [\n 'Fast sync mode enabled',\n 'A previous sync exists on',\n 'local and remote activities count matches',\n 'Mismatch found between local and remote activities. Syncing first page only.',\n 'Activities fetched in group',\n ', raw activities length: ',\n 'PagesRidden] Resolving with ',\n 'clearSyncCache requested',\n 'Group handled count: ',\n 'Updating synced activities to extension local storage.',\n 'Activities fetched in group'\n];\n\nexport const hasExtensionReferenceInHintErrorStack = (hint) =>\n hint?.originalException?.stack?.includes(BROWSER_EXTENSION);\n\nexport const hasExtensionReferenceInBreadCrumbs = (event) =>\n !!event?.breadcrumbs?.find((entry) => {\n return (\n entry.data?.url?.includes(BROWSER_EXTENSION) ||\n ELEVATE_APP_CONSOLE_LOGS.includes(entry.message)\n );\n });\n\nexport const hasExtensionReferenceInEventErrorStack = (event) => {\n return !!event?.exception?.values?.find((entry) => {\n return !!entry.stacktrace?.frames?.find(\n (frame) =>\n frame?.filename?.includes(BROWSER_EXTENSION) ||\n frame?.abs_path?.includes(BROWSER_EXTENSION) ||\n frame?.filename?.includes(ANONYMOUS) ||\n frame?.abs_path?.includes(ANONYMOUS)\n );\n });\n};\n\nexport default {\n hasExtensionReferenceInHintErrorStack,\n hasExtensionReferenceInBreadCrumbs,\n hasExtensionReferenceInEventErrorStack\n};\n","import * as Sentry from '@sentry/browser';\nimport { BrowserTracing } from '@sentry/tracing';\nimport { isDev } from './devUtils';\nimport {\n hasExtensionReferenceInBreadCrumbs,\n hasExtensionReferenceInHintErrorStack,\n hasExtensionReferenceInEventErrorStack\n} from './sentry.helper';\n\n// List of pages that have the same pathname but different variants controlled with\n// search params. Pages added to this list will have the search param added to the name\n// during tracing (performance tracking)\nconst PAGES_WITH_VARIANTS = ['/onboarding/continue', '/'];\n\nif (!window.StravaSentryDsn) {\n window.StravaSentryDsn = {};\n}\nif (!window.StravaSentryDsn.deferred) {\n window.StravaSentryDsn.deferred = {};\n const promise = new Promise(\n function _(resolve, reject) {\n this.doResolve = resolve;\n this.doReject = reject;\n }.bind(window.StravaSentryDsn.deferred)\n );\n window.StravaSentryDsn.deferred.then = promise.then.bind(promise);\n}\n\nconst { enabled, environment, release, userId, dsn, sampleRate, debug } =\n window.StravaSentry || {};\n\nwindow.StravaSentryDsn.deferred.doResolve(dsn);\n\nwindow.StravaSentryDsn.deferred.then((_dsn) => {\n // configure sentry_frontend.yml to enable sentry on local\n if (enabled) {\n Sentry.init({\n dsn: _dsn,\n maxBreadcrumbs: 50,\n integrations: [\n new BrowserTracing({\n tracingOrigins: [\n 'https://www.staging.strava.com',\n 'https://www.strava.com',\n 'localhost',\n /^\\//\n ],\n beforeNavigate: (context) => {\n const { pathname, search } = window.location;\n const includeSearchParam = PAGES_WITH_VARIANTS.includes(pathname);\n return {\n ...context,\n name: includeSearchParam ? pathname.concat(search) : pathname\n };\n }\n })\n ],\n denyUrls: [\n // Chrome extensions\n /extensions\\//i,\n /^chrome:\\/\\//i\n ],\n tracesSampleRate: sampleRate,\n debug,\n attachStacktrace: true,\n release,\n initialScope: {\n user: { id: userId }\n },\n environment,\n beforeSend: (event, hint) => {\n if (\n hasExtensionReferenceInHintErrorStack(hint) ||\n hasExtensionReferenceInBreadCrumbs(event) ||\n hasExtensionReferenceInEventErrorStack(event) ||\n hint?.originalException === 'Timeout' // google-recaptcha flakiness\n ) {\n return null;\n }\n return event;\n }\n });\n }\n});\n\nexport const logError = (err) => {\n if (isDev()) {\n // eslint-disable-next-line no-console\n console.error('logError :::', err);\n return;\n }\n Sentry.captureException(err);\n};\n\nexport const logMessage = (message) => {\n if (isDev()) {\n // eslint-disable-next-line no-console\n console.log('logMessage :::', message);\n return;\n }\n Sentry.captureMessage(message);\n};\n\nexport default { logError, logMessage };\n"],"names":["remoteUrls","initializedScopes","cleanup","scriptElement","parentNode","removeChild","useDynamicScript","url","React","isLoading","setIsLoading","failed","setFailed","promise","Promise","resolve","reject","element","document","createElement","src","type","async","onload","devLog","onerror","logMessage","head","appendChild","loadDynamicScript","then","cleanupScript","DynamicWidget","scope","component","appContext","Component","moduleResolve","react","require","translationscontext","legacyShareScope","version","get","singleton","loaded","from","containerResolve","window","init","factory","fallback","className","styles","AnalyticsContext","value","track","data","Strava","ExternalAnalytics","trackV2","TranslationContext","t","key","props","I18n","getLanguage","ErrorLoggingContext","logError","ReactComponentMounter","Microfrontend","undefined","stravaPublicServiceEnv","setPublicServiceEnv","FormattedHTMLMessage","tagName","message","onLinkClick","dangerouslySetInnerHTML","__html","onClick","e","target","nodeName","defaultProps","Locale","t_html","options","elevationFormatter","unitSystem","ElevationFormatter","elevationLabelFormatter","ChartLabelElevationFormatter","distanceFormatter","DistanceFormatter","distanceLabelFormatter","ChartLabelDistanceFormatter","distancePerTimeFormatter","DistancePerTimeFormatter","distancePerTimeLabelFormatter","ChartLabelDistancePerTimeFormatter","percentFormatter","PercentFormatter","timespanFormatter","TimespanFormatter","language","Locales","LANGUAGE_CODE","measurementUnits","UnitSystem","isDev","process","string","StravaDevTools","enabled","console","log","timeout","ms","setTimeout","publicServiceEnv","envData","Object","keys","length","forEach","freeze","registeredComponents","mountComponent","node","getAttribute","reactComponent","propsJson","reactProps","JSON","parse","reactElement","ReactDOM","stravaInlineMount","addEventListener","nodesToMount","querySelectorAll","i","detail","unwrappedNode","register","components","BROWSER_EXTENSION","ANONYMOUS","ELEVATE_APP_CONSOLE_LOGS","hasExtensionReferenceInHintErrorStack","hint","originalException","stack","includes","hasExtensionReferenceInBreadCrumbs","event","breadcrumbs","find","entry","hasExtensionReferenceInEventErrorStack","exception","values","stacktrace","frames","frame","filename","abs_path","PAGES_WITH_VARIANTS","StravaSentryDsn","deferred","this","doResolve","doReject","bind","StravaSentry","environment","release","userId","dsn","sampleRate","debug","_dsn","Sentry","maxBreadcrumbs","integrations","BrowserTracing","tracingOrigins","beforeNavigate","context","location","pathname","search","includeSearchParam","name","concat","denyUrls","tracesSampleRate","attachStacktrace","initialScope","user","id","beforeSend","err","error"],"sourceRoot":""}