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BvC,WAAYA,EACZC,EAAGA,EACHC,oBAAqBA","sources":["webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/clsx/clsx.ts","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/icons/dist/ActionsCancelNormalXsmall.js","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/Button/styles.module.scss?95b8","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/Button/Button.tsx","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/Modal/Modal.module.scss?ab51","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/Modal/Modal.tsx","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/ui/Button/LinkButton.tsx","webpack://StravaModern/./node_modules/@strava/api/node_modules/@strava/constants/src/httpStatusCodes.js","webpack://StravaModern/./node_modules/@strava/api/node_modules/@strava/constants/src/followingConstants.js","webpack://StravaModern/./node_modules/@strava/api/microfrontends/athlete/athlete.js","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/react-hooks/src/use-safe-state/useSafeState.hook.ts","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/@strava/constants/src/appConstants.js","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/node_modules/lodash-es/isNil.js","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/src/components/CPRAComplianceModal/CPRAComplianceModal.module.scss?8389","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/src/components/CPRAComplianceModal/CPRAComplianceModal.tsx","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/src/CPRAComplianceCTA.module.scss?ed07","webpack://StravaModern/./node_modules/@strava/cpra-compliance-cta/src/CPRAComplianceCTA.tsx"],"sourcesContent":["type Value = string | number | boolean | undefined | null;\ntype MixObject = {\n [key: string]: boolean | Mix | undefined | null;\n};\ntype MixArray = Array;\ntype Mix = Value | MixObject | MixArray;\n\nfunction toVal(mix: Mix): string {\n let k,\n y,\n str = '';\n\n if (typeof mix === 'string' || typeof mix === 'number') {\n str += mix;\n } else if (typeof mix === 'object') {\n if (Array.isArray(mix)) {\n for (k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if ((y = toVal(mix[k]))) {\n str && (str += ' ');\n str += y;\n }\n }\n }\n } else {\n for (k in mix) {\n if (!mix || mix[k]) {\n str && (str += ' ');\n str += k;\n }\n }\n }\n }\n\n return str;\n}\n\nexport function clsx(..._args: Mix[]): string {\n let i = 0,\n tmp,\n x,\n str = '';\n\n while (i < arguments.length) {\n if ((tmp = arguments[i++])) {\n if ((x = toVal(tmp))) {\n str && (str += ' ');\n str += x;\n }\n }\n }\n return str;\n}\n\nexport default clsx;\n","import * as React from \"react\";\nimport PropTypes from \"prop-types\";\nconst SvgActionsCancelNormalXsmall = React.forwardRef(\n ({ color, size, title, titleId, ...props }, ref) => (\n \n {title ? {title} : null}\n \n \n )\n);\nSvgActionsCancelNormalXsmall.defaultProps = {\n color: \"currentColor\",\n size: 16,\n title: undefined,\n titleId: undefined,\n};\nSvgActionsCancelNormalXsmall.propTypes = {\n color: PropTypes.string,\n size: PropTypes.number,\n title: PropTypes.string,\n titleId: PropTypes.string,\n};\nexport default SvgActionsCancelNormalXsmall;\n","// extracted by mini-css-extract-plugin\nexport default {\"btn\":\"Button--btn--qzt31\",\"default\":\"Button--default--TueBE\",\"primary\":\"Button--primary--xLuUm\",\"primaryOutline\":\"Button--primaryOutline--o8ikY\",\"secondary\":\"Button--secondary--nTxHS\",\"icon\":\"Button--icon--Jo4RT\",\"text\":\"Button--text--XZkQC\"};","import React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.module.scss';\n\nexport interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n children: React.ReactNode;\n variant?:\n | 'default'\n | 'primary'\n | 'primaryOutline'\n | 'secondary'\n | 'icon'\n | 'text';\n className?: string;\n}\n\nconst Button = React.forwardRef(\n ({ children, className, variant = 'default', ...props }, ref) => (\n \n {children}\n \n )\n);\n\nexport default Button;\n","// extracted by mini-css-extract-plugin\nexport default {\"overlay\":\"Modal--overlay--8jZHE\",\"dialog\":\"Modal--dialog--aSHqe\",\"closeButton\":\"Modal--closeButton--ojx5J\",\"title\":\"Modal--title--+-KBf\",\"heroImage\":\"Modal--heroImage--aGycP\",\"body\":\"Modal--body--PejEr\",\"actions\":\"Modal--actions--MGkUD\"};","import React from 'react';\nimport {\n DialogOverlay,\n DialogOverlayProps,\n DialogContent,\n DialogContentProps\n} from '@reach/dialog';\nimport ActionsCancelNormalXsmall from '@strava/icons/ActionsCancelNormalXsmall';\nimport clsx from '../clsx';\nimport { color as colors } from '@strava/ui-tokens/js';\nimport Button from '../Button/Button';\n\nimport styles from './Modal.module.scss';\nimport './ReachUI.css';\n\n//\n// ModalOverlay\n//\n// Reach UI docs: https://reach.tech/dialog/#dialogoverlay\n// --------------------\n\nexport interface ModalOverlayProps\n extends DialogOverlayProps,\n React.ComponentPropsWithoutRef<'div'> {\n className?: string;\n}\n\nexport function ModalOverlay({\n className,\n children,\n ...otherProps\n}: ModalOverlayProps) {\n return (\n \n {children}\n \n );\n}\n\n//\n// ModalContent\n//\n// Reach UI docs: https://reach.tech/dialog/#dialogcontent\n// --------------------\n\nexport interface ModalContentProps\n extends DialogContentProps,\n React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport function ModalContent({\n className,\n children,\n ...otherProps\n}: ModalContentProps) {\n return (\n \n {children}\n \n );\n}\n\n//\n// ModalTitle\n// --------------------\n\nexport interface ModalTitleProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function ModalTitle({\n className,\n children,\n ...otherProps\n}: ModalTitleProps) {\n return (\n

