styled-components 6.4.0-prerelease.9 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bench/bench-utils.d.ts +9 -0
- package/dist/constructors/constructWithOptions.d.ts +1 -1
- package/dist/constructors/createTheme.d.ts +19 -0
- package/dist/index.d.ts +1 -0
- package/dist/models/ComponentStyle.d.ts +5 -0
- package/dist/models/ServerStyleSheet.d.ts +0 -10
- package/dist/models/StyleSheetManager.d.ts +11 -2
- package/dist/styled-components.browser.cjs.js +3 -3
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +3 -3
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +3 -3
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +3 -3
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +221 -239
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +3 -3
- package/dist/styled-components.min.js.map +1 -1
- package/dist/types.d.ts +23 -26
- package/dist/utils/cssTagged.d.ts +2 -0
- package/dist/utils/joinStrings.d.ts +3 -0
- package/dist/utils/rscCache.d.ts +2 -0
- package/dist/utils/stylis.d.ts +17 -0
- package/dist/utils/stylisPluginRSC.d.ts +3 -0
- package/native/dist/bench/bench-utils.d.ts +9 -0
- package/native/dist/constructors/constructWithOptions.d.ts +1 -1
- package/native/dist/constructors/createTheme.d.ts +19 -0
- package/native/dist/dist/bench/bench-utils.d.ts +9 -0
- package/native/dist/dist/constructors/constructWithOptions.d.ts +1 -1
- package/native/dist/dist/constructors/createTheme.d.ts +19 -0
- package/native/dist/dist/index.d.ts +1 -0
- package/native/dist/dist/models/ComponentStyle.d.ts +5 -0
- package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -10
- package/native/dist/dist/models/StyleSheetManager.d.ts +11 -2
- package/native/dist/dist/types.d.ts +23 -26
- package/native/dist/dist/utils/cssTagged.d.ts +2 -0
- package/native/dist/dist/utils/joinStrings.d.ts +3 -0
- package/native/dist/dist/utils/rscCache.d.ts +2 -0
- package/native/dist/dist/utils/stylis.d.ts +17 -0
- package/native/dist/dist/utils/stylisPluginRSC.d.ts +3 -0
- package/native/dist/index.d.ts +1 -0
- package/native/dist/models/ComponentStyle.d.ts +5 -0
- package/native/dist/models/ServerStyleSheet.d.ts +0 -10
- package/native/dist/models/StyleSheetManager.d.ts +11 -2
- package/native/dist/styled-components.native.cjs.js +1 -1
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +1 -1
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/types.d.ts +23 -26
- package/native/dist/utils/cssTagged.d.ts +2 -0
- package/native/dist/utils/joinStrings.d.ts +3 -0
- package/native/dist/utils/rscCache.d.ts +2 -0
- package/native/dist/utils/stylis.d.ts +17 -0
- package/native/dist/utils/stylisPluginRSC.d.ts +3 -0
- package/package.json +30 -38
- package/native/dist/bench/run.d.ts +0 -5
- package/native/dist/dist/bench/run.d.ts +0 -5
- package/native/dist/dist/test/globals.d.ts +0 -2
- package/native/dist/dist/test/utils.d.ts +0 -163
- package/native/dist/dist/test/veryLargeUnionType.d.ts +0 -1
- package/native/dist/dist/utils/rawElement.d.ts +0 -11
- package/native/dist/test/globals.d.ts +0 -2
- package/native/dist/test/utils.d.ts +0 -163
- package/native/dist/test/veryLargeUnionType.d.ts +0 -1
- package/native/dist/utils/rawElement.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled-components.browser.cjs.js","sources":["../src/constants.ts","../src/utils/error.ts","../src/utils/errors.ts","../src/sheet/GroupIDAllocator.ts","../src/utils/checkDynamicCreation.ts","../src/utils/empties.ts","../src/utils/determineTheme.ts","../src/utils/domElements.ts","../src/utils/escape.ts","../src/utils/generateAlphabeticName.ts","../src/utils/hash.ts","../src/utils/generateComponentId.ts","../src/utils/getComponentName.ts","../src/utils/isTag.ts","../src/utils/generateDisplayName.ts","../src/utils/hoist.ts","../src/utils/isFunction.ts","../src/utils/isStyledComponent.ts","../src/utils/joinStrings.ts","../src/utils/isPlainObject.ts","../src/utils/mixinDeep.ts","../src/utils/setToString.ts","../src/sheet/GroupedTag.ts","../src/sheet/Rehydration.ts","../src/utils/nonce.ts","../src/sheet/dom.ts","../src/sheet/Tag.ts","../src/sheet/Sheet.ts","../src/utils/addUnitIfNeeded.ts","../src/utils/hyphenateStyleName.ts","../src/utils/isKeyframes.ts","../src/utils/isStatelessFunction.ts","../src/utils/flatten.ts","../src/models/ComponentStyle.ts","../src/utils/stylis.ts","../src/models/StyleSheetManager.tsx","../src/models/ThemeProvider.tsx","../src/models/StyledComponent.ts","../src/utils/createWarnTooManyClasses.ts","../src/utils/interleave.ts","../src/constructors/css.ts","../src/constructors/constructWithOptions.ts","../src/constructors/styled.tsx","../src/models/GlobalStyle.ts","../src/utils/isStaticRules.ts","../src/constructors/createGlobalStyle.ts","../src/constructors/createTheme.ts","../src/models/Keyframes.ts","../src/secretInternals.ts","../src/base.ts","../src/models/ServerStyleSheet.tsx","../src/constructors/keyframes.ts","../src/hoc/withTheme.tsx"],"sourcesContent":["declare let SC_DISABLE_SPEEDY: boolean | null | undefined;\ndeclare let __VERSION__: string;\n\nimport React from 'react';\n\nexport const SC_ATTR: string =\n (typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||\n 'data-styled';\n\nexport const SC_ATTR_ACTIVE = 'active';\nexport const SC_ATTR_VERSION = 'data-styled-version';\nexport const SC_VERSION = __VERSION__;\nexport const SPLITTER = '/*!sc*/\\n';\n\nexport const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * True when running in a React Server Component environment (createContext\n * is unavailable). In browser / standalone / native builds the entire\n * expression is replaced with the literal `false` via rollup-plugin-replace\n * with empty delimiters (exact string match), enabling rollup constant\n * inlining and terser dead-code elimination for all RSC branches.\n */\nexport const IS_RSC: boolean = typeof React.createContext === 'undefined';\n\nfunction readSpeedyFlag(name: string): boolean | undefined {\n if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {\n const val = process.env[name];\n if (val !== undefined && val !== '') {\n return val !== 'false';\n }\n }\n return undefined;\n}\n\nexport const DISABLE_SPEEDY = Boolean(\n typeof SC_DISABLE_SPEEDY === 'boolean'\n ? SC_DISABLE_SPEEDY\n : (readSpeedyFlag('REACT_APP_SC_DISABLE_SPEEDY') ??\n readSpeedyFlag('SC_DISABLE_SPEEDY') ??\n (typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? process.env.NODE_ENV !== 'production'\n : true))\n);\n\nexport const KEYFRAMES_ID_PREFIX = 'sc-keyframes-';\n\n// Shared empty execution context when generating static styles\nexport const STATIC_EXECUTION_CONTEXT = {};\n","import { Dict } from '../types';\nimport errorMap from './errors';\n\nconst ERRORS: Dict<any> = process.env.NODE_ENV !== 'production' ? errorMap : {};\n\n/**\n * super basic version of sprintf\n */\nfunction format(...args: [string, ...any]) {\n let a = args[0];\n const b = [];\n\n for (let c = 1, len = args.length; c < len; c += 1) {\n b.push(args[c]);\n }\n\n b.forEach(d => {\n a = a.replace(/%[a-z]/, d);\n });\n\n return a;\n}\n\n/**\n * Create an error file out of errors.md for development and a simple web link to the full errors\n * in production mode.\n */\nexport default function throwStyledComponentsError(\n code: string | number,\n ...interpolations: any[]\n) {\n if (process.env.NODE_ENV === 'production') {\n return new Error(\n `An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${code} for more information.${\n interpolations.length > 0 ? ` Args: ${interpolations.join(', ')}` : ''\n }`\n );\n } else {\n return new Error(format(ERRORS[code], ...interpolations).trim());\n }\n}\n","export default {\n '1': 'Cannot create styled-component for component: %s.\\n\\n',\n '2': \"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\\n\\n- Are you trying to reuse it across renders?\\n- Are you accidentally calling collectStyles twice?\\n\\n\",\n '3': 'Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\\n\\n',\n '4': 'The `StyleSheetManager` expects a valid target or sheet prop!\\n\\n- Does this error occur on the client and is your target falsy?\\n- Does this error occur on the server and is the sheet falsy?\\n\\n',\n '5': 'The clone method cannot be used on the client!\\n\\n- Are you running in a client-like environment on the server?\\n- Are you trying to run SSR on the client?\\n\\n',\n '6': \"Trying to insert a new style tag, but the given Node is unmounted!\\n\\n- Are you using a custom target that isn't mounted?\\n- Does your document not have a valid head element?\\n- Have you accidentally removed a style tag manually?\\n\\n\",\n '7': 'ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\\n\\n```js\\ntheme={() => ({})}\\n```\\n\\n',\n '8': 'ThemeProvider: Please make your \"theme\" prop an object.\\n\\n',\n '9': 'Missing document `<head>`\\n\\n',\n '10': 'Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\\n\\n',\n '11': '_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\\n\\n',\n '12': 'It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\\\`\\\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\\n\\n',\n '13': '%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\\n\\n',\n '14': 'ThemeProvider: \"theme\" prop is required.\\n\\n',\n '15': \"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\\n\\n```js\\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\\n```\\n\\n\",\n '16': \"Reached the limit of how many styled components may be created at group %s.\\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\\nas for instance in your render method then you may be running into this limitation.\\n\\n\",\n '17': \"CSSStyleSheet could not be found on HTMLStyleElement.\\nHas styled-components' style tag been unmounted or altered by another script?\\n\",\n '18': 'ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`',\n};\n","import styledError from '../utils/error';\n\nconst MAX_SMI = 1 << (31 - 1);\n\nlet groupIDRegister: Map<string, number> = new Map();\nlet reverseRegister: Map<number, string> = new Map();\nlet nextFreeGroup = 1;\n\nexport const resetGroupIds = () => {\n groupIDRegister = new Map();\n reverseRegister = new Map();\n nextFreeGroup = 1;\n};\n\nexport const getGroupForId = (id: string): number => {\n if (groupIDRegister.has(id)) {\n return groupIDRegister.get(id) as any;\n }\n\n while (reverseRegister.has(nextFreeGroup)) {\n nextFreeGroup++;\n }\n\n const group = nextFreeGroup++;\n\n if (process.env.NODE_ENV !== 'production' && ((group | 0) < 0 || group > MAX_SMI)) {\n throw styledError(16, `${group}`);\n }\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n return group;\n};\n\nexport const getIdForGroup = (group: number): void | string => {\n return reverseRegister.get(group);\n};\n\nexport const setGroupForId = (id: string, group: number) => {\n // move pointer\n nextFreeGroup = group + 1;\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n};\n","import React from 'react';\nimport { IS_RSC } from '../constants';\n\nconst invalidHookCallRe = /invalid hook call/i;\nconst seen = new Set();\n\nexport const checkDynamicCreation = (displayName: string, componentId?: string | undefined) => {\n if (process.env.NODE_ENV !== 'production') {\n // Skip check in RSC environments where:\n // 1. Components are always module-level (can't be in render functions)\n // 2. Hook detection is unreliable due to different module evaluation context\n if (IS_RSC) {\n return;\n }\n\n const parsedIdString = componentId ? ` with the id of \"${componentId}\"` : '';\n const message =\n `The component ${displayName}${parsedIdString} has been created dynamically.\\n` +\n \"You may see this warning because you've called styled inside another component.\\n\" +\n 'To resolve this only create new StyledComponents outside of any render method and function component.\\n' +\n 'See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\\n';\n\n // If a hook is called outside of a component:\n // React 17 and earlier throw an error\n // React 18 and above use console.error\n\n const originalConsoleError = console.error;\n try {\n let didNotCallInvalidHook = true;\n console.error = (consoleErrorMessage, ...consoleErrorArgs) => {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test(consoleErrorMessage)) {\n didNotCallInvalidHook = false;\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n } else {\n originalConsoleError(consoleErrorMessage, ...consoleErrorArgs);\n }\n };\n // We purposefully call a hook outside of a component and expect it to throw\n // If it doesn't, then we're inside another component.\n // Use useState instead of useRef to avoid importing useRef\n if (typeof React.useState === 'function') {\n React.useState(null);\n }\n\n if (didNotCallInvalidHook && !seen.has(message)) {\n console.warn(message);\n seen.add(message);\n }\n } catch (error) {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test((error as Error).message)) {\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n }\n } finally {\n console.error = originalConsoleError;\n }\n }\n};\n","import { Dict } from '../types';\n\nexport const EMPTY_ARRAY = Object.freeze([]) as Readonly<any[]>;\nexport const EMPTY_OBJECT = Object.freeze({}) as Readonly<Dict<any>>;\n","import { DefaultTheme, ExecutionProps } from '../types';\nimport { EMPTY_OBJECT } from './empties';\n\nexport default function determineTheme(\n props: ExecutionProps,\n providedTheme?: DefaultTheme | undefined,\n defaultProps: { theme?: DefaultTheme | undefined } = EMPTY_OBJECT\n): DefaultTheme | undefined {\n return (props.theme !== defaultProps.theme && props.theme) || providedTheme || defaultProps.theme;\n}\n","// prettier-ignore\nconst elements = [\n 'a','abbr','address','area','article','aside','audio','b','bdi','bdo','blockquote','body','button','br','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','dialog','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','label','legend','li','main','map','mark','menu','meter','nav','object','ol','optgroup','option','output','p','picture','pre','progress','q','rp','rt','ruby','s','samp','search','section','select','slot','small','span','strong','sub','summary','sup','table','tbody','td','template','textarea','tfoot','th','thead','time','tr','u','ul','var','video','wbr','circle','clipPath','defs','ellipse','feBlend','feColorMatrix','feComponentTransfer','feComposite','feConvolveMatrix','feDiffuseLighting','feDisplacementMap','feDistantLight','feDropShadow','feFlood','feFuncA','feFuncB','feFuncG','feFuncR','feGaussianBlur','feImage','feMerge','feMergeNode','feMorphology','feOffset','fePointLight','feSpecularLighting','feSpotLight','feTile','feTurbulence','filter','foreignObject','g','image','line','linearGradient','marker','mask','path','pattern','polygon','polyline','radialGradient','rect','stop','svg','switch','symbol','text','textPath','tspan','use',\n] as const;\n\nexport default new Set(elements);\nexport type SupportedHTMLElements = (typeof elements)[number];\n","// Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier\n// Control characters and non-letter first symbols are not supported\nconst escapeRegex = /[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~-]+/g;\n\nconst dashesAtEnds = /(^-|-$)/g;\n\nexport default function escape(str: string) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}\n","const AD_REPLACER_R = /(a)(d)/gi;\n\n/* This is the \"capacity\" of our alphabet i.e. 2x26 for all letters plus their capitalised\n * counterparts */\nconst charsLength = 52;\n\n/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */\nconst getAlphabeticChar = (code: number) => String.fromCharCode(code + (code > 25 ? 39 : 97));\n\n/* input a number, usually a hash and convert it to base-52 */\nexport default function generateAlphabeticName(code: number) {\n let name = '';\n let x;\n\n /* get a char and divide by alphabet-length */\n for (x = Math.abs(code); x > charsLength; x = (x / charsLength) | 0) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');\n}\n","export const SEED = 5381;\n\n// When we have separate strings it's useful to run a progressive\n// version of djb2 where we pretend that we're still looping over\n// the same string\nexport const phash = (h: number, x: string) => {\n let i = x.length;\n\n while (i) {\n h = (h * 33) ^ x.charCodeAt(--i);\n }\n\n return h;\n};\n\n// Hash a non-negative integer, avoiding String() allocation for single digits.\n// Equivalent to phash(h, String(n)) for n >= 0.\nexport const phashN = (h: number, n: number) => {\n if (n >= 0 && n < 10) return (h * 33) ^ (n + 48);\n return phash(h, '' + n);\n};\n\n// This is a djb2 hashing function\nexport const hash = (x: string) => {\n return phash(SEED, x);\n};\n","import generateAlphabeticName from './generateAlphabeticName';\nimport { hash } from './hash';\n\nexport default function generateComponentId(str: string) {\n return generateAlphabeticName(hash(str) >>> 0);\n}\n","import { StyledTarget } from '../types';\n\nexport default function getComponentName(target: StyledTarget<any>) {\n return (\n (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) ||\n (target as Exclude<StyledTarget<any>, string>).displayName ||\n (target as Function).name ||\n 'Component'\n );\n}\n","import { StyledTarget } from '../types';\n\nexport default function isTag(target: StyledTarget<'web'>): target is string {\n return (\n typeof target === 'string' &&\n (process.env.NODE_ENV !== 'production'\n ? target.charAt(0) === target.charAt(0).toLowerCase()\n : true)\n );\n}\n","import { StyledTarget } from '../types';\nimport getComponentName from './getComponentName';\nimport isTag from './isTag';\n\nexport default function generateDisplayName(target: StyledTarget<any>) {\n return isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`;\n}\n","import React from 'react';\nimport { AnyComponent } from '../types';\n\n// copied from react-is\nconst REACT_MEMO_TYPE = Symbol.for('react.memo');\nconst REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\n\n/**\n * Adapted from hoist-non-react-statics to avoid the react-is dependency.\n */\nconst REACT_STATICS = {\n contextType: true,\n defaultProps: true,\n displayName: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n propTypes: true,\n type: true,\n};\n\nconst KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true,\n};\n\nconst FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n};\n\nconst MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true,\n};\n\nconst TYPE_STATICS: Record<symbol, Record<string, boolean>> = {\n [REACT_FORWARD_REF_TYPE]: FORWARD_REF_STATICS,\n [REACT_MEMO_TYPE]: MEMO_STATICS,\n};\n\ntype OmniComponent = AnyComponent;\n\n// adapted from react-is\nfunction isMemo(\n object: OmniComponent | React.MemoExoticComponent<any>\n): object is React.MemoExoticComponent<any> {\n const $$typeofType = 'type' in object && object.type.$$typeof;\n\n return $$typeofType === REACT_MEMO_TYPE;\n}\n\nfunction getStatics(component: OmniComponent) {\n // React v16.11 and below\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n\n // React v16.12 and above\n return '$$typeof' in component\n ? TYPE_STATICS[component['$$typeof'] as unknown as symbol]\n : REACT_STATICS;\n}\n\nconst defineProperty = Object.defineProperty;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectPrototype = Object.prototype;\n\ntype ExcludeList = {\n [key: string]: true;\n};\n\nexport type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {\n [key in Exclude<\n keyof S,\n S extends React.MemoExoticComponent<any>\n ? keyof typeof MEMO_STATICS | keyof C\n : S extends React.ForwardRefExoticComponent<any>\n ? keyof typeof FORWARD_REF_STATICS | keyof C\n : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C\n >]: S[key];\n};\n\nexport default function hoistNonReactStatics<\n T extends OmniComponent,\n S extends OmniComponent,\n C extends ExcludeList = {},\n>(targetComponent: T, sourceComponent: S, excludelist?: C | undefined) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, excludelist);\n }\n\n const keys: (string | symbol)[] = (\n getOwnPropertyNames(sourceComponent) as (string | symbol)[]\n ).concat(getOwnPropertySymbols(sourceComponent));\n\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i] as string;\n if (\n !(key in KNOWN_STATICS) &&\n !(excludelist && excludelist[key]) &&\n !(sourceStatics && key in sourceStatics) &&\n !(targetStatics && key in targetStatics)\n ) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor!);\n } catch (e) {\n /* ignore */\n }\n }\n }\n }\n\n return targetComponent as T & NonReactStatics<S, C>;\n}\n","export default function isFunction(test: any): test is Function {\n return typeof test === 'function';\n}\n","import { StyledComponentBrand } from '../types';\n\n/** Type guard that returns true if the target is a styled component. */\nexport default function isStyledComponent(target: any): target is StyledComponentBrand {\n return typeof target === 'object' && 'styledComponentId' in target;\n}\n","/**\n * Convenience function for joining strings to form className chains\n */\nexport function joinStrings(a?: string | undefined, b?: string | undefined): string {\n return a && b ? a + ' ' + b : a || b || '';\n}\n\nexport function joinStringArray(arr: string[], sep?: string | undefined): string {\n return arr.join(sep || '');\n}\n","export default function isPlainObject(x: any): x is Record<any, any> {\n return (\n x !== null &&\n typeof x === 'object' &&\n x.constructor.name === Object.name &&\n /* check for reasonable markers that the object isn't an element for react & preact/compat */\n !('props' in x && x.$$typeof)\n );\n}\n","import isPlainObject from './isPlainObject';\n\nfunction mixinRecursively(target: any, source: any, forceMerge = false) {\n /* only merge into POJOs, Arrays, but for top level objects only\n * allow to merge into anything by passing forceMerge = true */\n if (!forceMerge && !isPlainObject(target) && !Array.isArray(target)) {\n return source;\n }\n\n if (Array.isArray(source)) {\n for (let key = 0; key < source.length; key++) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n } else if (isPlainObject(source)) {\n for (const key in source) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n }\n\n return target;\n}\n\n/**\n * Arrays & POJOs merged recursively, other objects and value types are overridden\n * If target is not a POJO or an Array, it will get source properties injected via shallow merge\n * Source objects applied left to right. Mutates & returns target. Similar to lodash merge.\n */\nexport default function mixinDeep(target: any, ...sources: any[]) {\n for (const source of sources) {\n mixinRecursively(target, source, true);\n }\n\n return target;\n}\n","/**\n * If the Object prototype is frozen, the \"toString\" property is non-writable. This means that any objects which inherit this property\n * cannot have the property changed using a \"=\" assignment operator. If using strict mode, attempting that will cause an error. If not using\n * strict mode, attempting that will be silently ignored.\n *\n * If the Object prototype is frozen, inherited non-writable properties can still be shadowed using one of two mechanisms:\n *\n * 1. ES6 class methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#methods\n * 2. Using the `Object.defineProperty()` static method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n *\n * However, this project uses Babel to transpile ES6 classes, and transforms ES6 class methods to use the assignment operator instead:\n * https://babeljs.io/docs/babel-plugin-transform-class-properties#options\n *\n * Therefore, the most compatible way to shadow the prototype's \"toString\" property is to define a new \"toString\" property on this object.\n */\nexport function setToString(object: object, toStringFn: () => string) {\n Object.defineProperty(object, 'toString', { value: toStringFn });\n}\n","import { SPLITTER } from '../constants';\nimport styledError from '../utils/error';\nimport { GroupedTag, Tag } from './types';\n\n/** Create a GroupedTag with an underlying Tag implementation */\nexport const makeGroupedTag = (tag: Tag) => {\n return new DefaultGroupedTag(tag);\n};\n\nconst BASE_SIZE = 1 << 9;\n\nconst DefaultGroupedTag = class DefaultGroupedTag implements GroupedTag {\n groupSizes: Uint32Array;\n length: number;\n tag: Tag;\n\n // Cached position for O(1) sequential indexOfGroup lookups.\n // Avoids the O(n) linear scan on every call by remembering the last\n // computed (group → absoluteIndex) pair and scanning incrementally.\n _cGroup: number;\n _cIndex: number;\n\n constructor(tag: Tag) {\n this.groupSizes = new Uint32Array(BASE_SIZE);\n this.length = BASE_SIZE;\n this.tag = tag;\n this._cGroup = 0;\n this._cIndex = 0;\n }\n\n indexOfGroup(group: number) {\n if (group === this._cGroup) return this._cIndex;\n\n let index = this._cIndex;\n\n if (group > this._cGroup) {\n for (let i = this._cGroup; i < group; i++) {\n index += this.groupSizes[i];\n }\n } else {\n for (let i = this._cGroup - 1; i >= group; i--) {\n index -= this.groupSizes[i];\n }\n }\n\n this._cGroup = group;\n this._cIndex = index;\n return index;\n }\n\n insertRules(group: number, rules: string[]) {\n if (group >= this.groupSizes.length) {\n const oldBuffer = this.groupSizes;\n const oldSize = oldBuffer.length;\n\n let newSize = oldSize;\n while (group >= newSize) {\n newSize <<= 1;\n if (newSize < 0) {\n throw styledError(16, `${group}`);\n }\n }\n\n this.groupSizes = new Uint32Array(newSize);\n this.groupSizes.set(oldBuffer);\n this.length = newSize;\n\n for (let i = oldSize; i < newSize; i++) {\n this.groupSizes[i] = 0;\n }\n }\n\n let ruleIndex = this.indexOfGroup(group + 1);\n let insertedCount = 0;\n\n for (let i = 0, l = rules.length; i < l; i++) {\n if (this.tag.insertRule(ruleIndex, rules[i])) {\n this.groupSizes[group]++;\n ruleIndex++;\n insertedCount++;\n }\n }\n\n // Keep cache consistent: groups after the insertion point shift forward\n if (insertedCount > 0 && this._cGroup > group) {\n this._cIndex += insertedCount;\n }\n }\n\n clearGroup(group: number) {\n if (group < this.length) {\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n this.groupSizes[group] = 0;\n\n for (let i = startIndex; i < endIndex; i++) {\n this.tag.deleteRule(startIndex);\n }\n\n // Keep cache consistent: groups after the cleared group shift backward\n if (length > 0 && this._cGroup > group) {\n this._cIndex -= length;\n }\n }\n }\n\n getGroup(group: number) {\n let css = '';\n if (group >= this.length || this.groupSizes[group] === 0) {\n return css;\n }\n\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n for (let i = startIndex; i < endIndex; i++) {\n css += this.tag.getRule(i) + SPLITTER;\n }\n\n return css;\n }\n};\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION, SPLITTER } from '../constants';\nimport { InsertionTarget } from '../types';\nimport { getIdForGroup, setGroupForId } from './GroupIDAllocator';\nimport { Sheet } from './types';\n\nconst SELECTOR = `style[${SC_ATTR}][${SC_ATTR_VERSION}=\"${SC_VERSION}\"]`;\nconst MARKER_RE = new RegExp(`^${SC_ATTR}\\\\.g(\\\\d+)\\\\[id=\"([\\\\w\\\\d-]+)\"\\\\].*?\"([^\"]*)`);\n\n/**\n * Type guard to check if a node is a ShadowRoot.\n * Uses instanceof when available, with duck-typing fallback for cross-realm scenarios.\n */\nconst isShadowRoot = (node: InsertionTarget | Node): node is ShadowRoot => {\n return (\n (typeof ShadowRoot !== 'undefined' && node instanceof ShadowRoot) ||\n ('host' in node &&\n // https://dom.spec.whatwg.org/#dom-node-document_fragment_node\n node.nodeType === 11)\n );\n};\n\n/**\n * Extract the container (Document or ShadowRoot) from an InsertionTarget.\n * If the target is a ShadowRoot, return it directly.\n * If the target is an HTMLElement, return its root node if it's a ShadowRoot, otherwise return document.\n */\nexport const getRehydrationContainer = (\n target?: InsertionTarget | undefined\n): Document | ShadowRoot => {\n if (!target) {\n return document;\n }\n\n // Check if target is a ShadowRoot\n if (isShadowRoot(target)) {\n return target;\n }\n\n // Check if target is an HTMLElement inside a ShadowRoot\n if ('getRootNode' in target) {\n const root = (target as HTMLElement).getRootNode();\n if (isShadowRoot(root)) {\n return root;\n }\n }\n\n return document;\n};\n\nexport const outputSheet = (sheet: Sheet) => {\n const tag = sheet.getTag();\n const { length } = tag;\n\n let css = '';\n for (let group = 0; group < length; group++) {\n const id = getIdForGroup(group);\n if (id === undefined) continue;\n\n const names = sheet.names.get(id);\n if (names === undefined || !names.size) continue;\n\n const rules = tag.getGroup(group);\n if (rules.length === 0) continue;\n\n const selector = SC_ATTR + '.g' + group + '[id=\"' + id + '\"]';\n\n let content = '';\n for (const name of names) {\n if (name.length > 0) {\n content += name + ',';\n }\n }\n\n // NOTE: It's easier to collect rules and have the marker\n // after the actual rules to simplify the rehydration\n css += rules + selector + '{content:\"' + content + '\"}' + SPLITTER;\n }\n\n return css;\n};\n\nconst rehydrateNamesFromContent = (sheet: Sheet, id: string, content: string) => {\n const names = content.split(',');\n let name;\n\n for (let i = 0, l = names.length; i < l; i++) {\n if ((name = names[i])) {\n sheet.registerName(id, name);\n }\n }\n};\n\nconst rehydrateSheetFromTag = (sheet: Sheet, style: HTMLStyleElement) => {\n const parts = (style.textContent ?? '').split(SPLITTER);\n const rules: string[] = [];\n\n for (let i = 0, l = parts.length; i < l; i++) {\n const part = parts[i].trim();\n if (!part) continue;\n\n const marker = part.match(MARKER_RE);\n\n if (marker) {\n const group = parseInt(marker[1], 10) | 0;\n const id = marker[2];\n\n if (group !== 0) {\n // Rehydrate componentId to group index mapping\n setGroupForId(id, group);\n // Rehydrate names and rules\n // looks like: data-styled.g11[id=\"idA\"]{content:\"nameA,\"}\n rehydrateNamesFromContent(sheet, id, marker[3]);\n sheet.getTag().insertRules(group, rules);\n }\n\n rules.length = 0;\n } else {\n rules.push(part);\n }\n }\n};\n\nexport const rehydrateSheet = (sheet: Sheet) => {\n const container = getRehydrationContainer(sheet.options.target);\n const nodes = container.querySelectorAll(SELECTOR);\n\n for (let i = 0, l = nodes.length; i < l; i++) {\n const node = nodes[i] as any as HTMLStyleElement;\n if (node && node.getAttribute(SC_ATTR) !== SC_ATTR_ACTIVE) {\n rehydrateSheetFromTag(sheet, node);\n\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n }\n};\n","declare let __webpack_nonce__: string;\n\n/**\n * Resolve a CSP nonce from available sources (in priority order):\n * 1. <meta property=\"csp-nonce\"> (Vite puts nonce in the `nonce` attr)\n * 2. <meta name=\"sc-nonce\"> (SC convention, nonce in `content` attr)\n * 3. __webpack_nonce__ global (legacy)\n *\n * For Next.js/Remix, pass nonces explicitly via StyleSheetManager or\n * ServerStyleSheet instead—auto-detection doesn't apply to header-based nonces.\n */\nlet cached: string | undefined | false = false;\n\n/** @internal Reset the nonce cache (for testing only). */\nexport function resetNonceCache() {\n cached = false;\n}\n\nexport default function getNonce(): string | undefined {\n if (cached !== false) return cached;\n\n if (typeof document !== 'undefined') {\n // Vite sets the nonce in the `nonce` attribute. Browsers expose this via\n // the .nonce DOM property but return \"\" from getAttribute('nonce').\n const viteMeta = document.head.querySelector<HTMLMetaElement>('meta[property=\"csp-nonce\"]');\n if (viteMeta) return (cached = viteMeta.nonce || viteMeta.getAttribute('content') || undefined);\n\n const scMeta = document.head.querySelector<HTMLMetaElement>('meta[name=\"sc-nonce\"]');\n if (scMeta) return (cached = scMeta.getAttribute('content') || undefined);\n }\n\n return (cached = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : undefined);\n}\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION } from '../constants';\nimport { InsertionTarget } from '../types';\nimport styledError from '../utils/error';\nimport getNonce from '../utils/nonce';\n\n/** Find last style element if any inside target */\nconst findLastStyleTag = (target: InsertionTarget): void | HTMLStyleElement => {\n const arr = Array.from(target.querySelectorAll<HTMLStyleElement>(`style[${SC_ATTR}]`));\n\n return arr[arr.length - 1];\n};\n\n/** Create a style element inside `target` or <head> after the last */\nexport const makeStyleTag = (\n target?: InsertionTarget | undefined,\n nonce?: string | undefined\n): HTMLStyleElement => {\n const head = document.head;\n const parent = target || head;\n const style = document.createElement('style');\n const prevStyle = findLastStyleTag(parent);\n const nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;\n\n style.setAttribute(SC_ATTR, SC_ATTR_ACTIVE);\n style.setAttribute(SC_ATTR_VERSION, SC_VERSION);\n\n const resolvedNonce = nonce || getNonce();\n\n if (resolvedNonce) style.setAttribute('nonce', resolvedNonce);\n\n parent.insertBefore(style, nextSibling);\n\n return style;\n};\n\n/** Get the CSSStyleSheet instance for a given style element */\nexport const getSheet = (tag: HTMLStyleElement): CSSStyleSheet => {\n if (tag.sheet) {\n return tag.sheet as any as CSSStyleSheet;\n }\n\n // Avoid Firefox quirk where the style element might not have a sheet property.\n // Use the tag's root node to find styleSheets — document.styleSheets doesn't\n // include sheets inside shadow roots.\n const root = tag.getRootNode() as Document | ShadowRoot;\n const styleSheets = root.styleSheets ?? document.styleSheets;\n for (let i = 0, l = styleSheets.length; i < l; i++) {\n const sheet = styleSheets[i];\n if (sheet.ownerNode === tag) {\n return sheet as any as CSSStyleSheet;\n }\n }\n\n throw styledError(17);\n};\n\n/** Remove a GlobalStyle's SSR-rendered inline style tag(s) from the DOM */\nexport const removeGlobalStyleTag = (componentId: string, target?: InsertionTarget): void => {\n if (typeof document === 'undefined') return;\n\n const container = target ?? document;\n const styleTags = container.querySelectorAll(`style[data-styled-global=\"${componentId}\"]`);\n styleTags.forEach(tag => tag.remove());\n};\n","import { InsertionTarget } from '../types';\nimport { getSheet, makeStyleTag } from './dom';\nimport { SheetOptions, Tag } from './types';\n\n/** Create a CSSStyleSheet-like tag depending on the environment */\nexport const makeTag = ({ isServer, useCSSOMInjection, target, nonce }: SheetOptions) => {\n if (isServer) {\n return new VirtualTag(target);\n } else if (useCSSOMInjection) {\n return new CSSOMTag(target, nonce);\n } else {\n return new TextTag(target, nonce);\n }\n};\n\nexport const CSSOMTag = class CSSOMTag implements Tag {\n element: HTMLStyleElement;\n\n sheet: CSSStyleSheet;\n\n length: number;\n\n constructor(target?: InsertionTarget | undefined, nonce?: string | undefined) {\n this.element = makeStyleTag(target, nonce);\n\n // Avoid Edge bug where empty style elements don't create sheets\n this.element.appendChild(document.createTextNode(''));\n\n this.sheet = getSheet(this.element);\n this.length = 0;\n }\n\n insertRule(index: number, rule: string): boolean {\n try {\n this.sheet.insertRule(rule, index);\n this.length++;\n return true;\n } catch (_error) {\n return false;\n }\n }\n\n deleteRule(index: number): void {\n this.sheet.deleteRule(index);\n this.length--;\n }\n\n getRule(index: number): string {\n const rule = this.sheet.cssRules[index];\n\n // Avoid IE11 quirk where cssText is inaccessible on some invalid rules\n if (rule && rule.cssText) {\n return rule.cssText;\n } else {\n return '';\n }\n }\n};\n\n/** A Tag that emulates the CSSStyleSheet API but uses text nodes */\nexport const TextTag = class TextTag implements Tag {\n element: HTMLStyleElement;\n nodes: NodeListOf<Node>;\n length: number;\n\n constructor(target?: InsertionTarget | undefined, nonce?: string | undefined) {\n this.element = makeStyleTag(target, nonce);\n this.nodes = this.element.childNodes;\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length && index >= 0) {\n const node = document.createTextNode(rule);\n const refNode = this.nodes[index];\n this.element.insertBefore(node, refNode || null);\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.element.removeChild(this.nodes[index]);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.nodes[index].textContent as string;\n } else {\n return '';\n }\n }\n};\n\n/** A completely virtual (server-side) Tag that doesn't manipulate the DOM */\nexport const VirtualTag = class VirtualTag implements Tag {\n rules: string[];\n\n length: number;\n\n constructor(_target?: InsertionTarget | undefined) {\n this.rules = [];\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length) {\n if (index === this.length) {\n this.rules.push(rule);\n } else {\n this.rules.splice(index, 0, rule);\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.rules.splice(index, 1);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.rules[index];\n } else {\n return '';\n }\n }\n};\n","import { DISABLE_SPEEDY, IS_BROWSER, KEYFRAMES_ID_PREFIX } from '../constants';\nimport { InsertionTarget } from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport { setToString } from '../utils/setToString';\nimport { makeGroupedTag } from './GroupedTag';\nimport { getGroupForId } from './GroupIDAllocator';\nimport { getRehydrationContainer, outputSheet, rehydrateSheet } from './Rehydration';\nimport { makeTag } from './Tag';\nimport { GroupedTag, Sheet, SheetOptions } from './types';\n\nlet SHOULD_REHYDRATE = IS_BROWSER;\n\ntype SheetConstructorArgs = {\n isServer?: boolean;\n nonce?: string | undefined;\n useCSSOMInjection?: boolean;\n target?: InsertionTarget | undefined;\n};\n\ntype GlobalStylesAllocationMap = {\n [key: string]: number;\n};\ntype NamesAllocationMap = Map<string, Set<string>>;\n\nconst defaultOptions: SheetOptions = {\n isServer: !IS_BROWSER,\n useCSSOMInjection: !DISABLE_SPEEDY,\n};\n\n/** Contains the main stylesheet logic for stringification and caching */\nexport default class StyleSheet implements Sheet {\n gs: GlobalStylesAllocationMap;\n /** Keyframe component IDs for efficient RSC rendering (avoids scanning all names) */\n keyframeIds: Set<string>;\n names: NamesAllocationMap;\n options: SheetOptions;\n server: boolean;\n tag?: GroupedTag | undefined;\n\n /** Register a group ID to give it an index */\n static registerId(id: string): number {\n return getGroupForId(id);\n }\n\n constructor(\n options: SheetConstructorArgs = EMPTY_OBJECT as Object,\n globalStyles: GlobalStylesAllocationMap = {},\n names?: NamesAllocationMap | undefined\n ) {\n this.options = {\n ...defaultOptions,\n ...options,\n };\n\n this.gs = globalStyles;\n this.keyframeIds = new Set();\n this.names = new Map(names as NamesAllocationMap);\n this.server = !!options.isServer;\n\n // We rehydrate only once and use the sheet that is created first\n if (!this.server && IS_BROWSER && SHOULD_REHYDRATE) {\n SHOULD_REHYDRATE = false;\n rehydrateSheet(this);\n }\n\n setToString(this, () => outputSheet(this));\n }\n\n rehydrate(): void {\n if (!this.server && IS_BROWSER) {\n rehydrateSheet(this);\n }\n }\n\n reconstructWithOptions(options: SheetConstructorArgs, withNames = true) {\n const newSheet = new StyleSheet(\n { ...this.options, ...options },\n this.gs,\n (withNames && this.names) || undefined\n );\n\n newSheet.keyframeIds = new Set(this.keyframeIds);\n\n // If we're reconstructing with a new target on the client, check if the container changed\n // This handles the case where StyleSheetManager's target prop changes (e.g., from undefined to shadowRoot)\n // We only rehydrate if the container (Document or ShadowRoot) actually changes\n if (!this.server && IS_BROWSER && options.target !== this.options.target) {\n const oldContainer = getRehydrationContainer(this.options.target);\n const newContainer = getRehydrationContainer(options.target);\n\n if (oldContainer !== newContainer) {\n rehydrateSheet(newSheet);\n }\n }\n\n return newSheet;\n }\n\n allocateGSInstance(id: string) {\n return (this.gs[id] = (this.gs[id] || 0) + 1);\n }\n\n /** Lazily initialises a GroupedTag for when it's actually needed */\n getTag() {\n return this.tag || (this.tag = makeGroupedTag(makeTag(this.options)));\n }\n\n /** Check whether a name is known for caching */\n hasNameForId(id: string, name: string): boolean {\n return this.names.get(id)?.has(name) ?? false;\n }\n\n /** Mark a group's name as known for caching */\n registerName(id: string, name: string) {\n getGroupForId(id);\n\n if (id.startsWith(KEYFRAMES_ID_PREFIX)) {\n this.keyframeIds.add(id);\n }\n\n const existing = this.names.get(id);\n if (existing) {\n existing.add(name);\n } else {\n this.names.set(id, new Set([name]));\n }\n }\n\n /** Insert new rules which also marks the name as known */\n insertRules(id: string, name: string, rules: string[]) {\n this.registerName(id, name);\n this.getTag().insertRules(getGroupForId(id), rules);\n }\n\n /** Clears all cached names for a given group ID */\n clearNames(id: string) {\n if (this.names.has(id)) {\n (this.names.get(id) as any).clear();\n }\n }\n\n /** Clears all rules for a given group ID */\n clearRules(id: string) {\n this.getTag().clearGroup(getGroupForId(id));\n this.clearNames(id);\n }\n\n /** Clears the entire tag which deletes all rules but not its names */\n clearTag() {\n // NOTE: This does not clear the names, since it's only used during SSR\n // so that we can continuously output only new rules\n this.tag = undefined;\n }\n}\n","/**\n * CSS properties that accept unitless numeric values.\n * Inlined from @emotion/unitless with IE-only entries removed\n * (boxFlex, boxFlexGroup, boxOrdinalGroup, flexPositive, flexNegative,\n * flexOrder, msGridRow, msGridRowSpan, msGridColumn, msGridColumnSpan).\n */\nconst unitless: Record<string, 1> = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexShrink: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1,\n};\n\n// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js\nexport default function addUnitIfNeeded(name: string, value: any) {\n // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133\n if (value == null || typeof value === 'boolean' || value === '') {\n return '';\n }\n\n if (typeof value === 'number' && value !== 0 && !(name in unitless) && !name.startsWith('--')) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers except for CSS variables\n }\n\n return String(value).trim();\n}\n","const isUpper = (c: string) => c >= 'A' && c <= 'Z';\n\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\nexport default function hyphenateStyleName(string: string): string {\n let output = '';\n\n for (let i = 0; i < string.length; i++) {\n const c = string[i];\n // Check for CSS variable prefix\n if (i === 1 && c === '-' && string[0] === '-') {\n return string;\n }\n\n if (isUpper(c)) {\n output += '-' + c.toLowerCase();\n } else {\n output += c;\n }\n }\n\n return output.startsWith('ms-') ? '-' + output : output;\n}\n","import type KeyframesClass from '../models/Keyframes';\n\nconst KEYFRAMES_SYMBOL = Symbol.for('sc-keyframes');\n\nexport default function isKeyframes(value: unknown): value is KeyframesClass {\n return typeof value === 'object' && value !== null && KEYFRAMES_SYMBOL in value;\n}\n\nexport { KEYFRAMES_SYMBOL };\n","import isFunction from './isFunction';\n\nexport default function isStatelessFunction(test: any): test is Function {\n return isFunction(test) && !(test.prototype && test.prototype.isReactComponent);\n}\n","import type StyleSheet from '../sheet';\nimport {\n AnyComponent,\n Dict,\n ExecutionContext,\n Interpolation,\n IStyledComponent,\n RuleSet,\n Stringifier,\n StyledObject,\n} from '../types';\nimport addUnitIfNeeded from './addUnitIfNeeded';\nimport getComponentName from './getComponentName';\nimport hyphenate from './hyphenateStyleName';\nimport isFunction from './isFunction';\nimport isKeyframes from './isKeyframes';\nimport isPlainObject from './isPlainObject';\nimport isStatelessFunction from './isStatelessFunction';\nimport isStyledComponent from './isStyledComponent';\n\n/**\n * It's falsish not falsy because 0 is allowed.\n */\nconst isFalsish = (chunk: any): chunk is undefined | null | false | '' =>\n chunk === undefined || chunk === null || chunk === false || chunk === '';\n\nexport const objToCssArray = (obj: Dict<any>): string[] => {\n const rules = [];\n\n for (const key in obj) {\n const val = obj[key];\n if (!obj.hasOwnProperty(key) || isFalsish(val)) continue;\n\n // @ts-expect-error Property 'isCss' does not exist on type 'any[]'\n if ((Array.isArray(val) && val.isCss) || isFunction(val)) {\n rules.push(hyphenate(key) + ':', val, ';');\n } else if (isPlainObject(val)) {\n rules.push(key + ' {', ...objToCssArray(val), '}');\n } else {\n rules.push(hyphenate(key) + ': ' + addUnitIfNeeded(key, val) + ';');\n }\n }\n\n return rules;\n};\n\nexport default function flatten<Props extends object>(\n chunk: Interpolation<object>,\n executionContext?: (ExecutionContext & Props) | undefined,\n styleSheet?: StyleSheet | undefined,\n stylisInstance?: Stringifier | undefined,\n result: RuleSet<Props> = []\n): RuleSet<Props> {\n if (typeof chunk === 'string') {\n if (chunk) result.push(chunk);\n return result;\n }\n\n if (isFalsish(chunk)) {\n return result;\n }\n\n /* Handle other components */\n if (isStyledComponent(chunk)) {\n result.push(`.${(chunk as unknown as IStyledComponent<'web', any>).styledComponentId}`);\n return result;\n }\n\n /* Either execute or defer the function */\n if (isFunction(chunk)) {\n if (isStatelessFunction(chunk) && executionContext) {\n const fnResult = chunk(executionContext);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof fnResult === 'object' &&\n !Array.isArray(fnResult) &&\n !isKeyframes(fnResult) &&\n !isPlainObject(fnResult) &&\n fnResult !== null\n ) {\n console.error(\n `${getComponentName(\n chunk as AnyComponent\n )} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`\n );\n }\n\n return flatten<Props>(fnResult, executionContext, styleSheet, stylisInstance, result);\n } else {\n result.push(chunk as unknown as IStyledComponent<'web'>);\n return result;\n }\n }\n\n if (isKeyframes(chunk)) {\n if (styleSheet) {\n chunk.inject(styleSheet, stylisInstance);\n result.push(chunk.getName(stylisInstance));\n } else {\n result.push(chunk);\n }\n return result;\n }\n\n /* Handle objects */\n if (isPlainObject(chunk)) {\n const cssArr = objToCssArray(chunk as StyledObject<Props>);\n for (let i = 0; i < cssArr.length; i++) result.push(cssArr[i]);\n return result;\n }\n\n if (!Array.isArray(chunk)) {\n result.push(chunk.toString());\n return result;\n }\n\n for (let i = 0; i < chunk.length; i++) {\n flatten<Props>(chunk[i], executionContext, styleSheet, stylisInstance, result);\n }\n\n return result;\n}\n","import { SC_VERSION } from '../constants';\nimport StyleSheet from '../sheet';\nimport type { AnyComponent } from '../types';\nimport { ExecutionContext, RuleSet, Stringifier } from '../types';\nimport flatten from '../utils/flatten';\nimport generateName from '../utils/generateAlphabeticName';\nimport getComponentName from '../utils/getComponentName';\nimport { hash, phash } from '../utils/hash';\nimport isKeyframes from '../utils/isKeyframes';\nimport isPlainObject from '../utils/isPlainObject';\nimport isStatelessFunction from '../utils/isStatelessFunction';\nimport { joinStringArray, joinStrings } from '../utils/joinStrings';\n\nconst SEED = hash(SC_VERSION);\n\n/**\n * ComponentStyle is all the CSS-specific stuff, not the React-specific stuff.\n */\nexport default class ComponentStyle {\n baseHash: number;\n baseStyle: ComponentStyle | null | undefined;\n componentId: string;\n rules: RuleSet<any>;\n dynamicNameCache: Map<string, string> | undefined;\n\n constructor(rules: RuleSet<any>, componentId: string, baseStyle?: ComponentStyle | undefined) {\n this.rules = rules;\n this.componentId = componentId;\n this.baseHash = phash(SEED, componentId);\n this.baseStyle = baseStyle;\n\n // NOTE: This registers the componentId, which ensures a consistent order\n // for this component's styles compared to others\n StyleSheet.registerId(componentId);\n }\n\n generateAndInjectStyles(\n executionContext: ExecutionContext,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): string {\n let names = this.baseStyle\n ? this.baseStyle.generateAndInjectStyles(executionContext, styleSheet, stylis)\n : '';\n\n {\n let css = '';\n\n for (let i = 0; i < this.rules.length; i++) {\n const partRule = this.rules[i];\n\n if (typeof partRule === 'string') {\n css += partRule;\n } else if (partRule) {\n // Fast path: inline function call for the common case (interpolation\n // returning a string). Avoids flatten's type dispatch and array alloc.\n if (isStatelessFunction(partRule)) {\n const fnResult = partRule(executionContext);\n if (typeof fnResult === 'string') {\n css += fnResult;\n } else if (fnResult !== undefined && fnResult !== null && fnResult !== false) {\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof fnResult === 'object' &&\n !Array.isArray(fnResult) &&\n !isKeyframes(fnResult) &&\n !isPlainObject(fnResult)\n ) {\n console.error(\n `${getComponentName(\n partRule as AnyComponent\n )} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`\n );\n }\n\n css += joinStringArray(\n flatten(fnResult, executionContext, styleSheet, stylis) as string[]\n );\n }\n } else {\n css += joinStringArray(\n flatten(partRule, executionContext, styleSheet, stylis) as string[]\n );\n }\n }\n }\n\n if (css) {\n // Cache css->name to skip phash+generateName for repeat CSS strings.\n // The CSS string fully determines the class name for a given component,\n // so a Map lookup replaces O(cssLen) hashing on cache hit.\n if (!this.dynamicNameCache) this.dynamicNameCache = new Map();\n const cacheKey = stylis.hash ? stylis.hash + css : css;\n let name = this.dynamicNameCache.get(cacheKey);\n if (!name) {\n name = generateName(phash(phash(this.baseHash, stylis.hash), css) >>> 0);\n this.dynamicNameCache.set(cacheKey, name);\n }\n\n if (!styleSheet.hasNameForId(this.componentId, name)) {\n const cssFormatted = stylis(css, '.' + name, undefined, this.componentId);\n styleSheet.insertRules(this.componentId, name, cssFormatted);\n }\n\n names = joinStrings(names, name);\n }\n }\n\n return names;\n }\n}\n","import * as stylis from 'stylis';\nimport { Stringifier } from '../types';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from './empties';\nimport throwStyledError from './error';\nimport { SEED, phash } from './hash';\n\nconst AMP_REGEX = /&/g;\n\n// Character codes for fast comparison\nconst DOUBLE_QUOTE = 34; // \"\nconst SINGLE_QUOTE = 39; // '\nconst SLASH = 47; // /\nconst ASTERISK = 42; // *\nconst BACKSLASH = 92; // \\\nconst OPEN_BRACE = 123; // {\nconst CLOSE_BRACE = 125; // }\nconst SEMICOLON = 59; // ;\nconst NEWLINE = 10; // \\n\nconst OPEN_PAREN = 40; // (\nconst CLOSE_PAREN = 41; // )\n\n/**\n * Strips JS-style line comments (//) from CSS, handling comments anywhere\n * in the line while preserving strings, url() contents, and valid CSS.\n * Optimized with early bail and charCodeAt for performance.\n */\nfunction stripLineComments(css: string): string {\n // Fast path: no // means no line comments\n if (css.indexOf('//') === -1) return css;\n\n const len = css.length;\n const parts: string[] = [];\n let start = 0;\n let i = 0;\n let inString = 0; // 0 = none, DOUBLE_QUOTE or SINGLE_QUOTE when in string\n let urlDepth = 0; // Track nesting depth inside url()\n\n while (i < len) {\n const code = css.charCodeAt(i);\n\n // Track string state\n if (\n (code === DOUBLE_QUOTE || code === SINGLE_QUOTE) &&\n (i === 0 || css.charCodeAt(i - 1) !== BACKSLASH)\n ) {\n if (inString === 0) {\n inString = code;\n } else if (inString === code) {\n inString = 0;\n }\n i++;\n continue;\n }\n\n // Skip string content\n if (inString !== 0) {\n i++;\n continue;\n }\n\n // Handle CSS block comments: skip /* ... */ entirely\n if (code === SLASH && i + 1 < len && css.charCodeAt(i + 1) === ASTERISK) {\n i += 2;\n while (i + 1 < len && !(css.charCodeAt(i) === ASTERISK && css.charCodeAt(i + 1) === SLASH)) {\n i++;\n }\n i += 2; // skip past */\n continue;\n }\n\n // Track url() context - check for 'url(' (case insensitive via | 32)\n if (\n code === OPEN_PAREN &&\n i >= 3 &&\n (css.charCodeAt(i - 1) | 32) === 108 && // l\n (css.charCodeAt(i - 2) | 32) === 114 && // r\n (css.charCodeAt(i - 3) | 32) === 117 // u\n ) {\n urlDepth = 1;\n i++;\n continue;\n }\n\n // Track nested parentheses inside url()\n if (urlDepth > 0) {\n if (code === CLOSE_PAREN) urlDepth--;\n else if (code === OPEN_PAREN) urlDepth++;\n i++;\n continue;\n }\n\n // Strip orphaned */ (no matching /*) — invalid CSS that breaks parsing\n if (code === ASTERISK && i + 1 < len && css.charCodeAt(i + 1) === SLASH) {\n if (i > start) parts.push(css.substring(start, i));\n i += 2;\n start = i;\n continue;\n }\n\n // Check for line comment (only when not in url())\n if (code === SLASH && i + 1 < len && css.charCodeAt(i + 1) === SLASH) {\n if (i > start) parts.push(css.substring(start, i));\n // Skip to end of line\n while (i < len && css.charCodeAt(i) !== NEWLINE) {\n i++;\n }\n start = i;\n continue;\n }\n\n i++;\n }\n\n // No comments found after indexOf check means // was in a string or url()\n if (start === 0) return css;\n if (start < len) parts.push(css.substring(start));\n return parts.join('');\n}\n\n/**\n * Checks if CSS has unbalanced closing braces that would cause stylis\n * to prematurely close rule blocks.\n * Optimized with early bail and charCodeAt for performance.\n */\nfunction hasUnbalancedBraces(css: string): boolean {\n // Fast path: no closing brace means can't have unbalanced braces\n if (css.indexOf('}') === -1) return false;\n\n const len = css.length;\n let depth = 0;\n let inString = 0; // 0 = none, char code when in string\n let inComment = false;\n\n for (let i = 0; i < len; i++) {\n const code = css.charCodeAt(i);\n\n // Handle CSS comments\n if (inString === 0 && !inComment && code === SLASH && css.charCodeAt(i + 1) === ASTERISK) {\n inComment = true;\n i++;\n continue;\n }\n if (inComment) {\n if (code === ASTERISK && css.charCodeAt(i + 1) === SLASH) {\n inComment = false;\n i++;\n }\n continue;\n }\n\n // Track string state\n if (\n (code === DOUBLE_QUOTE || code === SINGLE_QUOTE) &&\n (i === 0 || css.charCodeAt(i - 1) !== BACKSLASH)\n ) {\n if (inString === 0) {\n inString = code;\n } else if (inString === code) {\n inString = 0;\n }\n continue;\n }\n if (inString !== 0) continue;\n\n // Track brace depth\n if (code === OPEN_BRACE) {\n depth++;\n } else if (code === CLOSE_BRACE) {\n depth--;\n if (depth < 0) return true;\n }\n }\n\n return depth !== 0 || inString !== 0;\n}\n\n/**\n * Sanitizes CSS by removing declarations with unbalanced braces.\n * This contains invalid syntax to just the affected declaration.\n * Optimized with charCodeAt for performance.\n */\nfunction sanitizeCSS(css: string): string {\n // Fast path: valid CSS passes through unchanged\n if (!hasUnbalancedBraces(css)) {\n return css;\n }\n\n const len = css.length;\n let result = '';\n let declStart = 0;\n let braceDepth = 0;\n let inString = 0;\n let inComment = false;\n\n for (let i = 0; i < len; i++) {\n const code = css.charCodeAt(i);\n\n // Handle CSS comments\n if (inString === 0 && !inComment && code === SLASH && css.charCodeAt(i + 1) === ASTERISK) {\n inComment = true;\n i++;\n continue;\n }\n if (inComment) {\n if (code === ASTERISK && css.charCodeAt(i + 1) === SLASH) {\n inComment = false;\n i++;\n }\n continue;\n }\n\n // Track string state\n if (\n (code === DOUBLE_QUOTE || code === SINGLE_QUOTE) &&\n (i === 0 || css.charCodeAt(i - 1) !== BACKSLASH)\n ) {\n if (inString === 0) {\n inString = code;\n } else if (inString === code) {\n inString = 0;\n }\n continue;\n }\n if (inString !== 0) continue;\n\n if (code === OPEN_BRACE) {\n braceDepth++;\n } else if (code === CLOSE_BRACE) {\n braceDepth--;\n\n if (braceDepth < 0) {\n // Extra closing brace - skip to next semicolon or newline\n let skipEnd = i + 1;\n while (skipEnd < len) {\n const skipCode = css.charCodeAt(skipEnd);\n if (skipCode === SEMICOLON || skipCode === NEWLINE) break;\n skipEnd++;\n }\n if (skipEnd < len && css.charCodeAt(skipEnd) === SEMICOLON) skipEnd++;\n\n braceDepth = 0;\n i = skipEnd - 1;\n declStart = skipEnd;\n continue;\n }\n\n if (braceDepth === 0) {\n result += css.substring(declStart, i + 1);\n declStart = i + 1;\n }\n } else if (code === SEMICOLON && braceDepth === 0) {\n result += css.substring(declStart, i + 1);\n declStart = i + 1;\n }\n }\n\n // Add remaining valid content\n if (declStart < len) {\n const remaining = css.substring(declStart);\n if (!hasUnbalancedBraces(remaining)) {\n result += remaining;\n }\n }\n\n return result;\n}\n\nexport type ICreateStylisInstance = {\n options?: { namespace?: string | undefined; prefix?: boolean | undefined } | undefined;\n plugins?: stylis.Middleware[] | undefined;\n};\n\n/**\n * Takes an element and recurses through it's rules added the namespace to the start of each selector.\n * Takes into account media queries by recursing through child rules if they are present.\n */\nfunction recursivelySetNamespace(compiled: stylis.Element[], namespace: string): stylis.Element[] {\n for (let i = 0; i < compiled.length; i++) {\n const rule = compiled[i];\n if (rule.type === 'rule') {\n // add the namespace to the start\n rule.value = namespace + ' ' + rule.value;\n // add the namespace after each comma for subsequent selectors.\n rule.value = rule.value.replaceAll(',', ',' + namespace + ' ');\n const props = rule.props as string[];\n const newProps: string[] = [];\n for (let j = 0; j < props.length; j++) {\n newProps[j] = namespace + ' ' + props[j];\n }\n rule.props = newProps;\n }\n\n if (Array.isArray(rule.children) && rule.type !== '@keyframes') {\n rule.children = recursivelySetNamespace(rule.children, namespace);\n }\n }\n return compiled;\n}\n\nexport default function createStylisInstance(\n {\n options = EMPTY_OBJECT as object,\n plugins = EMPTY_ARRAY as unknown as stylis.Middleware[],\n }: ICreateStylisInstance = EMPTY_OBJECT as object\n) {\n let _componentId: string;\n let _selector: string;\n let _selectorRegexp: RegExp | undefined;\n\n const selfReferenceReplacer = (match: string, offset: number, string: string) => {\n if (\n /**\n * We only want to refer to the static class directly if the selector is part of a\n * self-reference selector `& + & { color: red; }`\n */\n string.startsWith(_selector) &&\n string.endsWith(_selector) &&\n string.replaceAll(_selector, '').length > 0\n ) {\n return `.${_componentId}`;\n }\n\n return match;\n };\n\n /**\n * When writing a style like\n *\n * & + & {\n * color: red;\n * }\n *\n * The second ampersand should be a reference to the static component class. stylis\n * has no knowledge of static class so we have to intelligently replace the base selector.\n *\n * https://github.com/thysultan/stylis.js/tree/v4.0.2#abstract-syntax-structure\n */\n const selfReferenceReplacementPlugin: stylis.Middleware = element => {\n if (element.type === stylis.RULESET && element.value.includes('&')) {\n // Lazy RegExp creation: only allocate when self-reference pattern is actually used\n if (!_selectorRegexp) {\n _selectorRegexp = new RegExp(`\\\\${_selector}\\\\b`, 'g');\n }\n\n (element.props as string[])[0] = element.props[0]\n // catch any hanging references that stylis missed\n .replace(AMP_REGEX, _selector)\n .replace(_selectorRegexp, selfReferenceReplacer);\n }\n };\n\n const middlewares = plugins.slice();\n\n middlewares.push(selfReferenceReplacementPlugin);\n\n /**\n * Enables automatic vendor-prefixing for styles.\n */\n if (options.prefix) {\n middlewares.push(stylis.prefixer);\n }\n\n middlewares.push(stylis.stringify);\n\n // Pre-build the middleware chain once to avoid allocating closures,\n // arrays, and middleware wrappers on every stringifyRules call.\n // Safe because JS is single-threaded and _stack is consumed before next call.\n let _stack: string[] = [];\n const _middleware = stylis.middleware(\n middlewares.concat(stylis.rulesheet(value => _stack.push(value)))\n );\n\n const stringifyRules: Stringifier = (\n css: string,\n selector = '',\n /**\n * This \"prefix\" referes to a _selector_ prefix.\n */\n prefix = '',\n componentId = '&'\n ) => {\n // stylis has no concept of state to be passed to plugins\n // but since JS is single-threaded, we can rely on that to ensure\n // these properties stay in sync with the current stylis run\n _componentId = componentId;\n _selector = selector;\n _selectorRegexp = undefined; // Reset for lazy creation per call\n\n const flatCSS = sanitizeCSS(stripLineComments(css));\n let compiled = stylis.compile(\n prefix || selector ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS\n );\n\n if (options.namespace) {\n compiled = recursivelySetNamespace(compiled, options.namespace);\n }\n\n _stack = [];\n stylis.serialize(compiled, _middleware);\n\n return _stack;\n };\n\n stringifyRules.hash = plugins.length\n ? plugins\n .reduce((acc, plugin) => {\n if (!plugin.name) {\n throwStyledError(15);\n }\n\n return phash(acc, plugin.name);\n }, SEED)\n .toString()\n : '';\n\n return stringifyRules;\n}\n","import React from 'react';\nimport type stylis from 'stylis';\nimport { IS_RSC } from '../constants';\nimport StyleSheet from '../sheet';\nimport { InsertionTarget, ShouldForwardProp, Stringifier } from '../types';\nimport createStylisInstance from '../utils/stylis';\n\nexport const mainSheet: StyleSheet = new StyleSheet();\nexport const mainStylis: Stringifier = createStylisInstance();\n\n/** Per-render mainSheet reset to prevent HMR accumulation (see AGENTS.md § RSC Style Injection). */\nconst ensureSheetReset: (() => void) | null = IS_RSC\n ? (((React as any).cache as (<T extends (...args: any[]) => any>(fn: T) => T) | undefined)?.(\n () => {\n mainSheet.names.clear();\n mainSheet.keyframeIds.clear();\n mainSheet.clearTag();\n }\n ) ?? null)\n : null;\n\nexport type IStyleSheetContext = {\n shouldForwardProp?: ShouldForwardProp<'web'> | undefined;\n styleSheet: StyleSheet;\n stylis: Stringifier;\n};\n\nconst defaultContextValue: IStyleSheetContext = {\n shouldForwardProp: undefined,\n styleSheet: mainSheet,\n stylis: mainStylis,\n};\n\n// Create context only if createContext is available, otherwise create a fallback\nexport const StyleSheetContext = !IS_RSC\n ? React.createContext<IStyleSheetContext>(defaultContextValue)\n : ({\n Provider: ({ children }: { children: React.ReactNode; value?: IStyleSheetContext }) =>\n children,\n Consumer: ({ children }: { children: (value: IStyleSheetContext) => React.ReactNode }) =>\n children(defaultContextValue),\n } as React.Context<IStyleSheetContext>);\n\nexport const StyleSheetConsumer = StyleSheetContext.Consumer;\n\nexport type IStylisContext = Stringifier | void;\nexport const StylisContext = !IS_RSC\n ? React.createContext<IStylisContext>(undefined)\n : ({\n Provider: ({ children }: { children: React.ReactNode; value?: IStylisContext }) => children,\n Consumer: ({ children }: { children: (value: IStylisContext) => React.ReactNode }) =>\n children(undefined),\n } as React.Context<IStylisContext>);\nexport const StylisConsumer = StylisContext.Consumer;\n\nexport function useStyleSheetContext() {\n if (!IS_RSC) return React.useContext(StyleSheetContext);\n\n // Reset mainSheet once per render to prevent HMR accumulation.\n // React.cache ensures this runs exactly once per server render.\n if (ensureSheetReset) ensureSheetReset();\n\n return defaultContextValue;\n}\n\nexport type IStyleSheetManager = React.PropsWithChildren<{\n /**\n * If desired, you can pass this prop to disable \"speedy\" insertion mode, which\n * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).\n * When disabled, rules are inserted as simple text into style blocks.\n */\n disableCSSOMInjection?: undefined | boolean;\n /**\n * If you are working exclusively with modern browsers, vendor prefixes can often be omitted\n * to reduce the weight of CSS on the page.\n */\n enableVendorPrefixes?: undefined | boolean;\n /**\n * Provide an optional selector to be prepended to all generated style rules.\n */\n namespace?: undefined | string;\n /**\n * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.\n * When provided, `target` and `nonce` props are ignored (configure them on the sheet directly).\n */\n sheet?: undefined | StyleSheet;\n /**\n * Starting in v6, styled-components no longer does its own prop validation\n * and recommends use of transient props \"$prop\" to pass style-only props to\n * components. If for some reason you are not able to use transient props, a\n * prop validation function can be provided via `StyleSheetManager`, such as\n * `@emotion/is-prop-valid`.\n *\n * When the return value is `true`, props will be forwarded to the DOM/underlying\n * component. If return value is `false`, the prop will be discarded after styles\n * are calculated.\n *\n * Manually composing `styled.{element}.withConfig({shouldForwardProp})` will\n * override this default.\n */\n shouldForwardProp?: undefined | IStyleSheetContext['shouldForwardProp'];\n /**\n * An array of plugins to be run by stylis (style processor) during compilation.\n * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).\n *\n * \\* The plugin(s) must be compatible with stylis v4 or above.\n */\n stylisPlugins?: undefined | stylis.Middleware[];\n /**\n * CSP nonce to attach to injected `<style>` tags. Overrides auto-detection\n * from `<meta name=\"sc-nonce\">`, `<meta property=\"csp-nonce\">`, or `__webpack_nonce__`.\n */\n nonce?: undefined | string;\n /**\n * Provide an alternate DOM node to host generated styles; useful for iframes.\n */\n target?: undefined | InsertionTarget;\n}>;\n\n/** Configure style injection for descendant styled components (target element, stylis plugins, prop forwarding). */\nexport function StyleSheetManager(props: IStyleSheetManager): React.JSX.Element {\n // In RSC environments without context support, StyleSheetManager becomes a no-op\n if (IS_RSC || !React.useMemo) {\n return props.children as React.JSX.Element;\n }\n\n const { styleSheet } = useStyleSheetContext();\n\n const resolvedStyleSheet = React.useMemo(() => {\n let sheet = styleSheet;\n\n if (props.sheet) {\n sheet = props.sheet;\n } else if (props.target) {\n sheet = sheet.reconstructWithOptions({ target: props.target, nonce: props.nonce }, false);\n } else if (props.nonce !== undefined) {\n sheet = sheet.reconstructWithOptions({ nonce: props.nonce });\n }\n\n if (props.disableCSSOMInjection) {\n sheet = sheet.reconstructWithOptions({ useCSSOMInjection: false });\n }\n\n return sheet;\n }, [props.disableCSSOMInjection, props.nonce, props.sheet, props.target, styleSheet]);\n\n const stylis = React.useMemo(\n () =>\n createStylisInstance({\n options: { namespace: props.namespace, prefix: props.enableVendorPrefixes },\n plugins: props.stylisPlugins,\n }),\n [props.enableVendorPrefixes, props.namespace, props.stylisPlugins]\n );\n\n const styleSheetContextValue = React.useMemo(\n () => ({\n shouldForwardProp: props.shouldForwardProp,\n styleSheet: resolvedStyleSheet,\n stylis,\n }),\n [props.shouldForwardProp, resolvedStyleSheet, stylis]\n );\n\n return (\n <StyleSheetContext.Provider value={styleSheetContextValue}>\n <StylisContext.Provider value={stylis}>{props.children}</StylisContext.Provider>\n </StyleSheetContext.Provider>\n );\n}\n","import React from 'react';\nimport { IS_RSC } from '../constants';\nimport styledError from '../utils/error';\nimport isFunction from '../utils/isFunction';\n\n// Helper type for the `DefaultTheme` interface that enforces an object type & exclusively allows\n// for typed keys.\ntype DefaultThemeAsObject<T = object> = Record<keyof T, any>;\n\n/**\n * Override DefaultTheme to get accurate typings for your project.\n *\n * ```\n * // create styled-components.d.ts in your project source\n * // if it isn't being picked up, check tsconfig compilerOptions.types\n * import type { CSSProp } from \"styled-components\";\n * import Theme from './theme';\n *\n * type ThemeType = typeof Theme;\n *\n * declare module \"styled-components\" {\n * export interface DefaultTheme extends ThemeType {}\n * }\n *\n * declare module \"react\" {\n * interface DOMAttributes<T> {\n * css?: CSSProp;\n * }\n * }\n * ```\n */\nexport interface DefaultTheme extends DefaultThemeAsObject {}\n\ntype ThemeFn = (outerTheme?: DefaultTheme | undefined) => DefaultTheme;\ntype ThemeArgument = DefaultTheme | ThemeFn;\n\ntype Props = {\n children?: React.ReactNode;\n theme: ThemeArgument;\n};\n\n// Create context only if createContext is available, otherwise create a fallback\nexport const ThemeContext = !IS_RSC\n ? React.createContext<DefaultTheme | undefined>(undefined)\n : ({\n Provider: ({ children }: { children: React.ReactNode; value?: DefaultTheme }) => children,\n Consumer: ({ children }: { children: (theme?: DefaultTheme) => React.ReactNode }) =>\n children(undefined),\n } as React.Context<DefaultTheme | undefined>);\n\nexport const ThemeConsumer = ThemeContext.Consumer;\n\nfunction mergeTheme(theme: ThemeArgument, outerTheme?: DefaultTheme | undefined): DefaultTheme {\n if (!theme) {\n throw styledError(14);\n }\n\n if (isFunction(theme)) {\n const themeFn = theme as ThemeFn;\n const mergedTheme = themeFn(outerTheme);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (mergedTheme === null || Array.isArray(mergedTheme) || typeof mergedTheme !== 'object')\n ) {\n throw styledError(7);\n }\n\n return mergedTheme;\n }\n\n if (Array.isArray(theme) || typeof theme !== 'object') {\n throw styledError(8);\n }\n\n return outerTheme ? { ...outerTheme, ...theme } : theme;\n}\n\n/**\n * Returns the current theme (as provided by the closest ancestor `ThemeProvider`.)\n *\n * If no `ThemeProvider` is found, the function will error. If you need access to the theme in an\n * uncertain composition scenario, `React.useContext(ThemeContext)` will not emit an error if there\n * is no `ThemeProvider` ancestor.\n */\nexport function useTheme(): DefaultTheme {\n // Skip useContext if we're in an RSC environment without context support\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n\n if (!theme) {\n throw styledError(18);\n }\n\n return theme;\n}\n\n/**\n * Provide a theme to an entire react component tree via context\n */\nexport default function ThemeProvider(props: Props): React.JSX.Element | null {\n // In RSC environments without context support, ThemeProvider becomes a no-op\n if (IS_RSC) {\n return props.children as React.JSX.Element | null;\n }\n\n const outerTheme = React.useContext(ThemeContext);\n const themeContext = React.useMemo(\n () => mergeTheme(props.theme, outerTheme),\n [props.theme, outerTheme]\n );\n\n if (!props.children) {\n return null;\n }\n\n return <ThemeContext.Provider value={themeContext}>{props.children}</ThemeContext.Provider>;\n}\n","import isPropValid from '@emotion/is-prop-valid';\nimport React, { createElement, PropsWithoutRef, Ref } from 'react';\nimport { IS_RSC, SC_VERSION } from '../constants';\nimport { getGroupForId } from '../sheet/GroupIDAllocator';\nimport type StyleSheet from '../sheet';\nimport type {\n AnyComponent,\n Attrs,\n BaseObject,\n Dict,\n ExecutionContext,\n ExecutionProps,\n IStyledComponent,\n IStyledComponentFactory,\n IStyledStatics,\n OmitNever,\n RuleSet,\n Stringifier,\n StyledOptions,\n WebTarget,\n} from '../types';\nimport { checkDynamicCreation } from '../utils/checkDynamicCreation';\nimport createWarnTooManyClasses from '../utils/createWarnTooManyClasses';\nimport determineTheme from '../utils/determineTheme';\nimport domElements from '../utils/domElements';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '../utils/empties';\nimport escape from '../utils/escape';\nimport generateComponentId from '../utils/generateComponentId';\nimport generateDisplayName from '../utils/generateDisplayName';\nimport hoist from '../utils/hoist';\nimport isFunction from '../utils/isFunction';\nimport isStyledComponent from '../utils/isStyledComponent';\nimport isTag from '../utils/isTag';\nimport { joinStrings } from '../utils/joinStrings';\nimport merge from '../utils/mixinDeep';\nimport { setToString } from '../utils/setToString';\nimport ComponentStyle from './ComponentStyle';\nimport { useStyleSheetContext } from './StyleSheetManager';\nimport { DefaultTheme, ThemeContext } from './ThemeProvider';\n\ndeclare const __SERVER__: boolean;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nconst identifiers: { [key: string]: number } = {};\n\n/* We depend on components having unique IDs */\nfunction generateId(\n displayName?: string | undefined,\n parentComponentId?: string | undefined\n): string {\n const name = typeof displayName !== 'string' ? 'sc' : escape(displayName);\n // Ensure that no displayName can lead to duplicate componentIds\n identifiers[name] = (identifiers[name] || 0) + 1;\n\n const componentId =\n name +\n '-' +\n generateComponentId(\n // SC_VERSION gives us isolation between multiple runtimes on the page at once\n // this is improved further with use of the babel plugin \"namespace\" feature\n SC_VERSION + name + identifiers[name]\n );\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}\n\n/**\n * Shallow-compare two context objects using a stored key count to avoid\n * a second iteration pass. Returns true if all own-property values match.\n */\nfunction shallowEqualContext(prev: object, next: object, prevKeyCount: number): boolean {\n const a = prev as Record<string, unknown>;\n const b = next as Record<string, unknown>;\n let nextKeyCount = 0;\n for (const key in b) {\n if (hasOwn.call(b, key)) {\n nextKeyCount++;\n if (a[key] !== b[key]) return false;\n }\n }\n return nextKeyCount === prevKeyCount;\n}\n\nfunction useInjectedStyle<T extends ExecutionContext>(\n componentStyle: ComponentStyle,\n resolvedAttrs: T,\n styleSheet: StyleSheet,\n stylis: Stringifier\n): string {\n const className = componentStyle.generateAndInjectStyles(resolvedAttrs, styleSheet, stylis);\n\n if (process.env.NODE_ENV !== 'production' && React.useDebugValue) {\n React.useDebugValue(className);\n }\n\n return className;\n}\n\n// Cached render inputs + style result: [prevProps, prevTheme, prevStyleSheet, prevStylis,\n// prevPropsKeyCount, cachedContext, cachedClassName]\ntype RenderCache = [\n object, // prevProps\n DefaultTheme | undefined, // prevTheme\n StyleSheet, // prevStyleSheet\n Stringifier, // prevStylis\n number, // prevPropsKeyCount\n object, // cachedContext\n string, // cachedClassName\n ComponentStyle, // prevComponentStyle (for HMR invalidation)\n];\n\nfunction resolveContext<Props extends BaseObject>(\n attrs: Attrs<React.HTMLAttributes<Element> & Props>[],\n props: ExecutionProps & Props,\n theme: DefaultTheme | undefined\n): React.HTMLAttributes<Element> & ExecutionContext & Props {\n const context: React.HTMLAttributes<Element> & ExecutionContext & Props = {\n ...props,\n // unset, add `props.className` back at the end so props always \"wins\"\n className: undefined,\n theme,\n } as React.HTMLAttributes<Element> & ExecutionContext & Props;\n\n for (let i = 0; i < attrs.length; i++) {\n const attrDef = attrs[i];\n // Pass a shallow copy to function attrs so the callback's captured\n // reference isn't mutated by subsequent attrs processing (#3336).\n const resolvedAttrDef = isFunction(attrDef) ? attrDef({ ...context }) : attrDef;\n\n for (const key in resolvedAttrDef) {\n if (key === 'className') {\n context.className = joinStrings(context.className, resolvedAttrDef[key] as string);\n } else if (key === 'style') {\n context.style = { ...context.style, ...(resolvedAttrDef[key] as React.CSSProperties) };\n } else if (!(key in props && (props as any)[key] === undefined)) {\n // Apply attr value unless the user explicitly passed undefined for this prop,\n // which signals intent to reset the value.\n // @ts-expect-error attrs can dynamically add arbitrary properties\n context[key] = resolvedAttrDef[key];\n }\n }\n }\n\n if ('className' in props && typeof props.className === 'string') {\n context.className = joinStrings(context.className, props.className);\n }\n\n return context;\n}\n\nlet seenUnknownProps = new Set();\n\n/** Per-render dedup for RSC inline style tags via React.cache (React 19+). */\nlet getEmittedCSS: (() => Set<string>) | null = null;\nif (IS_RSC) {\n const reactCache: (<T extends (...args: any[]) => any>(fn: T) => T) | undefined = (React as any)\n .cache;\n if (reactCache) {\n getEmittedCSS = reactCache(() => new Set<string>());\n }\n}\n\n/** Cache RegExp objects for :where() wrapping to avoid recompilation per render */\nconst whereRegExpCache = new Map<string, RegExp>();\nfunction getWhereRegExp(name: string): RegExp {\n let re = whereRegExpCache.get(name);\n if (!re) {\n re = new RegExp('\\\\.' + name + '(?![a-zA-Z0-9_-])', 'g');\n whereRegExpCache.set(name, re);\n }\n return re;\n}\n\nfunction buildPropsForElement(\n context: Record<string, any>,\n elementToBeCreated: WebTarget,\n theme: DefaultTheme | undefined,\n shouldForwardProp: ((prop: string, el: WebTarget) => boolean) | undefined\n): Dict<any> {\n const propsForElement: Dict<any> = {};\n\n for (const key in context) {\n if (context[key] === undefined) {\n // Omit undefined values from props passed to wrapped element.\n } else if (key[0] === '$' || key === 'as' || (key === 'theme' && context.theme === theme)) {\n // Omit transient props and execution props.\n } else if (key === 'forwardedAs') {\n propsForElement.as = context.forwardedAs;\n } else if (!shouldForwardProp || shouldForwardProp(key, elementToBeCreated)) {\n propsForElement[key] = context[key];\n\n if (\n !shouldForwardProp &&\n process.env.NODE_ENV === 'development' &&\n !isPropValid(key) &&\n !seenUnknownProps.has(key) &&\n domElements.has(elementToBeCreated as any)\n ) {\n seenUnknownProps.add(key);\n console.warn(\n `styled-components: it looks like an unknown prop \"${key}\" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via \\`<StyleSheetManager shouldForwardProp={...}>\\` (connect an API like \\`@emotion/is-prop-valid\\`) or consider using transient props (\\`$\\` prefix for automatic filtering.)`\n );\n }\n }\n }\n\n return propsForElement;\n}\n\nfunction useStyledComponentImpl<Props extends BaseObject>(\n forwardedComponent: IStyledComponent<'web', Props>,\n props: ExecutionProps & Props,\n forwardedRef: Ref<Element>\n) {\n const {\n attrs: componentAttrs,\n componentStyle,\n defaultProps,\n foldedComponentIds,\n styledComponentId,\n target,\n } = forwardedComponent;\n\n const contextTheme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n const ssc = useStyleSheetContext();\n const shouldForwardProp = forwardedComponent.shouldForwardProp || ssc.shouldForwardProp;\n\n if (process.env.NODE_ENV !== 'production' && React.useDebugValue) {\n React.useDebugValue(styledComponentId);\n }\n\n // NOTE: the non-hooks version only subscribes to this when !componentStyle.isStatic,\n // but that'd be against the rules-of-hooks. We could be naughty and do it anyway as it\n // should be an immutable value, but behave for now.\n const theme =\n determineTheme(props, contextTheme, defaultProps) || (IS_RSC ? undefined : EMPTY_OBJECT);\n\n let context: React.HTMLAttributes<Element> & ExecutionContext & Props;\n let generatedClassName: string;\n\n // Client-only render cache: skip resolveContext and generateAndInjectStyles\n // when props+theme haven't changed. propsForElement is always rebuilt since\n // it's mutated with className/ref after construction.\n // __SERVER__ and IS_RSC are build/module-level constants for dead-code elimination.\n if (!__SERVER__ && !IS_RSC) {\n const renderCacheRef = React.useRef<RenderCache | null>(null);\n const prev = renderCacheRef.current;\n\n if (\n prev !== null &&\n prev[1] === theme &&\n prev[2] === ssc.styleSheet &&\n prev[3] === ssc.stylis &&\n prev[7] === componentStyle &&\n shallowEqualContext(prev[0], props, prev[4])\n ) {\n context = prev[5] as typeof context;\n generatedClassName = prev[6];\n } else {\n context = resolveContext<Props>(componentAttrs, props, theme);\n generatedClassName = useInjectedStyle(componentStyle, context, ssc.styleSheet, ssc.stylis);\n\n let propsKeyCount = 0;\n for (const key in props) {\n if (hasOwn.call(props, key)) propsKeyCount++;\n }\n renderCacheRef.current = [\n props,\n theme,\n ssc.styleSheet,\n ssc.stylis,\n propsKeyCount,\n context,\n generatedClassName,\n componentStyle,\n ];\n }\n } else {\n context = resolveContext<Props>(componentAttrs, props, theme);\n generatedClassName = useInjectedStyle(componentStyle, context, ssc.styleSheet, ssc.stylis);\n }\n\n if (process.env.NODE_ENV !== 'production' && forwardedComponent.warnTooManyClasses) {\n forwardedComponent.warnTooManyClasses(generatedClassName);\n }\n\n const elementToBeCreated: WebTarget = context.as || target;\n const propsForElement = buildPropsForElement(\n context,\n elementToBeCreated,\n theme,\n shouldForwardProp\n );\n\n let classString = joinStrings(foldedComponentIds, styledComponentId);\n if (generatedClassName) {\n classString += ' ' + generatedClassName;\n }\n if (context.className) {\n classString += ' ' + context.className;\n }\n\n propsForElement[\n isTag(elementToBeCreated) &&\n !domElements.has(elementToBeCreated as Extract<typeof domElements, string>)\n ? 'class'\n : 'className'\n ] = classString;\n\n if (forwardedRef) {\n propsForElement.ref = forwardedRef;\n }\n\n const element = createElement(elementToBeCreated, propsForElement);\n\n // RSC mode: emit this component's CSS (and its inheritance chain + keyframes)\n // as an inline <style> tag. No `precedence` — server component output isn't\n // hydrated, so no mismatch. Inline body styles come after the registry's\n // <head> styles in source order, so extensions naturally win (#5672).\n if (IS_RSC) {\n const tag = ssc.styleSheet.getTag();\n let css = '';\n\n // Walk the inheritance chain and collect CSS for all levels.\n // Base levels are wrapped in :where() so they have zero specificity —\n // this prevents duplicate base CSS in sibling extensions from\n // overriding earlier extensions' styles (#5672).\n let cs: ComponentStyle | null | undefined = componentStyle;\n while (cs) {\n let levelCss = tag.getGroup(getGroupForId(cs.componentId));\n if (levelCss && cs !== componentStyle) {\n // Base level: wrap selectors in :where() for zero specificity.\n // Class names are content-dependent hashes — a component's name is\n // derived from its CSS, so the name cannot appear in that CSS.\n // Cross-component collisions are impossible since names are scoped\n // per componentId. Use negative lookahead to avoid corrupting\n // longer names that share a prefix (e.g. `.a` vs `.ab`).\n const names = ssc.styleSheet.names.get(cs.componentId);\n if (names) {\n for (const name of names) {\n const re = getWhereRegExp(name);\n re.lastIndex = 0;\n levelCss = levelCss.replace(re, ':where(.' + name + ')');\n }\n }\n }\n css = levelCss + css;\n cs = cs.baseStyle;\n }\n\n // Keyframes emit in their own <style> tag, deduped by ID. They register\n // mid-render so prepending to component CSS breaks getEmittedCSS dedup.\n const emitted = getEmittedCSS ? getEmittedCSS() : null;\n let kfElement: React.ReactElement | null = null;\n if (ssc.styleSheet.keyframeIds.size > 0) {\n let kfCss = '';\n for (const kfId of ssc.styleSheet.keyframeIds) {\n const kfRules = tag.getGroup(getGroupForId(kfId));\n if (kfRules && (!emitted || !emitted.has(kfId))) {\n if (emitted) emitted.add(kfId);\n kfCss += kfRules;\n }\n }\n if (kfCss) {\n kfElement = React.createElement('style', {\n key: 'sc-kf-' + componentStyle.componentId,\n children: kfCss,\n });\n }\n }\n\n const cssDeduped = css && emitted ? emitted.has(css) : false;\n if (css && !cssDeduped) {\n if (emitted) emitted.add(css);\n }\n\n const styleElement =\n css && !cssDeduped\n ? React.createElement('style', { key: 'sc-' + componentStyle.componentId, children: css })\n : null;\n\n if (kfElement || styleElement) {\n return React.createElement(React.Fragment, null, kfElement, styleElement, element);\n }\n }\n\n return element;\n}\n\nfunction createStyledComponent<\n Target extends WebTarget,\n OuterProps extends BaseObject,\n Statics extends BaseObject = BaseObject,\n>(\n target: Target,\n options: StyledOptions<'web', OuterProps>,\n rules: RuleSet<OuterProps>\n): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>> {\n const isTargetStyledComp = isStyledComponent(target);\n const styledComponentTarget = target as IStyledComponent<'web', OuterProps>;\n const isCompositeComponent = !isTag(target);\n\n const {\n attrs = EMPTY_ARRAY,\n componentId = generateId(options.displayName, options.parentComponentId),\n displayName = generateDisplayName(target),\n } = options;\n\n const styledComponentId =\n options.displayName && options.componentId\n ? escape(options.displayName) + '-' + options.componentId\n : options.componentId || componentId;\n\n // fold the underlying StyledComponent attrs up (implicit extend)\n const finalAttrs =\n isTargetStyledComp && styledComponentTarget.attrs\n ? styledComponentTarget.attrs.concat(attrs as unknown as Attrs<OuterProps>[]).filter(Boolean)\n : (attrs as Attrs<OuterProps>[]);\n\n let { shouldForwardProp } = options;\n\n if (isTargetStyledComp && styledComponentTarget.shouldForwardProp) {\n const shouldForwardPropFn = styledComponentTarget.shouldForwardProp;\n\n if (options.shouldForwardProp) {\n const passedShouldForwardPropFn = options.shouldForwardProp;\n\n // compose nested shouldForwardProp calls\n shouldForwardProp = (prop, elementToBeCreated) =>\n shouldForwardPropFn(prop, elementToBeCreated) &&\n passedShouldForwardPropFn(prop, elementToBeCreated);\n } else {\n shouldForwardProp = shouldForwardPropFn;\n }\n }\n\n const componentStyle = new ComponentStyle(\n rules,\n styledComponentId,\n isTargetStyledComp ? (styledComponentTarget.componentStyle as ComponentStyle) : undefined\n );\n\n function forwardRefRender(\n props: PropsWithoutRef<ExecutionProps & OuterProps>,\n ref: Ref<Element>\n ) {\n return useStyledComponentImpl<OuterProps>(\n WrappedStyledComponent,\n props as ExecutionProps & OuterProps,\n ref\n );\n }\n\n forwardRefRender.displayName = displayName;\n\n /**\n * forwardRef creates a new interim component, which we'll take advantage of\n * instead of extending ParentComponent to create _another_ interim class\n */\n let WrappedStyledComponent = React.forwardRef(forwardRefRender) as unknown as IStyledComponent<\n 'web',\n any\n > &\n Statics;\n WrappedStyledComponent.attrs = finalAttrs;\n WrappedStyledComponent.componentStyle = componentStyle;\n WrappedStyledComponent.displayName = displayName;\n WrappedStyledComponent.shouldForwardProp = shouldForwardProp;\n\n // this static is used to preserve the cascade of static classes for component selector\n // purposes; this is especially important with usage of the css prop\n WrappedStyledComponent.foldedComponentIds = isTargetStyledComp\n ? joinStrings(styledComponentTarget.foldedComponentIds, styledComponentTarget.styledComponentId)\n : '';\n\n WrappedStyledComponent.styledComponentId = styledComponentId;\n\n // fold the underlying StyledComponent target up since we folded the styles\n WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;\n\n Object.defineProperty(WrappedStyledComponent, 'defaultProps', {\n get() {\n return this._foldedDefaultProps;\n },\n\n set(obj) {\n this._foldedDefaultProps = isTargetStyledComp\n ? merge({}, styledComponentTarget.defaultProps, obj)\n : obj;\n },\n });\n\n if (process.env.NODE_ENV !== 'production') {\n checkDynamicCreation(displayName, styledComponentId);\n\n WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(\n displayName,\n styledComponentId\n );\n }\n\n setToString(WrappedStyledComponent, () => `.${WrappedStyledComponent.styledComponentId}`);\n\n if (isCompositeComponent) {\n const compositeComponentTarget = target as AnyComponent;\n\n hoist<typeof WrappedStyledComponent, typeof compositeComponentTarget>(\n WrappedStyledComponent,\n compositeComponentTarget,\n {\n // all SC-specific things should not be hoisted\n attrs: true,\n componentStyle: true,\n displayName: true,\n foldedComponentIds: true,\n shouldForwardProp: true,\n styledComponentId: true,\n target: true,\n } as { [key in keyof OmitNever<IStyledStatics<'web', OuterProps>>]: true }\n );\n }\n\n return WrappedStyledComponent;\n}\n\nexport default createStyledComponent;\n","import { Dict } from '../types';\n\nexport const LIMIT = 200;\n\nexport default (displayName: string, componentId: string) => {\n let generatedClasses: Dict<any> = {};\n let warningSeen = false;\n\n return (className: string) => {\n if (!warningSeen) {\n generatedClasses[className] = true;\n if (Object.keys(generatedClasses).length >= LIMIT) {\n // Unable to find latestRule in test environment.\n\n const parsedIdString = componentId ? ` with the id of \"${componentId}\"` : '';\n\n console.warn(\n `Over ${LIMIT} classes were generated for component ${displayName}${parsedIdString}.\\n` +\n 'Consider using the attrs method, together with a style object for frequently changed styles.\\n' +\n 'Example:\\n' +\n ' const Component = styled.div.attrs(props => ({\\n' +\n ' style: {\\n' +\n ' background: props.background,\\n' +\n ' },\\n' +\n ' }))`width: 100%;`\\n\\n' +\n ' <Component />'\n );\n warningSeen = true;\n generatedClasses = {};\n }\n }\n };\n};\n","import { Interpolation } from '../types';\n\nexport default function interleave<Props extends object>(\n strings: readonly string[],\n interpolations: Interpolation<Props>[]\n): Interpolation<Props>[] {\n const result: Interpolation<Props>[] = [strings[0]];\n\n for (let i = 0, len = interpolations.length; i < len; i += 1) {\n result.push(interpolations[i], strings[i + 1]);\n }\n\n return result;\n}\n","import { BaseObject, Interpolation, RuleSet, StyledObject, StyleFunction, Styles } from '../types';\nimport { EMPTY_ARRAY } from '../utils/empties';\nimport flatten from '../utils/flatten';\nimport interleave from '../utils/interleave';\nimport isFunction from '../utils/isFunction';\nimport isPlainObject from '../utils/isPlainObject';\n\n/**\n * Used when flattening object styles to determine if we should\n * expand an array of styles.\n */\nconst addTag = <T extends RuleSet<any>>(arg: T): T & { isCss: true } =>\n Object.assign(arg, { isCss: true } as const);\n\n/**\n * Tag a CSS template literal for use in styled components, createGlobalStyle, or attrs.\n * Enables interpolation type-checking and shared style blocks.\n *\n * ```tsx\n * const truncate = css`\n * white-space: nowrap;\n * overflow: hidden;\n * text-overflow: ellipsis;\n * `;\n * ```\n */\nfunction css(styles: Styles<object>, ...interpolations: Interpolation<object>[]): RuleSet<object>;\nfunction css<Props extends object>(\n styles: Styles<NoInfer<Props>>,\n ...interpolations: Interpolation<NoInfer<Props>>[]\n): RuleSet<NoInfer<Props>>;\nfunction css<Props extends object = BaseObject>(\n styles: Styles<NoInfer<Props>>,\n ...interpolations: Interpolation<NoInfer<Props>>[]\n): RuleSet<NoInfer<Props>> {\n if (isFunction(styles) || isPlainObject(styles)) {\n const styleFunctionOrObject = styles as StyleFunction<Props> | StyledObject<Props>;\n\n return addTag(\n flatten<Props>(\n interleave<Props>(EMPTY_ARRAY, [\n styleFunctionOrObject,\n ...interpolations,\n ]) as Interpolation<object>\n )\n );\n }\n\n const styleStringArray = styles as TemplateStringsArray;\n\n if (\n interpolations.length === 0 &&\n styleStringArray.length === 1 &&\n typeof styleStringArray[0] === 'string'\n ) {\n return flatten<Props>(styleStringArray);\n }\n\n return addTag(\n flatten<Props>(interleave<Props>(styleStringArray, interpolations) as Interpolation<object>)\n );\n}\n\nexport default css;\n","import {\n Attrs,\n BaseObject,\n ExecutionProps,\n Interpolation,\n IStyledComponent,\n IStyledComponentFactory,\n KnownTarget,\n MakeAttrsOptional,\n Runtime,\n StyledOptions,\n StyledTarget,\n Styles,\n Substitute,\n} from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport styledError from '../utils/error';\nimport css from './css';\n\ntype AttrsResult<T extends Attrs<any>> = T extends (...args: any) => infer P\n ? P extends object\n ? P\n : never\n : T extends object\n ? T\n : never;\n\n/**\n * Based on Attrs being a simple object or function that returns\n * a prop object, inspect the attrs result and attempt to extract\n * any \"as\" prop usage to modify the runtime target.\n */\ntype AttrsTarget<\n R extends Runtime,\n T extends Attrs<any>,\n FallbackTarget extends StyledTarget<R>,\n Result extends ExecutionProps = AttrsResult<T>,\n> = Result extends { as: infer RuntimeTarget }\n ? RuntimeTarget extends KnownTarget\n ? RuntimeTarget\n : FallbackTarget\n : FallbackTarget;\n\nexport interface Styled<\n R extends Runtime,\n Target extends StyledTarget<R>,\n OuterProps extends object,\n OuterStatics extends object = BaseObject,\n AttrsKeys extends keyof any = never,\n> {\n <Props extends object = BaseObject, Statics extends object = BaseObject>(\n initialStyles: Styles<Substitute<OuterProps, NoInfer<Props>>>,\n ...interpolations: Interpolation<Substitute<OuterProps, NoInfer<Props>>>[]\n ): IStyledComponent<R, MakeAttrsOptional<Substitute<OuterProps, Props>, AttrsKeys>> &\n OuterStatics &\n Statics &\n (R extends 'web'\n ? Target extends string\n ? {}\n : Omit<Target, keyof React.Component<any>>\n : {});\n\n attrs: <\n Props extends object = BaseObject,\n PrivateMergedProps extends object = Substitute<OuterProps, Props>,\n PrivateAttrsArg extends Attrs<PrivateMergedProps> = Attrs<PrivateMergedProps>,\n PrivateResolvedTarget extends StyledTarget<R> = AttrsTarget<R, PrivateAttrsArg, Target>,\n >(\n attrs: PrivateAttrsArg\n ) => Styled<\n R,\n PrivateResolvedTarget,\n PrivateResolvedTarget extends KnownTarget\n ? Substitute<\n Substitute<OuterProps, React.ComponentPropsWithRef<PrivateResolvedTarget>>,\n Props\n >\n : PrivateMergedProps,\n OuterStatics,\n AttrsKeys | keyof AttrsResult<PrivateAttrsArg>\n >;\n\n withConfig: (\n config: StyledOptions<R, OuterProps>\n ) => Styled<R, Target, OuterProps, OuterStatics, AttrsKeys>;\n}\n\nexport default function constructWithOptions<\n R extends Runtime,\n Target extends StyledTarget<R>,\n OuterProps extends object = Target extends KnownTarget\n ? React.ComponentPropsWithRef<Target>\n : BaseObject,\n OuterStatics extends object = BaseObject,\n AttrsKeys extends keyof any = never,\n>(\n componentConstructor: IStyledComponentFactory<R, StyledTarget<R>, object, any>,\n tag: StyledTarget<R>,\n options: StyledOptions<R, OuterProps> = EMPTY_OBJECT\n): Styled<R, Target, OuterProps, OuterStatics, AttrsKeys> {\n /**\n * We trust that the tag is a valid component as long as it isn't\n * falsish. Typically the tag here is a string or function (i.e.\n * class or pure function component), however a component may also be\n * an object if it uses another utility, e.g. React.memo. React will\n * output an appropriate warning however if the `tag` isn't valid.\n */\n if (!tag) {\n throw styledError(1, tag);\n }\n\n /* This is callable directly as a template function */\n const templateFunction = <Props extends object = BaseObject, Statics extends object = BaseObject>(\n initialStyles: Styles<Substitute<OuterProps, Props>>,\n ...interpolations: Interpolation<Substitute<OuterProps, Props>>[]\n ) =>\n componentConstructor<Substitute<OuterProps, Props>, Statics>(\n tag,\n options as StyledOptions<R, Substitute<OuterProps, Props>>,\n css<Substitute<OuterProps, Props>>(initialStyles, ...interpolations)\n );\n\n /**\n * Attrs allows for accomplishing two goals:\n *\n * 1. Backfilling props at runtime more expressively than defaultProps\n * 2. Amending the prop interface of a wrapped styled component\n */\n templateFunction.attrs = <\n Props extends object = BaseObject,\n PrivateMergedProps extends object = Substitute<OuterProps, Props>,\n PrivateAttrsArg extends Attrs<PrivateMergedProps> = Attrs<PrivateMergedProps>,\n PrivateResolvedTarget extends StyledTarget<R> = AttrsTarget<R, PrivateAttrsArg, Target>,\n >(\n attrs: PrivateAttrsArg\n ) =>\n constructWithOptions<\n R,\n PrivateResolvedTarget,\n PrivateResolvedTarget extends KnownTarget\n ? Substitute<\n Substitute<OuterProps, React.ComponentPropsWithRef<PrivateResolvedTarget>>,\n Props\n >\n : PrivateMergedProps,\n OuterStatics,\n AttrsKeys | keyof AttrsResult<PrivateAttrsArg>\n >(componentConstructor, tag, {\n ...options,\n attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean),\n });\n\n /**\n * If config methods are called, wrap up a new template function\n * and merge options.\n */\n templateFunction.withConfig = (config: StyledOptions<R, OuterProps>) =>\n constructWithOptions<R, Target, OuterProps, OuterStatics, AttrsKeys>(\n componentConstructor,\n tag,\n {\n ...options,\n ...config,\n }\n );\n\n return templateFunction;\n}\n","import * as React from 'react';\nimport createStyledComponent from '../models/StyledComponent';\nimport { BaseObject, KnownTarget, WebTarget } from '../types';\nimport domElements, { SupportedHTMLElements } from '../utils/domElements';\nimport constructWithOptions, { Styled as StyledInstance } from './constructWithOptions';\n\n/**\n * Create a styled component from an HTML element or React component.\n *\n * ```tsx\n * const Button = styled.button`color: red;`;\n * const Link = styled(RouterLink)`text-decoration: none;`;\n * ```\n */\nconst baseStyled = <Target extends WebTarget, InjectedProps extends object = BaseObject>(\n tag: Target\n) =>\n constructWithOptions<\n 'web',\n Target,\n Target extends KnownTarget ? React.ComponentPropsWithRef<Target> & InjectedProps : InjectedProps\n >(createStyledComponent, tag);\n\nconst styled = baseStyled as typeof baseStyled & {\n [E in SupportedHTMLElements]: StyledInstance<'web', E, React.JSX.IntrinsicElements[E]>;\n};\n\n// Shorthands for all valid HTML Elements\ndomElements.forEach(domElement => {\n // @ts-expect-error some react typing bs\n styled[domElement] = baseStyled<typeof domElement>(domElement);\n});\n\nexport default styled;\nexport { StyledInstance };\n\n/**\n * This is the type of the `styled` HOC.\n */\nexport type Styled = typeof styled;\n\n/**\n * Use this higher-order type for scenarios where you are wrapping `styled`\n * and providing extra props as a third-party library.\n */\nexport type LibraryStyled<LibraryProps extends object = BaseObject> = <Target extends WebTarget>(\n tag: Target\n) => typeof baseStyled<Target, LibraryProps>;\n","import StyleSheet from '../sheet';\nimport { ExecutionContext, RuleSet, Stringifier } from '../types';\nimport flatten from '../utils/flatten';\nimport isStaticRules from '../utils/isStaticRules';\nimport { joinStringArray } from '../utils/joinStrings';\n\ntype InstanceEntry = { name: string; rules: string[] };\n\nexport default class GlobalStyle<Props extends object> {\n componentId: string;\n isStatic: boolean;\n rules: RuleSet<Props>;\n\n /** @internal Per-instance rule cache for shared-group rebuild. */\n instanceRules: Map<number, InstanceEntry> = new Map();\n\n constructor(rules: RuleSet<Props>, componentId: string) {\n this.rules = rules;\n this.componentId = componentId;\n this.isStatic = isStaticRules(rules);\n\n // Pre-register the shared group so global styles defined before\n // components always appear before them in the stylesheet.\n StyleSheet.registerId(this.componentId);\n }\n\n removeStyles(instance: number, styleSheet: StyleSheet): void {\n this.instanceRules.delete(instance);\n this.rebuildGroup(styleSheet);\n }\n\n renderStyles(\n instance: number,\n executionContext: ExecutionContext & Props,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): void {\n const id = this.componentId;\n\n if (this.isStatic) {\n if (!styleSheet.hasNameForId(id, id + instance)) {\n const entry = this.computeRules(instance, executionContext, styleSheet, stylis);\n styleSheet.insertRules(id, entry.name, entry.rules);\n } else if (!this.instanceRules.has(instance)) {\n // Rehydrated style: populate cache so rebuildGroup can restore\n // survivors if another instance unmounts.\n this.computeRules(instance, executionContext, styleSheet, stylis);\n }\n return;\n }\n\n // Compute new rules; skip CSSOM rebuild if CSS is unchanged.\n // The fast-path is only safe on the client where the tag persists between renders.\n // During SSR, clearTag() destroys the tag between requests, so we must always rebuild.\n const prev = this.instanceRules.get(instance);\n this.computeRules(instance, executionContext, styleSheet, stylis);\n if (!styleSheet.server && prev) {\n const a = prev.rules;\n const b = this.instanceRules.get(instance)!.rules;\n if (a.length === b.length) {\n let same = true;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n same = false;\n break;\n }\n }\n if (same) return;\n }\n }\n this.rebuildGroup(styleSheet);\n }\n\n private computeRules(\n instance: number,\n executionContext: ExecutionContext & Props,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): InstanceEntry {\n const flatCSS = joinStringArray(\n flatten(this.rules as RuleSet<object>, executionContext, styleSheet, stylis) as string[]\n );\n const entry: InstanceEntry = {\n name: this.componentId + instance,\n rules: stylis(flatCSS, ''),\n };\n this.instanceRules.set(instance, entry);\n return entry;\n }\n\n /**\n * Clear all CSS rules in the shared group and re-insert from surviving instances.\n * Must run synchronously — no yielding between clear and re-insert.\n */\n private rebuildGroup(styleSheet: StyleSheet): void {\n const id = this.componentId;\n styleSheet.clearRules(id);\n for (const entry of this.instanceRules.values()) {\n styleSheet.insertRules(id, entry.name, entry.rules);\n }\n }\n}\n","import { RuleSet } from '../types';\nimport isFunction from './isFunction';\nimport isStyledComponent from './isStyledComponent';\n\nexport default function isStaticRules<Props extends object>(rules: RuleSet<Props>) {\n for (let i = 0; i < rules.length; i += 1) {\n const rule = rules[i];\n\n if (isFunction(rule) && !isStyledComponent(rule)) {\n // functions are allowed to be static if they're just being\n // used to get the classname of a nested styled component\n return false;\n }\n }\n\n return true;\n}\n","import React from 'react';\nimport { IS_RSC, SPLITTER, STATIC_EXECUTION_CONTEXT } from '../constants';\nimport GlobalStyle from '../models/GlobalStyle';\nimport { useStyleSheetContext } from '../models/StyleSheetManager';\nimport { DefaultTheme, ThemeContext } from '../models/ThemeProvider';\nimport StyleSheet from '../sheet';\nimport { ExecutionContext, ExecutionProps, Interpolation, Stringifier, Styles } from '../types';\nimport { checkDynamicCreation } from '../utils/checkDynamicCreation';\nimport determineTheme from '../utils/determineTheme';\nimport generateComponentId from '../utils/generateComponentId';\nimport css from './css';\n\ndeclare const __SERVER__: boolean;\n\n/**\n * Create a component that injects global CSS when mounted. Supports theming and dynamic props.\n *\n * ```tsx\n * const GlobalStyle = createGlobalStyle`\n * body { margin: 0; font-family: system-ui; }\n * `;\n * // Render <GlobalStyle /> at the root of your app\n * ```\n */\nexport default function createGlobalStyle<Props extends object>(\n strings: Styles<Props>,\n ...interpolations: Array<Interpolation<Props>>\n) {\n const rules = css<Props>(strings, ...interpolations);\n const styledComponentId = `sc-global-${generateComponentId(JSON.stringify(rules))}`;\n const globalStyle = new GlobalStyle<Props>(rules, styledComponentId);\n\n if (process.env.NODE_ENV !== 'production') {\n checkDynamicCreation(styledComponentId);\n }\n\n const GlobalStyleComponent: React.ComponentType<ExecutionProps & Props> = props => {\n const ssc = useStyleSheetContext();\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n\n // Each mount needs a unique instance ID for the shared-group instanceRules cache.\n // __SERVER__ is a build-time constant: the dead branch is entirely eliminated,\n // so React never sees a conditional hook call.\n // Server bundle: direct allocation (one-shot renders, no stability needed).\n // Browser bundle: useRef for stable ID across re-renders + useLayoutEffect cleanup.\n let instance: number;\n if (__SERVER__) {\n instance = ssc.styleSheet.allocateGSInstance(styledComponentId);\n } else {\n const instanceRef = React.useRef<number | null>(null);\n if (instanceRef.current === null) {\n instanceRef.current = ssc.styleSheet.allocateGSInstance(styledComponentId);\n }\n instance = instanceRef.current;\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n // @ts-expect-error invariant check\n React.Children.count(props.children)\n ) {\n console.warn(\n `The global style component ${styledComponentId} was given child JSX. createGlobalStyle does not render children.`\n );\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n rules.some(rule => typeof rule === 'string' && rule.indexOf('@import') !== -1)\n ) {\n console.warn(\n `Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app.`\n );\n }\n\n // Render styles during component execution for RSC or explicit ServerStyleSheet.\n // Gate on IS_RSC or styleSheet.server (runtime flag from ServerStyleSheet),\n // NOT on __SERVER__ alone. The server build sets __SERVER__=true and eliminates\n // useLayoutEffect, so if we rendered here without cleanup, styles would\n // accumulate unboundedly in jsdom test environments (O(n²) regression).\n // On a real server without ServerStyleSheet, VirtualTag is used and styles are\n // discarded anyway, so skipping this path has no functional impact.\n // Turbopack resolves the browser entry for SSR, so __SERVER__ is false there;\n // styleSheet.server handles that case at runtime.\n if (IS_RSC || ssc.styleSheet.server) {\n renderStyles(instance, props, ssc.styleSheet, theme, ssc.stylis);\n }\n\n // Client-side lifecycle: render styles in effect and clean up on unmount.\n // __SERVER__ and IS_RSC are build/module-level constants, so this doesn't violate rules of hooks.\n if (!__SERVER__ && !IS_RSC) {\n // globalStyle is included in deps so HMR-induced module re-evaluation\n // (which creates a new GlobalStyle instance) triggers effect re-run.\n // For static rules, renderStyles exits early after the first injection\n // (via hasNameForId check), so the extra dep is effectively free at runtime.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const effectDeps = globalStyle.isStatic\n ? [instance, ssc.styleSheet, globalStyle]\n : [instance, props, ssc.styleSheet, theme, ssc.stylis, globalStyle];\n\n const prevGlobalStyleRef = React.useRef(globalStyle);\n\n React.useLayoutEffect(() => {\n if (!ssc.styleSheet.server) {\n // HMR creates a new globalStyle instance but the componentId stays stable\n // (SWC plugin assigns by file location), so stale hasNameForId hits skip injection.\n if (prevGlobalStyleRef.current !== globalStyle) {\n ssc.styleSheet.clearRules(styledComponentId);\n prevGlobalStyleRef.current = globalStyle;\n }\n\n renderStyles(instance, props, ssc.styleSheet, theme, ssc.stylis);\n }\n\n return () => {\n globalStyle.removeStyles(instance, ssc.styleSheet);\n };\n }, effectDeps);\n }\n\n // RSC mode: output style tag.\n // Unlike regular styled components, global styles must NOT use React 19's\n // `precedence` attribute because it makes style tags persist as permanent\n // resources even after unmount. Global styles need lifecycle-based cleanup\n // for conditional rendering (e.g. body lock on modal open/close).\n if (IS_RSC) {\n // Each instance emits only its own rules (not the entire shared group)\n // because RSC renders are independent and each instance needs its own style tag.\n const entry =\n typeof window === 'undefined' ? globalStyle.instanceRules.get(instance) : undefined;\n let css = '';\n if (entry) {\n const rules = entry.rules;\n for (let i = 0; i < rules.length; i++) {\n css += rules[i] + SPLITTER;\n }\n }\n\n if (css) {\n globalStyle.instanceRules.delete(instance);\n return React.createElement('style', {\n key: styledComponentId + '-' + instance,\n 'data-styled-global': styledComponentId,\n children: css,\n });\n }\n }\n\n // Clean up server instance cache — no useLayoutEffect cleanup runs on the\n // server, so instanceRules would grow unboundedly across SSR requests.\n if (__SERVER__ || ssc.styleSheet.server) {\n globalStyle.instanceRules.delete(instance);\n }\n\n return null;\n };\n\n function renderStyles(\n instance: number,\n props: ExecutionProps,\n styleSheet: StyleSheet,\n theme: DefaultTheme | undefined,\n stylis: Stringifier\n ) {\n if (globalStyle.isStatic) {\n globalStyle.renderStyles(\n instance,\n STATIC_EXECUTION_CONTEXT as unknown as ExecutionContext & Props,\n styleSheet,\n stylis\n );\n } else {\n const context = {\n ...props,\n theme: determineTheme(props, theme, GlobalStyleComponent.defaultProps),\n } as ExecutionContext & Props;\n\n globalStyle.renderStyles(instance, context, styleSheet, stylis);\n }\n }\n\n return React.memo(GlobalStyleComponent);\n}\n","import { IS_BROWSER } from '../constants';\nimport createGlobalStyle from './createGlobalStyle';\n\ntype ThemeLeaf = string | number;\n\n/**\n * Recursively maps a theme object so every leaf value becomes\n * a `var(--sc-path, fallback)` CSS string.\n */\ntype CSSVarTheme<T> = {\n [K in keyof T]: T[K] extends ThemeLeaf ? string : CSSVarTheme<T[K]>;\n};\n\n/**\n * The object returned by `createTheme`. Same shape as the input theme but\n * every leaf is a CSS `var()` reference. Also carries a `GlobalStyle`\n * component and the original `raw` theme object.\n */\ntype ThemeContract<T> = CSSVarTheme<T> & {\n /**\n * A `createGlobalStyle` component that emits `:root` CSS custom properties\n * from the current ThemeProvider context. Mount this once at the root of\n * your app so RSC components can consume theme values via CSS variables.\n */\n GlobalStyle: ReturnType<typeof createGlobalStyle>;\n /** The original theme object, for passing to `ThemeProvider`. */\n raw: T;\n /**\n * Read the current resolved CSS variable values from the DOM and return\n * an object with the same shape as the original theme. Each leaf is the\n * computed value (e.g. `\"#0070f3\"`), not the `var()` reference.\n *\n * Optionally pass a target element to read scoped variables from\n * (defaults to `document.documentElement`).\n *\n * Client-only — throws if called on the server.\n */\n resolve(el?: Element): T;\n};\n\n/** Shared recursive traversal — calls `leafFn` for each leaf, recurses for objects. */\nfunction walkTheme(\n obj: Record<string, any>,\n varPrefix: string,\n result: Record<string, any>,\n leafFn: (fullPath: string, val: any, key: string) => any,\n path?: string\n): void {\n for (const key in obj) {\n const val = obj[key];\n const fullPath = path ? path + '-' + key : key;\n if (typeof val === 'object' && val !== null) {\n const nested: Record<string, any> = {};\n walkTheme(val, varPrefix, nested, leafFn, fullPath);\n result[key] = nested;\n } else {\n result[key] = leafFn(fullPath, val, key);\n }\n }\n}\n\n/** Build `var(--prefix-a-b, fallback)` accessor object */\nfunction buildVars<T extends Record<string, any>>(obj: T, varPrefix: string): CSSVarTheme<T> {\n const result: Record<string, any> = {};\n walkTheme(obj, varPrefix, result, (fullPath, val) => {\n if (process.env.NODE_ENV !== 'production') {\n const str = String(val);\n let depth = 0;\n for (let i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) === 40) depth++;\n else if (str.charCodeAt(i) === 41) depth--;\n if (depth < 0) break;\n }\n if (depth !== 0) {\n console.warn(\n `createTheme: value \"${str}\" at \"${fullPath}\" contains unbalanced parentheses and may break the var() fallback`\n );\n }\n }\n return 'var(--' + varPrefix + fullPath + ', ' + val + ')';\n });\n return result as CSSVarTheme<T>;\n}\n\n/** Read computed CSS variable values from the DOM */\nfunction resolveVars<T extends Record<string, any>>(\n obj: T,\n varPrefix: string,\n styles: CSSStyleDeclaration\n): T {\n const result: Record<string, any> = {};\n walkTheme(obj, varPrefix, result, (fullPath, val) => {\n const resolved = styles.getPropertyValue('--' + varPrefix + fullPath).trim();\n return resolved || val;\n });\n return result as T;\n}\n\n/**\n * Emit CSS var declarations by walking `shape` for structure and reading\n * values from `theme`. This avoids hardcoded skip lists — only keys\n * present in the original theme shape are traversed.\n */\nfunction emitVarDeclarations(\n shape: Record<string, any>,\n theme: Record<string, any>,\n varPrefix: string,\n path?: string\n): string {\n let css = '';\n for (const key in shape) {\n const shapeVal = shape[key];\n const themeVal = theme[key];\n const fullPath = path ? path + '-' + key : key;\n if (typeof shapeVal === 'object' && shapeVal !== null) {\n if (typeof themeVal === 'object' && themeVal !== null) {\n css += emitVarDeclarations(shapeVal, themeVal, varPrefix, fullPath);\n }\n } else if (themeVal !== undefined && typeof themeVal !== 'function') {\n css += '--' + varPrefix + fullPath + ':' + themeVal + ';';\n }\n }\n return css;\n}\n\ninterface CreateThemeOptions {\n /**\n * Prefix for CSS variable names. Defaults to `\"sc\"`.\n * Useful for isolation when multiple design systems or microfrontends\n * coexist on the same page.\n *\n * @example\n * createTheme(theme, { prefix: 'ds' })\n * // → var(--ds-colors-primary, #0070f3)\n */\n prefix?: string;\n\n /**\n * CSS selector for the variable declarations. Defaults to `\":root\"`.\n * Use `\":host\"` for web components / Shadow DOM, or a class selector\n * for scoped theming.\n *\n * @example\n * createTheme(theme, { selector: ':host' })\n * // → :host { --sc-colors-primary: #0070f3; }\n */\n selector?: string;\n}\n\n/**\n * Create a theme backed by CSS custom properties, bridging `ThemeProvider` and CSS variables.\n *\n * Returns an object with the same shape as the input theme, but every leaf value\n * is a `var(--prefix-*, fallback)` CSS string. Use these in styled component\n * templates — they work in both client and RSC contexts.\n *\n * Mount the returned `GlobalStyle` component inside your `ThemeProvider` to emit\n * the CSS variables. When the theme changes (e.g. light → dark), the variables\n * update automatically.\n *\n * @example\n * ```tsx\n * const theme = createTheme({\n * colors: { primary: '#0070f3', text: '#111' },\n * });\n *\n * // Root layout (client):\n * <ThemeProvider theme={themes[preset]}>\n * <theme.GlobalStyle />\n * {children}\n * </ThemeProvider>\n *\n * // Any RSC file:\n * const Card = styled.div`\n * color: ${theme.colors.primary};\n * // → \"var(--sc-colors-primary, #0070f3)\"\n * `;\n * ```\n */\nexport default function createTheme<T extends Record<string, any>>(\n defaultTheme: T,\n options?: CreateThemeOptions\n): ThemeContract<T> {\n const pfx = (options?.prefix ?? 'sc') + '-';\n const sel = options?.selector ?? ':root';\n const vars = buildVars(defaultTheme, pfx);\n\n const GlobalStyle = createGlobalStyle`\n ${sel} {\n ${(p: { theme: Record<string, any> }) => emitVarDeclarations(defaultTheme, p.theme, pfx)}\n }\n `;\n\n return Object.assign(vars, {\n GlobalStyle,\n raw: defaultTheme,\n resolve(el?: Element): T {\n if (!IS_BROWSER) {\n throw new Error('createTheme.resolve() is client-only');\n }\n const target = el ?? document.documentElement;\n return resolveVars(defaultTheme, pfx, getComputedStyle(target));\n },\n }) as ThemeContract<T>;\n}\n","import { KEYFRAMES_ID_PREFIX } from '../constants';\nimport StyleSheet from '../sheet';\nimport { getGroupForId } from '../sheet/GroupIDAllocator';\nimport { Keyframes as KeyframesType, Stringifier } from '../types';\nimport styledError from '../utils/error';\nimport { KEYFRAMES_SYMBOL } from '../utils/isKeyframes';\nimport { setToString } from '../utils/setToString';\nimport { mainStylis } from './StyleSheetManager';\n\nexport default class Keyframes implements KeyframesType {\n readonly [KEYFRAMES_SYMBOL] = true as const;\n\n id: string;\n name: string;\n rules: string;\n\n constructor(name: string, rules: string) {\n this.name = name;\n this.id = KEYFRAMES_ID_PREFIX + name;\n this.rules = rules;\n\n // Eagerly register the group so keyframes defined before components\n // get a lower group ID and appear before them in the stylesheet.\n // Uses getGroupForId directly (not StyleSheet.registerId) because\n // GroupIDAllocator is pure JS — safe for native builds.\n getGroupForId(this.id);\n\n setToString(this, () => {\n throw styledError(12, String(this.name));\n });\n }\n\n inject = (styleSheet: StyleSheet, stylisInstance: Stringifier = mainStylis): void => {\n const resolvedName = this.name + stylisInstance.hash;\n\n if (!styleSheet.hasNameForId(this.id, resolvedName)) {\n styleSheet.insertRules(\n this.id,\n resolvedName,\n stylisInstance(this.rules, resolvedName, '@keyframes')\n );\n }\n };\n\n getName(stylisInstance: Stringifier = mainStylis): string {\n return this.name + stylisInstance.hash;\n }\n}\n","import { mainSheet } from './models/StyleSheetManager';\nimport StyleSheet from './sheet';\n\nexport const __PRIVATE__ = {\n StyleSheet,\n mainSheet,\n};\n","/* Import singletons */\nimport { SC_ATTR, SC_VERSION } from './constants';\nimport createGlobalStyle from './constructors/createGlobalStyle';\nimport createTheme from './constructors/createTheme';\nimport css from './constructors/css';\nimport keyframes from './constructors/keyframes';\n/* Import Higher Order Components */\nimport withTheme from './hoc/withTheme';\n/* Import hooks */\nimport ServerStyleSheet from './models/ServerStyleSheet';\nimport {\n IStyleSheetContext,\n IStyleSheetManager,\n IStylisContext,\n StyleSheetConsumer,\n StyleSheetContext,\n StyleSheetManager,\n} from './models/StyleSheetManager';\n/* Import components */\nimport ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from './models/ThemeProvider';\nimport isStyledComponent from './utils/isStyledComponent';\n\n/* Warning if you've imported this file on React Native */\nif (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n) {\n console.warn(\n `It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native`\n );\n}\n\nconst windowGlobalKey = `__sc-${SC_ATTR}__`;\n\n/* Warning if there are several instances of styled-components */\nif (\n process.env.NODE_ENV !== 'production' &&\n process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined'\n) {\n // @ts-expect-error dynamic key not in window object\n window[windowGlobalKey] ||= 0;\n\n // @ts-expect-error dynamic key not in window object\n if (window[windowGlobalKey] === 1) {\n console.warn(\n `It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`\n );\n }\n\n // @ts-expect-error dynamic key not in window object\n window[windowGlobalKey] += 1;\n}\n\n/* Export everything */\nexport * from './secretInternals';\nexport { Attrs, DefaultTheme, Keyframes, ShouldForwardProp } from './types';\nexport {\n IStyleSheetContext,\n IStyleSheetManager,\n IStylisContext,\n ServerStyleSheet,\n StyleSheetConsumer,\n StyleSheetContext,\n StyleSheetManager,\n ThemeConsumer,\n ThemeContext,\n ThemeProvider,\n createGlobalStyle,\n createTheme,\n css,\n isStyledComponent,\n keyframes,\n useTheme,\n SC_VERSION as version,\n withTheme,\n};\n","import React from 'react';\nimport { type PipeableStream } from 'react-dom/server';\nimport { SC_ATTR, SC_ATTR_VERSION, SC_VERSION } from '../constants';\nimport StyleSheet from '../sheet';\nimport styledError from '../utils/error';\n\ndeclare const __SERVER__: boolean;\nimport { joinStringArray } from '../utils/joinStrings';\nimport getNonce from '../utils/nonce';\nimport { StyleSheetManager } from './StyleSheetManager';\n\nconst CLOSING_TAG_R = /^\\s*<\\/[a-z]/i;\n\n/**\n * Collect styled-components CSS during server-side rendering.\n *\n * ```tsx\n * const sheet = new ServerStyleSheet();\n * const html = renderToString(sheet.collectStyles(<App />));\n * const styleTags = sheet.getStyleTags();\n * sheet.seal();\n * ```\n */\nexport default class ServerStyleSheet {\n instance: StyleSheet;\n sealed: boolean;\n\n constructor({ nonce }: { nonce?: string } = {}) {\n this.instance = new StyleSheet({ isServer: true, nonce });\n this.sealed = false;\n }\n\n _emitSheetCSS = (): string => {\n const css = this.instance.toString();\n if (!css) return '';\n const nonce = this.instance.options.nonce || getNonce();\n const attrs = [\n nonce && `nonce=\"${nonce}\"`,\n `${SC_ATTR}=\"true\"`,\n `${SC_ATTR_VERSION}=\"${SC_VERSION}\"`,\n ];\n const htmlAttr = joinStringArray(attrs.filter(Boolean) as string[], ' ');\n\n return `<style ${htmlAttr}>${css}</style>`;\n };\n\n collectStyles(children: any): React.JSX.Element {\n if (this.sealed) {\n throw styledError(2);\n }\n\n return <StyleSheetManager sheet={this.instance}>{children}</StyleSheetManager>;\n }\n\n getStyleTags = (): string => {\n if (this.sealed) {\n throw styledError(2);\n }\n\n return this._emitSheetCSS();\n };\n\n getStyleElement = () => {\n if (this.sealed) {\n throw styledError(2);\n }\n\n const css = this.instance.toString();\n if (!css) return [];\n\n const props = {\n [SC_ATTR]: '',\n [SC_ATTR_VERSION]: SC_VERSION,\n dangerouslySetInnerHTML: {\n __html: css,\n },\n };\n\n const nonce = this.instance.options.nonce || getNonce();\n if (nonce) {\n (props as any).nonce = nonce;\n }\n\n // v4 returned an array for this fn, so we'll do the same for v5 for backward compat\n return [<style {...props} key=\"sc-0-0\" />];\n };\n\n interleaveWithNodeStream(input: NodeJS.ReadableStream | PipeableStream): NodeJS.ReadWriteStream {\n if (!__SERVER__) {\n throw styledError(3);\n } else if (this.sealed) {\n throw styledError(2);\n }\n\n this.seal();\n\n const { Transform } = require('stream');\n const { instance: sheet, _emitSheetCSS } = this;\n\n const transformer: NodeJS.ReadWriteStream = new Transform({\n transform: function appendStyleChunks(\n chunk: string,\n /* encoding */\n _: string,\n callback: Function\n ) {\n // Get the chunk and retrieve the sheet's CSS as an HTML chunk,\n // then reset its rules so we get only new ones for the next chunk\n const renderedHtml = chunk.toString();\n const html = _emitSheetCSS();\n\n sheet.clearTag();\n\n // prepend style html to chunk, unless the start of the chunk is a\n // closing tag in which case append right after that\n if (CLOSING_TAG_R.test(renderedHtml)) {\n const endOfClosingTag = renderedHtml.indexOf('>') + 1;\n const before = renderedHtml.slice(0, endOfClosingTag);\n const after = renderedHtml.slice(endOfClosingTag);\n\n this.push(before + html + after);\n } else {\n this.push(html + renderedHtml);\n }\n\n callback();\n },\n });\n\n // Type guard to determine stream type\n if ('on' in input && typeof input.on === 'function' && 'pipe' in input) {\n // NodeJS.ReadableStream\n const readableStream = input as NodeJS.ReadableStream;\n readableStream.on('error', err => {\n // forward the error to the transform stream\n transformer.emit('error', err);\n });\n return readableStream.pipe(transformer);\n } else if ('pipe' in input && typeof input.pipe === 'function') {\n // React PipeableStream\n const pipeableStream = input as PipeableStream;\n return pipeableStream.pipe(transformer);\n } else {\n throw new Error('Unsupported stream type');\n }\n }\n\n seal = (): void => {\n this.sealed = true;\n };\n}\n","import Keyframes from '../models/Keyframes';\nimport { Interpolation, Styles } from '../types';\nimport generateComponentId from '../utils/generateComponentId';\nimport { joinStringArray } from '../utils/joinStrings';\nimport css from './css';\n\n/**\n * Define a CSS `@keyframes` animation with an automatically scoped name.\n *\n * ```tsx\n * const rotate = keyframes`\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * `;\n * const Spinner = styled.div`animation: ${rotate} 1s linear infinite;`;\n * ```\n */\nexport default function keyframes<Props extends object = {}>(\n strings: Styles<Props>,\n ...interpolations: Array<Interpolation<Props>>\n): Keyframes {\n /* Warning if you've used keyframes on React Native */\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n ) {\n console.warn(\n '`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.'\n );\n }\n\n const rules = joinStringArray(css<Props>(strings, ...interpolations) as string[]);\n const name = generateComponentId(rules);\n return new Keyframes(name, rules);\n}\n","import React from 'react';\nimport { IS_RSC } from '../constants';\nimport { ThemeContext } from '../models/ThemeProvider';\nimport { AnyComponent, ExecutionProps } from '../types';\nimport determineTheme from '../utils/determineTheme';\nimport getComponentName from '../utils/getComponentName';\nimport hoist, { NonReactStatics } from '../utils/hoist';\n\ntype WithThemeOuterProps<T extends AnyComponent> = Omit<\n React.ComponentPropsWithRef<T>,\n keyof ExecutionProps\n> &\n ExecutionProps;\n\n/** Higher-order component that injects the current theme as a prop. Prefer `useTheme` in function components. */\nexport default function withTheme<T extends AnyComponent>(\n Component: T\n): React.ForwardRefExoticComponent<\n React.PropsWithoutRef<WithThemeOuterProps<T>> & React.RefAttributes<any>\n> &\n NonReactStatics<T> {\n const WithTheme = React.forwardRef<any, WithThemeOuterProps<T>>((props, ref) => {\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n const themeProp = determineTheme(props, theme, Component.defaultProps);\n\n if (process.env.NODE_ENV !== 'production' && themeProp === undefined) {\n console.warn(\n `[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"${getComponentName(\n Component\n )}\"`\n );\n }\n\n return React.createElement(Component, {\n ...props,\n theme: themeProp,\n ref,\n } as React.ComponentPropsWithRef<T>);\n });\n\n WithTheme.displayName = `WithTheme(${getComponentName(Component)})`;\n\n return hoist(WithTheme, Component);\n}\n"],"names":["SC_ATTR","process","env","REACT_APP_SC_ATTR","SC_ATTR_ACTIVE","SC_ATTR_VERSION","SC_VERSION","SPLITTER","IS_BROWSER","window","document","readSpeedyFlag","name","val","undefined","DISABLE_SPEEDY","Boolean","SC_DISABLE_SPEEDY","_b","_a","NODE_ENV","KEYFRAMES_ID_PREFIX","STATIC_EXECUTION_CONTEXT","ERRORS","throwStyledComponentsError","code","interpolations","Error","length","join","args","a","b","c","len","push","forEach","d","replace","format","trim","MAX_SMI","groupIDRegister","Map","reverseRegister","nextFreeGroup","getGroupForId","id","has","get","group","styledError","set","getIdForGroup","setGroupForId","invalidHookCallRe","seen","Set","checkDynamicCreation","displayName","componentId","message","originalConsoleError","console","error","didNotCallInvalidHook","consoleErrorMessage","consoleErrorArgs","test","delete","React","useState","warn","add","EMPTY_ARRAY","Object","freeze","EMPTY_OBJECT","determineTheme","props","providedTheme","defaultProps","theme","domElements","escapeRegex","dashesAtEnds","escape","str","AD_REPLACER_R","getAlphabeticChar","String","fromCharCode","generateAlphabeticName","x","Math","abs","phash","h","i","charCodeAt","hash","generateComponentId","getComponentName","target","isTag","charAt","toLowerCase","generateDisplayName","REACT_MEMO_TYPE","Symbol","for","REACT_FORWARD_REF_TYPE","REACT_STATICS","contextType","getDerivedStateFromError","getDerivedStateFromProps","propTypes","type","KNOWN_STATICS","prototype","caller","callee","arguments","arity","MEMO_STATICS","$$typeof","compare","TYPE_STATICS","render","getStatics","component","object","defineProperty","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","excludelist","inheritedComponent","keys","concat","targetStatics","sourceStatics","key","descriptor","e","isFunction","isStyledComponent","joinStrings","joinStringArray","arr","sep","isPlainObject","constructor","mixinRecursively","source","forceMerge","Array","isArray","setToString","toStringFn","value","DefaultGroupedTag","tag","this","groupSizes","Uint32Array","_cGroup","_cIndex","indexOfGroup","index","insertRules","rules","oldBuffer","oldSize","newSize","ruleIndex","insertedCount","l","insertRule","clearGroup","startIndex","endIndex","deleteRule","getGroup","css","getRule","SELECTOR","MARKER_RE","RegExp","isShadowRoot","node","ShadowRoot","nodeType","getRehydrationContainer","root","getRootNode","rehydrateNamesFromContent","sheet","content","names","split","registerName","rehydrateSheetFromTag","style","parts","textContent","part","marker","match","parseInt","getTag","rehydrateSheet","nodes","options","querySelectorAll","getAttribute","parentNode","removeChild","cached","getNonce","viteMeta","head","querySelector","nonce","scMeta","__webpack_nonce__","makeStyleTag","parent","createElement","prevStyle","from","findLastStyleTag","nextSibling","setAttribute","resolvedNonce","insertBefore","CSSOMTag","element","appendChild","createTextNode","styleSheets","ownerNode","getSheet","rule","_error","cssRules","cssText","TextTag","childNodes","VirtualTag","_target","splice","SHOULD_REHYDRATE","defaultOptions","isServer","useCSSOMInjection","StyleSheet","registerId","globalStyles","assign","gs","keyframeIds","server","size","selector","outputSheet","rehydrate","reconstructWithOptions","withNames","newSheet","allocateGSInstance","makeTag","hasNameForId","startsWith","existing","clearNames","clear","clearRules","clearTag","unitless","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","flex","flexGrow","flexShrink","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","addUnitIfNeeded","isUpper","hyphenateStyleName","string","output","KEYFRAMES_SYMBOL","isKeyframes","isStatelessFunction","isReactComponent","isFalsish","chunk","objToCssArray","obj","hasOwnProperty","isCss","hyphenate","flatten","executionContext","styleSheet","stylisInstance","result","styledComponentId","fnResult","inject","getName","cssArr","toString","SEED","ComponentStyle","baseStyle","baseHash","generateAndInjectStyles","stylis","partRule","dynamicNameCache","cacheKey","generateName","cssFormatted","AMP_REGEX","SLASH","ASTERISK","hasUnbalancedBraces","indexOf","depth","inString","inComment","recursivelySetNamespace","compiled","namespace","replaceAll","newProps","j","children","createStylisInstance","plugins","_componentId","_selector","_selectorRegexp","selfReferenceReplacer","offset","endsWith","middlewares","slice","RULESET","includes","prefix","prefixer","stringify","_stack","_middleware","middleware","rulesheet","stringifyRules","flatCSS","declStart","braceDepth","skipEnd","skipCode","substring","remaining","sanitizeCSS","start","urlDepth","stripLineComments","compile","serialize","reduce","acc","plugin","throwStyledError","mainSheet","mainStylis","StyleSheetContext","createContext","shouldForwardProp","StyleSheetConsumer","Consumer","StylisContext","useStyleSheetContext","default","useContext","StyleSheetManager","useMemo","resolvedStyleSheet","disableCSSOMInjection","enableVendorPrefixes","stylisPlugins","styleSheetContextValue","Provider","ThemeContext","ThemeConsumer","hasOwn","identifiers","generateId","parentComponentId","seenUnknownProps","createStyledComponent","isTargetStyledComp","styledComponentTarget","isCompositeComponent","attrs","finalAttrs","filter","shouldForwardPropFn","passedShouldForwardPropFn","prop","elementToBeCreated","componentStyle","forwardRefRender","ref","forwardedComponent","forwardedRef","componentAttrs","foldedComponentIds","contextTheme","ssc","useDebugValue","context","generatedClassName","renderCacheRef","useRef","prev","current","next","prevKeyCount","nextKeyCount","call","shallowEqualContext","className","attrDef","resolvedAttrDef","resolveContext","resolvedAttrs","useInjectedStyle","propsKeyCount","warnTooManyClasses","as","propsForElement","forwardedAs","isPropValid","buildPropsForElement","classString","useStyledComponentImpl","WrappedStyledComponent","forwardRef","_foldedDefaultProps","sources","merge","generatedClasses","warningSeen","createWarnTooManyClasses","hoist","interleave","strings","addTag","arg","styles","styleStringArray","constructWithOptions","componentConstructor","templateFunction","initialStyles","withConfig","config","baseStyled","styled","domElement","GlobalStyle","instanceRules","isStatic","isStaticRules","removeStyles","instance","rebuildGroup","renderStyles","computeRules","entry","same","values","createGlobalStyle","JSON","globalStyle","GlobalStyleComponent","instanceRef","Children","count","some","effectDeps","prevGlobalStyleRef","useLayoutEffect","memo","walkTheme","varPrefix","leafFn","path","fullPath","nested","emitVarDeclarations","shape","shapeVal","themeVal","Keyframes","resolvedName","__PRIVATE__","navigator","product","windowGlobalKey","_emitSheetCSS","getStyleTags","sealed","getStyleElement","dangerouslySetInnerHTML","__html","seal","collectStyles","interleaveWithNodeStream","input","outerTheme","themeContext","mergedTheme","mergeTheme","defaultTheme","pfx","sel","vars","buildVars","p","raw","resolve","el","documentElement","getPropertyValue","resolveVars","getComputedStyle","Component","WithTheme","themeProp"],"mappings":"uiBAKO,MAAMA,EACS,oBAAZC,cACiB,IAAhBA,QAAQC,MACdD,QAAQC,IAAIC,mBAAqBF,QAAQC,IAAIF,UAChD,cAEWI,EAAiB,SACjBC,EAAkB,sBAClBC,EAAa,qBACbC,EAAW,YAEXC,EAA+B,oBAAXC,QAA8C,oBAAbC,SAWlE,SAASC,EAAeC,GACtB,GAAuB,oBAAZX,cAAkD,IAAhBA,QAAQC,IAAqB,CACxE,MAAMW,EAAMZ,QAAQC,IAAIU,GACxB,QAAYE,IAARD,GAA6B,KAARA,EACvB,MAAe,UAARA,CAEV,CAEH,CAEO,MAAME,EAAiBC,QACC,kBAAtBC,kBACHA,kBAGE,QAFDC,EACC,QADDC,EAAAR,EAAe,sCACd,IAAAQ,EAAAA,EAAAR,EAAe,4BACf,IAAAO,EAAAA,EAAoB,oBAAZjB,cAAkD,IAAhBA,QAAQC,KACrB,eAAzBD,QAAQC,IAAIkB,UAIXC,EAAsB,gBAGtBC,EAA2B,CAAE,EC/CpCC,EAA6C,eAAzBtB,QAAQC,IAAIkB,SCHvB,CACb,EAAK,wDACL,EAAK,gQACL,EAAK,sHACL,EAAK,sMACL,EAAK,kKACL,EAAK,4OACL,EAAK,qHACL,EAAK,8DACL,EAAK,gCACL,GAAM,iUACN,GAAM,wNACN,GAAM,qWACN,GAAM,yLACN,GAAM,+CACN,GAAM,2ZACN,GAAM,uQACN,GAAM,yI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zL,GACH,CAAAG,MAAOgf,EACP/H,WAMJ,OAFA8H,EAAUtgB,YAAc,aAAa2C,EAAiB0d,MAE/CnF,GAAMoF,EAAWD,EAC1B"}
|
|
1
|
+
{"version":3,"file":"styled-components.browser.cjs.js","sources":["../src/constants.ts","../src/utils/error.ts","../src/utils/errors.ts","../src/sheet/GroupIDAllocator.ts","../src/utils/checkDynamicCreation.ts","../src/utils/empties.ts","../src/utils/determineTheme.ts","../src/utils/escape.ts","../src/utils/generateAlphabeticName.ts","../src/utils/hash.ts","../src/utils/generateComponentId.ts","../src/utils/getComponentName.ts","../src/utils/isTag.ts","../src/utils/generateDisplayName.ts","../src/utils/hoist.ts","../src/utils/isFunction.ts","../src/utils/isStyledComponent.ts","../src/utils/joinStrings.ts","../src/utils/isPlainObject.ts","../src/utils/mixinDeep.ts","../src/utils/setToString.ts","../src/sheet/GroupedTag.ts","../src/sheet/Rehydration.ts","../src/utils/nonce.ts","../src/sheet/dom.ts","../src/sheet/Tag.ts","../src/sheet/Sheet.ts","../src/utils/cssTagged.ts","../src/utils/addUnitIfNeeded.ts","../src/utils/hyphenateStyleName.ts","../src/utils/isKeyframes.ts","../src/utils/isStatelessFunction.ts","../src/utils/flatten.ts","../src/models/ComponentStyle.ts","../src/utils/createWarnTooManyClasses.ts","../src/utils/stylis.ts","../src/models/StyleSheetManager.tsx","../src/models/ThemeProvider.tsx","../src/models/StyledComponent.ts","../src/utils/domElements.ts","../src/utils/interleave.ts","../src/constructors/css.ts","../src/constructors/constructWithOptions.ts","../src/constructors/styled.tsx","../src/models/GlobalStyle.ts","../src/utils/isStaticRules.ts","../src/constructors/createGlobalStyle.ts","../src/constructors/createTheme.ts","../src/models/Keyframes.ts","../src/secretInternals.ts","../src/base.ts","../src/utils/stylisPluginRSC.ts","../src/models/ServerStyleSheet.tsx","../src/constructors/keyframes.ts","../src/hoc/withTheme.tsx"],"sourcesContent":["declare let SC_DISABLE_SPEEDY: boolean | null | undefined;\ndeclare let __VERSION__: string;\n\nimport React from 'react';\n\nexport const SC_ATTR: string =\n (typeof process !== 'undefined' &&\n typeof process.env !== 'undefined' &&\n (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||\n 'data-styled';\n\nexport const SC_ATTR_ACTIVE = 'active';\nexport const SC_ATTR_VERSION = 'data-styled-version';\nexport const SC_VERSION = __VERSION__;\nexport const SPLITTER = '/*!sc*/\\n';\n\nexport const IS_BROWSER = typeof window !== 'undefined' && typeof document !== 'undefined';\n\n/**\n * True when running in a React Server Component environment (createContext\n * is unavailable). In browser / standalone / native builds the entire\n * expression is replaced with the literal `false` via rollup-plugin-replace\n * with empty delimiters (exact string match), enabling rollup constant\n * inlining and terser dead-code elimination for all RSC branches.\n */\nexport const IS_RSC: boolean = typeof React.createContext === 'undefined';\n\nfunction readSpeedyFlag(name: string): boolean | undefined {\n if (typeof process !== 'undefined' && typeof process.env !== 'undefined') {\n const val = process.env[name];\n if (val !== undefined && val !== '') {\n return val !== 'false';\n }\n }\n return undefined;\n}\n\nexport const DISABLE_SPEEDY = Boolean(\n typeof SC_DISABLE_SPEEDY === 'boolean'\n ? SC_DISABLE_SPEEDY\n : (readSpeedyFlag('REACT_APP_SC_DISABLE_SPEEDY') ??\n readSpeedyFlag('SC_DISABLE_SPEEDY') ??\n (typeof process !== 'undefined' && typeof process.env !== 'undefined'\n ? process.env.NODE_ENV !== 'production'\n : true))\n);\n\nexport const KEYFRAMES_ID_PREFIX = 'sc-keyframes-';\n\n// Shared empty execution context when generating static styles\nexport const STATIC_EXECUTION_CONTEXT = {};\n","import { Dict } from '../types';\nimport errorMap from './errors';\n\nconst ERRORS: Dict<any> = process.env.NODE_ENV !== 'production' ? errorMap : {};\n\n/**\n * super basic version of sprintf\n */\nfunction format(...args: [string, ...any]) {\n let a = args[0];\n const b = [];\n\n for (let c = 1, len = args.length; c < len; c += 1) {\n b.push(args[c]);\n }\n\n b.forEach(d => {\n a = a.replace(/%[a-z]/, d);\n });\n\n return a;\n}\n\n/**\n * Create an error file out of errors.md for development and a simple web link to the full errors\n * in production mode.\n */\nexport default function throwStyledComponentsError(\n code: string | number,\n ...interpolations: any[]\n) {\n if (process.env.NODE_ENV === 'production') {\n return new Error(\n `An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${code} for more information.${\n interpolations.length > 0 ? ` Args: ${interpolations.join(', ')}` : ''\n }`\n );\n } else {\n return new Error(format(ERRORS[code], ...interpolations).trim());\n }\n}\n","export default {\n '1': 'Cannot create styled-component for component: %s.\\n\\n',\n '2': \"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\\n\\n- Are you trying to reuse it across renders?\\n- Are you accidentally calling collectStyles twice?\\n\\n\",\n '3': 'Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\\n\\n',\n '4': 'The `StyleSheetManager` expects a valid target or sheet prop!\\n\\n- Does this error occur on the client and is your target falsy?\\n- Does this error occur on the server and is the sheet falsy?\\n\\n',\n '5': 'The clone method cannot be used on the client!\\n\\n- Are you running in a client-like environment on the server?\\n- Are you trying to run SSR on the client?\\n\\n',\n '6': \"Trying to insert a new style tag, but the given Node is unmounted!\\n\\n- Are you using a custom target that isn't mounted?\\n- Does your document not have a valid head element?\\n- Have you accidentally removed a style tag manually?\\n\\n\",\n '7': 'ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\\n\\n```js\\ntheme={() => ({})}\\n```\\n\\n',\n '8': 'ThemeProvider: Please make your \"theme\" prop an object.\\n\\n',\n '9': 'Missing document `<head>`\\n\\n',\n '10': 'Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\\n\\n',\n '11': '_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\\n\\n',\n '12': 'It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\\\`\\\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\\n\\n',\n '13': '%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\\n\\n',\n '14': 'ThemeProvider: \"theme\" prop is required.\\n\\n',\n '15': \"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\\n\\n```js\\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\\n```\\n\\n\",\n '16': \"Reached the limit of how many styled components may be created at group %s.\\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\\nas for instance in your render method then you may be running into this limitation.\\n\\n\",\n '17': \"CSSStyleSheet could not be found on HTMLStyleElement.\\nHas styled-components' style tag been unmounted or altered by another script?\\n\",\n '18': 'ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`',\n};\n","import styledError from '../utils/error';\n\nconst MAX_SMI = 1 << (31 - 1);\n\nlet groupIDRegister: Map<string, number> = new Map();\nlet reverseRegister: Map<number, string> = new Map();\nlet nextFreeGroup = 1;\n\nexport const resetGroupIds = () => {\n groupIDRegister = new Map();\n reverseRegister = new Map();\n nextFreeGroup = 1;\n};\n\nexport const getGroupForId = (id: string): number => {\n if (groupIDRegister.has(id)) {\n return groupIDRegister.get(id) as any;\n }\n\n while (reverseRegister.has(nextFreeGroup)) {\n nextFreeGroup++;\n }\n\n const group = nextFreeGroup++;\n\n if (process.env.NODE_ENV !== 'production' && ((group | 0) < 0 || group > MAX_SMI)) {\n throw styledError(16, `${group}`);\n }\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n return group;\n};\n\nexport const getIdForGroup = (group: number): void | string => {\n return reverseRegister.get(group);\n};\n\nexport const setGroupForId = (id: string, group: number) => {\n // move pointer\n nextFreeGroup = group + 1;\n\n groupIDRegister.set(id, group);\n reverseRegister.set(group, id);\n};\n","import React from 'react';\nimport { IS_RSC } from '../constants';\n\nconst invalidHookCallRe = /invalid hook call/i;\nconst seen = new Set();\n\nexport const checkDynamicCreation = (displayName: string, componentId?: string | undefined) => {\n if (process.env.NODE_ENV !== 'production') {\n // Skip check in RSC environments where:\n // 1. Components are always module-level (can't be in render functions)\n // 2. Hook detection is unreliable due to different module evaluation context\n if (IS_RSC) {\n return;\n }\n\n const parsedIdString = componentId ? ` with the id of \"${componentId}\"` : '';\n const message =\n `The component ${displayName}${parsedIdString} has been created dynamically.\\n` +\n \"You may see this warning because you've called styled inside another component.\\n\" +\n 'To resolve this only create new StyledComponents outside of any render method and function component.\\n' +\n 'See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\\n';\n\n // If a hook is called outside of a component:\n // React 17 and earlier throw an error\n // React 18 and above use console.error\n\n const originalConsoleError = console.error;\n try {\n let didNotCallInvalidHook = true;\n console.error = (consoleErrorMessage, ...consoleErrorArgs) => {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test(consoleErrorMessage)) {\n didNotCallInvalidHook = false;\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n } else {\n originalConsoleError(consoleErrorMessage, ...consoleErrorArgs);\n }\n };\n // We purposefully call a hook outside of a component and expect it to throw\n // If it doesn't, then we're inside another component.\n // Use useState instead of useRef to avoid importing useRef\n if (typeof React.useState === 'function') {\n React.useState(null);\n }\n\n if (didNotCallInvalidHook && !seen.has(message)) {\n console.warn(message);\n seen.add(message);\n }\n } catch (error) {\n // The error here is expected, since we're expecting anything that uses `checkDynamicCreation` to\n // be called outside of a React component.\n if (invalidHookCallRe.test((error as Error).message)) {\n // This shouldn't happen, but resets `warningSeen` if we had this error happen intermittently\n seen.delete(message);\n }\n } finally {\n console.error = originalConsoleError;\n }\n }\n};\n","import { Dict } from '../types';\n\nexport const EMPTY_ARRAY = Object.freeze([]) as Readonly<any[]>;\nexport const EMPTY_OBJECT = Object.freeze({}) as Readonly<Dict<any>>;\n","import { DefaultTheme, ExecutionProps } from '../types';\nimport { EMPTY_OBJECT } from './empties';\n\nexport default function determineTheme(\n props: ExecutionProps,\n providedTheme?: DefaultTheme | undefined,\n defaultProps: { theme?: DefaultTheme | undefined } = EMPTY_OBJECT\n): DefaultTheme | undefined {\n return (props.theme !== defaultProps.theme && props.theme) || providedTheme || defaultProps.theme;\n}\n","// Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier\n// Control characters and non-letter first symbols are not supported\nconst escapeRegex = /[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~-]+/g;\n\nconst dashesAtEnds = /(^-|-$)/g;\n\nexport default function escape(str: string) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n}\n","const AD_REPLACER_R = /(a)(d)/gi;\n\n/* This is the \"capacity\" of our alphabet i.e. 2x26 for all letters plus their capitalised\n * counterparts */\nconst charsLength = 52;\n\n/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */\nconst getAlphabeticChar = (code: number) => String.fromCharCode(code + (code > 25 ? 39 : 97));\n\n/* input a number, usually a hash and convert it to base-52 */\nexport default function generateAlphabeticName(code: number) {\n let name = '';\n let x;\n\n /* get a char and divide by alphabet-length */\n for (x = Math.abs(code); x > charsLength; x = (x / charsLength) | 0) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');\n}\n","export const SEED = 5381;\n\n// When we have separate strings it's useful to run a progressive\n// version of djb2 where we pretend that we're still looping over\n// the same string\nexport const phash = (h: number, x: string) => {\n let i = x.length;\n\n while (i) {\n h = (h * 33) ^ x.charCodeAt(--i);\n }\n\n return h;\n};\n\n// Hash a non-negative integer, avoiding String() allocation for single digits.\n// Equivalent to phash(h, String(n)) for n >= 0.\nexport const phashN = (h: number, n: number) => {\n if (n >= 0 && n < 10) return (h * 33) ^ (n + 48);\n return phash(h, '' + n);\n};\n\n// This is a djb2 hashing function\nexport const hash = (x: string) => {\n return phash(SEED, x);\n};\n","import generateAlphabeticName from './generateAlphabeticName';\nimport { hash } from './hash';\n\nexport default function generateComponentId(str: string) {\n return generateAlphabeticName(hash(str) >>> 0);\n}\n","import { StyledTarget } from '../types';\n\nexport default function getComponentName(target: StyledTarget<any>) {\n return (\n (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) ||\n (target as Exclude<StyledTarget<any>, string>).displayName ||\n (target as Function).name ||\n 'Component'\n );\n}\n","import { StyledTarget } from '../types';\n\nexport default function isTag(target: StyledTarget<'web'>): target is string {\n return (\n typeof target === 'string' &&\n (process.env.NODE_ENV !== 'production'\n ? target.charAt(0) === target.charAt(0).toLowerCase()\n : true)\n );\n}\n","import { StyledTarget } from '../types';\nimport getComponentName from './getComponentName';\nimport isTag from './isTag';\n\nexport default function generateDisplayName(target: StyledTarget<any>) {\n return isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`;\n}\n","import React from 'react';\nimport { AnyComponent } from '../types';\n\n// copied from react-is\nconst REACT_MEMO_TYPE = Symbol.for('react.memo');\nconst REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\n\n/**\n * Adapted from hoist-non-react-statics to avoid the react-is dependency.\n */\nconst REACT_STATICS = {\n contextType: true,\n defaultProps: true,\n displayName: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n propTypes: true,\n type: true,\n};\n\nconst KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true,\n};\n\nconst FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n};\n\nconst MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true,\n};\n\nconst TYPE_STATICS: Record<symbol, Record<string, boolean>> = {\n [REACT_FORWARD_REF_TYPE]: FORWARD_REF_STATICS,\n [REACT_MEMO_TYPE]: MEMO_STATICS,\n};\n\ntype OmniComponent = AnyComponent;\n\n// adapted from react-is\nfunction isMemo(\n object: OmniComponent | React.MemoExoticComponent<any>\n): object is React.MemoExoticComponent<any> {\n const $$typeofType = 'type' in object && object.type.$$typeof;\n\n return $$typeofType === REACT_MEMO_TYPE;\n}\n\nfunction getStatics(component: OmniComponent) {\n // React v16.11 and below\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n\n // React v16.12 and above\n return '$$typeof' in component\n ? TYPE_STATICS[component['$$typeof'] as unknown as symbol]\n : REACT_STATICS;\n}\n\nconst defineProperty = Object.defineProperty;\nconst getOwnPropertyNames = Object.getOwnPropertyNames;\nconst getOwnPropertySymbols = Object.getOwnPropertySymbols;\nconst getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectPrototype = Object.prototype;\n\ntype ExcludeList = {\n [key: string]: true;\n};\n\nexport type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {\n [key in Exclude<\n keyof S,\n S extends React.MemoExoticComponent<any>\n ? keyof typeof MEMO_STATICS | keyof C\n : S extends React.ForwardRefExoticComponent<any>\n ? keyof typeof FORWARD_REF_STATICS | keyof C\n : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C\n >]: S[key];\n};\n\nexport default function hoistNonReactStatics<\n T extends OmniComponent,\n S extends OmniComponent,\n C extends ExcludeList = {},\n>(targetComponent: T, sourceComponent: S, excludelist?: C | undefined) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, excludelist);\n }\n\n const keys: (string | symbol)[] = (\n getOwnPropertyNames(sourceComponent) as (string | symbol)[]\n ).concat(getOwnPropertySymbols(sourceComponent));\n\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i] as string;\n if (\n !(key in KNOWN_STATICS) &&\n !(excludelist && excludelist[key]) &&\n !(sourceStatics && key in sourceStatics) &&\n !(targetStatics && key in targetStatics)\n ) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor!);\n } catch (e) {\n /* ignore */\n }\n }\n }\n }\n\n return targetComponent as T & NonReactStatics<S, C>;\n}\n","export default function isFunction(test: any): test is Function {\n return typeof test === 'function';\n}\n","import { StyledComponentBrand } from '../types';\n\n/** Type guard that returns true if the target is a styled component. */\nexport default function isStyledComponent(target: any): target is StyledComponentBrand {\n return typeof target === 'object' && 'styledComponentId' in target;\n}\n","import { SPLITTER } from '../constants';\n\n/**\n * Convenience function for joining strings to form className chains\n */\nexport function joinStrings(a?: string | undefined, b?: string | undefined): string {\n return a && b ? a + ' ' + b : a || b || '';\n}\n\nexport function joinStringArray(arr: string[], sep?: string | undefined): string {\n return arr.join(sep || '');\n}\n\n/** Join compiled CSS rules with the SC splitter delimiter. */\nexport function joinRules(rules: string[]): string {\n let css = '';\n for (let i = 0; i < rules.length; i++) {\n css += rules[i] + SPLITTER;\n }\n return css;\n}\n\nexport function stripSplitter(css: string): string {\n if (!css) return css;\n return css.replaceAll(SPLITTER, '');\n}\n","export default function isPlainObject(x: any): x is Record<any, any> {\n return (\n x !== null &&\n typeof x === 'object' &&\n x.constructor.name === Object.name &&\n /* check for reasonable markers that the object isn't an element for react & preact/compat */\n !('props' in x && x.$$typeof)\n );\n}\n","import isPlainObject from './isPlainObject';\n\nfunction mixinRecursively(target: any, source: any, forceMerge = false) {\n /* only merge into POJOs, Arrays, but for top level objects only\n * allow to merge into anything by passing forceMerge = true */\n if (!forceMerge && !isPlainObject(target) && !Array.isArray(target)) {\n return source;\n }\n\n if (Array.isArray(source)) {\n for (let key = 0; key < source.length; key++) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n } else if (isPlainObject(source)) {\n for (const key in source) {\n target[key] = mixinRecursively(target[key], source[key]);\n }\n }\n\n return target;\n}\n\n/**\n * Arrays & POJOs merged recursively, other objects and value types are overridden\n * If target is not a POJO or an Array, it will get source properties injected via shallow merge\n * Source objects applied left to right. Mutates & returns target. Similar to lodash merge.\n */\nexport default function mixinDeep(target: any, ...sources: any[]) {\n for (const source of sources) {\n mixinRecursively(target, source, true);\n }\n\n return target;\n}\n","/**\n * If the Object prototype is frozen, the \"toString\" property is non-writable. This means that any objects which inherit this property\n * cannot have the property changed using a \"=\" assignment operator. If using strict mode, attempting that will cause an error. If not using\n * strict mode, attempting that will be silently ignored.\n *\n * If the Object prototype is frozen, inherited non-writable properties can still be shadowed using one of two mechanisms:\n *\n * 1. ES6 class methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#methods\n * 2. Using the `Object.defineProperty()` static method:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n *\n * However, this project uses Babel to transpile ES6 classes, and transforms ES6 class methods to use the assignment operator instead:\n * https://babeljs.io/docs/babel-plugin-transform-class-properties#options\n *\n * Therefore, the most compatible way to shadow the prototype's \"toString\" property is to define a new \"toString\" property on this object.\n */\nexport function setToString(object: object, toStringFn: () => string) {\n Object.defineProperty(object, 'toString', { value: toStringFn });\n}\n","import { SPLITTER } from '../constants';\nimport styledError from '../utils/error';\nimport { GroupedTag, Tag } from './types';\n\n/** Create a GroupedTag with an underlying Tag implementation */\nexport const makeGroupedTag = (tag: Tag) => {\n return new DefaultGroupedTag(tag);\n};\n\nconst BASE_SIZE = 1 << 9;\n\nconst DefaultGroupedTag = class DefaultGroupedTag implements GroupedTag {\n groupSizes: Uint32Array;\n length: number;\n tag: Tag;\n\n // Cached position for O(1) sequential indexOfGroup lookups.\n // Avoids the O(n) linear scan on every call by remembering the last\n // computed (group → absoluteIndex) pair and scanning incrementally.\n _cGroup: number;\n _cIndex: number;\n\n constructor(tag: Tag) {\n this.groupSizes = new Uint32Array(BASE_SIZE);\n this.length = BASE_SIZE;\n this.tag = tag;\n this._cGroup = 0;\n this._cIndex = 0;\n }\n\n indexOfGroup(group: number) {\n if (group === this._cGroup) return this._cIndex;\n\n let index = this._cIndex;\n\n if (group > this._cGroup) {\n for (let i = this._cGroup; i < group; i++) {\n index += this.groupSizes[i];\n }\n } else {\n for (let i = this._cGroup - 1; i >= group; i--) {\n index -= this.groupSizes[i];\n }\n }\n\n this._cGroup = group;\n this._cIndex = index;\n return index;\n }\n\n insertRules(group: number, rules: string[]) {\n if (group >= this.groupSizes.length) {\n const oldBuffer = this.groupSizes;\n const oldSize = oldBuffer.length;\n\n let newSize = oldSize;\n while (group >= newSize) {\n newSize <<= 1;\n if (newSize < 0) {\n throw styledError(16, `${group}`);\n }\n }\n\n this.groupSizes = new Uint32Array(newSize);\n this.groupSizes.set(oldBuffer);\n this.length = newSize;\n\n for (let i = oldSize; i < newSize; i++) {\n this.groupSizes[i] = 0;\n }\n }\n\n let ruleIndex = this.indexOfGroup(group + 1);\n let insertedCount = 0;\n\n for (let i = 0, l = rules.length; i < l; i++) {\n if (this.tag.insertRule(ruleIndex, rules[i])) {\n this.groupSizes[group]++;\n ruleIndex++;\n insertedCount++;\n }\n }\n\n // Keep cache consistent: groups after the insertion point shift forward\n if (insertedCount > 0 && this._cGroup > group) {\n this._cIndex += insertedCount;\n }\n }\n\n clearGroup(group: number) {\n if (group < this.length) {\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n this.groupSizes[group] = 0;\n\n for (let i = startIndex; i < endIndex; i++) {\n this.tag.deleteRule(startIndex);\n }\n\n // Keep cache consistent: groups after the cleared group shift backward\n if (length > 0 && this._cGroup > group) {\n this._cIndex -= length;\n }\n }\n }\n\n getGroup(group: number) {\n let css = '';\n if (group >= this.length || this.groupSizes[group] === 0) {\n return css;\n }\n\n const length = this.groupSizes[group];\n const startIndex = this.indexOfGroup(group);\n const endIndex = startIndex + length;\n\n for (let i = startIndex; i < endIndex; i++) {\n css += this.tag.getRule(i) + SPLITTER;\n }\n\n return css;\n }\n};\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION, SPLITTER } from '../constants';\nimport { InsertionTarget } from '../types';\nimport { getIdForGroup, setGroupForId } from './GroupIDAllocator';\nimport { Sheet } from './types';\n\nconst SELECTOR = `style[${SC_ATTR}][${SC_ATTR_VERSION}=\"${SC_VERSION}\"]`;\nconst MARKER_RE = new RegExp(`^${SC_ATTR}\\\\.g(\\\\d+)\\\\[id=\"([\\\\w\\\\d-]+)\"\\\\].*?\"([^\"]*)`);\n\n/**\n * Type guard to check if a node is a ShadowRoot.\n * Uses instanceof when available, with duck-typing fallback for cross-realm scenarios.\n */\nconst isShadowRoot = (node: InsertionTarget | Node): node is ShadowRoot => {\n return (\n (typeof ShadowRoot !== 'undefined' && node instanceof ShadowRoot) ||\n ('host' in node &&\n // https://dom.spec.whatwg.org/#dom-node-document_fragment_node\n node.nodeType === 11)\n );\n};\n\n/**\n * Extract the container (Document or ShadowRoot) from an InsertionTarget.\n * If the target is a ShadowRoot, return it directly.\n * If the target is an HTMLElement, return its root node if it's a ShadowRoot, otherwise return document.\n */\nexport const getRehydrationContainer = (\n target?: InsertionTarget | undefined\n): Document | ShadowRoot => {\n if (!target) {\n return document;\n }\n\n // Check if target is a ShadowRoot\n if (isShadowRoot(target)) {\n return target;\n }\n\n // Check if target is an HTMLElement inside a ShadowRoot\n if ('getRootNode' in target) {\n const root = (target as HTMLElement).getRootNode();\n if (isShadowRoot(root)) {\n return root;\n }\n }\n\n return document;\n};\n\nexport const outputSheet = (sheet: Sheet) => {\n const tag = sheet.getTag();\n const { length } = tag;\n\n let css = '';\n for (let group = 0; group < length; group++) {\n const id = getIdForGroup(group);\n if (id === undefined) continue;\n\n const names = sheet.names.get(id);\n if (names === undefined || !names.size) continue;\n\n const rules = tag.getGroup(group);\n if (rules.length === 0) continue;\n\n const selector = SC_ATTR + '.g' + group + '[id=\"' + id + '\"]';\n\n let content = '';\n for (const name of names) {\n if (name.length > 0) {\n content += name + ',';\n }\n }\n\n // NOTE: It's easier to collect rules and have the marker\n // after the actual rules to simplify the rehydration\n css += rules + selector + '{content:\"' + content + '\"}' + SPLITTER;\n }\n\n return css;\n};\n\nconst rehydrateNamesFromContent = (sheet: Sheet, id: string, content: string) => {\n const names = content.split(',');\n let name;\n\n for (let i = 0, l = names.length; i < l; i++) {\n if ((name = names[i])) {\n sheet.registerName(id, name);\n }\n }\n};\n\nconst rehydrateSheetFromTag = (sheet: Sheet, style: HTMLStyleElement) => {\n const parts = (style.textContent ?? '').split(SPLITTER);\n const rules: string[] = [];\n\n for (let i = 0, l = parts.length; i < l; i++) {\n const part = parts[i].trim();\n if (!part) continue;\n\n const marker = part.match(MARKER_RE);\n\n if (marker) {\n const group = parseInt(marker[1], 10) | 0;\n const id = marker[2];\n\n if (group !== 0) {\n // Rehydrate componentId to group index mapping\n setGroupForId(id, group);\n // Rehydrate names and rules\n // looks like: data-styled.g11[id=\"idA\"]{content:\"nameA,\"}\n rehydrateNamesFromContent(sheet, id, marker[3]);\n sheet.getTag().insertRules(group, rules);\n }\n\n rules.length = 0;\n } else {\n rules.push(part);\n }\n }\n};\n\nexport const rehydrateSheet = (sheet: Sheet) => {\n const container = getRehydrationContainer(sheet.options.target);\n const nodes = container.querySelectorAll(SELECTOR);\n\n for (let i = 0, l = nodes.length; i < l; i++) {\n const node = nodes[i] as any as HTMLStyleElement;\n if (node && node.getAttribute(SC_ATTR) !== SC_ATTR_ACTIVE) {\n rehydrateSheetFromTag(sheet, node);\n\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n }\n }\n};\n","declare let __webpack_nonce__: string;\n\n/**\n * Resolve a CSP nonce from available sources (in priority order):\n * 1. <meta property=\"csp-nonce\"> (Vite puts nonce in the `nonce` attr)\n * 2. <meta name=\"sc-nonce\"> (SC convention, nonce in `content` attr)\n * 3. __webpack_nonce__ global (legacy)\n *\n * For Next.js/Remix, pass nonces explicitly via StyleSheetManager or\n * ServerStyleSheet instead—auto-detection doesn't apply to header-based nonces.\n */\nlet cached: string | undefined | false = false;\n\n/** @internal Reset the nonce cache (for testing only). */\nexport function resetNonceCache() {\n cached = false;\n}\n\nexport default function getNonce(): string | undefined {\n if (cached !== false) return cached;\n\n if (typeof document !== 'undefined') {\n // Vite sets the nonce in the `nonce` attribute. Browsers expose this via\n // the .nonce DOM property but return \"\" from getAttribute('nonce').\n const viteMeta = document.head.querySelector<HTMLMetaElement>('meta[property=\"csp-nonce\"]');\n if (viteMeta) return (cached = viteMeta.nonce || viteMeta.getAttribute('content') || undefined);\n\n const scMeta = document.head.querySelector<HTMLMetaElement>('meta[name=\"sc-nonce\"]');\n if (scMeta) return (cached = scMeta.getAttribute('content') || undefined);\n }\n\n return (cached = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : undefined);\n}\n","import { SC_ATTR, SC_ATTR_ACTIVE, SC_ATTR_VERSION, SC_VERSION } from '../constants';\nimport { InsertionTarget } from '../types';\nimport styledError from '../utils/error';\nimport getNonce from '../utils/nonce';\n\n/** Find last style element if any inside target */\nconst findLastStyleTag = (target: InsertionTarget): void | HTMLStyleElement => {\n const arr = Array.from(target.querySelectorAll<HTMLStyleElement>(`style[${SC_ATTR}]`));\n\n return arr[arr.length - 1];\n};\n\n/** Create a style element inside `target` or <head> after the last */\nexport const makeStyleTag = (\n target?: InsertionTarget | undefined,\n nonce?: string | undefined\n): HTMLStyleElement => {\n const head = document.head;\n const parent = target || head;\n const style = document.createElement('style');\n const prevStyle = findLastStyleTag(parent);\n const nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;\n\n style.setAttribute(SC_ATTR, SC_ATTR_ACTIVE);\n style.setAttribute(SC_ATTR_VERSION, SC_VERSION);\n\n const resolvedNonce = nonce || getNonce();\n\n if (resolvedNonce) style.setAttribute('nonce', resolvedNonce);\n\n parent.insertBefore(style, nextSibling);\n\n return style;\n};\n\n/** Get the CSSStyleSheet instance for a given style element */\nexport const getSheet = (tag: HTMLStyleElement): CSSStyleSheet => {\n if (tag.sheet) {\n return tag.sheet as any as CSSStyleSheet;\n }\n\n // Avoid Firefox quirk where the style element might not have a sheet property.\n // Use the tag's root node to find styleSheets — document.styleSheets doesn't\n // include sheets inside shadow roots.\n const root = tag.getRootNode() as Document | ShadowRoot;\n const styleSheets = root.styleSheets ?? document.styleSheets;\n for (let i = 0, l = styleSheets.length; i < l; i++) {\n const sheet = styleSheets[i];\n if (sheet.ownerNode === tag) {\n return sheet as any as CSSStyleSheet;\n }\n }\n\n throw styledError(17);\n};\n\n/** Remove a GlobalStyle's SSR-rendered inline style tag(s) from the DOM */\nexport const removeGlobalStyleTag = (componentId: string, target?: InsertionTarget): void => {\n if (typeof document === 'undefined') return;\n\n const container = target ?? document;\n const styleTags = container.querySelectorAll(`style[data-styled-global=\"${componentId}\"]`);\n styleTags.forEach(tag => tag.remove());\n};\n","import { InsertionTarget } from '../types';\nimport { getSheet, makeStyleTag } from './dom';\nimport { SheetOptions, Tag } from './types';\n\ndeclare const __SERVER__: boolean;\n\n/** Create a CSSStyleSheet-like tag depending on the environment */\nexport const makeTag = ({ isServer, useCSSOMInjection, target, nonce }: SheetOptions) => {\n if (__SERVER__ && isServer) {\n return new VirtualTag(target);\n } else if (useCSSOMInjection) {\n return new CSSOMTag(target, nonce);\n } else {\n return new TextTag(target, nonce);\n }\n};\n\nexport const CSSOMTag = class CSSOMTag implements Tag {\n element: HTMLStyleElement;\n\n sheet: CSSStyleSheet;\n\n length: number;\n\n constructor(target?: InsertionTarget | undefined, nonce?: string | undefined) {\n this.element = makeStyleTag(target, nonce);\n\n // Avoid Edge bug where empty style elements don't create sheets\n this.element.appendChild(document.createTextNode(''));\n\n this.sheet = getSheet(this.element);\n this.length = 0;\n }\n\n insertRule(index: number, rule: string): boolean {\n try {\n this.sheet.insertRule(rule, index);\n this.length++;\n return true;\n } catch (_error) {\n return false;\n }\n }\n\n deleteRule(index: number): void {\n this.sheet.deleteRule(index);\n this.length--;\n }\n\n getRule(index: number): string {\n const rule = this.sheet.cssRules[index];\n\n // Avoid IE11 quirk where cssText is inaccessible on some invalid rules\n if (rule && rule.cssText) {\n return rule.cssText;\n } else {\n return '';\n }\n }\n};\n\n/** A Tag that emulates the CSSStyleSheet API but uses text nodes */\nexport const TextTag = class TextTag implements Tag {\n element: HTMLStyleElement;\n nodes: NodeListOf<Node>;\n length: number;\n\n constructor(target?: InsertionTarget | undefined, nonce?: string | undefined) {\n this.element = makeStyleTag(target, nonce);\n this.nodes = this.element.childNodes;\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length && index >= 0) {\n const node = document.createTextNode(rule);\n const refNode = this.nodes[index];\n this.element.insertBefore(node, refNode || null);\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.element.removeChild(this.nodes[index]);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.nodes[index].textContent as string;\n } else {\n return '';\n }\n }\n};\n\n/** A completely virtual (server-side) Tag that doesn't manipulate the DOM */\nexport const VirtualTag = class VirtualTag implements Tag {\n rules: string[];\n\n length: number;\n\n constructor(_target?: InsertionTarget | undefined) {\n this.rules = [];\n this.length = 0;\n }\n\n insertRule(index: number, rule: string) {\n if (index <= this.length) {\n if (index === this.length) {\n this.rules.push(rule);\n } else {\n this.rules.splice(index, 0, rule);\n }\n this.length++;\n return true;\n } else {\n return false;\n }\n }\n\n deleteRule(index: number) {\n this.rules.splice(index, 1);\n this.length--;\n }\n\n getRule(index: number) {\n if (index < this.length) {\n return this.rules[index];\n } else {\n return '';\n }\n }\n};\n","import { DISABLE_SPEEDY, IS_BROWSER, KEYFRAMES_ID_PREFIX } from '../constants';\nimport { InsertionTarget } from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport { setToString } from '../utils/setToString';\nimport { makeGroupedTag } from './GroupedTag';\nimport { getGroupForId } from './GroupIDAllocator';\nimport { getRehydrationContainer, outputSheet, rehydrateSheet } from './Rehydration';\nimport { makeTag } from './Tag';\nimport { GroupedTag, Sheet, SheetOptions } from './types';\n\nlet SHOULD_REHYDRATE = IS_BROWSER;\n\ntype SheetConstructorArgs = {\n isServer?: boolean;\n nonce?: string | undefined;\n useCSSOMInjection?: boolean;\n target?: InsertionTarget | undefined;\n};\n\ntype GlobalStylesAllocationMap = {\n [key: string]: number;\n};\ntype NamesAllocationMap = Map<string, Set<string>>;\n\nconst defaultOptions: SheetOptions = {\n isServer: !IS_BROWSER,\n useCSSOMInjection: !DISABLE_SPEEDY,\n};\n\n/** Contains the main stylesheet logic for stringification and caching */\nexport default class StyleSheet implements Sheet {\n gs: GlobalStylesAllocationMap;\n /** Keyframe component IDs for efficient RSC rendering (avoids scanning all names) */\n keyframeIds: Set<string>;\n names: NamesAllocationMap;\n options: SheetOptions;\n server: boolean;\n tag?: GroupedTag | undefined;\n\n /** Register a group ID to give it an index */\n static registerId(id: string): number {\n return getGroupForId(id);\n }\n\n constructor(\n options: SheetConstructorArgs = EMPTY_OBJECT as Object,\n globalStyles: GlobalStylesAllocationMap = {},\n names?: NamesAllocationMap | undefined\n ) {\n this.options = {\n ...defaultOptions,\n ...options,\n };\n\n this.gs = globalStyles;\n this.keyframeIds = new Set();\n this.names = new Map(names as NamesAllocationMap);\n this.server = !!options.isServer;\n\n // We rehydrate only once and use the sheet that is created first\n if (!this.server && IS_BROWSER && SHOULD_REHYDRATE) {\n SHOULD_REHYDRATE = false;\n rehydrateSheet(this);\n }\n\n setToString(this, () => outputSheet(this));\n }\n\n rehydrate(): void {\n if (!this.server && IS_BROWSER) {\n rehydrateSheet(this);\n }\n }\n\n reconstructWithOptions(options: SheetConstructorArgs, withNames = true) {\n const newSheet = new StyleSheet(\n { ...this.options, ...options },\n this.gs,\n (withNames && this.names) || undefined\n );\n\n newSheet.keyframeIds = new Set(this.keyframeIds);\n\n // If we're reconstructing with a new target on the client, check if the container changed\n // This handles the case where StyleSheetManager's target prop changes (e.g., from undefined to shadowRoot)\n // We only rehydrate if the container (Document or ShadowRoot) actually changes\n if (!this.server && IS_BROWSER && options.target !== this.options.target) {\n const oldContainer = getRehydrationContainer(this.options.target);\n const newContainer = getRehydrationContainer(options.target);\n\n if (oldContainer !== newContainer) {\n rehydrateSheet(newSheet);\n }\n }\n\n return newSheet;\n }\n\n allocateGSInstance(id: string) {\n return (this.gs[id] = (this.gs[id] || 0) + 1);\n }\n\n /** Lazily initialises a GroupedTag for when it's actually needed */\n getTag() {\n return this.tag || (this.tag = makeGroupedTag(makeTag(this.options)));\n }\n\n /** Check whether a name is known for caching */\n hasNameForId(id: string, name: string): boolean {\n return this.names.get(id)?.has(name) ?? false;\n }\n\n /** Mark a group's name as known for caching */\n registerName(id: string, name: string) {\n getGroupForId(id);\n\n if (id.startsWith(KEYFRAMES_ID_PREFIX)) {\n this.keyframeIds.add(id);\n }\n\n const existing = this.names.get(id);\n if (existing) {\n existing.add(name);\n } else {\n this.names.set(id, new Set([name]));\n }\n }\n\n /** Insert new rules which also marks the name as known */\n insertRules(id: string, name: string, rules: string[]) {\n this.registerName(id, name);\n this.getTag().insertRules(getGroupForId(id), rules);\n }\n\n /** Clears all cached names for a given group ID */\n clearNames(id: string) {\n if (this.names.has(id)) {\n (this.names.get(id) as any).clear();\n }\n }\n\n /** Clears all rules for a given group ID */\n clearRules(id: string) {\n this.getTag().clearGroup(getGroupForId(id));\n this.clearNames(id);\n }\n\n /** Clears the entire tag which deletes all rules but not its names */\n clearTag() {\n // NOTE: This does not clear the names, since it's only used during SSR\n // so that we can continuously output only new rules\n this.tag = undefined;\n }\n}\n","import type { RuleSet } from '../types';\n\nexport const cssTagged = new WeakSet<RuleSet<any>>();\n","/**\n * CSS properties that accept unitless numeric values.\n * Inlined from @emotion/unitless with IE-only entries removed\n * (boxFlex, boxFlexGroup, boxOrdinalGroup, flexPositive, flexNegative,\n * flexOrder, msGridRow, msGridRowSpan, msGridColumn, msGridColumnSpan).\n */\nconst unitless: Record<string, 1> = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexShrink: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1,\n};\n\n// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js\nexport default function addUnitIfNeeded(name: string, value: any) {\n // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133\n if (value == null || typeof value === 'boolean' || value === '') {\n return '';\n }\n\n if (typeof value === 'number' && value !== 0 && !(name in unitless) && !name.startsWith('--')) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers except for CSS variables\n }\n\n return String(value).trim();\n}\n","const isUpper = (c: string) => c >= 'A' && c <= 'Z';\n\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\nexport default function hyphenateStyleName(string: string): string {\n let output = '';\n\n for (let i = 0; i < string.length; i++) {\n const c = string[i];\n // Check for CSS variable prefix\n if (i === 1 && c === '-' && string[0] === '-') {\n return string;\n }\n\n if (isUpper(c)) {\n output += '-' + c.toLowerCase();\n } else {\n output += c;\n }\n }\n\n return output.startsWith('ms-') ? '-' + output : output;\n}\n","import type KeyframesClass from '../models/Keyframes';\n\nconst KEYFRAMES_SYMBOL = Symbol.for('sc-keyframes');\n\nexport default function isKeyframes(value: unknown): value is KeyframesClass {\n return typeof value === 'object' && value !== null && KEYFRAMES_SYMBOL in value;\n}\n\nexport { KEYFRAMES_SYMBOL };\n","import isFunction from './isFunction';\n\nexport default function isStatelessFunction(test: any): test is Function {\n return isFunction(test) && !(test.prototype && test.prototype.isReactComponent);\n}\n","import type StyleSheet from '../sheet';\nimport {\n AnyComponent,\n Dict,\n ExecutionContext,\n Interpolation,\n IStyledComponent,\n RuleSet,\n Stringifier,\n StyledObject,\n} from '../types';\nimport { cssTagged } from './cssTagged';\nimport addUnitIfNeeded from './addUnitIfNeeded';\nimport getComponentName from './getComponentName';\nimport hyphenate from './hyphenateStyleName';\nimport isFunction from './isFunction';\nimport isKeyframes from './isKeyframes';\nimport isPlainObject from './isPlainObject';\nimport isStatelessFunction from './isStatelessFunction';\nimport isStyledComponent from './isStyledComponent';\n\n/**\n * It's falsish not falsy because 0 is allowed.\n */\nconst isFalsish = (chunk: any): chunk is undefined | null | false | '' =>\n chunk === undefined || chunk === null || chunk === false || chunk === '';\n\nconst CLIENT_REFERENCE = Symbol.for('react.client.reference');\n\ninterface ClientReference {\n $$typeof: symbol;\n $$id?: string;\n $$async?: boolean;\n name?: string;\n}\n\nfunction isClientReference(chunk: unknown): chunk is ClientReference {\n return (chunk as any).$$typeof === CLIENT_REFERENCE;\n}\n\n// React encodes $$id as \"modulePath#exportName\"\nfunction warnClientReference(ref: ClientReference): void {\n const id = ref.$$id;\n const label = (id && id.includes('#') ? id.split('#').pop() : id) || ref.name || 'unknown';\n console.warn(\n `Interpolating a client component (${label}) as a selector is not supported in server components. The component selector pattern requires access to the component's internal class name, which is not available across the server/client boundary. Use a plain CSS class selector instead.`\n );\n}\n\nexport const objToCssArray = (obj: Dict<any>): string[] => {\n const rules = [];\n\n for (const key in obj) {\n const val = obj[key];\n if (!obj.hasOwnProperty(key) || isFalsish(val)) continue;\n\n if ((Array.isArray(val) && cssTagged.has(val)) || isFunction(val)) {\n rules.push(hyphenate(key) + ':', val, ';');\n } else if (isPlainObject(val)) {\n rules.push(key + ' {', ...objToCssArray(val), '}');\n } else {\n rules.push(hyphenate(key) + ': ' + addUnitIfNeeded(key, val) + ';');\n }\n }\n\n return rules;\n};\n\nexport default function flatten<Props extends object>(\n chunk: Interpolation<object>,\n executionContext?: (ExecutionContext & Props) | undefined,\n styleSheet?: StyleSheet | undefined,\n stylisInstance?: Stringifier | undefined,\n result: RuleSet<Props> = []\n): RuleSet<Props> {\n if (isFalsish(chunk)) {\n return result;\n }\n\n const t = typeof chunk;\n\n if (t === 'string') {\n result.push(chunk as string);\n return result;\n }\n\n if (t === 'function') {\n if (isClientReference(chunk)) {\n if (process.env.NODE_ENV !== 'production') warnClientReference(chunk);\n return result;\n }\n\n if (isStatelessFunction(chunk) && executionContext) {\n const fnResult = (chunk as Function)(executionContext);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof fnResult === 'object' &&\n !Array.isArray(fnResult) &&\n !isKeyframes(fnResult) &&\n !isPlainObject(fnResult) &&\n fnResult !== null\n ) {\n console.error(\n `${getComponentName(\n chunk as AnyComponent\n )} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`\n );\n }\n\n return flatten<Props>(fnResult, executionContext, styleSheet, stylisInstance, result);\n } else {\n result.push(chunk as unknown as IStyledComponent<'web'>);\n return result;\n }\n }\n\n if (Array.isArray(chunk)) {\n for (let i = 0; i < chunk.length; i++) {\n flatten<Props>(chunk[i], executionContext, styleSheet, stylisInstance, result);\n }\n return result;\n }\n\n if (isStyledComponent(chunk)) {\n result.push(`.${(chunk as unknown as IStyledComponent<'web', any>).styledComponentId}`);\n return result;\n }\n\n if (isKeyframes(chunk)) {\n if (styleSheet) {\n chunk.inject(styleSheet, stylisInstance);\n result.push(chunk.getName(stylisInstance));\n } else {\n result.push(chunk);\n }\n return result;\n }\n\n // Module-level client reference proxies (typeof 'object') pass isPlainObject — catch before\n if (isClientReference(chunk)) {\n if (process.env.NODE_ENV !== 'production') warnClientReference(chunk);\n return result;\n }\n\n if (isPlainObject(chunk)) {\n const cssArr = objToCssArray(chunk as StyledObject<Props>);\n for (let i = 0; i < cssArr.length; i++) result.push(cssArr[i]);\n return result;\n }\n\n result.push((chunk as any).toString());\n return result;\n}\n","import { IS_RSC, SC_VERSION } from '../constants';\nimport StyleSheet from '../sheet';\nimport type { AnyComponent } from '../types';\nimport { ExecutionContext, RuleSet, Stringifier } from '../types';\nimport flatten from '../utils/flatten';\nimport generateName from '../utils/generateAlphabeticName';\nimport getComponentName from '../utils/getComponentName';\nimport { LIMIT as TOO_MANY_CLASSES_LIMIT } from '../utils/createWarnTooManyClasses';\nimport { hash, phash } from '../utils/hash';\nimport isKeyframes from '../utils/isKeyframes';\nimport isPlainObject from '../utils/isPlainObject';\nimport isStatelessFunction from '../utils/isStatelessFunction';\nimport { joinRules, joinStringArray, joinStrings } from '../utils/joinStrings';\n\nconst SEED = hash(SC_VERSION);\n\n/**\n * Upper bound on dynamicNameCache entries per ComponentStyle instance.\n * Without this cap, components with free-form string interpolations\n * (e.g. `color: ${p => p.$color}` where $color is unbounded user input)\n * leak memory for the lifetime of the component definition. Aligned to\n * the warnTooManyClasses dev threshold so the warning and the eviction\n * share a single source of truth: by the time you start dropping cache\n * entries, the dev warning has already told you why.\n */\nconst MAX_DYNAMIC_NAME_CACHE = TOO_MANY_CLASSES_LIMIT;\n\n/**\n * RSC optimization: caches compiled CSS per class name so the RSC emission\n * path can read directly without round-tripping through the sheet tag.\n * WeakMap keyed by ComponentStyle to avoid adding fields to the class\n * (which would increase the browser bundle where IS_RSC is eliminated).\n */\nconst compiledCSSCache: WeakMap<ComponentStyle, Map<string, string>> | null = IS_RSC\n ? new WeakMap()\n : null;\n\n/** Store compiled CSS for a ComponentStyle's class name (RSC only). */\nfunction cacheCompiledCSS(cs: ComponentStyle, name: string, rules: string[]): void {\n if (!compiledCSSCache) return;\n let map = compiledCSSCache.get(cs);\n if (!map) {\n map = new Map();\n compiledCSSCache.set(cs, map);\n }\n map.set(name, joinRules(rules));\n}\n\n/** Check if compiled CSS is cached for a name (RSC only). */\nfunction hasCompiledCSS(cs: ComponentStyle, name: string): boolean {\n return compiledCSSCache?.get(cs)?.has(name) ?? false;\n}\n\n/**\n * Get all compiled CSS for a ComponentStyle's registered names.\n * Returns null on any cache miss (caller falls back to getGroup).\n */\nexport function getCompiledCSS(cs: ComponentStyle, styleSheet: StyleSheet): string | null {\n if (!compiledCSSCache) return null;\n const map = compiledCSSCache.get(cs);\n if (!map) return null;\n const names = styleSheet.names.get(cs.componentId);\n if (!names) return null;\n let css = '';\n for (const name of names) {\n const compiled = map.get(name);\n if (!compiled) return null;\n css += compiled;\n }\n return css;\n}\n\n/**\n * ComponentStyle is all the CSS-specific stuff, not the React-specific stuff.\n */\nexport default class ComponentStyle {\n baseHash: number;\n baseStyle: ComponentStyle | null | undefined;\n componentId: string;\n rules: RuleSet<any>;\n dynamicNameCache: Map<string, string> | undefined;\n\n constructor(rules: RuleSet<any>, componentId: string, baseStyle?: ComponentStyle | undefined) {\n this.rules = rules;\n this.componentId = componentId;\n this.baseHash = phash(SEED, componentId);\n this.baseStyle = baseStyle;\n\n // NOTE: This registers the componentId, which ensures a consistent order\n // for this component's styles compared to others\n StyleSheet.registerId(componentId);\n }\n\n generateAndInjectStyles(\n executionContext: ExecutionContext,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): string {\n let names = this.baseStyle\n ? this.baseStyle.generateAndInjectStyles(executionContext, styleSheet, stylis)\n : '';\n\n {\n let css = '';\n\n for (let i = 0; i < this.rules.length; i++) {\n const partRule = this.rules[i];\n\n if (typeof partRule === 'string') {\n css += partRule;\n } else if (partRule) {\n // Fast path: inline function call for the common case (interpolation\n // returning a string). Avoids flatten's type dispatch and array alloc.\n if (isStatelessFunction(partRule)) {\n const fnResult = partRule(executionContext);\n if (typeof fnResult === 'string') {\n css += fnResult;\n } else if (fnResult !== undefined && fnResult !== null && fnResult !== false) {\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof fnResult === 'object' &&\n !Array.isArray(fnResult) &&\n !isKeyframes(fnResult) &&\n !isPlainObject(fnResult)\n ) {\n console.error(\n `${getComponentName(\n partRule as AnyComponent\n )} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`\n );\n }\n\n css += joinStringArray(\n flatten(fnResult, executionContext, styleSheet, stylis) as string[]\n );\n }\n } else {\n css += joinStringArray(\n flatten(partRule, executionContext, styleSheet, stylis) as string[]\n );\n }\n }\n }\n\n if (css) {\n // Cache css->name to skip phash+generateName for repeat CSS strings.\n // The CSS string fully determines the class name for a given component,\n // so a Map lookup replaces O(cssLen) hashing on cache hit.\n if (!this.dynamicNameCache) this.dynamicNameCache = new Map();\n const cacheKey = stylis.hash ? stylis.hash + css : css;\n let name = this.dynamicNameCache.get(cacheKey);\n if (!name) {\n name = generateName(phash(phash(this.baseHash, stylis.hash), css) >>> 0);\n if (this.dynamicNameCache.size >= MAX_DYNAMIC_NAME_CACHE) {\n const oldest = this.dynamicNameCache.keys().next().value;\n if (oldest !== undefined) this.dynamicNameCache.delete(oldest);\n }\n this.dynamicNameCache.set(cacheKey, name);\n }\n\n if (!styleSheet.hasNameForId(this.componentId, name)) {\n if (IS_RSC && hasCompiledCSS(this, name)) {\n // RSC cold render with cached compilation: register the name\n // without re-running stylis or writing to the tag.\n styleSheet.registerName(this.componentId, name);\n } else {\n const cssFormatted = stylis(css, '.' + name, undefined, this.componentId);\n if (IS_RSC) cacheCompiledCSS(this, name, cssFormatted);\n styleSheet.insertRules(this.componentId, name, cssFormatted);\n }\n }\n\n names = joinStrings(names, name);\n }\n }\n\n return names;\n }\n}\n","import { Dict } from '../types';\n\nexport const LIMIT = 200;\n\nexport default (displayName: string, componentId: string) => {\n let generatedClasses: Dict<any> = {};\n let warningSeen = false;\n\n return (className: string) => {\n if (!warningSeen) {\n generatedClasses[className] = true;\n if (Object.keys(generatedClasses).length >= LIMIT) {\n // Unable to find latestRule in test environment.\n\n const parsedIdString = componentId ? ` with the id of \"${componentId}\"` : '';\n\n console.warn(\n `Over ${LIMIT} classes were generated for component ${displayName}${parsedIdString}.\\n` +\n 'Consider using the attrs method, together with a style object for frequently changed styles.\\n' +\n 'Example:\\n' +\n ' const Component = styled.div.attrs(props => ({\\n' +\n ' style: {\\n' +\n ' background: props.background,\\n' +\n ' },\\n' +\n ' }))`width: 100%;`\\n\\n' +\n ' <Component />'\n );\n warningSeen = true;\n generatedClasses = {};\n }\n }\n };\n};\n","import * as stylis from 'stylis';\nimport { Stringifier } from '../types';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from './empties';\nimport throwStyledError from './error';\nimport { SEED, phash } from './hash';\n\nconst AMP_REGEX = /&/g;\n\n// Character codes for fast comparison\nconst DOUBLE_QUOTE = 34; // \"\nconst SINGLE_QUOTE = 39; // '\nconst SLASH = 47; // /\nconst ASTERISK = 42; // *\nconst BACKSLASH = 92; // \\\nconst OPEN_BRACE = 123; // {\nconst CLOSE_BRACE = 125; // }\nconst SEMICOLON = 59; // ;\nconst NEWLINE = 10; // \\n\nconst OPEN_PAREN = 40; // (\nconst CLOSE_PAREN = 41; // )\n\n/**\n * Check if a quote at position i is escaped. A quote is escaped when preceded\n * by an ODD number of backslashes (\\\", \\\\\\\", etc.). An even number means the\n * backslashes themselves are escaped and the quote is real (\\\\\", \\\\\\\\\", etc.).\n */\nexport function isEscaped(css: string, i: number): boolean {\n let backslashes = 0;\n while (--i >= 0 && css.charCodeAt(i) === BACKSLASH) backslashes++;\n return (backslashes & 1) === 1;\n}\n\n/**\n * Unified CSS preprocessor: strips JS-style line comments (//) and validates\n * brace balance in a single pass. Handles strings, parenthesized expressions\n * (any function call), and block comments with one shared state machine.\n *\n * Fast paths:\n * - No // and no } → return unchanged (zero work)\n * - No // but has } → brace-only validation (lightweight single pass)\n * - Has // → full unified pass (strip comments + count braces simultaneously)\n */\nexport function preprocessCSS(css: string): string {\n const hasLineComments = css.indexOf('//') !== -1;\n const hasCloseBrace = css.indexOf('}') !== -1;\n\n if (!hasLineComments && !hasCloseBrace) return css;\n\n if (!hasLineComments) return sanitizeBraces(css);\n\n const len = css.length;\n let out = '';\n let start = 0;\n let i = 0;\n let inString = 0;\n let parenDepth = 0;\n let braceDepth = 0;\n let modified = false;\n\n while (i < len) {\n const code = css.charCodeAt(i);\n\n if ((code === DOUBLE_QUOTE || code === SINGLE_QUOTE) && !isEscaped(css, i)) {\n if (inString === 0) {\n inString = code;\n } else if (inString === code) {\n inString = 0;\n }\n i++;\n continue;\n }\n\n if (inString !== 0) {\n i++;\n continue;\n }\n\n if (code === SLASH && i + 1 < len && css.charCodeAt(i + 1) === ASTERISK) {\n i += 2;\n while (i + 1 < len && !(css.charCodeAt(i) === ASTERISK && css.charCodeAt(i + 1) === SLASH)) {\n i++;\n }\n i += 2;\n continue;\n }\n\n if (code === OPEN_PAREN) {\n parenDepth++;\n i++;\n continue;\n }\n\n if (code === CLOSE_PAREN) {\n if (parenDepth > 0) parenDepth--;\n i++;\n continue;\n }\n\n // Inside parentheses (any function call), skip comment/brace detection\n // so that url(https://...), image-set(), etc. are preserved\n if (parenDepth > 0) {\n i++;\n continue;\n }\n\n if (code === ASTERISK && i + 1 < len && css.charCodeAt(i + 1) === SLASH) {\n out += css.substring(start, i);\n i += 2;\n start = i;\n modified = true;\n continue;\n }\n\n if (code === SLASH && i + 1 < len && css.charCodeAt(i + 1) === SLASH) {\n out += css.substring(start, i);\n while (i < len && css.charCodeAt(i) !== NEWLINE) {\n i++;\n }\n start = i;\n modified = true;\n continue;\n }\n\n if (code === OPEN_BRACE) {\n braceDepth++;\n } else if (code === CLOSE_BRACE) {\n braceDepth--;\n }\n\n i++;\n }\n\n if (!modified) {\n if (braceDepth === 0) return css;\n return sanitizeBraces(css);\n }\n\n if (start < len) out += css.substring(start);\n\n if (braceDepth === 0) return out;\n return sanitizeBraces(out);\n}\n\n/**\n * Removes declarations with unbalanced braces from CSS.\n * Only called when preprocessCSS detects brace imbalance.\n */\nfunction sanitizeBraces(css: string): string {\n const len = css.length;\n let result = '';\n let declStart = 0;\n let braceDepth = 0;\n let inString = 0;\n let inComment = false;\n let imbalanced = false;\n\n for (let i = 0; i < len; i++) {\n const code = css.charCodeAt(i);\n\n if (inString === 0 && !inComment && code === SLASH && css.charCodeAt(i + 1) === ASTERISK) {\n inComment = true;\n i++;\n continue;\n }\n if (inComment) {\n if (code === ASTERISK && css.charCodeAt(i + 1) === SLASH) {\n inComment = false;\n i++;\n }\n continue;\n }\n\n if ((code === DOUBLE_QUOTE || code === SINGLE_QUOTE) && !isEscaped(css, i)) {\n if (inString === 0) {\n inString = code;\n } else if (inString === code) {\n inString = 0;\n }\n continue;\n }\n if (inString !== 0) continue;\n\n if (code === OPEN_BRACE) {\n braceDepth++;\n } else if (code === CLOSE_BRACE) {\n braceDepth--;\n\n if (braceDepth < 0) {\n imbalanced = true;\n let skipEnd = i + 1;\n while (skipEnd < len) {\n const skipCode = css.charCodeAt(skipEnd);\n if (skipCode === SEMICOLON || skipCode === NEWLINE) break;\n skipEnd++;\n }\n if (skipEnd < len && css.charCodeAt(skipEnd) === SEMICOLON) skipEnd++;\n\n braceDepth = 0;\n i = skipEnd - 1;\n declStart = skipEnd;\n continue;\n }\n\n if (braceDepth === 0) {\n result += css.substring(declStart, i + 1);\n declStart = i + 1;\n }\n } else if (code === SEMICOLON && braceDepth === 0) {\n result += css.substring(declStart, i + 1);\n declStart = i + 1;\n }\n }\n\n if (!imbalanced && braceDepth === 0 && inString === 0) return css;\n\n if (declStart < len && braceDepth === 0 && inString === 0) {\n result += css.substring(declStart);\n }\n\n return result;\n}\n\nexport type ICreateStylisInstance = {\n options?: { namespace?: string | undefined; prefix?: boolean | undefined } | undefined;\n plugins?: stylis.Middleware[] | undefined;\n};\n\n/**\n * Takes an element and recurses through it's rules added the namespace to the start of each selector.\n * Takes into account media queries by recursing through child rules if they are present.\n */\nfunction recursivelySetNamespace(compiled: stylis.Element[], namespace: string): stylis.Element[] {\n for (let i = 0; i < compiled.length; i++) {\n const rule = compiled[i];\n if (rule.type === 'rule') {\n // add the namespace to the start\n rule.value = namespace + ' ' + rule.value;\n // add the namespace after each comma for subsequent selectors.\n rule.value = rule.value.replaceAll(',', ',' + namespace + ' ');\n const props = rule.props as string[];\n const newProps: string[] = [];\n for (let j = 0; j < props.length; j++) {\n newProps[j] = namespace + ' ' + props[j];\n }\n rule.props = newProps;\n }\n\n if (Array.isArray(rule.children) && rule.type !== '@keyframes') {\n rule.children = recursivelySetNamespace(rule.children, namespace);\n }\n }\n return compiled;\n}\n\nexport default function createStylisInstance(\n {\n options = EMPTY_OBJECT as object,\n plugins = EMPTY_ARRAY as unknown as stylis.Middleware[],\n }: ICreateStylisInstance = EMPTY_OBJECT as object\n) {\n let _componentId: string;\n let _selector: string;\n let _selectorRegexp: RegExp | undefined;\n\n const selfReferenceReplacer = (match: string, offset: number, string: string) => {\n if (\n /**\n * We only want to refer to the static class directly if the selector is part of a\n * self-reference selector `& + & { color: red; }`\n */\n string.startsWith(_selector) &&\n string.endsWith(_selector) &&\n string.replaceAll(_selector, '').length > 0\n ) {\n return `.${_componentId}`;\n }\n\n return match;\n };\n\n /**\n * When writing a style like\n *\n * & + & {\n * color: red;\n * }\n *\n * The second ampersand should be a reference to the static component class. stylis\n * has no knowledge of static class so we have to intelligently replace the base selector.\n *\n * https://github.com/thysultan/stylis.js/tree/v4.0.2#abstract-syntax-structure\n */\n const selfReferenceReplacementPlugin: stylis.Middleware = element => {\n if (element.type === stylis.RULESET && element.value.includes('&')) {\n // Lazy RegExp creation: only allocate when self-reference pattern is actually used\n if (!_selectorRegexp) {\n _selectorRegexp = new RegExp(`\\\\${_selector}\\\\b`, 'g');\n }\n\n (element.props as string[])[0] = element.props[0]\n // catch any hanging references that stylis missed\n .replace(AMP_REGEX, _selector)\n .replace(_selectorRegexp, selfReferenceReplacer);\n }\n };\n\n const middlewares = plugins.slice();\n\n middlewares.push(selfReferenceReplacementPlugin);\n\n /**\n * Enables automatic vendor-prefixing for styles.\n */\n if (options.prefix) {\n middlewares.push(stylis.prefixer);\n }\n\n middlewares.push(stylis.stringify);\n\n // Pre-build the middleware chain once to avoid allocating closures,\n // arrays, and middleware wrappers on every stringifyRules call.\n // Safe because JS is single-threaded and _stack is consumed before next call.\n let _stack: string[] = [];\n const _middleware = stylis.middleware(\n middlewares.concat(stylis.rulesheet(value => _stack.push(value)))\n );\n\n const stringifyRules: Stringifier = (\n css: string,\n selector = '',\n /**\n * This \"prefix\" referes to a _selector_ prefix.\n */\n prefix = '',\n componentId = '&'\n ) => {\n // stylis has no concept of state to be passed to plugins\n // but since JS is single-threaded, we can rely on that to ensure\n // these properties stay in sync with the current stylis run\n _componentId = componentId;\n _selector = selector;\n _selectorRegexp = undefined; // Reset for lazy creation per call\n\n const flatCSS = preprocessCSS(css);\n let compiled = stylis.compile(\n prefix || selector ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS\n );\n\n if (options.namespace) {\n compiled = recursivelySetNamespace(compiled, options.namespace);\n }\n\n _stack = [];\n stylis.serialize(compiled, _middleware);\n\n return _stack;\n };\n\n // Hash includes plugins + options so different stylis configs produce\n // different class names and cache keys.\n const o = options as ICreateStylisInstance['options'];\n let h = SEED;\n for (let i = 0; i < plugins.length; i++) {\n if (!plugins[i].name) throwStyledError(15);\n h = phash(h, plugins[i].name);\n }\n if (o?.namespace) h = phash(h, o.namespace);\n if (o?.prefix) h = phash(h, 'p');\n stringifyRules.hash = h !== SEED ? h.toString() : '';\n\n return stringifyRules;\n}\n","import React from 'react';\nimport type stylis from 'stylis';\nimport { IS_RSC } from '../constants';\nimport StyleSheet from '../sheet';\nimport { InsertionTarget, ShouldForwardProp, Stringifier } from '../types';\nimport createStylisInstance from '../utils/stylis';\n\nexport const mainSheet: StyleSheet = new StyleSheet();\nexport const mainStylis: Stringifier = createStylisInstance();\n\n/**\n * RSC context slot — module-level mutable state scoped per render via React.cache.\n * In RSC, createContext doesn't exist, so StyleSheetManager writes here and\n * useStyleSheetContext reads from here. Single-threaded RSC renders guarantee\n * no concurrent mutation. React.cache ensures reset between renders.\n */\nlet rscContextOverride: IStyleSheetContext | null = null;\nlet rscLastPlugins: stylis.Middleware[] | undefined;\nlet rscCachedStylis: Stringifier = mainStylis;\n\n/** Per-render reset to prevent HMR accumulation (see AGENTS.md § RSC Style Injection). */\nconst ensureSheetReset: (() => void) | null = IS_RSC\n ? (((React as any).cache as (<T extends (...args: any[]) => any>(fn: T) => T) | undefined)?.(\n () => {\n mainSheet.names.clear();\n mainSheet.keyframeIds.clear();\n mainSheet.clearTag();\n rscContextOverride = null;\n }\n ) ?? null)\n : null;\n\nexport type IStyleSheetContext = {\n shouldForwardProp?: ShouldForwardProp<'web'> | undefined;\n styleSheet: StyleSheet;\n stylis: Stringifier;\n /** Preserved for inheritance — inner SSMs that set namespace/vendorPrefixes\n * but not stylisPlugins can still inherit the parent's plugins. */\n stylisPlugins?: stylis.Middleware[] | undefined;\n};\n\nconst defaultContextValue: IStyleSheetContext = {\n shouldForwardProp: undefined,\n styleSheet: mainSheet,\n stylis: mainStylis,\n stylisPlugins: undefined,\n};\n\n// Create context only if createContext is available, otherwise create a fallback\nexport const StyleSheetContext = !IS_RSC\n ? React.createContext<IStyleSheetContext>(defaultContextValue)\n : ({\n Provider: ({ children }: { children: React.ReactNode; value?: IStyleSheetContext }) =>\n children,\n Consumer: ({ children }: { children: (value: IStyleSheetContext) => React.ReactNode }) =>\n children(defaultContextValue),\n } as React.Context<IStyleSheetContext>);\n\nexport const StyleSheetConsumer = StyleSheetContext.Consumer;\n\nexport type IStylisContext = Stringifier | void;\n\nexport function useStyleSheetContext() {\n if (!IS_RSC) return React.useContext(StyleSheetContext);\n\n // Reset mainSheet once per render to prevent HMR accumulation.\n // React.cache ensures this runs exactly once per render, so calling\n // it here AND in StyleSheetManager is safe — whichever runs first wins.\n if (ensureSheetReset) ensureSheetReset();\n\n return rscContextOverride || defaultContextValue;\n}\n\nexport type IStyleSheetManager = React.PropsWithChildren<{\n /**\n * If desired, you can pass this prop to disable \"speedy\" insertion mode, which\n * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).\n * When disabled, rules are inserted as simple text into style blocks.\n */\n disableCSSOMInjection?: undefined | boolean;\n /**\n * If you are working exclusively with modern browsers, vendor prefixes can often be omitted\n * to reduce the weight of CSS on the page.\n */\n enableVendorPrefixes?: undefined | boolean;\n /**\n * Provide an optional selector to be prepended to all generated style rules.\n */\n namespace?: undefined | string;\n /**\n * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.\n * When provided, `target` and `nonce` props are ignored (configure them on the sheet directly).\n */\n sheet?: undefined | StyleSheet;\n /**\n * Starting in v6, styled-components no longer does its own prop validation\n * and recommends use of transient props \"$prop\" to pass style-only props to\n * components. If for some reason you are not able to use transient props, a\n * prop validation function can be provided via `StyleSheetManager`, such as\n * `@emotion/is-prop-valid`.\n *\n * When the return value is `true`, props will be forwarded to the DOM/underlying\n * component. If return value is `false`, the prop will be discarded after styles\n * are calculated.\n *\n * Manually composing `styled.{element}.withConfig({shouldForwardProp})` will\n * override this default.\n *\n * When nested inside another `StyleSheetManager`, omitting this prop inherits\n * the parent's function. Pass `undefined` explicitly or a passthrough function\n * to disable inherited behavior for a subtree.\n */\n shouldForwardProp?: undefined | IStyleSheetContext['shouldForwardProp'];\n /**\n * An array of plugins to be run by stylis (style processor) during compilation.\n * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).\n *\n * \\* The plugin(s) must be compatible with stylis v4 or above.\n *\n * When nested inside another `StyleSheetManager`, omitting this prop inherits\n * the parent's plugins. Pass an empty array (`[]`) to explicitly disable\n * inherited plugins for a subtree.\n */\n stylisPlugins?: undefined | stylis.Middleware[];\n /**\n * CSP nonce to attach to injected `<style>` tags. Overrides auto-detection\n * from `<meta name=\"sc-nonce\">`, `<meta property=\"csp-nonce\">`, or `__webpack_nonce__`.\n */\n nonce?: undefined | string;\n /**\n * Provide an alternate DOM node to host generated styles; useful for iframes.\n */\n target?: undefined | InsertionTarget;\n}>;\n\n/** Configure style injection for descendant styled components (target element, stylis plugins, prop forwarding). */\nexport function StyleSheetManager(props: IStyleSheetManager): React.JSX.Element {\n // In RSC, context doesn't exist but we can set module-level state.\n // Single-threaded RSC renders + React.cache reset make this safe.\n if (IS_RSC) {\n // Reset once per render (React.cache scopes this per request)\n if (ensureSheetReset) ensureSheetReset();\n\n // Merge with existing override: inherit parent values when props are omitted.\n const parentOverride = rscContextOverride || defaultContextValue;\n\n // Build a stylis instance when any stylis-related prop is provided.\n // Cache it when the plugins array ref is stable.\n const hasStylisProps =\n props.stylisPlugins !== undefined ||\n props.namespace !== undefined ||\n props.enableVendorPrefixes !== undefined;\n\n if (hasStylisProps) {\n if (props.stylisPlugins && props.stylisPlugins !== rscLastPlugins) {\n rscLastPlugins = props.stylisPlugins;\n rscCachedStylis = createStylisInstance({\n options: { namespace: props.namespace, prefix: props.enableVendorPrefixes },\n plugins: props.stylisPlugins,\n });\n } else if (props.namespace !== undefined || props.enableVendorPrefixes !== undefined) {\n // Namespace or prefix changed without new plugins — create fresh instance\n // using inherited plugins from parent.\n rscCachedStylis = createStylisInstance({\n options: { namespace: props.namespace, prefix: props.enableVendorPrefixes },\n plugins: props.stylisPlugins ?? parentOverride.stylisPlugins,\n });\n }\n }\n\n const resolvedStylis = hasStylisProps\n ? props.stylisPlugins !== undefined && !props.stylisPlugins.length\n ? mainStylis\n : rscCachedStylis\n : parentOverride.stylis;\n const resolvedShouldForwardProp =\n 'shouldForwardProp' in props ? props.shouldForwardProp : parentOverride.shouldForwardProp;\n\n const resolvedPlugins = props.stylisPlugins ?? parentOverride.stylisPlugins;\n\n if (resolvedStylis !== mainStylis || resolvedShouldForwardProp) {\n rscContextOverride = {\n shouldForwardProp: resolvedShouldForwardProp,\n styleSheet: mainSheet,\n stylis: resolvedStylis,\n stylisPlugins: resolvedPlugins,\n };\n } else {\n rscContextOverride = null;\n }\n\n return props.children as React.JSX.Element;\n }\n\n const parentContext = useStyleSheetContext();\n const { styleSheet } = parentContext;\n\n const resolvedStyleSheet = React.useMemo(() => {\n let sheet = styleSheet;\n\n if (props.sheet) {\n sheet = props.sheet;\n } else if (props.target) {\n sheet = sheet.reconstructWithOptions(\n props.nonce !== undefined\n ? { target: props.target, nonce: props.nonce }\n : { target: props.target },\n false\n );\n } else if (props.nonce !== undefined) {\n sheet = sheet.reconstructWithOptions({ nonce: props.nonce });\n }\n\n if (props.disableCSSOMInjection) {\n sheet = sheet.reconstructWithOptions({ useCSSOMInjection: false });\n }\n\n return sheet;\n }, [props.disableCSSOMInjection, props.nonce, props.sheet, props.target, styleSheet]);\n\n // Inherit parent stylis when no stylis-related props are provided.\n // When any stylis option (namespace, vendorPrefixes) changes, create a new\n // instance but still inherit plugins from the parent if stylisPlugins is omitted.\n // An explicit empty array disables inherited plugins.\n const stylis = React.useMemo(\n () =>\n props.stylisPlugins === undefined &&\n props.namespace === undefined &&\n props.enableVendorPrefixes === undefined\n ? parentContext.stylis\n : createStylisInstance({\n options: { namespace: props.namespace, prefix: props.enableVendorPrefixes },\n plugins: props.stylisPlugins ?? parentContext.stylisPlugins,\n }),\n [\n props.enableVendorPrefixes,\n props.namespace,\n props.stylisPlugins,\n parentContext.stylis,\n parentContext.stylisPlugins,\n ]\n );\n\n // Inherit parent shouldForwardProp when not provided.\n const shouldForwardProp =\n 'shouldForwardProp' in props ? props.shouldForwardProp : parentContext.shouldForwardProp;\n\n // Resolve which plugins to propagate: own > parent > none\n const resolvedPlugins = props.stylisPlugins ?? parentContext.stylisPlugins;\n\n const styleSheetContextValue = React.useMemo(\n () => ({\n shouldForwardProp,\n styleSheet: resolvedStyleSheet,\n stylis,\n stylisPlugins: resolvedPlugins,\n }),\n [shouldForwardProp, resolvedStyleSheet, stylis, resolvedPlugins]\n );\n\n return (\n <StyleSheetContext.Provider value={styleSheetContextValue}>\n {props.children}\n </StyleSheetContext.Provider>\n );\n}\n","import React from 'react';\nimport { IS_RSC } from '../constants';\nimport styledError from '../utils/error';\nimport isFunction from '../utils/isFunction';\n\n// Helper type for the `DefaultTheme` interface that enforces an object type & exclusively allows\n// for typed keys.\ntype DefaultThemeAsObject<T = object> = Record<keyof T, any>;\n\n/**\n * Override DefaultTheme to get accurate typings for your project.\n *\n * ```\n * // create styled-components.d.ts in your project source\n * // if it isn't being picked up, check tsconfig compilerOptions.types\n * import type { CSSProp } from \"styled-components\";\n * import Theme from './theme';\n *\n * type ThemeType = typeof Theme;\n *\n * declare module \"styled-components\" {\n * export interface DefaultTheme extends ThemeType {}\n * }\n *\n * declare module \"react\" {\n * interface DOMAttributes<T> {\n * css?: CSSProp;\n * }\n * }\n * ```\n */\nexport interface DefaultTheme extends DefaultThemeAsObject {}\n\ntype ThemeFn = (outerTheme?: DefaultTheme | undefined) => DefaultTheme;\ntype ThemeArgument = DefaultTheme | ThemeFn;\n\ntype Props = {\n children?: React.ReactNode;\n theme: ThemeArgument;\n};\n\n// Create context only if createContext is available, otherwise create a fallback\nexport const ThemeContext = !IS_RSC\n ? React.createContext<DefaultTheme | undefined>(undefined)\n : ({\n Provider: ({ children }: { children: React.ReactNode; value?: DefaultTheme }) => children,\n Consumer: ({ children }: { children: (theme?: DefaultTheme) => React.ReactNode }) =>\n children(undefined),\n } as React.Context<DefaultTheme | undefined>);\n\nexport const ThemeConsumer = ThemeContext.Consumer;\n\nfunction mergeTheme(theme: ThemeArgument, outerTheme?: DefaultTheme | undefined): DefaultTheme {\n if (!theme) {\n throw styledError(14);\n }\n\n if (isFunction(theme)) {\n const themeFn = theme as ThemeFn;\n const mergedTheme = themeFn(outerTheme);\n\n if (\n process.env.NODE_ENV !== 'production' &&\n (mergedTheme === null || Array.isArray(mergedTheme) || typeof mergedTheme !== 'object')\n ) {\n throw styledError(7);\n }\n\n return mergedTheme;\n }\n\n if (Array.isArray(theme) || typeof theme !== 'object') {\n throw styledError(8);\n }\n\n return outerTheme ? { ...outerTheme, ...theme } : theme;\n}\n\n/**\n * Returns the current theme (as provided by the closest ancestor `ThemeProvider`.)\n *\n * If no `ThemeProvider` is found, the function will error. If you need access to the theme in an\n * uncertain composition scenario, `React.useContext(ThemeContext)` will not emit an error if there\n * is no `ThemeProvider` ancestor.\n */\nexport function useTheme(): DefaultTheme {\n // Skip useContext if we're in an RSC environment without context support\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n\n if (!theme) {\n throw styledError(18);\n }\n\n return theme;\n}\n\n/**\n * Provide a theme to an entire react component tree via context\n */\nexport default function ThemeProvider(props: Props): React.JSX.Element | null {\n // In RSC environments without context support, ThemeProvider becomes a no-op\n if (IS_RSC) {\n return props.children as React.JSX.Element | null;\n }\n\n const outerTheme = React.useContext(ThemeContext);\n const themeContext = React.useMemo(\n () => mergeTheme(props.theme, outerTheme),\n [props.theme, outerTheme]\n );\n\n if (!props.children) {\n return null;\n }\n\n return <ThemeContext.Provider value={themeContext}>{props.children}</ThemeContext.Provider>;\n}\n","import isPropValid from '@emotion/is-prop-valid';\nimport React, { createElement, PropsWithoutRef, Ref } from 'react';\nimport { IS_RSC, SC_ATTR, SC_VERSION, SPLITTER } from '../constants';\nimport { getGroupForId } from '../sheet/GroupIDAllocator';\nimport type StyleSheet from '../sheet';\nimport type {\n AnyComponent,\n Attrs,\n BaseObject,\n Dict,\n ExecutionContext,\n ExecutionProps,\n IStyledComponent,\n IStyledComponentFactory,\n IStyledStatics,\n OmitNever,\n RuleSet,\n Stringifier,\n StyledOptions,\n WebTarget,\n} from '../types';\nimport { checkDynamicCreation } from '../utils/checkDynamicCreation';\nimport createWarnTooManyClasses from '../utils/createWarnTooManyClasses';\nimport determineTheme from '../utils/determineTheme';\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from '../utils/empties';\nimport escape from '../utils/escape';\nimport generateComponentId from '../utils/generateComponentId';\nimport generateDisplayName from '../utils/generateDisplayName';\nimport hoist from '../utils/hoist';\nimport isFunction from '../utils/isFunction';\nimport isStyledComponent from '../utils/isStyledComponent';\nimport isTag from '../utils/isTag';\nimport { joinStrings, stripSplitter } from '../utils/joinStrings';\nimport merge from '../utils/mixinDeep';\nimport { createRSCCache } from '../utils/rscCache';\nimport { setToString } from '../utils/setToString';\nimport ComponentStyle, { getCompiledCSS } from './ComponentStyle';\nimport { useStyleSheetContext } from './StyleSheetManager';\nimport { DefaultTheme, ThemeContext } from './ThemeProvider';\n\ndeclare const __SERVER__: boolean;\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nconst identifiers: { [key: string]: number } = {};\n\n/* We depend on components having unique IDs */\nfunction generateId(\n displayName?: string | undefined,\n parentComponentId?: string | undefined\n): string {\n const name = typeof displayName !== 'string' ? 'sc' : escape(displayName);\n // Ensure that no displayName can lead to duplicate componentIds\n identifiers[name] = (identifiers[name] || 0) + 1;\n\n const componentId =\n name +\n '-' +\n generateComponentId(\n // SC_VERSION gives us isolation between multiple runtimes on the page at once\n // this is improved further with use of the babel plugin \"namespace\" feature\n SC_VERSION + name + identifiers[name]\n );\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n}\n\n/**\n * Shallow-compare two context objects using a stored key count to avoid\n * a second iteration pass. Returns true if all own-property values match.\n */\nfunction shallowEqualContext(prev: object, next: object, prevKeyCount: number): boolean {\n const a = prev as Record<string, unknown>;\n const b = next as Record<string, unknown>;\n let nextKeyCount = 0;\n for (const key in b) {\n if (hasOwn.call(b, key)) {\n nextKeyCount++;\n if (a[key] !== b[key]) return false;\n }\n }\n return nextKeyCount === prevKeyCount;\n}\n\nfunction useInjectedStyle<T extends ExecutionContext>(\n componentStyle: ComponentStyle,\n resolvedAttrs: T,\n styleSheet: StyleSheet,\n stylis: Stringifier\n): string {\n const className = componentStyle.generateAndInjectStyles(resolvedAttrs, styleSheet, stylis);\n\n if (process.env.NODE_ENV !== 'production' && React.useDebugValue) {\n React.useDebugValue(className);\n }\n\n return className;\n}\n\n// Cached render inputs + style result: [prevProps, prevTheme, prevStyleSheet, prevStylis,\n// prevPropsKeyCount, cachedContext, cachedClassName]\ntype RenderCache = [\n object, // prevProps\n DefaultTheme | undefined, // prevTheme\n StyleSheet, // prevStyleSheet\n Stringifier, // prevStylis\n number, // prevPropsKeyCount\n object, // cachedContext\n string, // cachedClassName\n ComponentStyle, // prevComponentStyle (for HMR invalidation)\n];\n\nfunction resolveContext<Props extends BaseObject>(\n attrs: Attrs<React.HTMLAttributes<Element> & Props>[],\n props: ExecutionProps & Props,\n theme: DefaultTheme | undefined\n): React.HTMLAttributes<Element> & ExecutionContext & Props {\n const context: React.HTMLAttributes<Element> & ExecutionContext & Props = {\n ...props,\n // unset, add `props.className` back at the end so props always \"wins\"\n className: undefined,\n theme,\n } as React.HTMLAttributes<Element> & ExecutionContext & Props;\n\n const needsCopy = attrs.length > 1;\n for (let i = 0; i < attrs.length; i++) {\n const attrDef = attrs[i];\n const resolvedAttrDef = isFunction(attrDef)\n ? attrDef(needsCopy ? { ...context } : context)\n : attrDef;\n\n for (const key in resolvedAttrDef) {\n if (key === 'className') {\n context.className = joinStrings(context.className, resolvedAttrDef[key] as string);\n } else if (key === 'style') {\n context.style = { ...context.style, ...(resolvedAttrDef[key] as React.CSSProperties) };\n } else if (!(key in props && (props as any)[key] === undefined)) {\n // Apply attr value unless the user explicitly passed undefined for this prop,\n // which signals intent to reset the value.\n // @ts-expect-error attrs can dynamically add arbitrary properties\n context[key] = resolvedAttrDef[key];\n }\n }\n }\n\n if ('className' in props && typeof props.className === 'string') {\n context.className = joinStrings(context.className, props.className);\n }\n\n return context;\n}\n\nlet seenUnknownProps: Set<string> | undefined;\n\n/** Per-render tracking of emitted class names and keyframe IDs for RSC dedup. */\nconst getEmittedNames = createRSCCache(() => new Set<string>());\n\n/** Cache RegExp objects for :where() wrapping to avoid recompilation per render */\nconst whereRegExpCache = new Map<string, RegExp>();\nfunction getWhereRegExp(name: string): RegExp {\n let re = whereRegExpCache.get(name);\n if (!re) {\n re = new RegExp('\\\\.' + name + '(?![a-zA-Z0-9_-])', 'g');\n whereRegExpCache.set(name, re);\n }\n return re;\n}\n\n/** Wrap base-level CSS class selectors in :where() for zero specificity (RSC inheritance). */\nfunction wrapBaseInWhere(levelCss: string, componentId: string, styleSheet: StyleSheet): string {\n const names = styleSheet.names.get(componentId);\n if (names) {\n for (const name of names) {\n const re = getWhereRegExp(name);\n re.lastIndex = 0;\n levelCss = levelCss.replace(re, ':where(.' + name + ')');\n }\n }\n return levelCss;\n}\n\nfunction buildPropsForElement(\n context: Record<string, any>,\n elementToBeCreated: WebTarget,\n theme: DefaultTheme | undefined,\n shouldForwardProp: ((prop: string, el: WebTarget) => boolean) | undefined\n): Dict<any> {\n const propsForElement: Dict<any> = {};\n\n for (const key in context) {\n if (context[key] === undefined) {\n // Omit undefined values from props passed to wrapped element.\n } else if (key[0] === '$' || key === 'as' || (key === 'theme' && context.theme === theme)) {\n // Omit transient props and execution props.\n } else if (key === 'forwardedAs') {\n propsForElement.as = context.forwardedAs;\n } else if (!shouldForwardProp || shouldForwardProp(key, elementToBeCreated)) {\n propsForElement[key] = context[key];\n\n if (\n !shouldForwardProp &&\n process.env.NODE_ENV === 'development' &&\n !isPropValid(key) &&\n !(seenUnknownProps || (seenUnknownProps = new Set())).has(key) &&\n isTag(elementToBeCreated) &&\n !elementToBeCreated.includes('-')\n ) {\n seenUnknownProps.add(key);\n console.warn(\n `styled-components: it looks like an unknown prop \"${key}\" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via \\`<StyleSheetManager shouldForwardProp={...}>\\` (connect an API like \\`@emotion/is-prop-valid\\`) or consider using transient props (\\`$\\` prefix for automatic filtering.)`\n );\n }\n }\n }\n\n return propsForElement;\n}\n\nfunction useStyledComponentImpl<Props extends BaseObject>(\n forwardedComponent: IStyledComponent<'web', Props>,\n props: ExecutionProps & Props,\n forwardedRef: Ref<Element>\n) {\n const {\n attrs: componentAttrs,\n componentStyle,\n defaultProps,\n foldedComponentIds,\n styledComponentId,\n target,\n } = forwardedComponent;\n\n const contextTheme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n const ssc = useStyleSheetContext();\n const shouldForwardProp = forwardedComponent.shouldForwardProp || ssc.shouldForwardProp;\n\n if (process.env.NODE_ENV !== 'production' && React.useDebugValue) {\n React.useDebugValue(styledComponentId);\n }\n\n // NOTE: the non-hooks version only subscribes to this when !componentStyle.isStatic,\n // but that'd be against the rules-of-hooks. We could be naughty and do it anyway as it\n // should be an immutable value, but behave for now.\n const theme =\n determineTheme(props, contextTheme, defaultProps) || (IS_RSC ? undefined : EMPTY_OBJECT);\n\n let context: React.HTMLAttributes<Element> & ExecutionContext & Props;\n let generatedClassName: string;\n\n // Client-only render cache: skip resolveContext and generateAndInjectStyles\n // when props+theme haven't changed. propsForElement is always rebuilt since\n // it's mutated with className/ref after construction.\n // __SERVER__ and IS_RSC are build/module-level constants for dead-code elimination.\n if (!__SERVER__ && !IS_RSC) {\n const renderCacheRef = React.useRef<RenderCache | null>(null);\n const prev = renderCacheRef.current;\n\n if (\n prev !== null &&\n prev[1] === theme &&\n prev[2] === ssc.styleSheet &&\n prev[3] === ssc.stylis &&\n prev[7] === componentStyle &&\n shallowEqualContext(prev[0], props, prev[4])\n ) {\n context = prev[5] as typeof context;\n generatedClassName = prev[6];\n } else {\n context = resolveContext<Props>(componentAttrs, props, theme);\n generatedClassName = useInjectedStyle(componentStyle, context, ssc.styleSheet, ssc.stylis);\n\n let propsKeyCount = 0;\n for (const key in props) {\n if (hasOwn.call(props, key)) propsKeyCount++;\n }\n renderCacheRef.current = [\n props,\n theme,\n ssc.styleSheet,\n ssc.stylis,\n propsKeyCount,\n context,\n generatedClassName,\n componentStyle,\n ];\n }\n } else {\n context = resolveContext<Props>(componentAttrs, props, theme);\n generatedClassName = useInjectedStyle(componentStyle, context, ssc.styleSheet, ssc.stylis);\n }\n\n if (process.env.NODE_ENV !== 'production' && forwardedComponent.warnTooManyClasses) {\n forwardedComponent.warnTooManyClasses(generatedClassName);\n }\n\n const elementToBeCreated: WebTarget = context.as || target;\n const propsForElement = buildPropsForElement(\n context,\n elementToBeCreated,\n theme,\n shouldForwardProp\n );\n\n let classString = joinStrings(foldedComponentIds, styledComponentId);\n if (generatedClassName) {\n classString += ' ' + generatedClassName;\n }\n if (context.className) {\n classString += ' ' + context.className;\n }\n\n propsForElement[\n isTag(elementToBeCreated) && elementToBeCreated.includes('-') ? 'class' : 'className'\n ] = classString;\n\n if (forwardedRef) {\n propsForElement.ref = forwardedRef;\n }\n\n const element = createElement(elementToBeCreated, propsForElement);\n\n // RSC mode: emit this component's CSS (and its inheritance chain + keyframes)\n // as an inline <style> tag. No `precedence` — server component output isn't\n // hydrated, so no mismatch. Inline body styles come after the registry's\n // <head> styles in source order, so extensions naturally win (#5672).\n if (IS_RSC) {\n const emitted = getEmittedNames ? getEmittedNames() : null;\n\n let newNames: string[] | null = null;\n let totalNames = 0;\n let css = '';\n let usedCache = true;\n\n let walk: ComponentStyle | null | undefined = componentStyle;\n while (walk) {\n const names = ssc.styleSheet.names.get(walk.componentId);\n if (names) {\n totalNames += names.size;\n for (const name of names) {\n if (!emitted || !emitted.has(name)) {\n if (!newNames) newNames = [];\n newNames.push(name);\n if (emitted) emitted.add(name);\n }\n }\n }\n\n if (newNames && usedCache) {\n let levelCss = getCompiledCSS(walk, ssc.styleSheet);\n if (levelCss === null) {\n usedCache = false;\n } else {\n if (walk !== componentStyle) {\n levelCss = wrapBaseInWhere(levelCss, walk.componentId, ssc.styleSheet);\n }\n css = levelCss + css;\n }\n }\n\n walk = walk.baseStyle;\n }\n\n if (newNames && !usedCache) {\n css = '';\n const tag = ssc.styleSheet.getTag();\n let cs: ComponentStyle | null | undefined = componentStyle;\n while (cs) {\n let levelCss = tag.getGroup(getGroupForId(cs.componentId));\n if (levelCss && cs !== componentStyle) {\n levelCss = wrapBaseInWhere(levelCss, cs.componentId, ssc.styleSheet);\n }\n css = levelCss + css;\n cs = cs.baseStyle;\n }\n }\n\n let kfCss = '';\n if (ssc.styleSheet.keyframeIds.size > 0) {\n const kfTag = ssc.styleSheet.getTag();\n for (const kfId of ssc.styleSheet.keyframeIds) {\n if (emitted && emitted.has(kfId)) continue;\n const kfRules = kfTag.getGroup(getGroupForId(kfId));\n if (kfRules) {\n kfCss += kfRules;\n if (emitted) emitted.add(kfId);\n }\n }\n }\n\n if (css && emitted && newNames && newNames.length < totalNames) {\n const rules = css.split(SPLITTER);\n let filtered = '';\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (!rule) continue;\n for (let j = 0; j < newNames.length; j++) {\n const re = getWhereRegExp(newNames[j]);\n re.lastIndex = 0;\n if (re.test(rule)) {\n filtered += rule + SPLITTER;\n break;\n }\n }\n }\n css = filtered;\n }\n\n const combined = stripSplitter(kfCss + css);\n if (combined) {\n const styleElement = React.createElement('style', {\n [SC_ATTR]: '',\n key: 'sc-' + componentStyle.componentId,\n children: combined,\n });\n return React.createElement(React.Fragment, null, styleElement, element);\n }\n }\n\n return element;\n}\n\nfunction createStyledComponent<\n Target extends WebTarget,\n OuterProps extends BaseObject,\n Statics extends BaseObject = BaseObject,\n>(\n target: Target,\n options: StyledOptions<'web', OuterProps>,\n rules: RuleSet<OuterProps>\n): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>> {\n const isTargetStyledComp = isStyledComponent(target);\n const styledComponentTarget = target as IStyledComponent<'web', OuterProps>;\n const isCompositeComponent = !isTag(target);\n\n const {\n attrs = EMPTY_ARRAY,\n componentId = generateId(options.displayName, options.parentComponentId),\n displayName = generateDisplayName(target),\n } = options;\n\n const styledComponentId =\n options.displayName && options.componentId\n ? escape(options.displayName) + '-' + options.componentId\n : options.componentId || componentId;\n\n // fold the underlying StyledComponent attrs up (implicit extend)\n const finalAttrs =\n isTargetStyledComp && styledComponentTarget.attrs\n ? styledComponentTarget.attrs.concat(attrs as unknown as Attrs<OuterProps>[]).filter(Boolean)\n : (attrs as Attrs<OuterProps>[]);\n\n let { shouldForwardProp } = options;\n\n if (isTargetStyledComp && styledComponentTarget.shouldForwardProp) {\n const shouldForwardPropFn = styledComponentTarget.shouldForwardProp;\n\n if (options.shouldForwardProp) {\n const passedShouldForwardPropFn = options.shouldForwardProp;\n\n // compose nested shouldForwardProp calls\n shouldForwardProp = (prop, elementToBeCreated) =>\n shouldForwardPropFn(prop, elementToBeCreated) &&\n passedShouldForwardPropFn(prop, elementToBeCreated);\n } else {\n shouldForwardProp = shouldForwardPropFn;\n }\n }\n\n const componentStyle = new ComponentStyle(\n rules,\n styledComponentId,\n isTargetStyledComp ? (styledComponentTarget.componentStyle as ComponentStyle) : undefined\n );\n\n function forwardRefRender(\n props: PropsWithoutRef<ExecutionProps & OuterProps>,\n ref: Ref<Element>\n ) {\n return useStyledComponentImpl<OuterProps>(\n WrappedStyledComponent,\n props as ExecutionProps & OuterProps,\n ref\n );\n }\n\n forwardRefRender.displayName = displayName;\n\n /**\n * forwardRef creates a new interim component, which we'll take advantage of\n * instead of extending ParentComponent to create _another_ interim class\n */\n let WrappedStyledComponent = React.forwardRef(forwardRefRender) as unknown as IStyledComponent<\n 'web',\n any\n > &\n Statics;\n WrappedStyledComponent.attrs = finalAttrs;\n WrappedStyledComponent.componentStyle = componentStyle;\n WrappedStyledComponent.displayName = displayName;\n WrappedStyledComponent.shouldForwardProp = shouldForwardProp;\n\n // this static is used to preserve the cascade of static classes for component selector\n // purposes; this is especially important with usage of the css prop\n WrappedStyledComponent.foldedComponentIds = isTargetStyledComp\n ? joinStrings(styledComponentTarget.foldedComponentIds, styledComponentTarget.styledComponentId)\n : '';\n\n WrappedStyledComponent.styledComponentId = styledComponentId;\n\n // fold the underlying StyledComponent target up since we folded the styles\n WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;\n\n Object.defineProperty(WrappedStyledComponent, 'defaultProps', {\n get() {\n return this._foldedDefaultProps;\n },\n\n set(obj) {\n this._foldedDefaultProps = isTargetStyledComp\n ? merge({}, styledComponentTarget.defaultProps, obj)\n : obj;\n },\n });\n\n if (process.env.NODE_ENV !== 'production') {\n checkDynamicCreation(displayName, styledComponentId);\n\n WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(\n displayName,\n styledComponentId\n );\n }\n\n setToString(WrappedStyledComponent, () => `.${WrappedStyledComponent.styledComponentId}`);\n\n if (isCompositeComponent) {\n const compositeComponentTarget = target as AnyComponent;\n\n hoist<typeof WrappedStyledComponent, typeof compositeComponentTarget>(\n WrappedStyledComponent,\n compositeComponentTarget,\n {\n // all SC-specific things should not be hoisted\n attrs: true,\n componentStyle: true,\n displayName: true,\n foldedComponentIds: true,\n shouldForwardProp: true,\n styledComponentId: true,\n target: true,\n } as { [key in keyof OmitNever<IStyledStatics<'web', OuterProps>>]: true }\n );\n }\n\n return WrappedStyledComponent;\n}\n\nexport default createStyledComponent;\n","// prettier-ignore\nconst elements = [\n 'a','abbr','address','area','article','aside','audio','b','bdi','bdo','blockquote','body','button','br','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','dialog','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','label','legend','li','main','map','mark','menu','meter','nav','object','ol','optgroup','option','output','p','picture','pre','progress','q','rp','rt','ruby','s','samp','search','section','select','slot','small','span','strong','sub','summary','sup','table','tbody','td','template','textarea','tfoot','th','thead','time','tr','u','ul','var','video','wbr','circle','clipPath','defs','ellipse','feBlend','feColorMatrix','feComponentTransfer','feComposite','feConvolveMatrix','feDiffuseLighting','feDisplacementMap','feDistantLight','feDropShadow','feFlood','feFuncA','feFuncB','feFuncG','feFuncR','feGaussianBlur','feImage','feMerge','feMergeNode','feMorphology','feOffset','fePointLight','feSpecularLighting','feSpotLight','feTile','feTurbulence','filter','foreignObject','g','image','line','linearGradient','marker','mask','path','pattern','polygon','polyline','radialGradient','rect','stop','svg','switch','symbol','text','textPath','tspan','use',\n] as const;\n\nexport default new Set(elements);\nexport type SupportedHTMLElements = (typeof elements)[number];\n","import { Interpolation } from '../types';\n\nexport default function interleave<Props extends object>(\n strings: readonly string[],\n interpolations: Interpolation<Props>[]\n): Interpolation<Props>[] {\n const result: Interpolation<Props>[] = [strings[0]];\n\n for (let i = 0, len = interpolations.length; i < len; i += 1) {\n result.push(interpolations[i], strings[i + 1]);\n }\n\n return result;\n}\n","import { BaseObject, Interpolation, RuleSet, StyledObject, StyleFunction, Styles } from '../types';\nimport { EMPTY_ARRAY } from '../utils/empties';\nimport flatten from '../utils/flatten';\nimport interleave from '../utils/interleave';\nimport isFunction from '../utils/isFunction';\nimport isPlainObject from '../utils/isPlainObject';\n\nimport { cssTagged } from '../utils/cssTagged';\n\nconst addTag = <T extends RuleSet<any>>(arg: T): T & { isCss: true } => {\n cssTagged.add(arg);\n return arg as T & { isCss: true };\n};\n\n/**\n * Tag a CSS template literal for use in styled components, createGlobalStyle, or attrs.\n * Enables interpolation type-checking and shared style blocks.\n *\n * ```tsx\n * const truncate = css`\n * white-space: nowrap;\n * overflow: hidden;\n * text-overflow: ellipsis;\n * `;\n * ```\n */\nfunction css(styles: Styles<object>, ...interpolations: Interpolation<object>[]): RuleSet<object>;\nfunction css<Props extends object>(\n styles: Styles<NoInfer<Props>>,\n ...interpolations: Interpolation<NoInfer<Props>>[]\n): RuleSet<NoInfer<Props>>;\nfunction css<Props extends object = BaseObject>(\n styles: Styles<NoInfer<Props>>,\n ...interpolations: Interpolation<NoInfer<Props>>[]\n): RuleSet<NoInfer<Props>> {\n if (isFunction(styles) || isPlainObject(styles)) {\n const styleFunctionOrObject = styles as StyleFunction<Props> | StyledObject<Props>;\n\n return addTag(\n flatten<Props>(\n interleave<Props>(EMPTY_ARRAY, [\n styleFunctionOrObject,\n ...interpolations,\n ]) as Interpolation<object>\n )\n );\n }\n\n const styleStringArray = styles as TemplateStringsArray;\n\n if (\n interpolations.length === 0 &&\n styleStringArray.length === 1 &&\n typeof styleStringArray[0] === 'string'\n ) {\n return flatten<Props>(styleStringArray);\n }\n\n return addTag(\n flatten<Props>(interleave<Props>(styleStringArray, interpolations) as Interpolation<object>)\n );\n}\n\nexport default css;\n","import {\n Attrs,\n BaseObject,\n ExecutionProps,\n Interpolation,\n IStyledComponent,\n IStyledComponentFactory,\n KnownTarget,\n MakeAttrsOptional,\n Runtime,\n StyledOptions,\n StyledTarget,\n Styles,\n Substitute,\n} from '../types';\nimport { EMPTY_OBJECT } from '../utils/empties';\nimport styledError from '../utils/error';\nimport css from './css';\n\ntype AttrsResult<T extends Attrs<any>> = T extends (...args: any) => infer P\n ? P extends object\n ? P\n : never\n : T extends object\n ? T\n : never;\n\n/**\n * Based on Attrs being a simple object or function that returns\n * a prop object, inspect the attrs result and attempt to extract\n * any \"as\" prop usage to modify the runtime target.\n */\ntype AttrsTarget<\n R extends Runtime,\n T extends Attrs<any>,\n FallbackTarget extends StyledTarget<R>,\n Result extends ExecutionProps = AttrsResult<T>,\n> = Result extends { as: infer RuntimeTarget }\n ? RuntimeTarget extends KnownTarget\n ? RuntimeTarget\n : FallbackTarget\n : FallbackTarget;\n\nexport interface Styled<\n out R extends Runtime,\n out Target extends StyledTarget<R>,\n in out OuterProps extends object,\n out OuterStatics extends object = BaseObject,\n out AttrsKeys extends keyof any = never,\n> {\n <Props extends object = BaseObject, Statics extends object = BaseObject>(\n initialStyles: Styles<Substitute<OuterProps, NoInfer<Props>>>,\n ...interpolations: Interpolation<Substitute<OuterProps, NoInfer<Props>>>[]\n ): IStyledComponent<R, MakeAttrsOptional<Substitute<OuterProps, Props>, AttrsKeys>> &\n OuterStatics &\n Statics &\n (R extends 'web'\n ? Target extends string\n ? {}\n : Omit<Target, keyof React.Component<any>>\n : {});\n\n attrs: <\n Props extends object = BaseObject,\n PrivateMergedProps extends object = Substitute<OuterProps, Props>,\n PrivateAttrsArg extends Attrs<PrivateMergedProps> = Attrs<PrivateMergedProps>,\n PrivateResolvedTarget extends StyledTarget<R> = AttrsTarget<R, PrivateAttrsArg, Target>,\n >(\n attrs: PrivateAttrsArg\n ) => Styled<\n R,\n PrivateResolvedTarget,\n PrivateResolvedTarget extends KnownTarget\n ? Substitute<\n Substitute<OuterProps, React.ComponentPropsWithRef<PrivateResolvedTarget>>,\n Props\n >\n : PrivateMergedProps,\n OuterStatics,\n AttrsKeys | keyof AttrsResult<PrivateAttrsArg>\n >;\n\n withConfig: (\n config: StyledOptions<R, OuterProps>\n ) => Styled<R, Target, OuterProps, OuterStatics, AttrsKeys>;\n}\n\nexport default function constructWithOptions<\n R extends Runtime,\n Target extends StyledTarget<R>,\n OuterProps extends object = Target extends KnownTarget\n ? React.ComponentPropsWithRef<Target>\n : BaseObject,\n OuterStatics extends object = BaseObject,\n AttrsKeys extends keyof any = never,\n>(\n componentConstructor: IStyledComponentFactory<R, StyledTarget<R>, object, any>,\n tag: StyledTarget<R>,\n options: StyledOptions<R, OuterProps> = EMPTY_OBJECT\n): Styled<R, Target, OuterProps, OuterStatics, AttrsKeys> {\n /**\n * We trust that the tag is a valid component as long as it isn't\n * falsish. Typically the tag here is a string or function (i.e.\n * class or pure function component), however a component may also be\n * an object if it uses another utility, e.g. React.memo. React will\n * output an appropriate warning however if the `tag` isn't valid.\n */\n if (!tag) {\n throw styledError(1, tag);\n }\n\n /* This is callable directly as a template function */\n const templateFunction = <Props extends object = BaseObject, Statics extends object = BaseObject>(\n initialStyles: Styles<Substitute<OuterProps, Props>>,\n ...interpolations: Interpolation<Substitute<OuterProps, Props>>[]\n ) =>\n componentConstructor<Substitute<OuterProps, Props>, Statics>(\n tag,\n options as StyledOptions<R, Substitute<OuterProps, Props>>,\n css<Substitute<OuterProps, Props>>(initialStyles, ...interpolations)\n );\n\n /**\n * Attrs allows for accomplishing two goals:\n *\n * 1. Backfilling props at runtime more expressively than defaultProps\n * 2. Amending the prop interface of a wrapped styled component\n */\n templateFunction.attrs = <\n Props extends object = BaseObject,\n PrivateMergedProps extends object = Substitute<OuterProps, Props>,\n PrivateAttrsArg extends Attrs<PrivateMergedProps> = Attrs<PrivateMergedProps>,\n PrivateResolvedTarget extends StyledTarget<R> = AttrsTarget<R, PrivateAttrsArg, Target>,\n >(\n attrs: PrivateAttrsArg\n ) =>\n constructWithOptions<\n R,\n PrivateResolvedTarget,\n PrivateResolvedTarget extends KnownTarget\n ? Substitute<\n Substitute<OuterProps, React.ComponentPropsWithRef<PrivateResolvedTarget>>,\n Props\n >\n : PrivateMergedProps,\n OuterStatics,\n AttrsKeys | keyof AttrsResult<PrivateAttrsArg>\n >(componentConstructor, tag, {\n ...options,\n attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean),\n });\n\n /**\n * If config methods are called, wrap up a new template function\n * and merge options.\n */\n templateFunction.withConfig = (config: StyledOptions<R, OuterProps>) =>\n constructWithOptions<R, Target, OuterProps, OuterStatics, AttrsKeys>(\n componentConstructor,\n tag,\n {\n ...options,\n ...config,\n }\n );\n\n return templateFunction;\n}\n","import * as React from 'react';\nimport createStyledComponent from '../models/StyledComponent';\nimport { BaseObject, KnownTarget, WebTarget } from '../types';\nimport domElements, { SupportedHTMLElements } from '../utils/domElements';\nimport constructWithOptions, { Styled as StyledInstance } from './constructWithOptions';\n\n/**\n * Create a styled component from an HTML element or React component.\n *\n * ```tsx\n * const Button = styled.button`color: red;`;\n * const Link = styled(RouterLink)`text-decoration: none;`;\n * ```\n */\nconst baseStyled = <Target extends WebTarget, InjectedProps extends object = BaseObject>(\n tag: Target\n) =>\n constructWithOptions<\n 'web',\n Target,\n Target extends KnownTarget ? React.ComponentPropsWithRef<Target> & InjectedProps : InjectedProps\n >(createStyledComponent, tag);\n\nconst styled = baseStyled as typeof baseStyled & {\n [E in SupportedHTMLElements]: StyledInstance<'web', E, React.JSX.IntrinsicElements[E]>;\n};\n\n// Shorthands for all valid HTML Elements.\n// The type assertion avoids 120 Styled<> instantiations during type checking —\n// the correct types are declared on the `styled` const above via the mapped type.\ndomElements.forEach(domElement => {\n (styled as any)[domElement] = baseStyled(domElement);\n});\n\nexport default styled;\nexport { StyledInstance };\n\n/**\n * This is the type of the `styled` HOC.\n */\nexport type Styled = typeof styled;\n\n/**\n * Use this higher-order type for scenarios where you are wrapping `styled`\n * and providing extra props as a third-party library.\n */\nexport type LibraryStyled<LibraryProps extends object = BaseObject> = <Target extends WebTarget>(\n tag: Target\n) => typeof baseStyled<Target, LibraryProps>;\n","import StyleSheet from '../sheet';\nimport { ExecutionContext, RuleSet, Stringifier } from '../types';\nimport flatten from '../utils/flatten';\nimport isStaticRules from '../utils/isStaticRules';\nimport { joinStringArray } from '../utils/joinStrings';\n\ntype InstanceEntry = { name: string; rules: string[] };\n\nexport default class GlobalStyle<Props extends object> {\n componentId: string;\n isStatic: boolean;\n rules: RuleSet<Props>;\n\n /** @internal Per-instance rule cache for shared-group rebuild. */\n instanceRules: Map<number, InstanceEntry> = new Map();\n\n constructor(rules: RuleSet<Props>, componentId: string) {\n this.rules = rules;\n this.componentId = componentId;\n this.isStatic = isStaticRules(rules);\n\n // Pre-register the shared group so global styles defined before\n // components always appear before them in the stylesheet.\n StyleSheet.registerId(this.componentId);\n }\n\n removeStyles(instance: number, styleSheet: StyleSheet): void {\n this.instanceRules.delete(instance);\n this.rebuildGroup(styleSheet);\n }\n\n renderStyles(\n instance: number,\n executionContext: ExecutionContext & Props,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): void {\n const id = this.componentId;\n\n if (this.isStatic) {\n if (!styleSheet.hasNameForId(id, id + instance)) {\n const entry = this.computeRules(instance, executionContext, styleSheet, stylis);\n styleSheet.insertRules(id, entry.name, entry.rules);\n } else if (!this.instanceRules.has(instance)) {\n // Rehydrated style: populate cache so rebuildGroup can restore\n // survivors if another instance unmounts.\n this.computeRules(instance, executionContext, styleSheet, stylis);\n }\n return;\n }\n\n // Compute new rules; skip CSSOM rebuild if CSS is unchanged.\n // The fast-path is only safe on the client where the tag persists between renders.\n // During SSR, clearTag() destroys the tag between requests, so we must always rebuild.\n const prev = this.instanceRules.get(instance);\n this.computeRules(instance, executionContext, styleSheet, stylis);\n if (!styleSheet.server && prev) {\n const a = prev.rules;\n const b = this.instanceRules.get(instance)!.rules;\n if (a.length === b.length) {\n let same = true;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n same = false;\n break;\n }\n }\n if (same) return;\n }\n }\n this.rebuildGroup(styleSheet);\n }\n\n private computeRules(\n instance: number,\n executionContext: ExecutionContext & Props,\n styleSheet: StyleSheet,\n stylis: Stringifier\n ): InstanceEntry {\n const flatCSS = joinStringArray(\n flatten(this.rules as RuleSet<object>, executionContext, styleSheet, stylis) as string[]\n );\n const entry: InstanceEntry = {\n name: this.componentId + instance,\n rules: stylis(flatCSS, ''),\n };\n this.instanceRules.set(instance, entry);\n return entry;\n }\n\n /**\n * Clear all CSS rules in the shared group and re-insert from surviving instances.\n * Must run synchronously — no yielding between clear and re-insert.\n */\n private rebuildGroup(styleSheet: StyleSheet): void {\n const id = this.componentId;\n styleSheet.clearRules(id);\n for (const entry of this.instanceRules.values()) {\n styleSheet.insertRules(id, entry.name, entry.rules);\n }\n }\n}\n","import { RuleSet } from '../types';\nimport isFunction from './isFunction';\nimport isStyledComponent from './isStyledComponent';\n\nexport default function isStaticRules<Props extends object>(rules: RuleSet<Props>) {\n for (let i = 0; i < rules.length; i += 1) {\n const rule = rules[i];\n\n if (isFunction(rule) && !isStyledComponent(rule)) {\n // functions are allowed to be static if they're just being\n // used to get the classname of a nested styled component\n return false;\n }\n }\n\n return true;\n}\n","import React from 'react';\nimport { IS_RSC, STATIC_EXECUTION_CONTEXT } from '../constants';\nimport GlobalStyle from '../models/GlobalStyle';\nimport { useStyleSheetContext } from '../models/StyleSheetManager';\nimport { DefaultTheme, ThemeContext } from '../models/ThemeProvider';\nimport StyleSheet from '../sheet';\nimport { ExecutionContext, ExecutionProps, Interpolation, Stringifier, Styles } from '../types';\nimport { checkDynamicCreation } from '../utils/checkDynamicCreation';\nimport determineTheme from '../utils/determineTheme';\nimport generateComponentId from '../utils/generateComponentId';\nimport { joinRules, stripSplitter } from '../utils/joinStrings';\nimport { createRSCCache } from '../utils/rscCache';\nimport css from './css';\n\ndeclare const __SERVER__: boolean;\n\n/** Per-render dedup for RSC global style tags (same pattern as StyledComponent). */\nconst getEmittedGlobalCSS = createRSCCache(() => new Set<string>());\n\n/**\n * Create a component that injects global CSS when mounted. Supports theming and dynamic props.\n *\n * ```tsx\n * const GlobalStyle = createGlobalStyle`\n * body { margin: 0; font-family: system-ui; }\n * `;\n * // Render <GlobalStyle /> at the root of your app\n * ```\n */\nexport default function createGlobalStyle<Props extends object>(\n strings: Styles<Props>,\n ...interpolations: Array<Interpolation<Props>>\n) {\n const rules = css<Props>(strings, ...interpolations);\n const styledComponentId = `sc-global-${generateComponentId(JSON.stringify(rules))}`;\n const globalStyle = new GlobalStyle<Props>(rules, styledComponentId);\n\n if (process.env.NODE_ENV !== 'production') {\n checkDynamicCreation(styledComponentId);\n }\n\n const GlobalStyleComponent: React.ComponentType<ExecutionProps & Props> = props => {\n const ssc = useStyleSheetContext();\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n\n // Each mount needs a unique instance ID for the shared-group instanceRules cache.\n // __SERVER__ is a build-time constant: the dead branch is entirely eliminated,\n // so React never sees a conditional hook call.\n // Server bundle: direct allocation (one-shot renders, no stability needed).\n // Browser bundle: useRef for stable ID across re-renders + useLayoutEffect cleanup.\n let instance: number;\n if (__SERVER__) {\n instance = ssc.styleSheet.allocateGSInstance(styledComponentId);\n } else {\n const instanceRef = React.useRef<number | null>(null);\n if (instanceRef.current === null) {\n instanceRef.current = ssc.styleSheet.allocateGSInstance(styledComponentId);\n }\n instance = instanceRef.current;\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n // @ts-expect-error invariant check\n React.Children.count(props.children)\n ) {\n console.warn(\n `The global style component ${styledComponentId} was given child JSX. createGlobalStyle does not render children.`\n );\n }\n\n if (\n process.env.NODE_ENV !== 'production' &&\n rules.some(rule => typeof rule === 'string' && rule.indexOf('@import') !== -1)\n ) {\n console.warn(\n `Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app.`\n );\n }\n\n // Render styles during component execution for RSC or explicit ServerStyleSheet.\n // Gate on IS_RSC or styleSheet.server (runtime flag from ServerStyleSheet),\n // NOT on __SERVER__ alone. The server build sets __SERVER__=true and eliminates\n // useLayoutEffect, so if we rendered here without cleanup, styles would\n // accumulate unboundedly in jsdom test environments (O(n²) regression).\n // On a real server without ServerStyleSheet, VirtualTag is used and styles are\n // discarded anyway, so skipping this path has no functional impact.\n // Turbopack resolves the browser entry for SSR, so __SERVER__ is false there;\n // styleSheet.server handles that case at runtime.\n if (IS_RSC || ssc.styleSheet.server) {\n renderStyles(instance, props, ssc.styleSheet, theme, ssc.stylis);\n }\n\n // Client-side lifecycle: render styles in effect and clean up on unmount.\n // __SERVER__ and IS_RSC are build/module-level constants, so this doesn't violate rules of hooks.\n if (!__SERVER__ && !IS_RSC) {\n // globalStyle is included in deps so HMR-induced module re-evaluation\n // (which creates a new GlobalStyle instance) triggers effect re-run.\n // For static rules, renderStyles exits early after the first injection\n // (via hasNameForId check), so the extra dep is effectively free at runtime.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const effectDeps = globalStyle.isStatic\n ? [instance, ssc.styleSheet, globalStyle]\n : [instance, props, ssc.styleSheet, theme, ssc.stylis, globalStyle];\n\n const prevGlobalStyleRef = React.useRef(globalStyle);\n\n React.useLayoutEffect(() => {\n if (!ssc.styleSheet.server) {\n // HMR creates a new globalStyle instance but the componentId stays stable\n // (SWC plugin assigns by file location), so stale hasNameForId hits skip injection.\n if (prevGlobalStyleRef.current !== globalStyle) {\n ssc.styleSheet.clearRules(styledComponentId);\n prevGlobalStyleRef.current = globalStyle;\n }\n\n renderStyles(instance, props, ssc.styleSheet, theme, ssc.stylis);\n }\n\n return () => {\n globalStyle.removeStyles(instance, ssc.styleSheet);\n };\n }, effectDeps);\n }\n\n // RSC mode: output style tag.\n // Unlike regular styled components, global styles must NOT use React 19's\n // `precedence` attribute because it makes style tags persist as permanent\n // resources even after unmount. Global styles need lifecycle-based cleanup\n // for conditional rendering (e.g. body lock on modal open/close).\n if (IS_RSC) {\n const entry =\n typeof window === 'undefined' ? globalStyle.instanceRules.get(instance) : undefined;\n const css = entry ? joinRules(entry.rules) : '';\n\n if (css) {\n globalStyle.instanceRules.delete(instance);\n\n // Dedup: static by componentId + stylis hash, dynamic by CSS string.\n // Stylis hash ensures different SSM configs emit separate variants.\n const emitted = getEmittedGlobalCSS ? getEmittedGlobalCSS() : null;\n if (emitted) {\n const key = globalStyle.isStatic ? styledComponentId + ssc.stylis.hash : css;\n if (emitted.has(key)) return null;\n emitted.add(key);\n }\n\n return React.createElement('style', {\n key: styledComponentId + '-' + instance,\n 'data-styled-global': styledComponentId,\n children: stripSplitter(css),\n });\n }\n }\n\n // Clean up server instance cache — no useLayoutEffect cleanup runs on the\n // server, so instanceRules would grow unboundedly across SSR requests.\n if (__SERVER__ || ssc.styleSheet.server) {\n globalStyle.instanceRules.delete(instance);\n }\n\n return null;\n };\n\n function renderStyles(\n instance: number,\n props: ExecutionProps,\n styleSheet: StyleSheet,\n theme: DefaultTheme | undefined,\n stylis: Stringifier\n ) {\n if (globalStyle.isStatic) {\n globalStyle.renderStyles(\n instance,\n STATIC_EXECUTION_CONTEXT as unknown as ExecutionContext & Props,\n styleSheet,\n stylis\n );\n } else {\n const context = {\n ...props,\n theme: determineTheme(props, theme, GlobalStyleComponent.defaultProps),\n } as ExecutionContext & Props;\n\n globalStyle.renderStyles(instance, context, styleSheet, stylis);\n }\n }\n\n return React.memo(GlobalStyleComponent);\n}\n","import { IS_BROWSER } from '../constants';\nimport createGlobalStyle from './createGlobalStyle';\n\ntype ThemeLeaf = string | number;\n\n/**\n * Recursively maps a theme object so every leaf value becomes\n * a `var(--sc-path, fallback)` CSS string.\n */\ntype CSSVarTheme<T> = {\n [K in keyof T]: T[K] extends ThemeLeaf ? string : CSSVarTheme<T[K]>;\n};\n\n/**\n * The object returned by `createTheme`. Same shape as the input theme but\n * every leaf is a CSS `var()` reference. Also carries a `GlobalStyle`\n * component and the original `raw` theme object.\n */\ntype ThemeContract<T> = CSSVarTheme<T> & {\n /**\n * A `createGlobalStyle` component that emits `:root` CSS custom properties\n * from the current ThemeProvider context. Mount this once at the root of\n * your app so RSC components can consume theme values via CSS variables.\n */\n GlobalStyle: ReturnType<typeof createGlobalStyle>;\n /** The original theme object, for passing to `ThemeProvider`. */\n raw: T;\n /**\n * Same shape as the theme but every leaf is the bare CSS custom property\n * name (e.g. `\"--sc-colors-primary\"`). Useful for building dark mode\n * overrides without hand-writing variable names.\n *\n * @example\n * ```tsx\n * const { vars } = createTheme({ colors: { bg: '#fff', text: '#000' } });\n * vars.colors.bg // \"--sc-colors-bg\"\n *\n * const DarkMode = createGlobalStyle`\n * .dark {\n * ${vars.colors.bg}: #111;\n * ${vars.colors.text}: #eee;\n * }\n * `;\n * ```\n */\n vars: CSSVarTheme<T>;\n /**\n * Read the current resolved CSS variable values from the DOM and return\n * an object with the same shape as the original theme. Each leaf is the\n * computed value (e.g. `\"#0070f3\"`), not the `var()` reference.\n *\n * Optionally pass a target element to read scoped variables from\n * (defaults to `document.documentElement`).\n *\n * Client-only — throws if called on the server.\n */\n resolve(el?: Element): T;\n};\n\n/** Shared recursive traversal — calls `leafFn` for each leaf, recurses for objects. */\nfunction walkTheme(\n obj: Record<string, any>,\n varPrefix: string,\n result: Record<string, any>,\n leafFn: (fullPath: string, val: any, key: string) => any,\n path?: string\n): void {\n for (const key in obj) {\n const val = obj[key];\n const fullPath = path ? path + '-' + key : key;\n if (typeof val === 'object' && val !== null) {\n const nested: Record<string, any> = {};\n walkTheme(val, varPrefix, nested, leafFn, fullPath);\n result[key] = nested;\n } else {\n result[key] = leafFn(fullPath, val, key);\n }\n }\n}\n\n/** Build bare CSS custom property names: `--prefix-a-b` */\nfunction buildVarNames<T extends Record<string, any>>(obj: T, varPrefix: string): CSSVarTheme<T> {\n const result: Record<string, any> = {};\n walkTheme(obj, varPrefix, result, fullPath => '--' + varPrefix + fullPath);\n return result as CSSVarTheme<T>;\n}\n\n/** Build `var(--prefix-a-b, fallback)` references with dev-mode parenthesis validation */\nfunction buildVarRefs<T extends Record<string, any>>(obj: T, varPrefix: string): CSSVarTheme<T> {\n const result: Record<string, any> = {};\n walkTheme(obj, varPrefix, result, (fullPath, val) => {\n if (process.env.NODE_ENV !== 'production') {\n const str = String(val);\n let depth = 0;\n for (let i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) === 40) depth++;\n else if (str.charCodeAt(i) === 41) depth--;\n if (depth < 0) break;\n }\n if (depth !== 0) {\n console.warn(\n `createTheme: value \"${str}\" at \"${fullPath}\" contains unbalanced parentheses and may break the var() fallback`\n );\n }\n }\n return 'var(--' + varPrefix + fullPath + ', ' + val + ')';\n });\n return result as CSSVarTheme<T>;\n}\n\n/** Read computed CSS variable values from the DOM */\nfunction resolveVars<T extends Record<string, any>>(\n obj: T,\n varPrefix: string,\n styles: CSSStyleDeclaration\n): T {\n const result: Record<string, any> = {};\n walkTheme(obj, varPrefix, result, (fullPath, val) => {\n const resolved = styles.getPropertyValue('--' + varPrefix + fullPath).trim();\n return resolved || val;\n });\n return result as T;\n}\n\n/**\n * Emit CSS var declarations by walking `shape` for structure and reading\n * values from `theme`. This avoids hardcoded skip lists — only keys\n * present in the original theme shape are traversed.\n */\nfunction emitVarDeclarations(\n shape: Record<string, any>,\n theme: Record<string, any>,\n varPrefix: string,\n path?: string\n): string {\n let css = '';\n for (const key in shape) {\n const shapeVal = shape[key];\n const themeVal = theme[key];\n const fullPath = path ? path + '-' + key : key;\n if (typeof shapeVal === 'object' && shapeVal !== null) {\n if (typeof themeVal === 'object' && themeVal !== null) {\n css += emitVarDeclarations(shapeVal, themeVal, varPrefix, fullPath);\n }\n } else if (themeVal !== undefined && typeof themeVal !== 'function') {\n css += '--' + varPrefix + fullPath + ':' + themeVal + ';';\n }\n }\n return css;\n}\n\ninterface CreateThemeOptions {\n /**\n * Prefix for CSS variable names. Defaults to `\"sc\"`.\n * Useful for isolation when multiple design systems or microfrontends\n * coexist on the same page.\n *\n * @example\n * createTheme(theme, { prefix: 'ds' })\n * // → var(--ds-colors-primary, #0070f3)\n */\n prefix?: string;\n\n /**\n * CSS selector for the variable declarations. Defaults to `\":root\"`.\n * Use `\":host\"` for web components / Shadow DOM, or a class selector\n * for scoped theming.\n *\n * @example\n * createTheme(theme, { selector: ':host' })\n * // → :host { --sc-colors-primary: #0070f3; }\n */\n selector?: string;\n}\n\n/**\n * Create a theme backed by CSS custom properties, bridging `ThemeProvider` and CSS variables.\n *\n * Returns an object with the same shape as the input theme, but every leaf value\n * is a `var(--prefix-*, fallback)` CSS string. Use these in styled component\n * templates — they work in both client and RSC contexts.\n *\n * Mount the returned `GlobalStyle` component inside your `ThemeProvider` to emit\n * the CSS variables. When the theme changes (e.g. light → dark), the variables\n * update automatically.\n *\n * @example\n * ```tsx\n * const theme = createTheme({\n * colors: { primary: '#0070f3', text: '#111' },\n * });\n *\n * // Root layout (client):\n * <ThemeProvider theme={themes[preset]}>\n * <theme.GlobalStyle />\n * {children}\n * </ThemeProvider>\n *\n * // Any RSC file:\n * const Card = styled.div`\n * color: ${theme.colors.primary};\n * // → \"var(--sc-colors-primary, #0070f3)\"\n * `;\n * ```\n */\nexport default function createTheme<T extends Record<string, any>>(\n defaultTheme: T,\n options?: CreateThemeOptions\n): ThemeContract<T> {\n const pfx = (options?.prefix ?? 'sc') + '-';\n const sel = options?.selector ?? ':root';\n const varNames = buildVarNames(defaultTheme, pfx);\n const varRefs = buildVarRefs(defaultTheme, pfx);\n\n const GlobalStyle = createGlobalStyle`\n ${sel} {\n ${(p: { theme: Record<string, any> }) => emitVarDeclarations(defaultTheme, p.theme, pfx)}\n }\n `;\n\n return Object.assign(varRefs, {\n GlobalStyle,\n raw: defaultTheme,\n vars: varNames,\n resolve(el?: Element): T {\n if (!IS_BROWSER) {\n throw new Error('createTheme.resolve() is client-only');\n }\n const target = el ?? document.documentElement;\n return resolveVars(defaultTheme, pfx, getComputedStyle(target));\n },\n }) as ThemeContract<T>;\n}\n","import { IS_RSC, KEYFRAMES_ID_PREFIX } from '../constants';\nimport StyleSheet from '../sheet';\nimport { getGroupForId } from '../sheet/GroupIDAllocator';\nimport { Keyframes as KeyframesType, Stringifier } from '../types';\nimport styledError from '../utils/error';\nimport generateAlphabeticName from '../utils/generateAlphabeticName';\nimport { KEYFRAMES_SYMBOL } from '../utils/isKeyframes';\nimport { setToString } from '../utils/setToString';\nimport { mainStylis } from './StyleSheetManager';\n\n/** RSC optimization: caches compiled keyframe CSS per stylis hash. */\nconst kfCompiledCache: WeakMap<Keyframes, Map<string, string[]>> | null = IS_RSC\n ? new WeakMap()\n : null;\n\nexport default class Keyframes implements KeyframesType {\n readonly [KEYFRAMES_SYMBOL] = true as const;\n\n id: string;\n name: string;\n rules: string;\n\n constructor(name: string, rules: string) {\n this.name = name;\n this.id = KEYFRAMES_ID_PREFIX + name;\n this.rules = rules;\n\n // Eagerly register the group so keyframes defined before components\n // get a lower group ID and appear before them in the stylesheet.\n // Uses getGroupForId directly (not StyleSheet.registerId) because\n // GroupIDAllocator is pure JS — safe for native builds.\n getGroupForId(this.id);\n\n setToString(this, () => {\n throw styledError(12, String(this.name));\n });\n }\n\n inject = (styleSheet: StyleSheet, stylisInstance: Stringifier = mainStylis): void => {\n const resolvedName = this.getName(stylisInstance);\n\n if (!styleSheet.hasNameForId(this.id, resolvedName)) {\n const cacheKey = stylisInstance.hash || '';\n const cached = IS_RSC ? kfCompiledCache?.get(this)?.get(cacheKey) : undefined;\n if (cached) {\n // RSC cache hit: re-insert cached rules into the tag (needed for\n // getGroup in the RSC emission path) without re-running stylis.\n styleSheet.insertRules(this.id, resolvedName, cached);\n } else {\n const compiled = stylisInstance(this.rules, resolvedName, '@keyframes');\n if (IS_RSC && kfCompiledCache) {\n let map = kfCompiledCache.get(this);\n if (!map) {\n map = new Map();\n kfCompiledCache.set(this, map);\n }\n map.set(cacheKey, compiled);\n }\n styleSheet.insertRules(this.id, resolvedName, compiled);\n }\n }\n };\n\n getName(stylisInstance: Stringifier = mainStylis): string {\n return stylisInstance.hash\n ? this.name + generateAlphabeticName(+stylisInstance.hash >>> 0)\n : this.name;\n }\n}\n","import { mainSheet } from './models/StyleSheetManager';\nimport StyleSheet from './sheet';\n\nexport const __PRIVATE__ = {\n StyleSheet,\n mainSheet,\n};\n","/* Import singletons */\nimport { SC_ATTR, SC_VERSION } from './constants';\nimport createGlobalStyle from './constructors/createGlobalStyle';\nimport createTheme from './constructors/createTheme';\nimport css from './constructors/css';\nimport keyframes from './constructors/keyframes';\n/* Import Higher Order Components */\nimport withTheme from './hoc/withTheme';\n/* Import hooks */\nimport ServerStyleSheet from './models/ServerStyleSheet';\nimport {\n IStyleSheetContext,\n IStyleSheetManager,\n IStylisContext,\n StyleSheetConsumer,\n StyleSheetContext,\n StyleSheetManager,\n} from './models/StyleSheetManager';\n/* Import components */\nimport ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from './models/ThemeProvider';\nimport isStyledComponent from './utils/isStyledComponent';\n\n/* Warning if you've imported this file on React Native */\nif (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n) {\n console.warn(\n `It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native`\n );\n}\n\nconst windowGlobalKey = `__sc-${SC_ATTR}__`;\n\n/* Warning if there are several instances of styled-components */\nif (\n process.env.NODE_ENV !== 'production' &&\n process.env.NODE_ENV !== 'test' &&\n typeof window !== 'undefined'\n) {\n // @ts-expect-error dynamic key not in window object\n window[windowGlobalKey] ||= 0;\n\n // @ts-expect-error dynamic key not in window object\n if (window[windowGlobalKey] === 1) {\n console.warn(\n `It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`\n );\n }\n\n // @ts-expect-error dynamic key not in window object\n window[windowGlobalKey] += 1;\n}\n\n/* Export everything */\nexport * from './secretInternals';\nexport { Attrs, DefaultTheme, Keyframes, ShouldForwardProp } from './types';\nexport {\n IStyleSheetContext,\n IStyleSheetManager,\n IStylisContext,\n ServerStyleSheet,\n StyleSheetConsumer,\n StyleSheetContext,\n StyleSheetManager,\n ThemeConsumer,\n ThemeContext,\n ThemeProvider,\n createGlobalStyle,\n createTheme,\n css,\n isStyledComponent,\n keyframes,\n useTheme,\n SC_VERSION as version,\n withTheme,\n};\n","import { RULESET, type Middleware } from 'stylis';\nimport { SC_ATTR } from '../constants';\nimport { isEscaped } from './stylis';\n\n/**\n * Rewrites CSS selectors that break when styled-components' inline\n * `<style data-styled>` tags appear in the DOM (RSC/SSR):\n *\n * 1. Child-index pseudo-selectors (:first-child, :nth-child, etc.) are\n * rewritten using CSS Selectors Level 4 `of S` syntax to exclude\n * style tags from the child count. This is a precise, spec-level fix.\n *\n * 2. Adjacent sibling combinators (+) are expanded with fallback selectors\n * that match when 1 or 2 `<style data-styled>` tags are interleaved\n * between siblings. The RSC render path emits Fragment[kfStyle?, compStyle?,\n * element] per component, so a component's style tags always precede its own\n * element — the maximum between any two elements is 2 (the next component's\n * keyframe + component CSS). Known limitations:\n * - `+` inside pseudo-functions (:is(), :has(), :where(), :not()) is not\n * expanded. Prefer :first-of-type/:nth-of-type or ~ (general sibling).\n * - Each `+` adds 2 fallback selectors, increasing CSS output size.\n *\n * ```jsx\n * import { StyleSheetManager, stylisPluginRSC } from 'styled-components';\n *\n * <StyleSheetManager stylisPlugins={[stylisPluginRSC]}>\n * ...\n * </StyleSheetManager>\n * ```\n *\n * Requires browser support for CSS Selectors Level 4 `of S` syntax\n * (Chrome 111+, Firefox 113+, Safari 9+).\n */\nconst CHILD_RE =\n /:(?:(first)-child|(last)-child|(only)-child|(nth-child)\\(([^()]+)\\)|(nth-last-child)\\(([^()]+)\\))/g;\n\nconst EXCLUDE = `:not(style[${SC_ATTR}])`;\nconst STYLE_TAG = `style[${SC_ATTR}]`;\n\nfunction rewriteSelector(selector: string): string {\n if (selector.indexOf('-child') === -1) return selector;\n\n CHILD_RE.lastIndex = 0;\n return selector.replace(\n CHILD_RE,\n (_match, first, last, only, nth, nthArgs, nthLast, nthLastArgs) => {\n if (first) return `:nth-child(1 of ${EXCLUDE})`;\n if (last) return `:nth-last-child(1 of ${EXCLUDE})`;\n if (only) return `:nth-child(1 of ${EXCLUDE}):nth-last-child(1 of ${EXCLUDE})`;\n if (nth) {\n if (nthArgs.indexOf(' of ') !== -1) return _match;\n return `:nth-child(${nthArgs} of ${EXCLUDE})`;\n }\n if (nthLastArgs.indexOf(' of ') !== -1) return _match;\n return `:nth-last-child(${nthLastArgs} of ${EXCLUDE})`;\n }\n );\n}\n\n/**\n * Expand each `+` combinator to also match when 1 or 2 `<style data-styled>`\n * tags are interleaved. Skips `+` inside parentheses, brackets, and after\n * backslash escapes. Pushes expanded selectors directly to `out`.\n *\n * `A+B` → `A+style[data-styled]+B` + `A+style[data-styled]+style[data-styled]+B`\n */\nfunction expandAdjacentSibling(selector: string, out: string[]): void {\n if (selector.indexOf('+') === -1) return;\n\n let parenDepth = 0;\n let bracketDepth = 0;\n for (let i = 0; i < selector.length; i++) {\n const ch = selector.charCodeAt(i);\n if (ch === 40 /* ( */) parenDepth++;\n else if (ch === 41 /* ) */) parenDepth--;\n else if (ch === 91 /* [ */) bracketDepth++;\n else if (ch === 93 /* ] */) bracketDepth--;\n else if (\n ch === 43 /* + */ &&\n parenDepth === 0 &&\n bracketDepth === 0 &&\n !isEscaped(selector, i)\n ) {\n const before = selector.substring(0, i);\n const after = selector.substring(i + 1);\n out.push(before + '+' + STYLE_TAG + '+' + after);\n out.push(before + '+' + STYLE_TAG + '+' + STYLE_TAG + '+' + after);\n }\n }\n}\n\nfunction stylisPluginRSC(element: Parameters<Middleware>[0]) {\n if (element.type === RULESET) {\n // New array — stylis caches AST objects, in-place mutation corrupts the cache\n const props = element.props as string[];\n const newProps: string[] = [];\n for (let i = 0; i < props.length; i++) {\n const rewritten = rewriteSelector(props[i]);\n newProps.push(rewritten);\n expandAdjacentSibling(rewritten, newProps);\n }\n element.props = newProps;\n }\n}\n\n// Minifiers mangle function names; stylis hash needs a stable .name for cache keying\n/*#__PURE__*/ Object.defineProperty(stylisPluginRSC, 'name', { value: 'stylisPluginRSC' });\n\nexport default stylisPluginRSC;\n","import React from 'react';\nimport { type PipeableStream } from 'react-dom/server';\nimport { SC_ATTR, SC_ATTR_VERSION, SC_VERSION } from '../constants';\nimport StyleSheet from '../sheet';\nimport styledError from '../utils/error';\n\ndeclare const __SERVER__: boolean;\nimport { joinStringArray } from '../utils/joinStrings';\nimport getNonce from '../utils/nonce';\nimport { StyleSheetManager } from './StyleSheetManager';\n\nconst CLOSING_TAG_R = /*#__PURE__*/ /^\\s*<\\/[a-z]/i;\n\nexport default class ServerStyleSheet {\n instance: StyleSheet;\n sealed: boolean;\n\n constructor({ nonce }: { nonce?: string } = {}) {\n this.instance = new StyleSheet({ isServer: true, nonce });\n this.sealed = false;\n }\n\n _emitSheetCSS = (): string => {\n const css = this.instance.toString();\n if (!css) return '';\n const nonce = this.instance.options.nonce || getNonce();\n const attrs = [\n nonce && `nonce=\"${nonce}\"`,\n `${SC_ATTR}=\"true\"`,\n `${SC_ATTR_VERSION}=\"${SC_VERSION}\"`,\n ];\n const htmlAttr = joinStringArray(attrs.filter(Boolean) as string[], ' ');\n\n return `<style ${htmlAttr}>${css}</style>`;\n };\n\n collectStyles(children: any): React.JSX.Element {\n if (this.sealed) {\n throw styledError(2);\n }\n\n return <StyleSheetManager sheet={this.instance}>{children}</StyleSheetManager>;\n }\n\n getStyleTags = (): string => {\n if (this.sealed) {\n throw styledError(2);\n }\n\n return this._emitSheetCSS();\n };\n\n getStyleElement = () => {\n if (this.sealed) {\n throw styledError(2);\n }\n\n const css = this.instance.toString();\n if (!css) return [];\n\n const props = {\n [SC_ATTR]: '',\n [SC_ATTR_VERSION]: SC_VERSION,\n dangerouslySetInnerHTML: {\n __html: css,\n },\n };\n\n const nonce = this.instance.options.nonce || getNonce();\n if (nonce) {\n (props as any).nonce = nonce;\n }\n\n // v4 returned an array for this fn, so we'll do the same for v5 for backward compat\n return [<style {...props} key=\"sc-0-0\" />];\n };\n\n interleaveWithNodeStream(input: NodeJS.ReadableStream | PipeableStream): NodeJS.ReadWriteStream {\n if (!__SERVER__) {\n throw styledError(3);\n } else if (this.sealed) {\n throw styledError(2);\n }\n\n this.seal();\n\n const { Transform } = require('stream');\n const { instance: sheet, _emitSheetCSS } = this;\n\n const transformer: NodeJS.ReadWriteStream = new Transform({\n transform: function appendStyleChunks(\n chunk: string,\n /* encoding */\n _: string,\n callback: Function\n ) {\n const renderedHtml = chunk.toString();\n const html = _emitSheetCSS();\n\n sheet.clearTag();\n\n if (CLOSING_TAG_R.test(renderedHtml)) {\n const endOfClosingTag = renderedHtml.indexOf('>') + 1;\n const before = renderedHtml.slice(0, endOfClosingTag);\n const after = renderedHtml.slice(endOfClosingTag);\n\n this.push(before + html + after);\n } else {\n this.push(html + renderedHtml);\n }\n\n callback();\n },\n });\n\n if ('on' in input && typeof input.on === 'function' && 'pipe' in input) {\n const readableStream = input as NodeJS.ReadableStream;\n readableStream.on('error', err => {\n transformer.emit('error', err);\n });\n return readableStream.pipe(transformer);\n } else if ('pipe' in input && typeof input.pipe === 'function') {\n const pipeableStream = input as PipeableStream;\n return pipeableStream.pipe(transformer);\n } else {\n throw new Error('Unsupported stream type');\n }\n }\n\n seal = (): void => {\n this.sealed = true;\n };\n}\n","import Keyframes from '../models/Keyframes';\nimport { Interpolation, Styles } from '../types';\nimport generateComponentId from '../utils/generateComponentId';\nimport { joinStringArray } from '../utils/joinStrings';\nimport css from './css';\n\n/**\n * Define a CSS `@keyframes` animation with an automatically scoped name.\n *\n * ```tsx\n * const rotate = keyframes`\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * `;\n * const Spinner = styled.div`animation: ${rotate} 1s linear infinite;`;\n * ```\n */\nexport default function keyframes<Props extends object = {}>(\n strings: Styles<Props>,\n ...interpolations: Array<Interpolation<Props>>\n): Keyframes {\n /* Warning if you've used keyframes on React Native */\n if (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n ) {\n console.warn(\n '`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.'\n );\n }\n\n const rules = joinStringArray(css<Props>(strings, ...interpolations) as string[]);\n const name = generateComponentId(rules);\n return new Keyframes(name, rules);\n}\n","import React from 'react';\nimport { IS_RSC } from '../constants';\nimport { ThemeContext } from '../models/ThemeProvider';\nimport { AnyComponent, ExecutionProps } from '../types';\nimport determineTheme from '../utils/determineTheme';\nimport getComponentName from '../utils/getComponentName';\nimport hoist, { NonReactStatics } from '../utils/hoist';\n\ntype WithThemeOuterProps<T extends AnyComponent> = Omit<\n React.ComponentPropsWithRef<T>,\n keyof ExecutionProps\n> &\n ExecutionProps;\n\n/** Higher-order component that injects the current theme as a prop. Prefer `useTheme` in function components. */\nexport default function withTheme<T extends AnyComponent>(\n Component: T\n): React.ForwardRefExoticComponent<\n React.PropsWithoutRef<WithThemeOuterProps<T>> & React.RefAttributes<any>\n> &\n NonReactStatics<T> {\n const WithTheme = React.forwardRef<any, WithThemeOuterProps<T>>((props, ref) => {\n const theme = !IS_RSC ? React.useContext(ThemeContext) : undefined;\n const themeProp = determineTheme(props, theme, Component.defaultProps);\n\n if (process.env.NODE_ENV !== 'production' && themeProp === undefined) {\n console.warn(\n `[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"${getComponentName(\n Component\n )}\"`\n );\n }\n\n return React.createElement(Component, {\n ...props,\n theme: themeProp,\n ref,\n } as React.ComponentPropsWithRef<T>);\n });\n\n WithTheme.displayName = `WithTheme(${getComponentName(Component)})`;\n\n return hoist(WithTheme, Component);\n}\n"],"names":["SC_ATTR","process","env","REACT_APP_SC_ATTR","SC_ATTR_ACTIVE","SC_ATTR_VERSION","SC_VERSION","SPLITTER","IS_BROWSER","window","document","readSpeedyFlag","name","val","undefined","DISABLE_SPEEDY","Boolean","SC_DISABLE_SPEEDY","_b","_a","NODE_ENV","KEYFRAMES_ID_PREFIX","STATIC_EXECUTION_CONTEXT","ERRORS","throwStyledComponentsError","code","interpolations","Error","length","join","args","a","b","c","len","push","forEach","d","replace","format","trim","MAX_SMI","groupIDRegister","Map","reverseRegister","nextFreeGroup","getGroupForId","id","has","get","group","styledError","set","getIdForGroup","setGroupForId","invalidHookCallRe","seen","Set","checkDynamicCreation","displayName","componentId","message","originalConsoleError","console","error","didNotCallInvalidHook","consoleErrorMessage","consoleErrorArgs","test","delete","React","useState","warn","add","EMPTY_ARRAY","Object","freeze","EMPTY_OBJECT","determineTheme","props","providedTheme","defaultProps","theme","escapeRegex","dashesAtEnds","escape","str","AD_REPLACER_R","getAlphabeticChar","String","fromCharCode","generateAlphabeticName","x","Math","abs","SEED","phash","h","i","charCodeAt","hash","generateComponentId","getComponentName","target","isTag","charAt","toLowerCase","generateDisplayName","REACT_MEMO_TYPE","Symbol","for","REACT_FORWARD_REF_TYPE","REACT_STATICS","contextType","getDerivedStateFromError","getDerivedStateFromProps","propTypes","type","KNOWN_STATICS","prototype","caller","callee","arguments","arity","MEMO_STATICS","$$typeof","compare","TYPE_STATICS","render","getStatics","component","object","defineProperty","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","excludelist","inheritedComponent","keys","concat","targetStatics","sourceStatics","key","descriptor","e","isFunction","isStyledComponent","joinStrings","joinStringArray","arr","sep","isPlainObject","constructor","mixinRecursively","source","forceMerge","Array","isArray","setToString","toStringFn","value","DefaultGroupedTag","tag","this","groupSizes","Uint32Array","_cGroup","_cIndex","indexOfGroup","index","insertRules","rules","oldBuffer","oldSize","newSize","ruleIndex","insertedCount","l","insertRule","clearGroup","startIndex","endIndex","deleteRule","getGroup","css","getRule","SELECTOR","MARKER_RE","RegExp","isShadowRoot","node","ShadowRoot","nodeType","getRehydrationContainer","root","getRootNode","rehydrateNamesFromContent","sheet","content","names","split","registerName","rehydrateSheetFromTag","style","parts","textContent","part","marker","match","parseInt","getTag","rehydrateSheet","nodes","options","querySelectorAll","getAttribute","parentNode","removeChild","cached","getNonce","viteMeta","head","querySelector","nonce","scMeta","__webpack_nonce__","makeStyleTag","parent","createElement","prevStyle","from","findLastStyleTag","nextSibling","setAttribute","resolvedNonce","insertBefore","CSSOMTag","element","appendChild","createTextNode","styleSheets","ownerNode","getSheet","rule","_error","cssRules","cssText","TextTag","childNodes","SHOULD_REHYDRATE","defaultOptions","isServer","useCSSOMInjection","StyleSheet","registerId","globalStyles","assign","gs","keyframeIds","server","size","selector","outputSheet","rehydrate","reconstructWithOptions","withNames","newSheet","allocateGSInstance","makeTag","hasNameForId","startsWith","existing","clearNames","clear","clearRules","clearTag","cssTagged","WeakSet","unitless","animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","flex","flexGrow","flexShrink","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","addUnitIfNeeded","isUpper","hyphenateStyleName","string","output","KEYFRAMES_SYMBOL","isKeyframes","isStatelessFunction","isReactComponent","isFalsish","chunk","CLIENT_REFERENCE","isClientReference","warnClientReference","ref","$$id","label","includes","pop","objToCssArray","obj","hasOwnProperty","hyphenate","flatten","executionContext","styleSheet","stylisInstance","result","t","fnResult","styledComponentId","inject","getName","cssArr","toString","ComponentStyle","baseStyle","baseHash","generateAndInjectStyles","stylis","partRule","dynamicNameCache","cacheKey","generateName","oldest","next","cssFormatted","AMP_REGEX","SLASH","isEscaped","backslashes","sanitizeBraces","declStart","braceDepth","inString","inComment","imbalanced","skipEnd","skipCode","substring","recursivelySetNamespace","compiled","namespace","replaceAll","newProps","j","children","createStylisInstance","plugins","_componentId","_selector","_selectorRegexp","selfReferenceReplacer","offset","endsWith","middlewares","slice","RULESET","prefix","prefixer","stringify","_stack","_middleware","middleware","rulesheet","stringifyRules","flatCSS","hasLineComments","indexOf","hasCloseBrace","out","start","parenDepth","modified","preprocessCSS","compile","serialize","o","throwStyledError","mainSheet","mainStylis","StyleSheetContext","createContext","shouldForwardProp","stylisPlugins","StyleSheetConsumer","Consumer","useStyleSheetContext","default","useContext","StyleSheetManager","parentContext","resolvedStyleSheet","useMemo","disableCSSOMInjection","enableVendorPrefixes","resolvedPlugins","_c","styleSheetContextValue","Provider","ThemeContext","ThemeConsumer","hasOwn","identifiers","generateId","parentComponentId","seenUnknownProps","createStyledComponent","isTargetStyledComp","styledComponentTarget","isCompositeComponent","attrs","finalAttrs","filter","shouldForwardPropFn","passedShouldForwardPropFn","prop","elementToBeCreated","componentStyle","forwardRefRender","forwardedComponent","forwardedRef","componentAttrs","foldedComponentIds","contextTheme","ssc","useDebugValue","context","generatedClassName","renderCacheRef","useRef","prev","current","prevKeyCount","nextKeyCount","call","shallowEqualContext","className","needsCopy","attrDef","resolvedAttrDef","resolveContext","resolvedAttrs","useInjectedStyle","propsKeyCount","warnTooManyClasses","as","propsForElement","forwardedAs","isPropValid","buildPropsForElement","classString","useStyledComponentImpl","WrappedStyledComponent","forwardRef","_foldedDefaultProps","sources","merge","generatedClasses","warningSeen","createWarnTooManyClasses","hoist","domElements","interleave","strings","addTag","arg","styles","styleStringArray","constructWithOptions","componentConstructor","templateFunction","initialStyles","withConfig","config","baseStyled","styled","domElement","GlobalStyle","instanceRules","isStatic","isStaticRules","removeStyles","instance","rebuildGroup","renderStyles","computeRules","entry","same","values","createGlobalStyle","JSON","globalStyle","GlobalStyleComponent","instanceRef","Children","count","some","effectDeps","prevGlobalStyleRef","useLayoutEffect","memo","walkTheme","varPrefix","leafFn","path","fullPath","nested","emitVarDeclarations","shape","shapeVal","themeVal","Keyframes","resolvedName","__PRIVATE__","navigator","product","windowGlobalKey","CHILD_RE","EXCLUDE","STYLE_TAG","rewriteSelector","lastIndex","_match","first","last","only","nth","nthArgs","nthLast","nthLastArgs","expandAdjacentSibling","bracketDepth","ch","before","after","_emitSheetCSS","getStyleTags","sealed","getStyleElement","dangerouslySetInnerHTML","__html","seal","collectStyles","interleaveWithNodeStream","input","outerTheme","themeContext","mergedTheme","mergeTheme","defaultTheme","pfx","sel","varNames","buildVarNames","varRefs","depth","buildVarRefs","p","raw","vars","resolve","el","documentElement","getPropertyValue","resolveVars","getComputedStyle","rewritten","Component","WithTheme","themeProp"],"mappings":"uiBAKO,MAAMA,EACS,oBAAZC,cACiB,IAAhBA,QAAQC,MACdD,QAAQC,IAAIC,mBAAqBF,QAAQC,IAAIF,UAChD,cAEWI,EAAiB,SACjBC,EAAkB,sBAClBC,EAAa,QACbC,EAAW,YAEXC,EAA+B,oBAAXC,QAA8C,oBAAbC,SAWlE,SAASC,EAAeC,GACtB,GAAuB,oBAAZX,cAAkD,IAAhBA,QAAQC,IAAqB,CACxE,MAAMW,EAAMZ,QAAQC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