// @flow import * as React from 'react' import { getDefaultShouldForwardProp, composeShouldForwardProps, type StyledOptions, type CreateStyled, type PrivateStyledComponent, type StyledElementType } from './utils' import { withEmotionCache, ThemeContext } from '@emotion/react' import { getRegisteredStyles, insertStyles, registerStyles } from '@emotion/utils' import { serializeStyles } from '@emotion/serialize' import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks' const ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value. Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';". You can read more about this here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences` let isBrowser = typeof document !== 'undefined' const Insertion = ({ cache, serialized, isStringTag }) => { registerStyles(cache, serialized, isStringTag) const rules = useInsertionEffectAlwaysWithSyncFallback(() => insertStyles(cache, serialized, isStringTag) ) if (!isBrowser && rules !== undefined) { let serializedNames = serialized.name let next = serialized.next while (next !== undefined) { serializedNames += ' ' + next.name next = next.next } return (