\n {children}\n

\n );\n}\n\n//\n// ModalActions\n// --------------------\n\nexport interface ModalActionsProps\n extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function ModalActions({\n className,\n children,\n ...otherProps\n}: ModalActionsProps) {\n return (\n
\n {children}\n
\n );\n}\n\n//\n// ModalHeroImage\n// --------------------\n\nexport interface ModalHeroImageProps\n extends React.ComponentPropsWithoutRef<'img'> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function ModalHeroImage({\n className,\n src,\n alt,\n ...otherProps\n}: ModalHeroImageProps) {\n return (\n \n );\n}\n\n//\n// ModalBody\n// --------------------\n\nexport interface ModalBodyProps extends React.ComponentPropsWithoutRef<'div'> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function ModalBody({ className, ...otherProps }: ModalBodyProps) {\n return
;\n}\n\n//\n// ModalCloseButton\n// --------------------\n\nexport interface ModalCloseButtonProps\n extends React.ComponentPropsWithoutRef<'button'> {\n className?: string;\n color?: string;\n}\n\nexport function ModalCloseButton({\n className,\n color,\n ...otherProps\n}: ModalCloseButtonProps) {\n return (\n \n );\n}\n\n//\n// Modal\n// --------------------\n\nexport interface ModalProps extends React.ComponentPropsWithoutRef<'div'> {\n className?: string;\n isOpen?: boolean;\n onDismiss?: () => void;\n hasClose?: boolean;\n children: React.ReactNode;\n initialFocusRef?: React.RefObject;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nfunction Modal({\n className,\n isOpen = false,\n onDismiss,\n hasClose,\n children,\n initialFocusRef,\n ...otherProps\n}: ModalProps) {\n return (\n \n \n {hasClose && (\n \n )}\n {children}\n \n \n );\n}\n\n// Adding support to use the compound component pattern and have backwards\n// compatibility with the existing pattern. To learn more read,\n// https://www.smashingmagazine.com/2021/08/compound-components-react/\nModal.Overlay = ModalOverlay;\nModal.Content = ModalContent;\nModal.Title = ModalTitle;\nModal.Actions = ModalActions;\nModal.HeroImage = ModalHeroImage;\nModal.Body = ModalBody;\nModal.CloseButton = ModalCloseButton;\n\nexport default Modal;\n","import clsx from 'clsx';\nimport React, { ComponentPropsWithoutRef, forwardRef } from 'react';\n\nimport styles from './styles.module.scss';\nimport { ButtonProps } from './Button';\n\ntype LinkButtonProps = ButtonProps & ComponentPropsWithoutRef<'a'>;\n\nconst LinkButton = forwardRef(\n ({ href, children, className, variant = 'default', ...otherProps }, ref) => {\n return (\n \n {children}\n \n );\n }\n);\n\nexport default LinkButton;\n","export const StatusCodes = Object.freeze({\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1\n *\n * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n */\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1\n *\n * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n */\n CONTINUE: 100,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2\n *\n * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n */\n SWITCHING_PROTOCOLS: 101,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1\n *\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n */\n PROCESSING: 102,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1\n *\n * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n * GET: The resource has been fetched and is transmitted in the message body.\n * HEAD: The entity headers are in the message body.\n * POST: The resource describing the result of the action is transmitted in the message body.\n * TRACE: The message body contains the request message as received by the server\n */\n OK: 200,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2\n *\n * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n */\n CREATED: 201,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3\n *\n * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n */\n ACCEPTED: 202,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4\n *\n * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n */\n NON_AUTHORITATIVE_INFORMATION: 203,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5\n *\n * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n */\n NO_CONTENT: 204,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6\n *\n * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n */\n RESET_CONTENT: 205,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1\n *\n * This response code is used because of range header sent by the client to separate download into multiple streams.\n */\n PARTIAL_CONTENT: 206,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2\n *\n * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n */\n MULTI_STATUS: 207,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1\n *\n * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n */\n MULTIPLE_CHOICES: 300,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2\n *\n * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n */\n MOVED_PERMANENTLY: 301,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3\n *\n * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n */\n MOVED_TEMPORARILY: 302,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4\n *\n * Server sent this response to directing client to get requested resource to another URI with an GET request.\n */\n SEE_OTHER: 303,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1\n *\n * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n */\n NOT_MODIFIED: 304,\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6\n *\n * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n */\n USE_PROXY: 305,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7\n *\n * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n TEMPORARY_REDIRECT: 307,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3\n *\n * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n PERMANENT_REDIRECT: 308,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1\n *\n * This response means that server could not understand the request due to invalid syntax.\n */\n BAD_REQUEST: 400,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1\n *\n * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n */\n UNAUTHORIZED: 401,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2\n *\n * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n */\n PAYMENT_REQUIRED: 402,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3\n *\n * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n */\n FORBIDDEN: 403,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4\n *\n * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n */\n NOT_FOUND: 404,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5\n *\n * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n */\n METHOD_NOT_ALLOWED: 405,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6\n *\n * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n */\n NOT_ACCEPTABLE: 406,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2\n *\n * This is similar to 401 but authentication is needed to be done by a proxy.\n */\n PROXY_AUTHENTICATION_REQUIRED: 407,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7\n *\n * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n */\n REQUEST_TIMEOUT: 408,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8\n *\n * This response is sent when a request conflicts with the current state of the server.\n */\n CONFLICT: 409,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9\n *\n * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n */\n GONE: 410,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10\n *\n * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n */\n LENGTH_REQUIRED: 411,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2\n *\n * The client has indicated preconditions in its headers which the server does not meet.\n */\n PRECONDITION_FAILED: 412,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11\n *\n * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n */\n REQUEST_TOO_LONG: 413,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12\n *\n * The URI requested by the client is longer than the server is willing to interpret.\n */\n REQUEST_URI_TOO_LONG: 414,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13\n *\n * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n */\n UNSUPPORTED_MEDIA_TYPE: 415,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4\n *\n * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n */\n REQUESTED_RANGE_NOT_SATISFIABLE: 416,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14\n *\n * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n */\n EXPECTATION_FAILED: 417,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2\n *\n * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n */\n IM_A_TEAPOT: 418,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n */\n INSUFFICIENT_SPACE_ON_RESOURCE: 419,\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n *\n * A deprecated response used by the Spring Framework when a method has failed.\n */\n METHOD_FAILURE: 420,\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2\n *\n * Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.\n */\n MISDIRECTED_REQUEST: 421,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3\n *\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UNPROCESSABLE_ENTITY: 422,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4\n *\n * The resource that is being accessed is locked.\n */\n LOCKED: 423,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5\n *\n * The request failed due to failure of a previous request.\n */\n FAILED_DEPENDENCY: 424,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3\n *\n * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n */\n PRECONDITION_REQUIRED: 428,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4\n *\n * The user has sent too many requests in a given amount of time (\"rate limiting\").\n */\n TOO_MANY_REQUESTS: 429,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5\n *\n * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7725\n *\n * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n */\n UNAVAILABLE_FOR_LEGAL_REASONS: 451,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1\n *\n * The server encountered an unexpected condition that prevented it from fulfilling the request.\n */\n INTERNAL_SERVER_ERROR: 500,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2\n *\n * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n */\n NOT_IMPLEMENTED: 501,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3\n *\n * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n */\n BAD_GATEWAY: 502,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4\n *\n * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n */\n SERVICE_UNAVAILABLE: 503,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5\n *\n * This error response is given when the server is acting as a gateway and cannot get a response in time.\n */\n GATEWAY_TIMEOUT: 504,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6\n *\n * The HTTP version used in the request is not supported by the server.\n */\n HTTP_VERSION_NOT_SUPPORTED: 505,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n */\n INSUFFICIENT_STORAGE: 507,\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6\n *\n * The 511 status code indicates that the client needs to authenticate to gain network access.\n */\n NETWORK_AUTHENTICATION_REQUIRED: 511\n});\n\nexport default { StatusCodes };\n","export const FOLLOWING_STATUS = Object.freeze({\n following: 'following',\n pending: 'pending',\n error: 'error',\n canFollow: 'can_follow',\n canRequest: 'can_request'\n});\n\nexport const FOLLOW_ACTIONS = Object.freeze({\n add: 'add',\n followRequested: 'follow_requested',\n following: 'following',\n requestToFollow: 'request_to_follow',\n follow: 'follow'\n});\n\nexport default { FOLLOWING_STATUS, FOLLOW_ACTIONS };\n","import apiClient from '@strava/api/lib/axios-client';\nimport { StatusCodes } from '@strava/constants/src/httpStatusCodes';\nimport { FOLLOWING_STATUS } from '@strava/constants/src/followingConstants';\nimport { convertKeysToCamel } from '@strava/utils';\n\n/**\n * @typedef {Object} CurrentAthlete\n *\n * @property {number} id\n * @property {string} firstname\n * @property {string} lastname\n * @property {number} athleteType\n * @property {boolean} isSubscriber\n * @property {boolean} isSuperUser\n * @property {string} profileMedium\n * @property {string} profileLarge\n * @property {string} measurementUnits\n * @property {string} datePreference\n * @property {string} chartPreference\n * @property {string} viewPreference\n * @property {Object} features\n * @property {Object} experiments\n * @property {Object} preferences\n * @property {boolean} inPreview\n * @property {number} numDaysRemainingInPreview\n * */\n\n/**\n * @description Fetches the current logged in athlete.\n *\n * @returns {Promise.} currentAthlete\n * */\nexport const getCurrentAthlete = async () => {\n const currentAthlete = await apiClient().get(`/frontend/athletes/current`);\n return convertKeysToCamel(currentAthlete.data.currentAthlete);\n};\n\n/**\n * Follows an athlete on strava.\n *\n * @param {Object} param\n * @param {string} param.followerId - id for the athlete who is requesting the follow\n * @param {string} param.followingId - id for the athlete to be followed\n * @returns {Promise} - enum value PENDING or FOLLOWING\n */\nexport const followAthlete = ({ followerId, followingId, logError }) => {\n return new Promise((resolve) => {\n apiClient()\n .post(`/athletes/${followerId}/follows`, {\n follow: {\n follower_id: followerId,\n following_id: followingId\n }\n })\n .then((response) => {\n if (response?.status === StatusCodes.OK) {\n const { data } = response;\n if (data.approved) {\n resolve(FOLLOWING_STATUS.following);\n } else {\n resolve(FOLLOWING_STATUS.pending);\n }\n } else {\n resolve(FOLLOWING_STATUS.error);\n logError(response.error);\n }\n })\n .catch((e) => {\n resolve(FOLLOWING_STATUS.error);\n logError(e);\n });\n });\n};\n\nexport const bulkFollow = ({ followeeIds, logError }) => {\n return new Promise((resolve) => {\n apiClient()\n .post('/athlete/bulk_follow', {\n followee_ids: followeeIds\n })\n .then((response) => {\n const { success, followed_athlete_ids: ids } = response.data;\n resolve({ success, followedAthleteIds: ids || [] });\n })\n .catch((e) => {\n logError(e);\n resolve({ success: false });\n });\n });\n};\n\nexport const unfollowAthlete = ({ followerId, followingId, logError }) => {\n return new Promise((resolve) => {\n apiClient()\n .delete(\n `/athletes/${followerId}/follows/${followingId}`,\n {\n data: {\n follow: {\n follower_id: followerId,\n following_id: followingId\n }\n }\n },\n { headers: { Accept: 'text/javascript' } }\n )\n .then((response) => {\n if (response?.status === StatusCodes.NO_CONTENT) {\n resolve(true);\n } else {\n logError(response);\n resolve(false);\n }\n })\n .catch((e) => {\n logError(e);\n resolve(false);\n });\n });\n};\n\n/**\n * Gets suggested follow list\n *\n * @param {Object} param\n * @param {string} param.callsite - source making the get request\n * @returns {Promise} - list of suggested friends to follow\n */\nexport const getSuggestedFollows = ({ callsite, logError }) => {\n return new Promise((resolve, reject) => {\n apiClient()\n .get('/athlete/suggested_follows', {\n params: { callsite }\n })\n .then((response) => {\n if (response?.status === StatusCodes.OK) {\n const { data } = response;\n resolve(data);\n } else {\n logError(response.error);\n resolve(response.error);\n }\n })\n .catch((e) => {\n logError(e);\n reject(e);\n });\n });\n};\n\nexport const postEmailContactsOnStrava = ({ importedEmails, logError }) => {\n return new Promise((resolve, reject) => {\n apiClient()\n .post('/athletes/email_contacts_on_strava', {\n emails: importedEmails\n })\n .then((response) => {\n if (response?.status === StatusCodes.OK) {\n resolve(response);\n } else {\n logError(response.error);\n resolve(response);\n }\n })\n .catch((e) => {\n logError(e);\n reject(e);\n });\n });\n};\n\nexport const deleteUnderageAthlete = ({ logError, locale }) => {\n return new Promise((resolve, reject) => {\n apiClient({ currentLanguage: locale })\n .delete('/athlete/destroy_u13')\n .then((response) => {\n if (response?.status === StatusCodes.OK) {\n resolve(response);\n } else {\n logError(response.error);\n resolve(response);\n }\n })\n .catch((e) => {\n logError(e);\n reject(e);\n });\n });\n};\n\n/**\n * @param {Object} params\n * @param {string} params.viewingAthleteId\n * @param {string} params.followingId\n * @param {string} params.followerId\n *\n * @return {Promise}\n * */\nexport const postAthleteFollow = ({\n viewingAthleteId,\n followingId,\n followerId\n}) => {\n return apiClient().post(`/athletes/${viewingAthleteId}/follows`, {\n follow: {\n following_id: followingId,\n follower_id: followerId\n }\n });\n};\n\n/**\n * @param {Object} params\n * @param {string} params.viewingAthleteId\n * @param {string} params.followId\n *\n * @return {Promise}\n * */\nexport const deleteAthleteFollow = ({ viewingAthleteId, followId }) =>\n apiClient().delete(`/athletes/${viewingAthleteId}/follows/${followId}`);\n\n/**\n * @param {Object} params\n * @param {string} [params.entity]\n * @param {string} [params.entityId]\n * @param {string} [params.surfaceType]\n *\n * @return {Promise}\n * */\nexport const fetchMentionableEntities = async ({\n entity,\n entityId,\n surfaceType\n}) => {\n let url = '/athlete/mentionable_entities';\n\n const params = new URLSearchParams();\n if (entity && entityId) {\n params.append('parent_type', entity);\n params.append('parent_id', entityId);\n }\n if (surfaceType) {\n params.append('surface_type', surfaceType);\n }\n\n const queryString = params.toString();\n if (queryString) {\n url += `?${queryString}`;\n }\n\n return apiClient().get(url);\n};\n\nexport const putAthleteAttributes = ({ athleteId, attributes, logError }) => {\n return new Promise((resolve) => {\n apiClient({\n options: {\n headers: { accept: 'text/javascript, application/javascript' }\n }\n })\n .put(`/athletes/${athleteId}`, { athlete: attributes })\n .then((response) => {\n if (response?.error) {\n logError(response.error);\n }\n resolve(response);\n })\n .catch((e) => {\n logError(e);\n resolve(e);\n });\n });\n};\n\nexport const updateAthleteSettings = ({ settings, logError }) => {\n return new Promise((resolve, reject) => {\n apiClient()\n .put('/athlete_settings', { settings })\n .then((response) => {\n if (response?.error) {\n logError(response.error);\n }\n resolve(response);\n })\n .catch((e) => {\n logError(e);\n reject(e);\n });\n });\n};\n\nexport const getDataSharingOptOut = ({ logError }) => {\n return new Promise((resolve) => {\n apiClient()\n .get('/athlete_settings/data_sharing')\n .then((response) => {\n if (response?.error) {\n logError(response.error);\n }\n resolve(response);\n })\n .catch((e) => {\n logError(e);\n resolve(e);\n });\n });\n};\n\nexport default {\n postEmailContactsOnStrava,\n followAthlete,\n unfollowAthlete,\n getSuggestedFollows,\n deleteUnderageAthlete,\n putAthleteAttributes,\n updateAthleteSettings,\n getDataSharingOptOut\n};\n","import {\n Dispatch,\n SetStateAction,\n useRef,\n useCallback,\n useEffect,\n useState\n} from 'react';\n\n/**\n * The `useSafeState` hook acts the same as React's `useState`,\n * where we can set the initial state, and it returns (1) the current state,\n * and (2) the state setter.\n *\n * But with `useSafeState`, it will only set the state when the component is mounted\n * in order to prevent memory leaks and avoid this warning:\n * \"Warning: Can’t perform a React state update on an unmounted component.\"\n * When a component is unmounted, we don't want to set the state.\n *\n * This helps when we have async behavior where we call an async API call,\n * then based on the async response, we set the state. But if the component\n * unmounts before the API call resolves, we don't want to set the state.\n * */\n// eslint-disable-next-line import/prefer-default-export\nexport const useSafeState = (\n initialState: S | (() => S)\n): [S, Dispatch>] => {\n const mountedRef = useRef(false);\n const [state, setState] = useState(initialState);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n const setSafeState = useCallback(\n (args) => (mountedRef.current ? setState(args) : () => {}),\n []\n );\n\n return [state, setSafeState];\n};\n","export const YOUNGEST_AGE_ON_PLATFORM = 13;\n\nexport const YOUNGEST_AGE_FOR_HEALTH_AND_PROMO = 16;\n\nexport const GENDER = Object.freeze({\n man: 'man',\n woman: 'woman',\n preferNotSay: 'prefer_not_say',\n nonBinary: 'nonbinary'\n});\n\nexport const LOCALE = Object.freeze({\n deDE: 'de-DE',\n enUS: 'en-US',\n enGB: 'en-GB',\n esES: 'es-ES',\n es419: 'es-419',\n frFR: 'fr-FR',\n itIT: 'it-IT',\n jaJP: 'ja-JP',\n koKR: 'ko-KR',\n nlNL: 'nl-NL',\n ptBR: 'pt-BR',\n ptPT: 'pt-PT',\n ruRU: 'ru-RU',\n zhCN: 'zh-CN',\n zhTW: 'zh-TW'\n});\n\n// If a language has more than one locale, the first in the list is the default\nexport const LANGUAGE_LOCALES = Object.freeze({\n de: [LOCALE.deDE],\n // en is intentionally omitted here since English is the global default\n es: [LOCALE.esES, LOCALE.es419],\n fr: [LOCALE.frFR],\n it: [LOCALE.itIT],\n ja: [LOCALE.jaJP],\n ko: [LOCALE.koKR],\n nl: [LOCALE.nlNL],\n pt: [LOCALE.ptPT, LOCALE.ptBR],\n ru: [LOCALE.ruRU],\n zh: [LOCALE.zhCN, LOCALE.zhTW]\n});\n\nexport const EXPERIMENT_COHORTS = Object.freeze({\n control: 'control',\n variantA: 'variant-a',\n variantB: 'variant-b'\n});\n\nexport const MOBILE_OS = Object.freeze({\n android: 'android',\n iPhone: 'iphone',\n iPad: 'ipad'\n});\n\nexport const SUPPORTED_BROWSERS = Object.freeze({\n chrome: 'chrome',\n firefox: 'firefox',\n safari: 'safari'\n});\n\n// universal link paths from 'apple-app-site-association' file in active\nexport const APPLE_APP_LINK_PATHS = [\n '/dashboard',\n '/activities/*',\n '/athletes/*',\n '/segments/*',\n '/challenges/*',\n '/videos/*',\n '/routes/*',\n '/premium/*',\n '/settings/*',\n '/shop/*',\n '/athlete/*',\n '/clubs/*',\n '/summit/join',\n '/summit/perks',\n '/oauth/mobile/authorize'\n];\n\nexport const ATHLETES_VISIBILITY = Object.freeze({\n optedOut: 'opted_out' // Strava::Athletes::Visibility::OPTED_OUT\n});\n\nexport default {\n YOUNGEST_AGE_ON_PLATFORM,\n YOUNGEST_AGE_FOR_HEALTH_AND_PROMO,\n GENDER,\n LOCALE,\n EXPERIMENT_COHORTS,\n MOBILE_OS,\n SUPPORTED_BROWSERS,\n APPLE_APP_LINK_PATHS,\n ATHLETES_VISIBILITY\n};\n","/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nexport default isNil;\n","// extracted by mini-css-extract-plugin\nexport default {\"modal\":\"CPRAComplianceModal--modal--8jHck\",\"modalTitle\":\"CPRAComplianceModal--modalTitle--Bu6HQ\",\"modalBody\":\"CPRAComplianceModal--modalBody--rAs+7\",\"modalActions\":\"CPRAComplianceModal--modalActions--tP+CZ\"};","import React, { useEffect } from 'react';\nimport { Markup } from 'interweave';\nimport Modal, { ModalTitle, ModalBody, ModalActions } from '@strava/ui/Modal';\nimport Button from '@strava/ui/Button';\nimport {\n getDataSharingOptOut,\n updateAthleteSettings\n} from '@strava/api/microfrontends/athlete';\nimport {\n useStravaAnalytics,\n useStravaErrorLogging\n} from '@strava/container-context';\nimport { useSafeState } from '@strava/react-hooks/src/use-safe-state';\nimport { ATHLETES_VISIBILITY } from '@strava/constants/src/appConstants';\nimport { isNil } from 'lodash-es';\n\nimport styles from './CPRAComplianceModal.module.scss';\n\ninterface Props {\n onDismiss: () => void;\n isLoggedIn: boolean;\n t: (\n key: string,\n params?: Record\n ) => string;\n dataSharingOptedOut?: boolean;\n}\n\nconst CPRAComplianceModal = ({\n onDismiss,\n isLoggedIn = false,\n t,\n dataSharingOptedOut\n}: Props) => {\n const { logError } = useStravaErrorLogging();\n const { track } = useStravaAnalytics();\n const [isProcessing, setIsProcessing] = useSafeState(false);\n const [isOptedOut, setIsOptedOut] = useSafeState(\n dataSharingOptedOut || false\n );\n\n useEffect(() => {\n // retrieve data sharing opt out status if its not provided as a prop\n if (isNil(dataSharingOptedOut)) {\n setIsProcessing(true);\n (async () => {\n const response = await getDataSharingOptOut({ logError });\n if (response?.data?.['opted_out']) {\n setIsOptedOut(true);\n } else {\n setIsProcessing(false);\n }\n })();\n }\n }, [logError, setIsProcessing, setIsOptedOut, dataSharingOptedOut]);\n\n useEffect(() => {\n track({\n category: 'privacy_compliance',\n page: 'do_not_share_info',\n action: 'screen_enter',\n element: 'modal',\n properties: {\n page_url: window.location.href\n }\n });\n }, [track]);\n\n const handleOptOut = async () => {\n setIsProcessing(true);\n if (isLoggedIn) {\n try {\n await updateAthleteSettings({\n settings: { data_sharing: ATHLETES_VISIBILITY.optedOut },\n logError\n });\n setIsOptedOut(true);\n } catch (error) {\n // let user try again\n setIsProcessing(false);\n }\n } else {\n // domain and cookie expiration logic copied from the cookie banner logic in active\n let domain;\n if (/localhost/.test(window.location.hostname)) {\n domain = 'localhost';\n } else if (/staging\\./.test(window.location.hostname)) {\n domain = '.staging.strava.com';\n } else {\n domain = '.strava.com';\n }\n\n const cookieExpiration = new Date();\n cookieExpiration.setFullYear(cookieExpiration.getFullYear() + 1);\n\n document.cookie =\n `_strava_cpra=${ATHLETES_VISIBILITY.optedOut};` +\n `expires=${cookieExpiration.toUTCString()};` +\n `domain=${domain};` +\n 'path=/;';\n\n setIsOptedOut(true);\n }\n\n track({\n category: 'privacy_compliance',\n page: 'do_not_share_info',\n action: 'click',\n element: 'opt_out'\n });\n };\n\n return (\n \n {t('modal.title')}\n \n \n \n \n \n \n \n {isOptedOut ? t('modal.opted_out') : t('modal.opt_out')}\n \n \n \n );\n};\n\nexport default CPRAComplianceModal;\n","// extracted by mini-css-extract-plugin\nexport default {\"cpraButton\":\"src--cpraButton--YfO7q\"};","import React, { useCallback, useState } from 'react';\nimport { useStravaTranslations } from '@strava/container-context';\nimport clsx from '@strava/ui/clsx';\nimport CPRAComplianceModal from './components/CPRAComplianceModal';\n\nimport styles from './CPRAComplianceCTA.module.scss';\n\nexport interface CPRAComplianceCTAProps {\n isLoggedIn?: boolean;\n className?: string;\n i18nPrefix?: string;\n dataSharingOptedOut?: boolean;\n}\n\nconst CPRAComplianceCTA = ({\n isLoggedIn = false,\n className = '',\n i18nPrefix = '',\n dataSharingOptedOut\n}: CPRAComplianceCTAProps) => {\n const [showModal, setShowModal] = useState(false);\n\n const { t: _t } = useStravaTranslations();\n\n const t = useCallback(\n (\n key: string,\n params?: Record\n ) => _t(`${i18nPrefix}.cpra_compliance_cta.${key}`, { ...params }),\n [_t, i18nPrefix]\n );\n\n return (\n <>\n setShowModal(true)}\n >\n {t('cta')}\n \n {showModal && (\n setShowModal(false)}\n isLoggedIn={isLoggedIn}\n t={t}\n dataSharingOptedOut={dataSharingOptedOut}\n />\n )}\n \n );\n};\n\nexport default CPRAComplianceCTA;\n"],"names":["toVal","mix","k","y","str","Array","isArray","length","_args","_key","arguments","tmp","x","i","SvgActionsCancelNormalXsmall","React","ref","color","size","title","titleId","props","_ref","fill","xmlns","viewBox","width","height","id","d","defaultProps","undefined","propTypes","PropTypes","children","className","variant","clsx","styles","ModalOverlay","otherProps","DialogOverlay","_extends","ModalContent","_ref2","DialogContent","ModalTitle","_ref3","ModalActions","_ref4","ModalBody","_ref6","ModalCloseButton","_ref7","Button","type","ActionsCancelNormalXsmall","colors","Modal","_ref8","isOpen","onDismiss","hasClose","initialFocusRef","onClick","Overlay","Content","Title","Actions","HeroImage","_ref5","src","alt","Body","CloseButton","Object","freeze","CONTINUE","SWITCHING_PROTOCOLS","PROCESSING","OK","CREATED","ACCEPTED","NON_AUTHORITATIVE_INFORMATION","NO_CONTENT","RESET_CONTENT","PARTIAL_CONTENT","MULTI_STATUS","MULTIPLE_CHOICES","MOVED_PERMANENTLY","MOVED_TEMPORARILY","SEE_OTHER","NOT_MODIFIED","USE_PROXY","TEMPORARY_REDIRECT","PERMANENT_REDIRECT","BAD_REQUEST","UNAUTHORIZED","PAYMENT_REQUIRED","FORBIDDEN","NOT_FOUND","METHOD_NOT_ALLOWED","NOT_ACCEPTABLE","PROXY_AUTHENTICATION_REQUIRED","REQUEST_TIMEOUT","CONFLICT","GONE","LENGTH_REQUIRED","PRECONDITION_FAILED","REQUEST_TOO_LONG","REQUEST_URI_TOO_LONG","UNSUPPORTED_MEDIA_TYPE","REQUESTED_RANGE_NOT_SATISFIABLE","EXPECTATION_FAILED","IM_A_TEAPOT","INSUFFICIENT_SPACE_ON_RESOURCE","METHOD_FAILURE","MISDIRECTED_REQUEST","UNPROCESSABLE_ENTITY","LOCKED","FAILED_DEPENDENCY","PRECONDITION_REQUIRED","TOO_MANY_REQUESTS","REQUEST_HEADER_FIELDS_TOO_LARGE","UNAVAILABLE_FOR_LEGAL_REASONS","INTERNAL_SERVER_ERROR","NOT_IMPLEMENTED","BAD_GATEWAY","SERVICE_UNAVAILABLE","GATEWAY_TIMEOUT","HTTP_VERSION_NOT_SUPPORTED","INSUFFICIENT_STORAGE","NETWORK_AUTHENTICATION_REQUIRED","following","pending","error","canFollow","canRequest","add","followRequested","requestToFollow","follow","updateAthleteSettings","_ref11","settings","logError","Promise","resolve","reject","apiClient","put","then","response","catch","e","getDataSharingOptOut","_ref12","get","useSafeState","initialState","mountedRef","useRef","state","setState","useState","useEffect","current","useCallback","args","LOCALE","man","woman","preferNotSay","nonBinary","deDE","enUS","enGB","esES","es419","frFR","itIT","jaJP","koKR","nlNL","ptBR","ptPT","ruRU","zhCN","zhTW","ATHLETES_VISIBILITY","de","es","fr","it","ja","ko","nl","pt","ru","zh","control","variantA","variantB","android","iPhone","iPad","chrome","firefox","safari","optedOut","value","isLoggedIn","t","dataSharingOptedOut","useStravaErrorLogging","track","useStravaAnalytics","isProcessing","setIsProcessing","isOptedOut","setIsOptedOut","isNil","data","category","page","action","element","properties","page_url","window","location","href","Markup","tagName","content","async","data_sharing","domain","test","hostname","cookieExpiration","Date","setFullYear","getFullYear","document","cookie","toUTCString","disabled","i18nPrefix","showModal","setShowModal","_t","useStravaTranslations","key","params","CPRAComplianceModal"],"sourceRoot":""}