@jasonshimmy/custom-elements-runtime 3.4.0 → 3.6.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.
Files changed (106) hide show
  1. package/README.md +28 -7
  2. package/dist/css-utils-Bn-dO44e.js +203 -0
  3. package/dist/{css-utils-CC43BbEy.js.map → css-utils-Bn-dO44e.js.map} +1 -1
  4. package/dist/{css-utils-CC43BbEy.js → css-utils-CFeP8SK1.cjs} +5 -71
  5. package/dist/{css-utils-mgjmH8qX.cjs.map → css-utils-CFeP8SK1.cjs.map} +1 -1
  6. package/dist/custom-elements-runtime.cjs.js +3 -4
  7. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  8. package/dist/custom-elements-runtime.colors.cjs.js +1 -2
  9. package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
  10. package/dist/custom-elements-runtime.colors.es.js +277 -277
  11. package/dist/custom-elements-runtime.colors.es.js.map +1 -1
  12. package/dist/custom-elements-runtime.directive-enhancements.cjs.js +1 -2
  13. package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
  14. package/dist/custom-elements-runtime.directive-enhancements.es.js +106 -122
  15. package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
  16. package/dist/custom-elements-runtime.directives.cjs.js +1 -2
  17. package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
  18. package/dist/custom-elements-runtime.directives.es.js +60 -65
  19. package/dist/custom-elements-runtime.directives.es.js.map +1 -1
  20. package/dist/custom-elements-runtime.dom-jit-css.cjs.js +1 -7
  21. package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
  22. package/dist/custom-elements-runtime.dom-jit-css.es.js +103 -115
  23. package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
  24. package/dist/custom-elements-runtime.es.js +206 -253
  25. package/dist/custom-elements-runtime.es.js.map +1 -1
  26. package/dist/custom-elements-runtime.event-bus.cjs.js +1 -2
  27. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
  28. package/dist/custom-elements-runtime.event-bus.es.js +102 -108
  29. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
  30. package/dist/custom-elements-runtime.jit-css.cjs.js +1 -2
  31. package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
  32. package/dist/custom-elements-runtime.jit-css.es.js +14 -32
  33. package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
  34. package/dist/custom-elements-runtime.router.cjs.js +20 -21
  35. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  36. package/dist/custom-elements-runtime.router.es.js +866 -926
  37. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  38. package/dist/custom-elements-runtime.ssr-middleware.cjs.js +3 -4
  39. package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
  40. package/dist/custom-elements-runtime.ssr-middleware.es.js +67 -73
  41. package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
  42. package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
  43. package/dist/custom-elements-runtime.ssr.es.js +3 -14
  44. package/dist/custom-elements-runtime.store.cjs.js +1 -2
  45. package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
  46. package/dist/custom-elements-runtime.store.es.js +32 -33
  47. package/dist/custom-elements-runtime.store.es.js.map +1 -1
  48. package/dist/custom-elements-runtime.transitions.cjs.js +1 -2
  49. package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
  50. package/dist/custom-elements-runtime.transitions.es.js +200 -210
  51. package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
  52. package/dist/custom-elements-runtime.vite-plugin.cjs.js +4 -2
  53. package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
  54. package/dist/custom-elements-runtime.vite-plugin.es.js +155 -78
  55. package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
  56. package/dist/helpers-7zLtbh_q.cjs +5 -0
  57. package/dist/helpers-7zLtbh_q.cjs.map +1 -0
  58. package/dist/helpers-kOWgceUQ.js +696 -0
  59. package/dist/helpers-kOWgceUQ.js.map +1 -0
  60. package/dist/hooks-BY_35J9Y.cjs +2 -0
  61. package/dist/hooks-BY_35J9Y.cjs.map +1 -0
  62. package/dist/hooks-Dj1xwqpK.js +407 -0
  63. package/dist/hooks-Dj1xwqpK.js.map +1 -0
  64. package/dist/logger-DIJ0UH3R.js +36 -0
  65. package/dist/{logger-L25axmB-.js.map → logger-DIJ0UH3R.js.map} +1 -1
  66. package/dist/logger-Dkht1dCX.cjs +2 -0
  67. package/dist/{logger-BYIN7ysT.cjs.map → logger-Dkht1dCX.cjs.map} +1 -1
  68. package/dist/namespace-helpers-CIUkG8Mn.js +56 -0
  69. package/dist/{namespace-helpers-BucDdgz_.js.map → namespace-helpers-CIUkG8Mn.js.map} +1 -1
  70. package/dist/namespace-helpers-yYIb7INq.cjs +2 -0
  71. package/dist/{namespace-helpers-Bf7rm9JV.cjs.map → namespace-helpers-yYIb7INq.cjs.map} +1 -1
  72. package/dist/runtime/tag-utils.d.ts +11 -0
  73. package/dist/ssr-Bg9jYXYv.js +171 -0
  74. package/dist/{ssr-H9GDwbTy.js.map → ssr-Bg9jYXYv.js.map} +1 -1
  75. package/dist/ssr-CucZ-Iwz.cjs +4 -0
  76. package/dist/{ssr-DRsGduIK.cjs.map → ssr-CucZ-Iwz.cjs.map} +1 -1
  77. package/dist/ssr.d.ts +2 -0
  78. package/dist/style-A8l3aQ52.cjs +55 -0
  79. package/dist/{style-Bjn8zDiZ.cjs.map → style-A8l3aQ52.cjs.map} +1 -1
  80. package/dist/style-DSSoCbC9.js +1877 -0
  81. package/dist/{style-DuDoj_xK.js.map → style-DSSoCbC9.js.map} +1 -1
  82. package/dist/tag-utils-Dg0vRKq9.js +10 -0
  83. package/dist/tag-utils-Dg0vRKq9.js.map +1 -0
  84. package/dist/tag-utils-ZOoyzCm9.cjs +2 -0
  85. package/dist/tag-utils-ZOoyzCm9.cjs.map +1 -0
  86. package/dist/template-compiler-BJRZoRzZ.js +3044 -0
  87. package/dist/{template-compiler-Cs5axmn4.js.map → template-compiler-BJRZoRzZ.js.map} +1 -1
  88. package/dist/template-compiler-C0SkzB_f.cjs +19 -0
  89. package/dist/{template-compiler-BB4JJdqk.cjs.map → template-compiler-C0SkzB_f.cjs.map} +1 -1
  90. package/dist/vite-plugin.d.ts +96 -2
  91. package/package.json +8 -8
  92. package/dist/css-utils-mgjmH8qX.cjs +0 -577
  93. package/dist/hooks-_3xP4G2N.js +0 -1189
  94. package/dist/hooks-_3xP4G2N.js.map +0 -1
  95. package/dist/hooks-fYQgZk2g.cjs +0 -7
  96. package/dist/hooks-fYQgZk2g.cjs.map +0 -1
  97. package/dist/logger-BYIN7ysT.cjs +0 -3
  98. package/dist/logger-L25axmB-.js +0 -41
  99. package/dist/namespace-helpers-Bf7rm9JV.cjs +0 -3
  100. package/dist/namespace-helpers-BucDdgz_.js +0 -61
  101. package/dist/ssr-DRsGduIK.cjs +0 -5
  102. package/dist/ssr-H9GDwbTy.js +0 -172
  103. package/dist/style-Bjn8zDiZ.cjs +0 -56
  104. package/dist/style-DuDoj_xK.js +0 -1972
  105. package/dist/template-compiler-BB4JJdqk.cjs +0 -23
  106. package/dist/template-compiler-Cs5axmn4.js +0 -3236
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-DRsGduIK.cjs","names":[],"sources":["../src/lib/runtime/ssr-utils.ts","../src/lib/runtime/vdom-ssr.ts","../src/lib/runtime/vdom-ssr-dsd.ts","../src/lib/ssr.ts"],"sourcesContent":["/**\n * Shared utilities for SSR renderers.\n * Imported by vdom-ssr.ts and vdom-ssr-dsd.ts to avoid duplication.\n */\nimport { escapeHTML } from './helpers';\nimport { TAG_NAMESPACE_MAP, SVG_NS } from './namespace-helpers';\n\nexport type RenderOptions = {\n /** Backwards-compatible: whether to inject the SVG namespace on <svg> nodes (default true) */\n injectSvgNamespace?: boolean;\n /** Inject known well-known namespaces for tags like <math> when missing (default follows injectSvgNamespace) */\n injectKnownNamespaces?: boolean;\n};\n\nexport const VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nexport function buildAttrs(\n attrs: Record<string, unknown>,\n tag: string,\n opts: RenderOptions,\n): string {\n const inject = opts.injectSvgNamespace ?? true;\n const injectKnown = opts.injectKnownNamespaces ?? inject;\n const merged = { ...attrs };\n\n if (inject && tag === 'svg' && !('xmlns' in merged)) {\n merged['xmlns'] = SVG_NS;\n } else if (injectKnown && tag in TAG_NAMESPACE_MAP && !('xmlns' in merged)) {\n merged['xmlns'] = TAG_NAMESPACE_MAP[tag];\n }\n\n return Object.entries(merged)\n .map(([k, v]) => ` ${k}=\"${escapeHTML(String(v))}\"`)\n .join('');\n}\n\nexport function buildRawAttrs(attrs: Record<string, unknown>): string {\n return Object.entries(attrs)\n .map(([k, v]) => ` ${k}=\"${escapeHTML(String(v))}\"`)\n .join('');\n}\n","import type { VNode } from './types';\nimport { escapeHTML } from './helpers';\nimport { VOID_ELEMENTS, buildAttrs, type RenderOptions } from './ssr-utils';\n\n/**\n * Render a VNode to a string (SSR).\n * Kept intentionally minimal: only serializes attributes under `props.attrs`\n * to avoid leaking runtime-only values (functions, reactive state, directives).\n * @param vnode The virtual node to render.\n * @returns The rendered HTML string.\n */\nexport type { RenderOptions } from './ssr-utils';\n\nexport function renderToString(vnode: VNode, opts?: RenderOptions): string {\n if (typeof vnode === 'string') return escapeHTML(vnode) as string;\n\n if (vnode.tag === '#text') {\n return typeof vnode.children === 'string'\n ? (escapeHTML(vnode.children) as string)\n : '';\n }\n\n if (vnode.tag === '#anchor') {\n // Preserve meaningful falsy children (0, false, '') while filtering out\n // only null and undefined. Anchor blocks are normalized by the compiler\n // to exclude null/undefined; SSR should follow the same rule to avoid\n // hydration mismatches where falsy values are significant.\n const children = Array.isArray(vnode.children)\n ? vnode.children.filter((c) => c !== null && c !== undefined)\n : [];\n return children.map((c) => renderToString(c, opts)).join('');\n }\n\n if (vnode.tag === '#raw') {\n return typeof vnode.children === 'string' ? vnode.children : '';\n }\n\n // Collect attributes from props.attrs. For SSR we mirror vnode.attrs\n // but ensure SVG nodes behave like client-side: if this is an <svg>\n // and no xmlns was provided, inject the standard SVG namespace so\n // server markup matches client-created DOM namespace.\n const attrsObj: Record<string, unknown> = vnode.props?.attrs\n ? { ...vnode.props.attrs }\n : {};\n\n const attrsString = buildAttrs(attrsObj, vnode.tag, opts ?? {});\n\n // Handle void elements (self-closing tags)\n if (VOID_ELEMENTS.has(vnode.tag)) {\n return `<${vnode.tag}${attrsString}>`;\n }\n\n const children = Array.isArray(vnode.children)\n ? vnode.children\n .filter((c) => c !== null && c !== undefined)\n .map((c) => renderToString(c, opts))\n .join('')\n : typeof vnode.children === 'string'\n ? escapeHTML(vnode.children)\n : vnode.children\n ? renderToString(vnode.children, opts)\n : '';\n\n return `<${vnode.tag}${attrsString}>${children}</${vnode.tag}>`;\n}\n","/**\n * Declarative Shadow DOM (DSD) SSR renderer.\n *\n * When `dsd: true` is passed to the render options, registered custom elements\n * are serialised as:\n *\n * ```html\n * <my-element attr=\"val\">\n * <template shadowrootmode=\"open\">\n * <style>\n * /* baseReset + useStyle() output + JIT utility CSS *\\/\n * </style>\n * <!-- shadow DOM from component render function -->\n * </template>\n * <!-- light DOM / slotted children from vnode.children -->\n * </my-element>\n * ```\n *\n * The browser parses the `<template shadowrootmode=\"open\">` block and attaches\n * a real shadow root before any JavaScript executes. All CSS layers are present\n * at first paint — eliminating both FOUC and layout shift.\n *\n * Non-custom-element VNodes are rendered identically to renderToString() but\n * with DSD recursion active for any custom elements nested inside them.\n */\n\nimport type { VNode } from './types';\nimport { renderToString } from './vdom-ssr';\nimport { VOID_ELEMENTS, buildAttrs, buildRawAttrs, type RenderOptions } from './ssr-utils';\nimport { registry } from './component/registry';\nimport { runComponentSSRRender } from './ssr-context';\nimport { jitCSS } from './style';\nimport { baseReset, minifyCSS } from './css-utils';\nimport { escapeHTML } from './helpers';\nimport { devWarn } from './logger';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type DSDRenderOptions = RenderOptions & {\n /**\n * Emit Declarative Shadow DOM output for registered custom elements.\n * Shadow content is serialised inside `<template shadowrootmode=\"open\">`,\n * with a complete CSS layer stack (`baseReset` + `useStyle` + JIT CSS)\n * injected as a `<style>` block so styles are available at first paint.\n * @default false\n */\n dsd?: boolean;\n /**\n * Append the DSD polyfill `<script>` for browsers without native support\n * (Firefox < 123). Only meaningful when `dsd` is true.\n * @default true\n */\n dsdPolyfill?: boolean;\n /**\n * Router instance to thread through each component's SSR context.\n *\n * When provided, `router-view` reads the current route from this instance\n * instead of the module-level `activeRouterProxy` singleton, making\n * concurrent SSR renders safe — each request carries its own router with\n * its own URL state.\n *\n * In browser mode this option is ignored; components always use\n * `activeRouterProxy` there.\n */\n router?: unknown;\n};\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/**\n * @internal\n * Minified DSD polyfill for browsers without native Declarative Shadow DOM.\n * Processes all `<template shadowrootmode>` elements synchronously.\n */\nexport const DSD_POLYFILL_SCRIPT =\n '<script>(function(){' +\n \"if(HTMLTemplateElement.prototype.hasOwnProperty('shadowRootMode'))return;\" +\n \"document.querySelectorAll('template[shadowrootmode]').forEach(function(t){\" +\n \"var m=t.getAttribute('shadowrootmode');\" +\n 'var s=t.parentElement.attachShadow({mode:m});' +\n 's.appendChild(t.content);t.remove();' +\n '});})()' +\n '</script>';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction isRegisteredCustomElement(tag: string): boolean {\n return tag.includes('-') && registry.has(tag);\n}\n\n/**\n * Build the combined `<style>` block for a shadow root.\n *\n * Layer order (matches the runtime adoptedStyleSheets order):\n * 1. baseReset — global reset + CSS custom properties\n * 2. useStyle() output — component-defined rules (:host, ::slotted, etc.)\n * 3. JIT CSS — utility classes extracted from the shadow HTML\n */\nexport function buildShadowStyleBlock(\n useStyleCSS: string,\n shadowHTML: string,\n): string {\n const parts: string[] = [baseReset];\n\n if (useStyleCSS.trim()) {\n parts.push(useStyleCSS);\n }\n\n const jit = jitCSS(shadowHTML);\n if (jit.trim()) {\n parts.push(jit);\n }\n\n const combined = minifyCSS(parts.join('\\n'));\n return combined ? `<style>${combined}</style>` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Streaming async component collector\n// ---------------------------------------------------------------------------\n\nexport interface AsyncStreamEntry {\n id: string;\n tag: string;\n attrsString: string;\n hydrateAttr: string;\n useStyleCSS: string;\n lightDOM: string;\n opts: DSDRenderOptions;\n promise: Promise<VNode | VNode[]>;\n /** Router threaded from the originating render pass — propagated to async re-renders. */\n router?: unknown;\n}\n\nlet _streamingCollector: AsyncStreamEntry[] | null = null;\nlet _streamingCounter = 0;\n\n/** @internal Called by renderToStream() before the sync render pass. */\nexport function beginStreamingCollection(collector: AsyncStreamEntry[]): void {\n _streamingCollector = collector;\n _streamingCounter = 0;\n}\n\n/** @internal Called by renderToStream() after the sync render pass. */\nexport function endStreamingCollection(): void {\n _streamingCollector = null;\n}\n\n// ---------------------------------------------------------------------------\n// Core renderer\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to an HTML string with Declarative Shadow DOM output\n * for all registered custom elements encountered in the tree.\n */\nexport function renderToDSD(vnode: VNode, opts: DSDRenderOptions): string {\n if (!opts.dsd) {\n return renderToString(vnode, opts);\n }\n\n // Primitive string nodes\n if (typeof vnode === 'string') {\n return escapeHTML(vnode) as string;\n }\n\n const tag = (vnode as VNode).tag;\n\n // Special virtual node types — delegate entirely to the base renderer\n if (tag === '#text' || tag === '#anchor' || tag === '#raw') {\n return renderToString(vnode, opts);\n }\n\n // Custom element — emit DSD wrapper\n if (isRegisteredCustomElement(tag)) {\n return renderCustomElementDSD(vnode, opts);\n }\n\n // Regular element — recurse with DSD mode on\n const attrsObj: Record<string, unknown> = vnode.props?.attrs\n ? { ...vnode.props.attrs }\n : {};\n\n const attrsString = buildAttrs(attrsObj, tag, opts);\n\n if (VOID_ELEMENTS.has(tag)) {\n return `<${tag}${attrsString}>`;\n }\n\n const children = renderChildrenDSD(vnode.children, opts);\n return `<${tag}${attrsString}>${children}</${tag}>`;\n}\n\nfunction renderCustomElementDSD(vnode: VNode, opts: DSDRenderOptions): string {\n const tag = vnode.tag;\n const config = registry.get(tag);\n\n // Build the plain attribute string (no namespace injection for custom elements)\n const rawAttrs = vnode.props?.attrs ?? {};\n const attrsString = buildRawAttrs(rawAttrs);\n\n // Move the null check BEFORE reading config.* properties for clarity.\n if (!config) {\n // Component not in registry on server (e.g. dynamic import not yet run).\n // Emit a shell with an empty DSD template so the client hydrates normally.\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n return `<${tag}${attrsString}><template shadowrootmode=\"open\"></template>${lightDOM}</${tag}>`;\n }\n\n // Emit data-cer-hydrate when a non-default strategy is configured.\n // 'load' is the default and doesn't need to be serialised.\n const hydrateStrategy = config.hydrate;\n const hydrateAttr =\n hydrateStrategy && hydrateStrategy !== 'load'\n ? ` data-cer-hydrate=\"${hydrateStrategy}\"`\n : '';\n\n // Run the component's render function in a minimal SSR context to get the\n // shadow DOM VNode tree and capture any useStyle() output.\n const { shadowVNode, useStyleCSS, asyncPromise } = runComponentSSRRender(config, rawAttrs, tag, opts.router);\n\n // When streaming and this component has an async render, emit a placeholder\n // and register the promise for later resolution.\n if (asyncPromise && _streamingCollector === null) {\n devWarn(\n `[SSR] Component \"${tag}\" has an async render function. ` +\n `In standard SSR the shadow DOM will be empty. ` +\n `Use renderToStream() for incremental async component streaming.`,\n );\n }\n if (asyncPromise && _streamingCollector !== null) {\n const id = `cer-stream-${_streamingCounter++}`;\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n _streamingCollector.push({\n id,\n tag,\n attrsString,\n hydrateAttr,\n useStyleCSS,\n lightDOM,\n opts,\n promise: asyncPromise,\n router: opts.router,\n });\n return (\n `<${tag} id=\"${id}\"${attrsString}${hydrateAttr}>` +\n `<template shadowrootmode=\"open\"></template>` +\n `${lightDOM}` +\n `</${tag}>`\n );\n }\n\n // Render the shadow DOM VNode tree to HTML (DSD-recursive for nested elements)\n let shadowHTML = '';\n if (shadowVNode !== null && shadowVNode !== undefined) {\n if (Array.isArray(shadowVNode)) {\n shadowHTML = (shadowVNode as VNode[])\n .map((n) => renderToDSD(n, opts))\n .join('');\n } else {\n shadowHTML = renderToDSD(shadowVNode as VNode, opts);\n }\n }\n\n const styleBlock = buildShadowStyleBlock(useStyleCSS, shadowHTML);\n\n // Light DOM children become slotted content — rendered outside the template\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n\n return (\n `<${tag}${attrsString}${hydrateAttr}>` +\n `<template shadowrootmode=\"open\">${styleBlock}${shadowHTML}</template>` +\n `${lightDOM}` +\n `</${tag}>`\n );\n}\n\nfunction renderChildrenDSD(\n children: VNode['children'],\n opts: DSDRenderOptions,\n): string {\n if (!children) return '';\n if (typeof children === 'string') return escapeHTML(children) as string;\n if (Array.isArray(children)) {\n return children\n .filter((c) => c !== null && c !== undefined)\n .map((c) => renderToDSD(c as VNode, opts))\n .join('');\n }\n return renderToDSD(children as VNode, opts);\n}\n\n// ---------------------------------------------------------------------------\n// Public entry points\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to a DSD HTML string and optionally append the\n * DSD polyfill script for older browsers.\n */\nexport function renderToStringDSD(\n vnode: VNode,\n opts?: DSDRenderOptions,\n): string {\n const effectiveOpts: DSDRenderOptions = { dsd: true, ...opts };\n const html = renderToDSD(vnode, effectiveOpts);\n\n if (effectiveOpts.dsdPolyfill !== false) {\n // Inject polyfill before </body> if present, otherwise append\n if (html.includes('</body>')) {\n return html.replace('</body>', `${DSD_POLYFILL_SCRIPT}</body>`);\n }\n return html + DSD_POLYFILL_SCRIPT;\n }\n\n return html;\n}\n","/**\n * SSR entry point — import from `@jasonshimmy/custom-elements-runtime/ssr`.\n *\n * Provides four rendering modes:\n *\n * 1. **renderToString** — baseline HTML serialisation (no shadow DOM content).\n * Backwards-compatible with the original API.\n *\n * 2. **renderToStringWithJITCSS** — HTML + pre-generated JIT CSS injected into\n * `<head>` to prevent FOUC. Supports `dsd: true` for DSD output.\n *\n * 3. **renderToStringWithJITCSSDSD** — convenience alias for DSD mode.\n * Full Declarative Shadow DOM output with per-shadow-root CSS layer stack\n * (baseReset + useStyle() + JIT CSS). Enables true hydration, zero FOUC.\n *\n * 4. **renderToStream** — ReadableStream variant for streaming SSR.\n *\n * 5. **renderToStreamWithJITCSSDSD** — convenience alias for streaming DSD mode.\n * Equivalent to `renderToStream(vnode, { dsd: true, ...options })`.\n * Recommended for new server-rendered applications that want true incremental\n * streaming with Declarative Shadow DOM and zero FOUC.\n *\n * Entity map utilities are also exported for full HTML5 named-entity support.\n *\n * @example DSD usage (recommended)\n * ```ts\n * import { renderToStringWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * const { htmlWithStyles } = renderToStringWithJITCSSDSD(appVNode, {\n * jit: { extendedColors: true },\n * });\n * res.send(`<!DOCTYPE html><html><head>${head}</head><body>${htmlWithStyles}</body></html>`);\n * ```\n */\n\n// ---------------------------------------------------------------------------\n// Re-exports — backwards-compatible\n// ---------------------------------------------------------------------------\n\nexport { renderToString } from './runtime/vdom-ssr';\nexport type { VNode } from './runtime/types';\nexport type { RenderOptions } from './runtime/vdom-ssr';\n\nexport {\n registerEntityMap,\n loadEntityMap,\n clearRegisteredEntityMap,\n} from './runtime/helpers';\n\nexport {\n renderToStringDSD,\n DSD_POLYFILL_SCRIPT,\n} from './runtime/vdom-ssr-dsd';\nexport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\n\n// ---------------------------------------------------------------------------\n// Internal imports\n// ---------------------------------------------------------------------------\n\nimport { renderToString as _render } from './runtime/vdom-ssr';\nimport {\n renderToStringDSD as _renderToStringDSD,\n renderToDSD,\n buildShadowStyleBlock,\n beginStreamingCollection,\n endStreamingCollection,\n DSD_POLYFILL_SCRIPT,\n type AsyncStreamEntry,\n} from './runtime/vdom-ssr-dsd';\nimport { jitCSS, enableJITCSS, type JITCSSOptions } from './runtime/style';\nimport type { VNode } from './runtime/types';\nimport type { RenderOptions } from './runtime/vdom-ssr';\nimport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\nimport {\n beginSSRGlobalStyleCollection,\n endSSRGlobalStyleCollection,\n} from './runtime/ssr-context';\n\n// ---------------------------------------------------------------------------\n// Result type\n// ---------------------------------------------------------------------------\n\n/**\n * Result of `renderToStringWithJITCSS()` and `renderToStringWithJITCSSDSD()`.\n */\nexport interface SSRJITResult {\n /** The rendered HTML string (styles not yet injected). */\n html: string;\n /**\n * Global JIT CSS extracted from the rendered HTML.\n * For DSD renders, each shadow root embeds its own scoped styles; this field\n * holds any residual light-DOM utility CSS.\n */\n css: string;\n /**\n * CSS captured from `useGlobalStyle()` calls during this render pass\n * (e.g. `@font-face`, `:root` custom properties).\n * Inject in a `<style id=\"cer-ssr-global\">` in `<head>`.\n */\n globalStyles: string;\n /**\n * Convenience: `html` with both `<style>` tags injected before `</head>`.\n * If no `</head>` is found, the styles are prepended.\n */\n htmlWithStyles: string;\n}\n\n// ---------------------------------------------------------------------------\n// renderToStringWithJITCSS — primary API, supports both modes\n// ---------------------------------------------------------------------------\n\n/**\n * Server-side render a VNode tree and simultaneously pre-generate JIT CSS.\n *\n * Pass `dsd: true` to enable Declarative Shadow DOM output with full per-shadow-\n * root CSS layer extraction (recommended for new apps).\n *\n * @example Standard (no DSD)\n * ```ts\n * const { htmlWithStyles } = renderToStringWithJITCSS(appVNode);\n * ```\n *\n * @example With DSD\n * ```ts\n * const { htmlWithStyles } = renderToStringWithJITCSS(appVNode, {\n * dsd: true,\n * jit: { extendedColors: true },\n * });\n * ```\n */\nexport function renderToStringWithJITCSS(\n vnode: VNode,\n options?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n): SSRJITResult {\n const { jit, dsd, dsdPolyfill, ...renderOptions } = options ?? {};\n\n if (jit) enableJITCSS(jit);\n\n beginSSRGlobalStyleCollection();\n\n let html!: string;\n let globalStylesCaptured!: string[];\n try {\n if (dsd) {\n // renderToStringDSD handles DSD wrapping but skips the polyfill so we can\n // place it correctly relative to other injected style tags below.\n html = _renderToStringDSD(vnode, {\n ...renderOptions,\n dsd: true,\n dsdPolyfill: false,\n });\n } else {\n html = _render(vnode, renderOptions);\n }\n } finally {\n // Always end collection — even when the render throws — so the collector\n // is never left non-null, which would cause subsequent non-SSR\n // useGlobalStyle() calls to silently skip DOM injection.\n globalStylesCaptured = endSSRGlobalStyleCollection();\n }\n\n const css = jitCSS(html);\n const globalStyles = globalStylesCaptured.join('\\n');\n\n const styleTags: string[] = [];\n if (css) styleTags.push(`<style id=\"cer-ssr-jit\">${css}</style>`);\n if (globalStyles.trim())\n styleTags.push(`<style id=\"cer-ssr-global\">${globalStyles}</style>`);\n\n let htmlWithStyles = html;\n if (styleTags.length) {\n const injection = styleTags.join('');\n htmlWithStyles = html.includes('</head>')\n ? html.replace('</head>', `${injection}</head>`)\n : `${injection}${html}`;\n }\n\n // Append DSD polyfill script inside </body> when in DSD mode\n if (dsd && dsdPolyfill !== false) {\n htmlWithStyles = htmlWithStyles.includes('</body>')\n ? htmlWithStyles.replace('</body>', `${DSD_POLYFILL_SCRIPT}</body>`)\n : htmlWithStyles + DSD_POLYFILL_SCRIPT;\n }\n\n return { html, css, globalStyles, htmlWithStyles };\n}\n\n// ---------------------------------------------------------------------------\n// renderToStringWithJITCSSDSD — convenience alias\n// ---------------------------------------------------------------------------\n\n/**\n * Convenience alias: `renderToStringWithJITCSS(vnode, { dsd: true, ...options })`.\n *\n * Renders with Declarative Shadow DOM output, full per-shadow-root CSS layer\n * extraction, and the DSD browser polyfill. This is the recommended function\n * for all new server-rendered applications.\n *\n * @example\n * ```ts\n * import { renderToStringWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * const { htmlWithStyles } = renderToStringWithJITCSSDSD(appVNode, {\n * jit: { extendedColors: true },\n * });\n * ```\n */\nexport function renderToStringWithJITCSSDSD(\n vnode: VNode,\n options?: Omit<\n RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n 'dsd'\n >,\n): SSRJITResult {\n return renderToStringWithJITCSS(vnode, { ...options, dsd: true });\n}\n\n// ---------------------------------------------------------------------------\n// renderToStream — streaming SSR\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to a `ReadableStream<string>`.\n *\n * Supports true incremental streaming: synchronous components are flushed as\n * the first chunk, then each async component's resolved output is streamed as\n * an inline swap `<script>` that fills the placeholder's shadow root.\n *\n * @example Node.js\n * ```ts\n * import { renderToStream } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * app.get('/', (req, res) => {\n * const stream = renderToStream(appVNode, { dsd: true });\n * const reader = stream.getReader();\n * const pump = () =>\n * reader.read().then(({ value, done }) => {\n * if (done) { res.end(); return; }\n * res.write(value);\n * pump();\n * });\n * pump();\n * });\n * ```\n */\nexport function renderToStream(\n vnode: VNode,\n options?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n): ReadableStream<string> {\n return new ReadableStream<string>({\n async start(controller) {\n const asyncEntries: AsyncStreamEntry[] = [];\n beginStreamingCollection(asyncEntries);\n\n try {\n const { htmlWithStyles } = renderToStringWithJITCSS(vnode, options);\n controller.enqueue(htmlWithStyles);\n } catch (err) {\n controller.error(err);\n return;\n } finally {\n endStreamingCollection();\n }\n\n // Resolve async components and stream swap scripts as they settle.\n // Each resolved component replaces its placeholder via an inline script.\n for (const entry of asyncEntries) {\n try {\n const resolvedVNodes = await entry.promise;\n const shadowHTML = Array.isArray(resolvedVNodes)\n ? (resolvedVNodes as VNode[]).map((n) => renderToDSD(n, entry.opts)).join('')\n : renderToDSD(resolvedVNodes as VNode, entry.opts);\n const styleBlock = buildShadowStyleBlock(entry.useStyleCSS, shadowHTML);\n const shadowContent = `${styleBlock}${shadowHTML}`;\n controller.enqueue(\n `<script>(function(){` +\n `var e=document.getElementById(${JSON.stringify(entry.id)});` +\n `if(!e)return;` +\n // The placeholder already has an empty shadow root attached (native DSD or polyfill).\n // If for some reason it doesn't, attach one now.\n `var s=e.shadowRoot;` +\n `if(!s&&e.attachShadow)try{s=e.attachShadow({mode:'open'});}catch(_){};` +\n `if(s)s.innerHTML=${JSON.stringify(shadowContent)};` +\n `e.removeAttribute('id');` +\n `})();</script>`,\n );\n } catch {\n // Async render failed — leave placeholder for client hydration.\n }\n }\n\n controller.close();\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// renderToStreamWithJITCSSDSD — convenience alias\n// ---------------------------------------------------------------------------\n\n/**\n * Convenience alias: `renderToStream(vnode, { dsd: true, ...options })`.\n *\n * Renders with Declarative Shadow DOM output and full JIT CSS extraction,\n * streaming the synchronous render as the first chunk and each resolved async\n * component as a subsequent inline-script swap. This is the recommended\n * function for all new server-rendered applications.\n *\n * @example\n * ```ts\n * import { renderToStreamWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * app.get('/', (req, res) => {\n * const stream = renderToStreamWithJITCSSDSD(appVNode, { router });\n * const reader = stream.getReader();\n * const pump = () =>\n * reader.read().then(({ value, done }) => {\n * if (done) { res.end(); return; }\n * res.write(value);\n * pump();\n * });\n * pump();\n * });\n * ```\n */\nexport function renderToStreamWithJITCSSDSD(\n vnode: VNode,\n options?: Omit<\n RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n 'dsd'\n >,\n): ReadableStream<string> {\n return renderToStream(vnode, { ...options, dsd: true });\n}\n"],"mappings":"iMAcA,IAAa,EAAgB,IAAI,IAAI,CACnC,OACA,OACA,KACA,MACA,QACA,KACA,MACA,QACA,OACA,OACA,QACA,SACA,QACA,MACD,EAED,SAAgB,EACd,EACA,EACA,EACQ,CACR,MAAM,EAAS,EAAK,oBAAsB,GACpC,EAAc,EAAK,uBAAyB,EAC5C,EAAS,CAAE,GAAG,CAAA,E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E,KAAA,EAAM,IAAA,EAAK,aAAA,EAAc,eAAA,GAuBpC,SAAgB,EACd,EACA,EAIc,CACd,OAAO,EAAyB,EAAO,CAAE,GAAG,EAAS,IAAK,GAAM,EA+BlE,SAAgB,EACd,EACA,EACwB,CACxB,OAAO,IAAI,eAAuB,CAChC,MAAM,MAAM,EAAY,CACtB,MAAM,EAAmC,CAAA,EACzC,EAAyB,CAAA,EAEzB,GAAI,CACF,KAAM,CAAE,eAAA,CAAA,EAAmB,EAAyB,EAAO,CAAA,EAC3D,EAAW,QAAQ,CAAA,QACZ,EAAK,CACZ,EAAW,MAAM,CAAA,EACjB,eAEA,EAAA,EAKF,UAAW,KAAS,EAClB,GAAI,CACF,MAAM,EAAiB,MAAM,EAAM,QAC7B,EAAa,MAAM,QAAQ,CAAA,EAC5B,EAA2B,IAAK,GAAM,EAAY,EAAG,EAAM,IAAA,CAAK,EAAE,KAAK,EAAA,EACxE,EAAY,EAAyB,EAAM,IAAA,EAEzC,EAAgB,GADH,EAAsB,EAAM,YAAa,CAAA,CAAW,GACjC,CAAA,GACtC,EAAW,QACT,qDACmC,KAAK,UAAU,EAAM,EAAA,CAAG,4HAMrC,KAAK,UAAU,CAAA,CAAc,0CAAC,OAIhD,CAAA,CAKV,EAAW,MAAA,GAEd,EAgCH,SAAgB,EACd,EACA,EAIwB,CACxB,OAAO,EAAe,EAAO,CAAE,GAAG,EAAS,IAAK,GAAM"}
1
+ {"version":3,"file":"ssr-CucZ-Iwz.cjs","names":[],"sources":["../src/lib/runtime/ssr-utils.ts","../src/lib/runtime/vdom-ssr.ts","../src/lib/runtime/vdom-ssr-dsd.ts","../src/lib/ssr.ts"],"sourcesContent":["/**\n * Shared utilities for SSR renderers.\n * Imported by vdom-ssr.ts and vdom-ssr-dsd.ts to avoid duplication.\n */\nimport { escapeHTML } from './helpers';\nimport { TAG_NAMESPACE_MAP, SVG_NS } from './namespace-helpers';\n\nexport type RenderOptions = {\n /** Backwards-compatible: whether to inject the SVG namespace on <svg> nodes (default true) */\n injectSvgNamespace?: boolean;\n /** Inject known well-known namespaces for tags like <math> when missing (default follows injectSvgNamespace) */\n injectKnownNamespaces?: boolean;\n};\n\nexport const VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nexport function buildAttrs(\n attrs: Record<string, unknown>,\n tag: string,\n opts: RenderOptions,\n): string {\n const inject = opts.injectSvgNamespace ?? true;\n const injectKnown = opts.injectKnownNamespaces ?? inject;\n const merged = { ...attrs };\n\n if (inject && tag === 'svg' && !('xmlns' in merged)) {\n merged['xmlns'] = SVG_NS;\n } else if (injectKnown && tag in TAG_NAMESPACE_MAP && !('xmlns' in merged)) {\n merged['xmlns'] = TAG_NAMESPACE_MAP[tag];\n }\n\n return Object.entries(merged)\n .map(([k, v]) => ` ${k}=\"${escapeHTML(String(v))}\"`)\n .join('');\n}\n\nexport function buildRawAttrs(attrs: Record<string, unknown>): string {\n return Object.entries(attrs)\n .map(([k, v]) => ` ${k}=\"${escapeHTML(String(v))}\"`)\n .join('');\n}\n","import type { VNode } from './types';\nimport { escapeHTML } from './helpers';\nimport { VOID_ELEMENTS, buildAttrs, type RenderOptions } from './ssr-utils';\n\n/**\n * Render a VNode to a string (SSR).\n * Kept intentionally minimal: only serializes attributes under `props.attrs`\n * to avoid leaking runtime-only values (functions, reactive state, directives).\n * @param vnode The virtual node to render.\n * @returns The rendered HTML string.\n */\nexport type { RenderOptions } from './ssr-utils';\n\nexport function renderToString(vnode: VNode, opts?: RenderOptions): string {\n if (typeof vnode === 'string') return escapeHTML(vnode) as string;\n\n if (vnode.tag === '#text') {\n return typeof vnode.children === 'string'\n ? (escapeHTML(vnode.children) as string)\n : '';\n }\n\n if (vnode.tag === '#anchor') {\n // Preserve meaningful falsy children (0, false, '') while filtering out\n // only null and undefined. Anchor blocks are normalized by the compiler\n // to exclude null/undefined; SSR should follow the same rule to avoid\n // hydration mismatches where falsy values are significant.\n const children = Array.isArray(vnode.children)\n ? vnode.children.filter((c) => c !== null && c !== undefined)\n : [];\n return children.map((c) => renderToString(c, opts)).join('');\n }\n\n if (vnode.tag === '#raw') {\n return typeof vnode.children === 'string' ? vnode.children : '';\n }\n\n // Collect attributes from props.attrs. For SSR we mirror vnode.attrs\n // but ensure SVG nodes behave like client-side: if this is an <svg>\n // and no xmlns was provided, inject the standard SVG namespace so\n // server markup matches client-created DOM namespace.\n const attrsObj: Record<string, unknown> = vnode.props?.attrs\n ? { ...vnode.props.attrs }\n : {};\n\n const attrsString = buildAttrs(attrsObj, vnode.tag, opts ?? {});\n\n // Handle void elements (self-closing tags)\n if (VOID_ELEMENTS.has(vnode.tag)) {\n return `<${vnode.tag}${attrsString}>`;\n }\n\n const children = Array.isArray(vnode.children)\n ? vnode.children\n .filter((c) => c !== null && c !== undefined)\n .map((c) => renderToString(c, opts))\n .join('')\n : typeof vnode.children === 'string'\n ? escapeHTML(vnode.children)\n : vnode.children\n ? renderToString(vnode.children, opts)\n : '';\n\n return `<${vnode.tag}${attrsString}>${children}</${vnode.tag}>`;\n}\n","/**\n * Declarative Shadow DOM (DSD) SSR renderer.\n *\n * When `dsd: true` is passed to the render options, registered custom elements\n * are serialised as:\n *\n * ```html\n * <my-element attr=\"val\">\n * <template shadowrootmode=\"open\">\n * <style>\n * /* baseReset + useStyle() output + JIT utility CSS *\\/\n * </style>\n * <!-- shadow DOM from component render function -->\n * </template>\n * <!-- light DOM / slotted children from vnode.children -->\n * </my-element>\n * ```\n *\n * The browser parses the `<template shadowrootmode=\"open\">` block and attaches\n * a real shadow root before any JavaScript executes. All CSS layers are present\n * at first paint — eliminating both FOUC and layout shift.\n *\n * Non-custom-element VNodes are rendered identically to renderToString() but\n * with DSD recursion active for any custom elements nested inside them.\n */\n\nimport type { VNode } from './types';\nimport { renderToString } from './vdom-ssr';\nimport { VOID_ELEMENTS, buildAttrs, buildRawAttrs, type RenderOptions } from './ssr-utils';\nimport { registry } from './component/registry';\nimport { runComponentSSRRender } from './ssr-context';\nimport { jitCSS } from './style';\nimport { baseReset, minifyCSS } from './css-utils';\nimport { escapeHTML } from './helpers';\nimport { devWarn } from './logger';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type DSDRenderOptions = RenderOptions & {\n /**\n * Emit Declarative Shadow DOM output for registered custom elements.\n * Shadow content is serialised inside `<template shadowrootmode=\"open\">`,\n * with a complete CSS layer stack (`baseReset` + `useStyle` + JIT CSS)\n * injected as a `<style>` block so styles are available at first paint.\n * @default false\n */\n dsd?: boolean;\n /**\n * Append the DSD polyfill `<script>` for browsers without native support\n * (Firefox < 123). Only meaningful when `dsd` is true.\n * @default true\n */\n dsdPolyfill?: boolean;\n /**\n * Router instance to thread through each component's SSR context.\n *\n * When provided, `router-view` reads the current route from this instance\n * instead of the module-level `activeRouterProxy` singleton, making\n * concurrent SSR renders safe — each request carries its own router with\n * its own URL state.\n *\n * In browser mode this option is ignored; components always use\n * `activeRouterProxy` there.\n */\n router?: unknown;\n};\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/**\n * @internal\n * Minified DSD polyfill for browsers without native Declarative Shadow DOM.\n * Processes all `<template shadowrootmode>` elements synchronously.\n */\nexport const DSD_POLYFILL_SCRIPT =\n '<script>(function(){' +\n \"if(HTMLTemplateElement.prototype.hasOwnProperty('shadowRootMode'))return;\" +\n \"document.querySelectorAll('template[shadowrootmode]').forEach(function(t){\" +\n \"var m=t.getAttribute('shadowrootmode');\" +\n 'var s=t.parentElement.attachShadow({mode:m});' +\n 's.appendChild(t.content);t.remove();' +\n '});})()' +\n '</script>';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction isRegisteredCustomElement(tag: string): boolean {\n return tag.includes('-') && registry.has(tag);\n}\n\n/**\n * Build the combined `<style>` block for a shadow root.\n *\n * Layer order (matches the runtime adoptedStyleSheets order):\n * 1. baseReset — global reset + CSS custom properties\n * 2. useStyle() output — component-defined rules (:host, ::slotted, etc.)\n * 3. JIT CSS — utility classes extracted from the shadow HTML\n */\nexport function buildShadowStyleBlock(\n useStyleCSS: string,\n shadowHTML: string,\n): string {\n const parts: string[] = [baseReset];\n\n if (useStyleCSS.trim()) {\n parts.push(useStyleCSS);\n }\n\n const jit = jitCSS(shadowHTML);\n if (jit.trim()) {\n parts.push(jit);\n }\n\n const combined = minifyCSS(parts.join('\\n'));\n return combined ? `<style>${combined}</style>` : '';\n}\n\n// ---------------------------------------------------------------------------\n// Streaming async component collector\n// ---------------------------------------------------------------------------\n\nexport interface AsyncStreamEntry {\n id: string;\n tag: string;\n attrsString: string;\n hydrateAttr: string;\n useStyleCSS: string;\n lightDOM: string;\n opts: DSDRenderOptions;\n promise: Promise<VNode | VNode[]>;\n /** Router threaded from the originating render pass — propagated to async re-renders. */\n router?: unknown;\n}\n\nlet _streamingCollector: AsyncStreamEntry[] | null = null;\nlet _streamingCounter = 0;\n\n/** @internal Called by renderToStream() before the sync render pass. */\nexport function beginStreamingCollection(collector: AsyncStreamEntry[]): void {\n _streamingCollector = collector;\n _streamingCounter = 0;\n}\n\n/** @internal Called by renderToStream() after the sync render pass. */\nexport function endStreamingCollection(): void {\n _streamingCollector = null;\n}\n\n// ---------------------------------------------------------------------------\n// Core renderer\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to an HTML string with Declarative Shadow DOM output\n * for all registered custom elements encountered in the tree.\n */\nexport function renderToDSD(vnode: VNode, opts: DSDRenderOptions): string {\n if (!opts.dsd) {\n return renderToString(vnode, opts);\n }\n\n // Primitive string nodes\n if (typeof vnode === 'string') {\n return escapeHTML(vnode) as string;\n }\n\n const tag = (vnode as VNode).tag;\n\n // Special virtual node types — delegate entirely to the base renderer\n if (tag === '#text' || tag === '#anchor' || tag === '#raw') {\n return renderToString(vnode, opts);\n }\n\n // Custom element — emit DSD wrapper\n if (isRegisteredCustomElement(tag)) {\n return renderCustomElementDSD(vnode, opts);\n }\n\n // Regular element — recurse with DSD mode on\n const attrsObj: Record<string, unknown> = vnode.props?.attrs\n ? { ...vnode.props.attrs }\n : {};\n\n const attrsString = buildAttrs(attrsObj, tag, opts);\n\n if (VOID_ELEMENTS.has(tag)) {\n return `<${tag}${attrsString}>`;\n }\n\n const children = renderChildrenDSD(vnode.children, opts);\n return `<${tag}${attrsString}>${children}</${tag}>`;\n}\n\nfunction renderCustomElementDSD(vnode: VNode, opts: DSDRenderOptions): string {\n const tag = vnode.tag;\n const config = registry.get(tag);\n\n // Build the plain attribute string (no namespace injection for custom elements)\n const rawAttrs = vnode.props?.attrs ?? {};\n const attrsString = buildRawAttrs(rawAttrs);\n\n // Move the null check BEFORE reading config.* properties for clarity.\n if (!config) {\n // Component not in registry on server (e.g. dynamic import not yet run).\n // Emit a shell with an empty DSD template so the client hydrates normally.\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n return `<${tag}${attrsString}><template shadowrootmode=\"open\"></template>${lightDOM}</${tag}>`;\n }\n\n // Emit data-cer-hydrate when a non-default strategy is configured.\n // 'load' is the default and doesn't need to be serialised.\n const hydrateStrategy = config.hydrate;\n const hydrateAttr =\n hydrateStrategy && hydrateStrategy !== 'load'\n ? ` data-cer-hydrate=\"${hydrateStrategy}\"`\n : '';\n\n // Run the component's render function in a minimal SSR context to get the\n // shadow DOM VNode tree and capture any useStyle() output.\n const { shadowVNode, useStyleCSS, asyncPromise } = runComponentSSRRender(config, rawAttrs, tag, opts.router);\n\n // When streaming and this component has an async render, emit a placeholder\n // and register the promise for later resolution.\n if (asyncPromise && _streamingCollector === null) {\n devWarn(\n `[SSR] Component \"${tag}\" has an async render function. ` +\n `In standard SSR the shadow DOM will be empty. ` +\n `Use renderToStream() for incremental async component streaming.`,\n );\n }\n if (asyncPromise && _streamingCollector !== null) {\n const id = `cer-stream-${_streamingCounter++}`;\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n _streamingCollector.push({\n id,\n tag,\n attrsString,\n hydrateAttr,\n useStyleCSS,\n lightDOM,\n opts,\n promise: asyncPromise,\n router: opts.router,\n });\n return (\n `<${tag} id=\"${id}\"${attrsString}${hydrateAttr}>` +\n `<template shadowrootmode=\"open\"></template>` +\n `${lightDOM}` +\n `</${tag}>`\n );\n }\n\n // Render the shadow DOM VNode tree to HTML (DSD-recursive for nested elements)\n let shadowHTML = '';\n if (shadowVNode !== null && shadowVNode !== undefined) {\n if (Array.isArray(shadowVNode)) {\n shadowHTML = (shadowVNode as VNode[])\n .map((n) => renderToDSD(n, opts))\n .join('');\n } else {\n shadowHTML = renderToDSD(shadowVNode as VNode, opts);\n }\n }\n\n const styleBlock = buildShadowStyleBlock(useStyleCSS, shadowHTML);\n\n // Light DOM children become slotted content — rendered outside the template\n const lightDOM = renderChildrenDSD(vnode.children, opts);\n\n return (\n `<${tag}${attrsString}${hydrateAttr}>` +\n `<template shadowrootmode=\"open\">${styleBlock}${shadowHTML}</template>` +\n `${lightDOM}` +\n `</${tag}>`\n );\n}\n\nfunction renderChildrenDSD(\n children: VNode['children'],\n opts: DSDRenderOptions,\n): string {\n if (!children) return '';\n if (typeof children === 'string') return escapeHTML(children) as string;\n if (Array.isArray(children)) {\n return children\n .filter((c) => c !== null && c !== undefined)\n .map((c) => renderToDSD(c as VNode, opts))\n .join('');\n }\n return renderToDSD(children as VNode, opts);\n}\n\n// ---------------------------------------------------------------------------\n// Public entry points\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to a DSD HTML string and optionally append the\n * DSD polyfill script for older browsers.\n */\nexport function renderToStringDSD(\n vnode: VNode,\n opts?: DSDRenderOptions,\n): string {\n const effectiveOpts: DSDRenderOptions = { dsd: true, ...opts };\n const html = renderToDSD(vnode, effectiveOpts);\n\n if (effectiveOpts.dsdPolyfill !== false) {\n // Inject polyfill before </body> if present, otherwise append\n if (html.includes('</body>')) {\n return html.replace('</body>', `${DSD_POLYFILL_SCRIPT}</body>`);\n }\n return html + DSD_POLYFILL_SCRIPT;\n }\n\n return html;\n}\n","/**\n * SSR entry point — import from `@jasonshimmy/custom-elements-runtime/ssr`.\n *\n * Provides four rendering modes:\n *\n * 1. **renderToString** — baseline HTML serialisation (no shadow DOM content).\n * Backwards-compatible with the original API.\n *\n * 2. **renderToStringWithJITCSS** — HTML + pre-generated JIT CSS injected into\n * `<head>` to prevent FOUC. Supports `dsd: true` for DSD output.\n *\n * 3. **renderToStringWithJITCSSDSD** — convenience alias for DSD mode.\n * Full Declarative Shadow DOM output with per-shadow-root CSS layer stack\n * (baseReset + useStyle() + JIT CSS). Enables true hydration, zero FOUC.\n *\n * 4. **renderToStream** — ReadableStream variant for streaming SSR.\n *\n * 5. **renderToStreamWithJITCSSDSD** — convenience alias for streaming DSD mode.\n * Equivalent to `renderToStream(vnode, { dsd: true, ...options })`.\n * Recommended for new server-rendered applications that want true incremental\n * streaming with Declarative Shadow DOM and zero FOUC.\n *\n * Entity map utilities are also exported for full HTML5 named-entity support.\n *\n * @example DSD usage (recommended)\n * ```ts\n * import { renderToStringWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * const { htmlWithStyles } = renderToStringWithJITCSSDSD(appVNode, {\n * jit: { extendedColors: true },\n * });\n * res.send(`<!DOCTYPE html><html><head>${head}</head><body>${htmlWithStyles}</body></html>`);\n * ```\n */\n\n// ---------------------------------------------------------------------------\n// Re-exports — backwards-compatible\n// ---------------------------------------------------------------------------\n\nexport { renderToString } from './runtime/vdom-ssr';\nexport type { VNode } from './runtime/types';\nexport type { RenderOptions } from './runtime/vdom-ssr';\n\nexport {\n registerEntityMap,\n loadEntityMap,\n clearRegisteredEntityMap,\n} from './runtime/helpers';\n\nexport {\n renderToStringDSD,\n DSD_POLYFILL_SCRIPT,\n} from './runtime/vdom-ssr-dsd';\nexport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\n\n// ---------------------------------------------------------------------------\n// Internal imports\n// ---------------------------------------------------------------------------\n\nimport { renderToString as _render } from './runtime/vdom-ssr';\nimport {\n renderToStringDSD as _renderToStringDSD,\n renderToDSD,\n buildShadowStyleBlock,\n beginStreamingCollection,\n endStreamingCollection,\n DSD_POLYFILL_SCRIPT,\n type AsyncStreamEntry,\n} from './runtime/vdom-ssr-dsd';\nimport { jitCSS, enableJITCSS, type JITCSSOptions } from './runtime/style';\nimport type { VNode } from './runtime/types';\nimport type { RenderOptions } from './runtime/vdom-ssr';\nimport type { DSDRenderOptions } from './runtime/vdom-ssr-dsd';\nimport {\n beginSSRGlobalStyleCollection,\n endSSRGlobalStyleCollection,\n} from './runtime/ssr-context';\n\n// ---------------------------------------------------------------------------\n// Result type\n// ---------------------------------------------------------------------------\n\n/**\n * Result of `renderToStringWithJITCSS()` and `renderToStringWithJITCSSDSD()`.\n */\nexport interface SSRJITResult {\n /** The rendered HTML string (styles not yet injected). */\n html: string;\n /**\n * Global JIT CSS extracted from the rendered HTML.\n * For DSD renders, each shadow root embeds its own scoped styles; this field\n * holds any residual light-DOM utility CSS.\n */\n css: string;\n /**\n * CSS captured from `useGlobalStyle()` calls during this render pass\n * (e.g. `@font-face`, `:root` custom properties).\n * Inject in a `<style id=\"cer-ssr-global\">` in `<head>`.\n */\n globalStyles: string;\n /**\n * Convenience: `html` with both `<style>` tags injected before `</head>`.\n * If no `</head>` is found, the styles are prepended.\n */\n htmlWithStyles: string;\n}\n\n// ---------------------------------------------------------------------------\n// renderToStringWithJITCSS — primary API, supports both modes\n// ---------------------------------------------------------------------------\n\n/**\n * Server-side render a VNode tree and simultaneously pre-generate JIT CSS.\n *\n * Pass `dsd: true` to enable Declarative Shadow DOM output with full per-shadow-\n * root CSS layer extraction (recommended for new apps).\n *\n * @example Standard (no DSD)\n * ```ts\n * const { htmlWithStyles } = renderToStringWithJITCSS(appVNode);\n * ```\n *\n * @example With DSD\n * ```ts\n * const { htmlWithStyles } = renderToStringWithJITCSS(appVNode, {\n * dsd: true,\n * jit: { extendedColors: true },\n * });\n * ```\n */\nexport function renderToStringWithJITCSS(\n vnode: VNode,\n options?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n): SSRJITResult {\n const { jit, dsd, dsdPolyfill, ...renderOptions } = options ?? {};\n\n if (jit) enableJITCSS(jit);\n\n beginSSRGlobalStyleCollection();\n\n let html!: string;\n let globalStylesCaptured!: string[];\n try {\n if (dsd) {\n // renderToStringDSD handles DSD wrapping but skips the polyfill so we can\n // place it correctly relative to other injected style tags below.\n html = _renderToStringDSD(vnode, {\n ...renderOptions,\n dsd: true,\n dsdPolyfill: false,\n });\n } else {\n html = _render(vnode, renderOptions);\n }\n } finally {\n // Always end collection — even when the render throws — so the collector\n // is never left non-null, which would cause subsequent non-SSR\n // useGlobalStyle() calls to silently skip DOM injection.\n globalStylesCaptured = endSSRGlobalStyleCollection();\n }\n\n const css = jitCSS(html);\n const globalStyles = globalStylesCaptured.join('\\n');\n\n const styleTags: string[] = [];\n if (css) styleTags.push(`<style id=\"cer-ssr-jit\">${css}</style>`);\n if (globalStyles.trim())\n styleTags.push(`<style id=\"cer-ssr-global\">${globalStyles}</style>`);\n\n let htmlWithStyles = html;\n if (styleTags.length) {\n const injection = styleTags.join('');\n htmlWithStyles = html.includes('</head>')\n ? html.replace('</head>', `${injection}</head>`)\n : `${injection}${html}`;\n }\n\n // Append DSD polyfill script inside </body> when in DSD mode\n if (dsd && dsdPolyfill !== false) {\n htmlWithStyles = htmlWithStyles.includes('</body>')\n ? htmlWithStyles.replace('</body>', `${DSD_POLYFILL_SCRIPT}</body>`)\n : htmlWithStyles + DSD_POLYFILL_SCRIPT;\n }\n\n return { html, css, globalStyles, htmlWithStyles };\n}\n\n// ---------------------------------------------------------------------------\n// renderToStringWithJITCSSDSD — convenience alias\n// ---------------------------------------------------------------------------\n\n/**\n * Convenience alias: `renderToStringWithJITCSS(vnode, { dsd: true, ...options })`.\n *\n * Renders with Declarative Shadow DOM output, full per-shadow-root CSS layer\n * extraction, and the DSD browser polyfill. This is the recommended function\n * for all new server-rendered applications.\n *\n * @example\n * ```ts\n * import { renderToStringWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * const { htmlWithStyles } = renderToStringWithJITCSSDSD(appVNode, {\n * jit: { extendedColors: true },\n * });\n * ```\n */\nexport function renderToStringWithJITCSSDSD(\n vnode: VNode,\n options?: Omit<\n RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions },\n 'dsd'\n >,\n): SSRJITResult {\n return renderToStringWithJITCSS(vnode, { ...options, dsd: true });\n}\n\n// ---------------------------------------------------------------------------\n// renderToStream — streaming SSR\n// ---------------------------------------------------------------------------\n\n/**\n * Render a VNode tree to a `ReadableStream<string>`.\n *\n * Supports true incremental streaming: synchronous components are flushed as\n * the first chunk, then each async component's resolved output is streamed as\n * an inline swap `<script>` that fills the placeholder's shadow root.\n *\n * @example Node.js\n * ```ts\n * import { renderToStream } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * app.get('/', (req, res) => {\n * const stream = renderToStream(appVNode, { dsd: true });\n * const reader = stream.getReader();\n * const pump = () =>\n * reader.read().then(({ value, done }) => {\n * if (done) { res.end(); return; }\n * res.write(value);\n * pump();\n * });\n * pump();\n * });\n * ```\n */\nexport function renderToStream(\n vnode: VNode,\n options?: RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions; asyncTimeout?: number },\n): ReadableStream<string> {\n const timeoutMs = options?.asyncTimeout ?? 30_000;\n\n return new ReadableStream<string>({\n async start(controller) {\n const asyncEntries: AsyncStreamEntry[] = [];\n beginStreamingCollection(asyncEntries);\n\n try {\n const { htmlWithStyles } = renderToStringWithJITCSS(vnode, options);\n controller.enqueue(htmlWithStyles);\n } catch (err) {\n controller.error(err);\n return;\n } finally {\n endStreamingCollection();\n }\n\n // Resolve async components and stream swap scripts as they settle.\n // Each resolved component replaces its placeholder via an inline script.\n // A per-entry timeout prevents hung async components from blocking the stream.\n for (const entry of asyncEntries) {\n try {\n const timeout = new Promise<never>((_, reject) =>\n setTimeout(() => reject(new Error(`[cer] async component timed out after ${timeoutMs}ms`)), timeoutMs),\n );\n const resolvedVNodes = await Promise.race([entry.promise, timeout]);\n const shadowHTML = Array.isArray(resolvedVNodes)\n ? (resolvedVNodes as VNode[]).map((n) => renderToDSD(n, entry.opts)).join('')\n : renderToDSD(resolvedVNodes as VNode, entry.opts);\n const styleBlock = buildShadowStyleBlock(entry.useStyleCSS, shadowHTML);\n const shadowContent = `${styleBlock}${shadowHTML}`;\n controller.enqueue(\n `<script>(function(){` +\n `var e=document.getElementById(${JSON.stringify(entry.id)});` +\n `if(!e)return;` +\n // The placeholder already has an empty shadow root attached (native DSD or polyfill).\n // If for some reason it doesn't, attach one now.\n `var s=e.shadowRoot;` +\n `if(!s&&e.attachShadow)try{s=e.attachShadow({mode:'open'});}catch(_){};` +\n `if(s)s.innerHTML=${JSON.stringify(shadowContent)};` +\n `e.removeAttribute('id');` +\n `})();</script>`,\n );\n } catch {\n // Async render failed — leave placeholder for client hydration.\n }\n }\n\n controller.close();\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// renderToStreamWithJITCSSDSD — convenience alias\n// ---------------------------------------------------------------------------\n\n/**\n * Convenience alias: `renderToStream(vnode, { dsd: true, ...options })`.\n *\n * Renders with Declarative Shadow DOM output and full JIT CSS extraction,\n * streaming the synchronous render as the first chunk and each resolved async\n * component as a subsequent inline-script swap. This is the recommended\n * function for all new server-rendered applications.\n *\n * @example\n * ```ts\n * import { renderToStreamWithJITCSSDSD } from '@jasonshimmy/custom-elements-runtime/ssr';\n *\n * app.get('/', (req, res) => {\n * const stream = renderToStreamWithJITCSSDSD(appVNode, { router });\n * const reader = stream.getReader();\n * const pump = () =>\n * reader.read().then(({ value, done }) => {\n * if (done) { res.end(); return; }\n * res.write(value);\n * pump();\n * });\n * pump();\n * });\n * ```\n */\nexport function renderToStreamWithJITCSSDSD(\n vnode: VNode,\n options?: Omit<\n RenderOptions & DSDRenderOptions & { jit?: JITCSSOptions; asyncTimeout?: number },\n 'dsd'\n >,\n):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ToStringWithJITCSSDSD(vnode: VNode, options?: Omit
133
133
  */
134
134
  export declare function renderToStream(vnode: VNode, options?: RenderOptions & DSDRenderOptions & {
135
135
  jit?: JITCSSOptions;
136
+ asyncTimeout?: number;
136
137
  }): ReadableStream<string>;
137
138
  /**
138
139
  * Convenience alias: `renderToStream(vnode, { dsd: true, ...options })`.
@@ -161,4 +162,5 @@ export declare function renderToStream(vnode: VNode, options?: RenderOptions & D
161
162
  */
162
163
  export declare function renderToStreamWithJITCSSDSD(vnode: VNode, options?: Omit<RenderOptions & DSDRenderOptions & {
163
164
  jit?: JITCSSOptions;
165
+ asyncTimeout?: number;
164
166
  }, 'dsd'>): ReadableStream<string>;
@@ -0,0 +1,55 @@
1
+ const e=require(`./css-utils-CFeP8SK1.cjs`),t=require(`./custom-elements-runtime.colors.cjs.js`);var n={base:{fontSize:`1rem`,lineHeight:`1.75`,p:`1.25em`,lead:`1.25em`,h1:`2.25em`,h2:`1.5em`,h3:`1.25em`,h4:`1em`,blockquote:`1.6em`,figure:`2em`,code:`0.875em`,pre:`0.875em`,ol:`1.25em`,ul:`1.25em`,li:`0.5em`,hr:`3em`,table:`2em`},sm:{fontSize:`0.875rem`,lineHeight:`1.7142857`,p:`1.1428571em`,lead:`1.1428571em`,h1:`2.1428571em`,h2:`1.4285714em`,h3:`1.2857143em`,h4:`1em`,blockquote:`1.4285714em`,figure:`1.7142857em`,code:`0.8571429em`,pre:`0.8571429em`,ol:`1.1428571em`,ul:`1.1428571em`,li:`0.4285714em`,hr:`2.5714286em`,table:`1.7142857em`},lg:{fontSize:`1.125rem`,lineHeight:`1.7777778`,p:`1.3333333em`,lead:`1.3333333em`,h1:`2.6666667em`,h2:`1.7777778em`,h3:`1.5555556em`,h4:`1.1111111em`,blockquote:`1.7777778em`,figure:`2.2222222em`,code:`0.8888889em`,pre:`0.8888889em`,ol:`1.3333333em`,ul:`1.3333333em`,li:`0.5555556em`,hr:`3.3333333em`,table:`2.2222222em`},xl:{fontSize:`1.25rem`,lineHeight:`1.8`,p:`1.4em`,lead:`1.4em`,h1:`2.8em`,h2:`1.8em`,h3:`1.6em`,h4:`1.2em`,blockquote:`1.8em`,figure:`2.4em`,code:`0.9em`,pre:`0.9em`,ol:`1.4em`,ul:`1.4em`,li:`0.6em`,hr:`3.6em`,table:`2.4em`},"2xl":{fontSize:`1.5rem`,lineHeight:`1.6666667`,p:`1.3333333em`,lead:`1.3333333em`,h1:`2.6666667em`,h2:`1.7777778em`,h3:`1.5555556em`,h4:`1.2222222em`,blockquote:`1.7777778em`,figure:`2.2222222em`,code:`0.8333333em`,pre:`0.8333333em`,ol:`1.3333333em`,ul:`1.3333333em`,li:`0.5555556em`,hr:`3.1111111em`,table:`2.2222222em`}};function r(e){let t=e.match(/^prose(?:-(sm|lg|xl|2xl))?$/);if(!t)return null;let r=n[t[1]||`base`],i=`.${e}`,a=[];return a.push(`${i}{--cer-prose-body:var(--cer-color-neutral-900);--cer-prose-headings:var(--cer-color-neutral-900);--cer-prose-lead:var(--cer-color-neutral-700);--cer-prose-links:var(--cer-color-neutral-700);--cer-prose-links-hover:var(--cer-color-neutral-500);--cer-prose-bold:var(--cer-color-neutral-900);--cer-prose-quotes:var(--cer-color-neutral-700);--cer-prose-quote-border:var(--cer-color-neutral-200);--cer-prose-code:var(--cer-color-neutral-800);--cer-prose-code-bg:var(--cer-color-neutral-100);--cer-prose-pre-code:var(--cer-color-neutral-800);--cer-prose-pre-bg:var(--cer-color-neutral-100);--cer-prose-pre-border:var(--cer-color-neutral-200);--cer-prose-hr:var(--cer-color-neutral-200);--cer-prose-caps:var(--cer-color-neutral-600);--cer-prose-list-marker:var(--cer-color-neutral-600);--cer-prose-list-marker-strong:var(--cer-color-neutral-700);--cer-prose-counters:var(--cer-color-neutral-600);--cer-prose-bullets:var(--cer-color-neutral-400);--cer-prose-img-caption:var(--cer-color-neutral-600);--cer-prose-table-border:var(--cer-color-neutral-200);--cer-prose-table-head:var(--cer-color-neutral-700);color:var(--cer-prose-body);font-size:${r.fontSize};line-height:${r.lineHeight};max-width:65ch;}`),a.push(`${i} p:not(.not-prose):not(.not-prose *){margin:${r.p} 0;}`),a.push(`${i} .lead:not(.not-prose):not(.not-prose *),${i} [class~="lead"]:not(.not-prose):not(.not-prose *){font-size:1.25em;line-height:1.6;margin-top:${r.lead};margin-bottom:${r.lead};color:var(--cer-prose-lead);}`),a.push(`${i} h1:not(.not-prose):not(.not-prose *),${i} h2:not(.not-prose):not(.not-prose *),${i} h3:not(.not-prose):not(.not-prose *),${i} h4:not(.not-prose):not(.not-prose *),${i} h5:not(.not-prose):not(.not-prose *),${i} h6:not(.not-prose):not(.not-prose *){color:var(--cer-prose-headings);font-weight:700;line-height:1.25;}`),a.push(`${i} h1:not(.not-prose):not(.not-prose *){font-size:${r.h1};margin-top:0;margin-bottom:0.8888889em;line-height:1.1111111;}`),a.push(`${i} h2:not(.not-prose):not(.not-prose *){font-size:${r.h2};margin-top:2em;margin-bottom:1em;line-height:1.3333333;}`),a.push(`${i} h3:not(.not-prose):not(.not-prose *){font-size:${r.h3};margin-top:1.6em;margin-bottom:0.6em;line-height:1.6;}`),a.push(`${i} h4:not(.not-prose):not(.not-prose *){font-size:${r.h4};margin-top:1.5em;margin-bottom:0.5em;line-height:1.5;}`),a.push(`${i} h5:not(.not-prose):not(.not-prose *){margin-top:1.5em;margin-bottom:0.5em;}`),a.push(`${i} h6:not(.not-prose):not(.not-prose *){margin-top:1.5em;margin-bottom:0.5em;}`),a.push(`${i} a:not(.not-prose):not(.not-prose *){color:var(--cer-prose-links);text-decoration:underline;text-decoration-thickness:.08em;text-underline-offset:.15em;font-weight:500;}`),a.push(`${i} a:not(.not-prose):not(.not-prose *):hover,${i} a:not(.not-prose):not(.not-prose *):focus{color:var(--cer-prose-links-hover);}`),a.push(`${i} strong:not(.not-prose):not(.not-prose *){color:var(--cer-prose-bold);font-weight:600;}`),a.push(`${i} em:not(.not-prose):not(.not-prose *){font-style:italic;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *){list-style-type:decimal;margin-top:${r.ol};margin-bottom:${r.ol};padding-left:1.625em;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)[type="A"]{list-style-type:upper-alpha;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)[type="a"]{list-style-type:lower-alpha;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)[type="I"]{list-style-type:upper-roman;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)[type="i"]{list-style-type:lower-roman;}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *){position:relative;padding-left:${r.li};}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)::marker{color:var(--cer-prose-counters);font-weight:400;}`),a.push(`${i} ul:not(.not-prose):not(.not-prose *){list-style-type:disc;margin-top:${r.ul};margin-bottom:${r.ul};padding-left:1.625em;}`),a.push(`${i} ul:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *){position:relative;padding-left:${r.li};}`),a.push(`${i} ul:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)::marker{color:var(--cer-prose-bullets);}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)>*:first-child,${i} ul:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)>*:first-child{margin-top:${r.ol};}`),a.push(`${i} ol:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)>*:last-child,${i} ul:not(.not-prose):not(.not-prose *)>li:not(.not-prose):not(.not-prose *)>*:last-child{margin-bottom:${r.ol};}`),a.push(`${i} ul:not(.not-prose):not(.not-prose *) ul:not(.not-prose):not(.not-prose *),${i} ul:not(.not-prose):not(.not-prose *) ol:not(.not-prose):not(.not-prose *),${i} ol:not(.not-prose):not(.not-prose *) ul:not(.not-prose):not(.not-prose *),${i} ol:not(.not-prose):not(.not-prose *) ol:not(.not-prose):not(.not-prose *){margin-top:0.75em;margin-bottom:0.75em;}`),a.push(`${i} li:not(.not-prose):not(.not-prose *)>p:not(.not-prose):not(.not-prose *){margin-top:${r.ol};margin-bottom:${r.ol};}`),a.push(`${i} code:not(.not-prose):not(.not-prose *){color:var(--cer-prose-code);background-color:var(--cer-prose-code-bg);border-radius:0.25rem;padding:0.125rem 0.25rem;font-size:${r.code};font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}`),a.push(`${i} pre:not(.not-prose):not(.not-prose *){color:var(--cer-prose-pre-code);background-color:var(--cer-prose-pre-bg);border:1px solid var(--cer-prose-pre-border);overflow-x:auto;font-size:${r.pre};line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:0.375rem;padding:0.8571429em 1.1428571em;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;white-space:pre;overflow-wrap:normal;}`),a.push(`${i} pre:not(.not-prose):not(.not-prose *) code:not(.not-prose):not(.not-prose *){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;line-height:inherit;}`),a.push(`${i} blockquote:not(.not-prose):not(.not-prose *){font-weight:500;font-style:italic;color:var(--cer-prose-quotes);border-left-width:0.25rem;border-left-color:var(--cer-prose-quote-border);quotes:"\\201C""\\201D""\\2018""\\2019";margin-top:${r.blockquote};margin-bottom:${r.blockquote};padding-left:1em;}`),a.push(`${i} blockquote:not(.not-prose):not(.not-prose *) p:not(.not-prose):not(.not-prose *):first-of-type::before{content:open-quote;}`),a.push(`${i} blockquote:not(.not-prose):not(.not-prose *) p:not(.not-prose):not(.not-prose *):last-of-type::after{content:close-quote;}`),a.push(`${i} hr:not(.not-prose):not(.not-prose *){border-color:var(--cer-prose-hr);border-top-width:1px;margin-top:${r.hr};margin-bottom:${r.hr};}`),a.push(`${i} figure:not(.not-prose):not(.not-prose *){margin-top:${r.figure};margin-bottom:${r.figure};}`),a.push(`${i} figure:not(.not-prose):not(.not-prose *)>*{margin-top:0;margin-bottom:0;}`),a.push(`${i} figcaption:not(.not-prose):not(.not-prose *){color:var(--cer-prose-img-caption);font-size:0.875em;line-height:1.4285714;margin-top:0.75em;}`),a.push(`${i} img:not(.not-prose):not(.not-prose *),${i} video:not(.not-prose):not(.not-prose *),${i} picture:not(.not-prose):not(.not-prose *){margin-top:${r.figure};margin-bottom:${r.figure};max-width:100%;height:auto;}`),a.push(`${i} figure:not(.not-prose):not(.not-prose *)>img:not(.not-prose):not(.not-prose *),${i} figure:not(.not-prose):not(.not-prose *)>video:not(.not-prose):not(.not-prose *),${i} figure:not(.not-prose):not(.not-prose *)>picture:not(.not-prose):not(.not-prose *){margin-top:0;margin-bottom:0;}`),a.push(`${i} table:not(.not-prose):not(.not-prose *){width:100%;table-layout:auto;text-align:left;margin-top:${r.table};margin-bottom:${r.table};font-size:0.875em;line-height:1.7142857;}`),a.push(`${i} thead:not(.not-prose):not(.not-prose *){border-bottom-width:1px;border-bottom-color:var(--cer-prose-table-border);}`),a.push(`${i} thead:not(.not-prose):not(.not-prose *) th:not(.not-prose):not(.not-prose *){color:var(--cer-prose-table-head);font-weight:600;vertical-align:bottom;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em;}`),a.push(`${i} tbody:not(.not-prose):not(.not-prose *) tr:not(.not-prose):not(.not-prose *){border-bottom-width:1px;border-bottom-color:var(--cer-prose-table-border);}`),a.push(`${i} tbody:not(.not-prose):not(.not-prose *) tr:not(.not-prose):not(.not-prose *):last-child{border-bottom-width:0;}`),a.push(`${i} tbody:not(.not-prose):not(.not-prose *) td:not(.not-prose):not(.not-prose *){vertical-align:baseline;padding:0.5714286em;}`),a.join(``)}var i={headings:`h1,h2,h3,h4,h5,h6,th`,h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,p:`p`,a:`a`,blockquote:`blockquote`,figure:`figure`,figcaption:`figcaption`,strong:`strong`,em:`em`,kbd:`kbd`,code:`code`,pre:`pre`,ol:`ol`,ul:`ul`,li:`li`,dl:`dl`,dt:`dt`,dd:`dd`,table:`table`,thead:`thead`,tbody:`tbody`,tr:`tr`,th:`th`,td:`td`,img:`img`,picture:`picture`,video:`video`,hr:`hr`,lead:`[class~="lead"]`};function a(t,n,r,a,o,s,c,l){let u=t.match(/^prose-([a-z0-9]+):(.+)$/);if(!u)return null;let[,d,f]=u,p=i[d];if(!p)return null;let m=n[f]??r(f)??a(f)??o(f)??s(f)??c(f)??l(f);if(!m)return null;let h=e.s(t);return p.split(`,`).map(e=>`${`.${h} ${e.trim()}:not(.not-prose):not(.not-prose *)`}{${m}}`).join(``)}var o=null,s=new Set,c=``,l=``;function u(){let t=Array.from(s).sort().join(`,`);if(t===l)return;l=t;let n=``;for(let e of s){let t=r(e);t&&(n+=t)}if(c=e.d(n),o&&typeof o.replaceSync==`function`&&n)try{o.replaceSync(c)}catch{}}function d(){return s.size===0?null:(o||(typeof CSSStyleSheet>`u`?o={cssRules:[],replaceSync:()=>{},toString:()=>c}:(o=new CSSStyleSheet,o.toString=()=>c),l=``),u(),o)}function f(e){let t=!s.has(e);s.add(e),t&&o&&u()}var p=Object.fromEntries(Object.entries({neutral:{50:`#fafafa`,100:`#f4f4f5`,200:`#e4e4e7`,300:`#d4d4d8`,400:`#9f9fa9`,500:`#71717b`,600:`#52525c`,700:`#3f3f46`,800:`#27272a`,900:`#18181b`,950:`#09090b`},primary:{50:`#eff6ff`,100:`#dbeafe`,200:`#bfdbfe`,300:`#93c5fd`,400:`#60a5fa`,500:`#3b82f6`,600:`#2563eb`,700:`#1d4ed8`,800:`#1e40af`,900:`#1e3a8a`,950:`#172554`},secondary:{50:`#eef2ff`,100:`#e0e7ff`,200:`#c7d2fe`,300:`#a5b4fc`,400:`#818cf8`,500:`#6366f1`,600:`#4f46e5`,700:`#4338ca`,800:`#3730a3`,900:`#312e81`,950:`#1e1b4b`},success:{50:`#f0fdf4`,100:`#dcfce7`,200:`#bbf7d0`,300:`#86efac`,400:`#4ade80`,500:`#22c55e`,600:`#16a34a`,700:`#15803d`,800:`#166534`,900:`#14532d`,950:`#052e16`},info:{50:`#f0f9ff`,100:`#e0f2fe`,200:`#bae6fd`,300:`#7dd3fc`,400:`#38bdf8`,500:`#0ea5e9`,600:`#0284c7`,700:`#0369a1`,800:`#075985`,900:`#0c4a6e`,950:`#082f49`},warning:{50:`#fffbeb`,100:`#fef3c7`,200:`#fde68a`,300:`#fcd34d`,400:`#fbbf24`,500:`#f59e0b`,600:`#d97706`,700:`#b45309`,800:`#92400e`,900:`#78350f`,950:`#451a03`},error:{50:`#fef2f2`,100:`#fee2e2`,200:`#fecaca`,300:`#fca5a5`,400:`#f87171`,500:`#ef4444`,600:`#dc2626`,700:`#b91c1c`,800:`#991b1b`,900:`#7f1d1d`,950:`#450a0a`},white:{DEFAULT:`#ffffff`},black:{DEFAULT:`#000000`},transparent:{DEFAULT:`transparent`},current:{DEFAULT:`currentColor`}}).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([t,n])=>[t,`var(--cer-color-${e}${t===`DEFAULT`?``:`-${t}`}, ${n})`]))])),m={...p};function h(e){if(m={...p},e.extendedColors){let n=Array.isArray(e.extendedColors)?e.extendedColors:Object.keys(t.extendedColors);for(let e of n){let n=t.extendedColors[e];!n||m[e]||(m[e]=Object.fromEntries(Object.entries(n).map(([t,n])=>[t,`var(--cer-color-${e}-${t}, ${n})`])))}}if(e.customColors)for(let[t,n]of Object.entries(e.customColors))m[t]=n}var g={},_=!1;function v(){_||=(e.t(S,ie,d),!0)}var y=!1,b=new WeakSet;function x(){return y}function S(e){return y||b.has(e)}function C(e,t){if(b.add(e),t){let e={...g,...t};JSON.stringify(e)!==JSON.stringify(g)&&(g=e,h(g),$.clear())}v()}function w(e){y=!0,e&&(g={...g,...e}),h(g),v(),$.clear()}function ee(){y=!1,b=new WeakSet}function T(){return{...g}}var E={"3xs":64,"2xs":72,xs:80,sm:96,md:112,lg:128,xl:144,"2xl":168,"3xl":192,"4xl":224,"5xl":256,"6xl":288,"7xl":320},D={m:[`margin`],mx:[`margin-inline`],my:[`margin-block`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],p:[`padding`],px:[`padding-inline`],py:[`padding-block`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],inset:[`inset`],"inset-x":[`inset-inline`],"inset-y":[`inset-block`],h:[`height`],w:[`width`],"min-h":[`min-height`],"min-w":[`min-width`],"max-h":[`max-height`],"max-w":[`max-width`],top:[`top`],bottom:[`bottom`],left:[`left`],right:[`right`],gap:[`gap`],"gap-x":[`column-gap`],"gap-y":[`row-gap`],size:[`width`,`height`],ms:[`margin-inline-start`],me:[`margin-inline-end`],ps:[`padding-inline-start`],pe:[`padding-inline-end`],bs:[`margin-block-start`],be:[`margin-block-end`],start:[`inset-inline-start`],end:[`inset-inline-end`],"inset-s":[`inset-inline-start`],"inset-e":[`inset-inline-end`]},O=(()=>{let t={};t[`@container`]=`container-type:inline-size;`,[`block`,`inline`,`inline-block`,`flex`,`inline-flex`,`grid`,`inline-grid`,`table`,`table-cell`,`table-row`,`hidden`].forEach(e=>{t[e]=e===`hidden`?`display:none;`:`display:${e};`}),[`absolute`,`relative`,`fixed`,`sticky`,`static`].forEach(e=>{t[e]=`position:${e};`}),Object.assign(t,{"items-center":`align-items:center;`,"items-start":`align-items:flex-start;`,"items-end":`align-items:flex-end;`,"items-baseline":`align-items:baseline;`,"items-stretch":`align-items:stretch;`,"justify-center":`justify-content:center;`,"justify-start":`justify-content:flex-start;`,"justify-between":`justify-content:space-between;`,"justify-around":`justify-content:space-around;`,"justify-evenly":`justify-content:space-evenly;`,"justify-end":`justify-content:flex-end;`,"flex-wrap":`flex-wrap:wrap;`,"flex-nowrap":`flex-wrap:nowrap;`,"flex-wrap-reverse":`flex-wrap:wrap-reverse;`,"content-center":`align-content:center;`,"content-start":`align-content:flex-start;`,"content-end":`align-content:flex-end;`,"content-between":`align-content:space-between;`,"content-around":`align-content:space-around;`,"content-evenly":`align-content:space-evenly;`,"content-stretch":`align-content:stretch;`,"self-auto":`align-self:auto;`,"self-start":`align-self:flex-start;`,"self-end":`align-self:flex-end;`,"self-center":`align-self:center;`,"self-stretch":`align-self:stretch;`,"flex-col":`flex-direction:column;`,"flex-row":`flex-direction:row;`,"flex-col-reverse":`flex-direction:column-reverse;`,"flex-row-reverse":`flex-direction:row-reverse;`,"flex-1":`flex:1 1 0%;`,"flex-auto":`flex:1 1 auto;`,"flex-initial":`flex:0 1 auto;`,"flex-none":`flex:0 0 auto;`,grow:`flex-grow:1;`,shrink:`flex-shrink:1;`,"grow-0":`flex-grow:0;`,"shrink-0":`flex-shrink:0;`});for(let e=1;e<=12;e++)t[`grid-cols-${e}`]=`grid-template-columns:repeat(${e},minmax(0,1fr));`,t[`grid-rows-${e}`]=`grid-template-rows:repeat(${e},minmax(0,1fr));`,t[`col-span-${e}`]=`grid-column:span ${e} / span ${e};`,t[`row-span-${e}`]=`grid-row:span ${e} / span ${e};`,t[`col-start-${e}`]=`grid-column-start:${e};`,t[`col-end-${e}`]=`grid-column-end:${e};`,t[`row-start-${e}`]=`grid-row-start:${e};`,t[`row-end-${e}`]=`grid-row-end:${e};`;Object.assign(t,{"grid-cols-none":`grid-template-columns:none;`,"grid-rows-none":`grid-template-rows:none;`,"col-span-full":`grid-column:1 / -1;`,"row-span-full":`grid-row:1 / -1;`,"auto-cols-auto":`grid-auto-columns:auto;`,"auto-cols-min":`grid-auto-columns:min-content;`,"auto-cols-max":`grid-auto-columns:max-content;`,"auto-cols-fr":`grid-auto-columns:1fr;`,"auto-rows-auto":`grid-auto-rows:auto;`,"auto-rows-min":`grid-auto-rows:min-content;`,"auto-rows-max":`grid-auto-rows:max-content;`,"auto-rows-fr":`grid-auto-rows:1fr;`,"grid-flow-row":`grid-auto-flow:row;`,"grid-flow-col":`grid-auto-flow:column;`,"grid-flow-row-dense":`grid-auto-flow:row dense;`,"grid-flow-col-dense":`grid-auto-flow:column dense;`}),Object.assign(t,{"text-left":`text-align:left;`,"text-center":`text-align:center;`,"text-right":`text-align:right;`,"text-justify":`text-align:justify;`,"font-thin":`font-weight:100;`,"font-extralight":`font-weight:200;`,"font-light":`font-weight:300;`,"font-normal":`font-weight:400;`,"font-medium":`font-weight:500;`,"font-semibold":`font-weight:600;`,"font-bold":`font-weight:700;`,"font-extrabold":`font-weight:800;`,"font-black":`font-weight:900;`,italic:`font-style:italic;`,"not-italic":`font-style:normal;`,uppercase:`text-transform:uppercase;`,lowercase:`text-transform:lowercase;`,capitalize:`text-transform:capitalize;`,"normal-case":`text-transform:none;`,underline:`text-decoration-line:underline;`,overline:`text-decoration-line:overline;`,"line-through":`text-decoration-line:line-through;`,"no-underline":`text-decoration-line:none;`,truncate:`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`,"whitespace-normal":`white-space:normal;`,"whitespace-nowrap":`white-space:nowrap;`,"whitespace-pre":`white-space:pre;`,"whitespace-pre-line":`white-space:pre-line;`,"whitespace-pre-wrap":`white-space:pre-wrap;`,"break-normal":`overflow-wrap:normal;word-break:normal;`,"break-words":`overflow-wrap:break-word;`,"break-all":`word-break:break-all;`,"text-wrap":`text-wrap:wrap;`,"text-nowrap":`text-wrap:nowrap;`,"text-balance":`text-wrap:balance;`,"text-pretty":`text-wrap:pretty;`}),[[`text-xs`,`0.75rem`,`1`],[`text-sm`,`0.875rem`,`1.25`],[`text-base`,`1rem`,`1.5`],[`text-lg`,`1.125rem`,`1.75`],[`text-xl`,`1.25rem`,`1.75`],[`text-2xl`,`1.5rem`,`2`],[`text-3xl`,`1.875rem`,`2.25`],[`text-4xl`,`2.25rem`,`2.5`],[`text-5xl`,`3rem`,`1`],[`text-6xl`,`3.75rem`,`1`],[`text-7xl`,`4.5rem`,`1`],[`text-8xl`,`6rem`,`1`],[`text-9xl`,`8rem`,`1`]].forEach(([e,n,r])=>{t[e]=`font-size:${n};line-height:var(--cer-line-height,${r});`}),[[`tracking-tighter`,`-0.05em`],[`tracking-tight`,`-0.025em`],[`tracking-normal`,`0em`],[`tracking-wide`,`0.025em`],[`tracking-wider`,`0.05em`],[`tracking-widest`,`0.1em`]].forEach(([e,n])=>{t[e]=`letter-spacing:${n};`}),[[`leading-3`,`0.75rem`],[`leading-4`,`1rem`],[`leading-5`,`1.25rem`],[`leading-6`,`1.5rem`],[`leading-7`,`1.75rem`],[`leading-8`,`2rem`],[`leading-9`,`2.25rem`],[`leading-10`,`2.5rem`],[`leading-none`,`1`],[`leading-tight`,`1.25`],[`leading-snug`,`1.375`],[`leading-normal`,`1.5`],[`leading-relaxed`,`1.625`],[`leading-loose`,`2`]].forEach(([e,n])=>{t[e]=`line-height:${n};--cer-line-height:${n};line-height:var(--cer-line-height,${n});`});for(let e of[0,1,2,4,6,8]){let n=`${e}px`;t[`outline-${e}`]=`outline-style:var(--cer-outline-style);outline-width:${n};`,t[`outline-offset-${e}`]=`outline-offset:${n};`,t[`border-${e}`]=`border-width:${n};`,t[`border-t-${e}`]=`border-top-width:${n};`,t[`border-r-${e}`]=`border-right-width:${n};`,t[`border-b-${e}`]=`border-bottom-width:${n};`,t[`border-l-${e}`]=`border-left-width:${n};`,t[`border-x-${e}`]=`border-left-width:${n};border-right-width:${n};`,t[`border-y-${e}`]=`border-top-width:${n};border-bottom-width:${n};`}Object.assign(t,{"font-sans":`font-family:var(--cer-font-sans, ui-sans-serif,system-ui,sans-serif);`,"font-serif":`font-family:var(--cer-font-serif, ui-serif,Georgia,serif);`,"font-mono":`font-family:var(--cer-font-mono, ui-monospace,SFMono-Regular,monospace);`,outline:`outline-style:var(--cer-outline-style);outline-width:1px;`,"outline-solid":`--cer-outline-style:solid;outline-style:solid;`,"outline-dashed":`--cer-outline-style:dashed;outline-style:dashed;`,"outline-dotted":`--cer-outline-style:dotted;outline-style:dotted;`,"outline-double":`--cer-outline-style:double;outline-style:double;`,"outline-none":`--cer-outline-style:none;outline-style:none;`,"outline-hidden":`--cer-outline-style:none;outline:2px solid transparent;outline-offset:2px;`,border:`border-width:1px;`,"border-t":`border-top-width:1px;`,"border-r":`border-right-width:1px;`,"border-b":`border-bottom-width:1px;`,"border-l":`border-left-width:1px;`,"border-x":`border-left-width:1px;border-right-width:1px;`,"border-y":`border-top-width:1px;border-bottom-width:1px;`,"border-solid":`border-style:solid;`,"border-dashed":`border-style:dashed;`,"border-dotted":`border-style:dotted;`,"border-double":`border-style:double;`,"border-none":`border-style:none;`});for(let[e,n]of Object.entries({none:0,xs:2,sm:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,"4xl":32,full:9999})){let r=n===9999?`9999px`:`${n/16}rem`;t[`rounded-${e}`]=`border-radius:${r};`,t[`rounded-t-${e}`]=`border-top-left-radius:${r};border-top-right-radius:${r};`,t[`rounded-r-${e}`]=`border-top-right-radius:${r};border-bottom-right-radius:${r};`,t[`rounded-b-${e}`]=`border-bottom-left-radius:${r};border-bottom-right-radius:${r};`,t[`rounded-l-${e}`]=`border-top-left-radius:${r};border-bottom-left-radius:${r};`,t[`rounded-tl-${e}`]=`border-top-left-radius:${r};`,t[`rounded-tr-${e}`]=`border-top-right-radius:${r};`,t[`rounded-br-${e}`]=`border-bottom-right-radius:${r};`,t[`rounded-bl-${e}`]=`border-bottom-left-radius:${r};`}Object.assign(t,{"shadow-none":`--cer-shadow-color:rgb(0 0 0 / 0);box-shadow:0 0 var(--cer-shadow-color, #0000);`,"shadow-xs":`--cer-shadow-color:rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--cer-shadow-color, rgb(0 0 0 / 0.05));`,"shadow-sm":`--cer-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--cer-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--cer-shadow-color, rgb(0 0 0 / 0.1));`,shadow:`--cer-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--cer-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--cer-shadow-color, rgb(0 0 0 / 0.1));`,"shadow-md":`--cer-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--cer-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--cer-shadow-color, rgb(0 0 0 / 0.1));`,"shadow-lg":`--cer-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--cer-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--cer-shadow-color, rgb(0 0 0 / 0.1));`,"shadow-xl":`--cer-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--cer-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--cer-shadow-color, rgb(0 0 0 / 0.1));`,"shadow-2xl":`--cer-shadow-color:rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--cer-shadow-color, rgb(0 0 0 / 0.25));`,"shadow-inner":`box-shadow:inset 0 2px 4px 0 rgb(0 0 0 / 0.05);`}),Object.assign(t,{rounded:`border-radius:0.25rem;`}),Object.assign(t,{"overflow-auto":`overflow:auto;`,"overflow-hidden":`overflow:hidden;`,"overflow-visible":`overflow:visible;`,"overflow-scroll":`overflow:scroll;`,"overflow-x-auto":`overflow-x:auto;`,"overflow-x-hidden":`overflow-x:hidden;`,"overflow-x-visible":`overflow-x:visible;`,"overflow-x-scroll":`overflow-x:scroll;`,"overflow-y-auto":`overflow-y:auto;`,"overflow-y-hidden":`overflow-y:hidden;`,"overflow-y-visible":`overflow-y:visible;`,"overflow-y-scroll":`overflow-y:scroll;`}),Object.assign(t,{"bg-cover":`background-size:cover;`,"bg-contain":`background-size:contain;`,"bg-auto":`background-size:auto;`,"bg-center":`background-position:center;`,"bg-top":`background-position:top;`,"bg-bottom":`background-position:bottom;`,"bg-left":`background-position:left;`,"bg-right":`background-position:right;`,"bg-left-top":`background-position:left top;`,"bg-left-bottom":`background-position:left bottom;`,"bg-right-top":`background-position:right top;`,"bg-right-bottom":`background-position:right bottom;`,"bg-no-repeat":`background-repeat:no-repeat;`,"bg-repeat":`background-repeat:repeat;`,"bg-repeat-x":`background-repeat:repeat-x;`,"bg-repeat-y":`background-repeat:repeat-y;`,"bg-repeat-round":`background-repeat:round;`,"bg-repeat-space":`background-repeat:space;`,"bg-fixed":`background-attachment:fixed;`,"bg-local":`background-attachment:local;`,"bg-scroll":`background-attachment:scroll;`,"bg-origin-border":`background-origin:border-box;`,"bg-origin-padding":`background-origin:padding-box;`,"bg-origin-content":`background-origin:content-box;`,"bg-clip-border":`background-clip:border-box;`,"bg-clip-padding":`background-clip:padding-box;`,"bg-clip-content":`background-clip:content-box;`,"bg-clip-text":`background-clip:text;-webkit-background-clip:text;`}),Object.assign(t,{"decoration-solid":`text-decoration-style:solid;`,"decoration-dashed":`text-decoration-style:dashed;`,"decoration-dotted":`text-decoration-style:dotted;`,"decoration-double":`text-decoration-style:double;`,"decoration-wavy":`text-decoration-style:wavy;`,"decoration-from-font":`text-decoration-thickness:from-font;`,"decoration-auto":`text-decoration-thickness:auto;`,"decoration-1":`text-decoration-thickness:1px;`,"decoration-2":`text-decoration-thickness:2px;`,"decoration-4":`text-decoration-thickness:4px;`,"decoration-8":`text-decoration-thickness:8px;`,"underline-offset-auto":`text-underline-offset:auto;`,"underline-offset-1":`text-underline-offset:1px;`,"underline-offset-2":`text-underline-offset:2px;`,"underline-offset-4":`text-underline-offset:4px;`,"underline-offset-8":`text-underline-offset:8px;`}),Object.assign(t,{"list-none":`list-style-type:none;`,"list-disc":`list-style-type:disc;`,"list-decimal":`list-style-type:decimal;`,"list-inside":`list-style-position:inside;`,"list-outside":`list-style-position:outside;`}),Object.assign(t,{"content-none":`content:none;`,"content-normal":`content:normal;`,"content-empty":`content:'';`}),Object.assign(t,{"scroll-smooth":`scroll-behavior:smooth;`,"scroll-auto":`scroll-behavior:auto;`,"scroll-m-0":`scroll-margin:0;`,"scroll-p-0":`scroll-padding:0;`,"snap-none":`scroll-snap-type:none;`,"snap-x":`scroll-snap-type:x var(--cer-scroll-snap-strictness,mandatory);`,"snap-y":`scroll-snap-type:y var(--cer-scroll-snap-strictness,mandatory);`,"snap-both":`scroll-snap-type:both var(--cer-scroll-snap-strictness,mandatory);`,"snap-mandatory":`--cer-scroll-snap-strictness:mandatory;`,"snap-proximity":`--cer-scroll-snap-strictness:proximity;`,"snap-start":`scroll-snap-align:start;`,"snap-end":`scroll-snap-align:end;`,"snap-center":`scroll-snap-align:center;`,"snap-align-none":`scroll-snap-align:none;`,"snap-normal":`scroll-snap-stop:normal;`,"snap-always":`scroll-snap-stop:always;`}),Object.assign(t,{"will-change-auto":`will-change:auto;`,"will-change-scroll":`will-change:scroll-position;`,"will-change-contents":`will-change:contents;`,"will-change-transform":`will-change:transform;`,"will-change-opacity":`will-change:opacity;`}),Object.assign(t,{"touch-auto":`touch-action:auto;`,"touch-none":`touch-action:none;`,"touch-pan-x":`touch-action:pan-x;`,"touch-pan-left":`touch-action:pan-left;`,"touch-pan-right":`touch-action:pan-right;`,"touch-pan-y":`touch-action:pan-y;`,"touch-pan-up":`touch-action:pan-up;`,"touch-pan-down":`touch-action:pan-down;`,"touch-pinch-zoom":`touch-action:pinch-zoom;`,"touch-manipulation":`touch-action:manipulation;`}),Object.assign(t,{"columns-auto":`columns:auto;`,"columns-1":`columns:1;`,"columns-2":`columns:2;`,"columns-3":`columns:3;`,"columns-4":`columns:4;`,"columns-5":`columns:5;`,"columns-6":`columns:6;`,"columns-7":`columns:7;`,"columns-8":`columns:8;`,"columns-9":`columns:9;`,"columns-10":`columns:10;`,"columns-11":`columns:11;`,"columns-12":`columns:12;`,"columns-3xs":`columns:${.25*64}rem;`,"columns-2xs":`columns:${.25*80}rem;`,"columns-xs":`columns:${.25*96}rem;`,"columns-sm":`columns:${.25*112}rem;`,"columns-md":`columns:${.25*128}rem;`,"columns-lg":`columns:${.25*160}rem;`,"columns-xl":`columns:${.25*192}rem;`,"columns-2xl":`columns:${.25*224}rem;`,"columns-3xl":`columns:${.25*256}rem;`,"columns-4xl":`columns:${.25*280}rem;`,"columns-5xl":`columns:${.25*320}rem;`}),Object.assign(t,{"divide-x":`border-left-width:1px;`,"divide-x-0":`border-left-width:0px;`,"divide-x-2":`border-left-width:2px;`,"divide-x-4":`border-left-width:4px;`,"divide-x-8":`border-left-width:8px;`,"divide-y":`border-top-width:1px;`,"divide-y-0":`border-top-width:0px;`,"divide-y-2":`border-top-width:2px;`,"divide-y-4":`border-top-width:4px;`,"divide-y-8":`border-top-width:8px;`,"divide-solid":`border-style:solid;`,"divide-dashed":`border-style:dashed;`,"divide-dotted":`border-style:dotted;`,"divide-double":`border-style:double;`,"divide-none":`border-style:none;`});for(let e of[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`grab`,`grabbing`])t[`cursor-${e}`]=`cursor:${e};`;for(let e of[0,1,2,3,4,5,6,7,8,9,10,20,30,40,50])t[`z-${e}`]=`z-index:${e};`;t[`z-auto`]=`z-index:auto;`,t[`-z-10`]=`z-index:-10;`,t[`-z-20`]=`z-index:-20;`,t[`-z-30`]=`z-index:-30;`,t[`-z-40`]=`z-index:-40;`,t[`-z-50`]=`z-index:-50;`,Object.assign(t,{"sr-only":`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;`,"not-sr-only":`position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;`,"pointer-events-none":`pointer-events:none;`,"pointer-events-auto":`pointer-events:auto;`,visible:`visibility:visible;`,invisible:`visibility:hidden;`}),Object.assign(t,{"w-full":`width:100%;`,"w-screen":`width:100dvw;`,"h-full":`height:100%;`,"h-screen":`height:100dvh;`,"max-w-full":`max-width:100%;`,"max-h-full":`max-height:100%;`,"max-w-screen":`max-width:100dvw;`,"max-h-screen":`max-height:100dvh;`,"min-w-0":`min-width:0;`,"min-h-0":`min-height:0;`,"min-w-full":`min-width:100%;`,"min-h-full":`min-height:100%;`,"min-w-screen":`min-width:100dvw;`,"min-h-screen":`min-height:100dvh;`,"w-auto":`width:auto;`,"h-auto":`height:auto;`,"w-fit":`width:fit-content;`,"h-fit":`height:fit-content;`,"w-min":`width:min-content;`,"h-min":`height:min-content;`,"w-max":`width:max-content;`,"h-max":`height:max-content;`,"m-auto":`margin:auto;`,"mx-auto":`margin-inline:auto;`,"my-auto":`margin-block:auto;`});for(let[n,r]of Object.entries(E))t[`max-w-${n}`]=`max-width:calc(${e.p} * ${r});`,t[`min-w-${n}`]=`min-width:calc(${e.p} * ${r});`,t[`w-${n}`]=`width:calc(${e.p} * ${r});`,t[`max-h-${n}`]=`max-height:calc(${e.p} * ${r});`,t[`min-h-${n}`]=`min-height:calc(${e.p} * ${r});`,t[`h-${n}`]=`height:calc(${e.p} * ${r});`;Object.assign(t,{transition:`transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;`,"transition-none":`transition-property:none;`,"transition-all":`transition-property:all;`,"transition-colors":`transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;`,"transition-shadow":`transition-property:box-shadow;`,"transition-opacity":`transition-property:opacity;`,"transition-transform":`transition-property:transform;`,"ease-linear":`transition-timing-function:linear;`,"ease-in":`transition-timing-function:ease-in;`,"ease-out":`transition-timing-function:ease-out;`,"ease-in-out":`transition-timing-function:ease-in-out;`,"duration-75":`transition-duration:75ms;`,"duration-100":`transition-duration:100ms;`,"duration-150":`transition-duration:150ms;`,"duration-200":`transition-duration:200ms;`,"duration-300":`transition-duration:300ms;`,"duration-500":`transition-duration:500ms;`,"duration-700":`transition-duration:700ms;`,"duration-1000":`transition-duration:1000ms;`}),Object.assign(t,{"delay-0":`transition-delay:0ms;`,"delay-75":`transition-delay:75ms;`,"delay-100":`transition-delay:100ms;`,"delay-150":`transition-delay:150ms;`,"delay-200":`transition-delay:200ms;`,"delay-300":`transition-delay:300ms;`,"delay-500":`transition-delay:500ms;`,"delay-700":`transition-delay:700ms;`,"delay-1000":`transition-delay:1000ms;`});let n=`translateX(var(--cer-translate-x)) translateY(var(--cer-translate-y)) rotate(var(--cer-rotate)) skewX(var(--cer-skew-x)) skewY(var(--cer-skew-y)) scaleX(var(--cer-scale-x)) scaleY(var(--cer-scale-y))`,r=e=>`--cer-translate-x:${e};transform:${n};`,i=e=>`--cer-translate-y:${e};transform:${n};`;Object.assign(t,{"scale-0":`--cer-scale-x:0;--cer-scale-y:0;transform:${n};`,"scale-50":`--cer-scale-x:.5;--cer-scale-y:.5;transform:${n};`,"scale-75":`--cer-scale-x:.75;--cer-scale-y:.75;transform:${n};`,"scale-90":`--cer-scale-x:.9;--cer-scale-y:.9;transform:${n};`,"scale-95":`--cer-scale-x:.95;--cer-scale-y:.95;transform:${n};`,"scale-100":`--cer-scale-x:1;--cer-scale-y:1;transform:${n};`,"scale-105":`--cer-scale-x:1.05;--cer-scale-y:1.05;transform:${n};`,"scale-110":`--cer-scale-x:1.1;--cer-scale-y:1.1;transform:${n};`,"scale-125":`--cer-scale-x:1.25;--cer-scale-y:1.25;transform:${n};`,"scale-150":`--cer-scale-x:1.5;--cer-scale-y:1.5;transform:${n};`,"scale-x-0":`--cer-scale-x:0;transform:${n};`,"scale-x-50":`--cer-scale-x:.5;transform:${n};`,"scale-x-75":`--cer-scale-x:.75;transform:${n};`,"scale-x-90":`--cer-scale-x:.9;transform:${n};`,"scale-x-95":`--cer-scale-x:.95;transform:${n};`,"scale-x-100":`--cer-scale-x:1;transform:${n};`,"scale-x-105":`--cer-scale-x:1.05;transform:${n};`,"scale-x-110":`--cer-scale-x:1.1;transform:${n};`,"scale-x-125":`--cer-scale-x:1.25;transform:${n};`,"scale-x-150":`--cer-scale-x:1.5;transform:${n};`,"scale-y-0":`--cer-scale-y:0;transform:${n};`,"scale-y-50":`--cer-scale-y:.5;transform:${n};`,"scale-y-75":`--cer-scale-y:.75;transform:${n};`,"scale-y-90":`--cer-scale-y:.9;transform:${n};`,"scale-y-95":`--cer-scale-y:.95;transform:${n};`,"scale-y-100":`--cer-scale-y:1;transform:${n};`,"scale-y-105":`--cer-scale-y:1.05;transform:${n};`,"scale-y-110":`--cer-scale-y:1.1;transform:${n};`,"scale-y-125":`--cer-scale-y:1.25;transform:${n};`,"scale-y-150":`--cer-scale-y:1.5;transform:${n};`,"rotate-0":`--cer-rotate:0deg;transform:${n};`,"rotate-1":`--cer-rotate:1deg;transform:${n};`,"rotate-2":`--cer-rotate:2deg;transform:${n};`,"rotate-3":`--cer-rotate:3deg;transform:${n};`,"rotate-6":`--cer-rotate:6deg;transform:${n};`,"rotate-12":`--cer-rotate:12deg;transform:${n};`,"rotate-45":`--cer-rotate:45deg;transform:${n};`,"rotate-90":`--cer-rotate:90deg;transform:${n};`,"rotate-180":`--cer-rotate:180deg;transform:${n};`,"-rotate-1":`--cer-rotate:-1deg;transform:${n};`,"-rotate-2":`--cer-rotate:-2deg;transform:${n};`,"-rotate-3":`--cer-rotate:-3deg;transform:${n};`,"-rotate-6":`--cer-rotate:-6deg;transform:${n};`,"-rotate-12":`--cer-rotate:-12deg;transform:${n};`,"-rotate-45":`--cer-rotate:-45deg;transform:${n};`,"-rotate-90":`--cer-rotate:-90deg;transform:${n};`,"-rotate-180":`--cer-rotate:-180deg;transform:${n};`,"translate-x-0":r(`0px`),"translate-x-px":r(`1px`),"translate-x-0.5":r(`0.125rem`),"translate-x-1":r(`0.25rem`),"translate-x-1.5":r(`0.375rem`),"translate-x-2":r(`0.5rem`),"translate-x-2.5":r(`0.625rem`),"translate-x-3":r(`0.75rem`),"translate-x-4":r(`1rem`),"translate-x-5":r(`1.25rem`),"translate-x-6":r(`1.5rem`),"translate-x-8":r(`2rem`),"translate-x-10":r(`2.5rem`),"translate-x-12":r(`3rem`),"translate-x-16":r(`4rem`),"translate-x-20":r(`5rem`),"translate-x-24":r(`6rem`),"translate-x-32":r(`8rem`),"translate-x-1/2":r(`50%`),"translate-x-1/3":r(`33.333333%`),"translate-x-2/3":r(`66.666667%`),"translate-x-1/4":r(`25%`),"translate-x-3/4":r(`75%`),"translate-x-full":r(`100%`),"-translate-x-px":r(`-1px`),"-translate-x-0.5":r(`-0.125rem`),"-translate-x-1":r(`-0.25rem`),"-translate-x-1.5":r(`-0.375rem`),"-translate-x-2":r(`-0.5rem`),"-translate-x-2.5":r(`-0.625rem`),"-translate-x-3":r(`-0.75rem`),"-translate-x-4":r(`-1rem`),"-translate-x-1/2":r(`-50%`),"-translate-x-full":r(`-100%`),"translate-y-0":i(`0px`),"translate-y-px":i(`1px`),"translate-y-0.5":i(`0.125rem`),"translate-y-1":i(`0.25rem`),"translate-y-1.5":i(`0.375rem`),"translate-y-2":i(`0.5rem`),"translate-y-2.5":i(`0.625rem`),"translate-y-3":i(`0.75rem`),"translate-y-4":i(`1rem`),"translate-y-5":i(`1.25rem`),"translate-y-6":i(`1.5rem`),"translate-y-8":i(`2rem`),"translate-y-10":i(`2.5rem`),"translate-y-12":i(`3rem`),"translate-y-16":i(`4rem`),"translate-y-20":i(`5rem`),"translate-y-24":i(`6rem`),"translate-y-32":i(`8rem`),"translate-y-1/2":i(`50%`),"translate-y-full":i(`100%`),"-translate-y-px":i(`-1px`),"-translate-y-0.5":i(`-0.125rem`),"-translate-y-1":i(`-0.25rem`),"-translate-y-2":i(`-0.5rem`),"-translate-y-4":i(`-1rem`),"-translate-y-1/2":i(`-50%`),"-translate-y-full":i(`-100%`),"skew-x-0":`--cer-skew-x:0deg;transform:${n};`,"skew-x-1":`--cer-skew-x:1deg;transform:${n};`,"skew-x-2":`--cer-skew-x:2deg;transform:${n};`,"skew-x-3":`--cer-skew-x:3deg;transform:${n};`,"skew-x-6":`--cer-skew-x:6deg;transform:${n};`,"skew-x-12":`--cer-skew-x:12deg;transform:${n};`,"-skew-x-1":`--cer-skew-x:-1deg;transform:${n};`,"-skew-x-2":`--cer-skew-x:-2deg;transform:${n};`,"-skew-x-3":`--cer-skew-x:-3deg;transform:${n};`,"-skew-x-6":`--cer-skew-x:-6deg;transform:${n};`,"-skew-x-12":`--cer-skew-x:-12deg;transform:${n};`,"skew-y-0":`--cer-skew-y:0deg;transform:${n};`,"skew-y-1":`--cer-skew-y:1deg;transform:${n};`,"skew-y-2":`--cer-skew-y:2deg;transform:${n};`,"skew-y-3":`--cer-skew-y:3deg;transform:${n};`,"skew-y-6":`--cer-skew-y:6deg;transform:${n};`,"skew-y-12":`--cer-skew-y:12deg;transform:${n};`,"-skew-y-1":`--cer-skew-y:-1deg;transform:${n};`,"-skew-y-2":`--cer-skew-y:-2deg;transform:${n};`,"-skew-y-3":`--cer-skew-y:-3deg;transform:${n};`,"-skew-y-6":`--cer-skew-y:-6deg;transform:${n};`,"-skew-y-12":`--cer-skew-y:-12deg;transform:${n};`}),Object.assign(t,{ring:`box-shadow:0 0 0 3px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-0":`box-shadow:0 0 0 0px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-1":`box-shadow:0 0 0 1px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-2":`box-shadow:0 0 0 2px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-4":`box-shadow:0 0 0 4px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-8":`box-shadow:0 0 0 8px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-inset":`box-shadow:inset 0 0 0 3px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-offset-0":`--cer-ring-offset-width:0px;box-shadow:0 0 0 0px var(--cer-ring-offset-color,#fff),0 0 0 3px var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-offset-1":`--cer-ring-offset-width:1px;box-shadow:0 0 0 1px var(--cer-ring-offset-color,#fff),0 0 0 calc(3px + 1px) var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-offset-2":`--cer-ring-offset-width:2px;box-shadow:0 0 0 2px var(--cer-ring-offset-color,#fff),0 0 0 calc(3px + 2px) var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-offset-4":`--cer-ring-offset-width:4px;box-shadow:0 0 0 4px var(--cer-ring-offset-color,#fff),0 0 0 calc(3px + 4px) var(--cer-ring-color,rgb(59 130 246/0.5));`,"ring-offset-8":`--cer-ring-offset-width:8px;box-shadow:0 0 0 8px var(--cer-ring-offset-color,#fff),0 0 0 calc(3px + 8px) var(--cer-ring-color,rgb(59 130 246/0.5));`});let a=`var(--cer-blur) var(--cer-brightness) var(--cer-contrast) var(--cer-grayscale) var(--cer-hue-rotate) var(--cer-invert) var(--cer-saturate) var(--cer-sepia) var(--cer-drop-shadow)`,o=`var(--cer-backdrop-blur) var(--cer-backdrop-brightness) var(--cer-backdrop-contrast) var(--cer-backdrop-grayscale) var(--cer-backdrop-hue-rotate) var(--cer-backdrop-invert) var(--cer-backdrop-saturate) var(--cer-backdrop-sepia)`;Object.assign(t,{"blur-none":`--cer-blur:;filter:${a};`,"blur-sm":`--cer-blur:blur(4px);filter:${a};`,blur:`--cer-blur:blur(8px);filter:${a};`,"blur-md":`--cer-blur:blur(12px);filter:${a};`,"blur-lg":`--cer-blur:blur(16px);filter:${a};`,"blur-xl":`--cer-blur:blur(24px);filter:${a};`,"blur-2xl":`--cer-blur:blur(40px);filter:${a};`,"blur-3xl":`--cer-blur:blur(64px);filter:${a};`,"brightness-0":`--cer-brightness:brightness(0);filter:${a};`,"brightness-50":`--cer-brightness:brightness(.5);filter:${a};`,"brightness-75":`--cer-brightness:brightness(.75);filter:${a};`,"brightness-90":`--cer-brightness:brightness(.9);filter:${a};`,"brightness-95":`--cer-brightness:brightness(.95);filter:${a};`,"brightness-100":`--cer-brightness:brightness(1);filter:${a};`,"brightness-105":`--cer-brightness:brightness(1.05);filter:${a};`,"brightness-110":`--cer-brightness:brightness(1.1);filter:${a};`,"brightness-125":`--cer-brightness:brightness(1.25);filter:${a};`,"brightness-150":`--cer-brightness:brightness(1.5);filter:${a};`,"brightness-200":`--cer-brightness:brightness(2);filter:${a};`,"contrast-0":`--cer-contrast:contrast(0);filter:${a};`,"contrast-50":`--cer-contrast:contrast(.5);filter:${a};`,"contrast-75":`--cer-contrast:contrast(.75);filter:${a};`,"contrast-100":`--cer-contrast:contrast(1);filter:${a};`,"contrast-125":`--cer-contrast:contrast(1.25);filter:${a};`,"contrast-150":`--cer-contrast:contrast(1.5);filter:${a};`,"contrast-200":`--cer-contrast:contrast(2);filter:${a};`,grayscale:`--cer-grayscale:grayscale(100%);filter:${a};`,"grayscale-0":`--cer-grayscale:grayscale(0);filter:${a};`,"hue-rotate-0":`--cer-hue-rotate:hue-rotate(0deg);filter:${a};`,"hue-rotate-15":`--cer-hue-rotate:hue-rotate(15deg);filter:${a};`,"hue-rotate-30":`--cer-hue-rotate:hue-rotate(30deg);filter:${a};`,"hue-rotate-60":`--cer-hue-rotate:hue-rotate(60deg);filter:${a};`,"hue-rotate-90":`--cer-hue-rotate:hue-rotate(90deg);filter:${a};`,"hue-rotate-180":`--cer-hue-rotate:hue-rotate(180deg);filter:${a};`,"-hue-rotate-180":`--cer-hue-rotate:hue-rotate(-180deg);filter:${a};`,"-hue-rotate-90":`--cer-hue-rotate:hue-rotate(-90deg);filter:${a};`,"-hue-rotate-60":`--cer-hue-rotate:hue-rotate(-60deg);filter:${a};`,"-hue-rotate-30":`--cer-hue-rotate:hue-rotate(-30deg);filter:${a};`,"-hue-rotate-15":`--cer-hue-rotate:hue-rotate(-15deg);filter:${a};`,invert:`--cer-invert:invert(100%);filter:${a};`,"invert-0":`--cer-invert:invert(0);filter:${a};`,"saturate-0":`--cer-saturate:saturate(0);filter:${a};`,"saturate-50":`--cer-saturate:saturate(.5);filter:${a};`,"saturate-100":`--cer-saturate:saturate(1);filter:${a};`,"saturate-150":`--cer-saturate:saturate(1.5);filter:${a};`,"saturate-200":`--cer-saturate:saturate(2);filter:${a};`,sepia:`--cer-sepia:sepia(100%);filter:${a};`,"sepia-0":`--cer-sepia:sepia(0);filter:${a};`,"drop-shadow-sm":`--cer-drop-shadow:drop-shadow(0 1px 1px rgb(0 0 0/.05));filter:${a};`,"drop-shadow":`--cer-drop-shadow:drop-shadow(0 1px 2px rgb(0 0 0/.1)) drop-shadow(0 1px 1px rgb(0 0 0/.06));filter:${a};`,"drop-shadow-md":`--cer-drop-shadow:drop-shadow(0 4px 3px rgb(0 0 0/.07)) drop-shadow(0 2px 2px rgb(0 0 0/.06));filter:${a};`,"drop-shadow-lg":`--cer-drop-shadow:drop-shadow(0 10px 8px rgb(0 0 0/.04)) drop-shadow(0 4px 3px rgb(0 0 0/.1));filter:${a};`,"drop-shadow-xl":`--cer-drop-shadow:drop-shadow(0 20px 13px rgb(0 0 0/.03)) drop-shadow(0 8px 5px rgb(0 0 0/.08));filter:${a};`,"drop-shadow-2xl":`--cer-drop-shadow:drop-shadow(0 25px 25px rgb(0 0 0/.15));filter:${a};`,"drop-shadow-none":`--cer-drop-shadow:drop-shadow(0 0 #0000);filter:${a};`,"backdrop-blur-none":`--cer-backdrop-blur:;backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-sm":`--cer-backdrop-blur:blur(4px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur":`--cer-backdrop-blur:blur(8px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-md":`--cer-backdrop-blur:blur(12px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-lg":`--cer-backdrop-blur:blur(16px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-xl":`--cer-backdrop-blur:blur(24px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-2xl":`--cer-backdrop-blur:blur(40px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`,"backdrop-blur-3xl":`--cer-backdrop-blur:blur(64px);backdrop-filter:${o};-webkit-backdrop-filter:${o};`}),Object.assign(t,{"aspect-auto":`aspect-ratio:auto;`,"aspect-square":`aspect-ratio:1 / 1;`,"aspect-video":`aspect-ratio:16 / 9;`}),Object.assign(t,{"object-contain":`object-fit:contain;`,"object-cover":`object-fit:cover;`,"object-fill":`object-fit:fill;`,"object-none":`object-fit:none;`,"object-scale-down":`object-fit:scale-down;`,"object-bottom":`object-position:bottom;`,"object-center":`object-position:center;`,"object-left":`object-position:left;`,"object-left-bottom":`object-position:left bottom;`,"object-left-top":`object-position:left top;`,"object-right":`object-position:right;`,"object-right-bottom":`object-position:right bottom;`,"object-right-top":`object-position:right top;`,"object-top":`object-position:top;`});for(let e=1;e<=6;e++)t[`line-clamp-${e}`]=`display:-webkit-box;-webkit-line-clamp:${e};-webkit-box-orient:vertical;overflow:hidden;`;t[`line-clamp-none`]=`overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none;`;for(let e=1;e<=12;e++)t[`order-${e}`]=`order:${e};`;t[`order-first`]=`order:-9999;`,t[`order-last`]=`order:9999;`,t[`order-none`]=`order:0;`;for(let e=0;e<=12;e++)e<=1||(t[`grow-${e}`]=`flex-grow:${e};`,t[`shrink-${e}`]=`flex-shrink:${e};`);return Object.assign(t,{"bg-linear-to-t":`background-image:linear-gradient(to top, var(--cer-gradient-stops));`,"bg-linear-to-tr":`background-image:linear-gradient(to top right, var(--cer-gradient-stops));`,"bg-linear-to-r":`background-image:linear-gradient(to right, var(--cer-gradient-stops));`,"bg-linear-to-br":`background-image:linear-gradient(to bottom right, var(--cer-gradient-stops));`,"bg-linear-to-b":`background-image:linear-gradient(to bottom, var(--cer-gradient-stops));`,"bg-linear-to-bl":`background-image:linear-gradient(to bottom left, var(--cer-gradient-stops));`,"bg-linear-to-l":`background-image:linear-gradient(to left, var(--cer-gradient-stops));`,"bg-linear-to-tl":`background-image:linear-gradient(to top left, var(--cer-gradient-stops));`,"bg-radial":`background-image:radial-gradient(ellipse at center, var(--cer-gradient-stops));`,"bg-radial-at-t":`background-image:radial-gradient(ellipse at top, var(--cer-gradient-stops));`,"bg-radial-at-tr":`background-image:radial-gradient(ellipse at top right, var(--cer-gradient-stops));`,"bg-radial-at-r":`background-image:radial-gradient(ellipse at right, var(--cer-gradient-stops));`,"bg-radial-at-br":`background-image:radial-gradient(ellipse at bottom right, var(--cer-gradient-stops));`,"bg-radial-at-b":`background-image:radial-gradient(ellipse at bottom, var(--cer-gradient-stops));`,"bg-radial-at-bl":`background-image:radial-gradient(ellipse at bottom left, var(--cer-gradient-stops));`,"bg-radial-at-l":`background-image:radial-gradient(ellipse at left, var(--cer-gradient-stops));`,"bg-radial-at-tl":`background-image:radial-gradient(ellipse at top left, var(--cer-gradient-stops));`,"bg-radial-circle":`background-image:radial-gradient(circle at center, var(--cer-gradient-stops));`,"bg-radial-circle-at-t":`background-image:radial-gradient(circle at top, var(--cer-gradient-stops));`,"bg-radial-circle-at-tr":`background-image:radial-gradient(circle at top right, var(--cer-gradient-stops));`,"bg-radial-circle-at-r":`background-image:radial-gradient(circle at right, var(--cer-gradient-stops));`,"bg-radial-circle-at-br":`background-image:radial-gradient(circle at bottom right, var(--cer-gradient-stops));`,"bg-radial-circle-at-b":`background-image:radial-gradient(circle at bottom, var(--cer-gradient-stops));`,"bg-radial-circle-at-bl":`background-image:radial-gradient(circle at bottom left, var(--cer-gradient-stops));`,"bg-radial-circle-at-l":`background-image:radial-gradient(circle at left, var(--cer-gradient-stops));`,"bg-radial-circle-at-tl":`background-image:radial-gradient(circle at top left, var(--cer-gradient-stops));`,"bg-conic":`background-image:conic-gradient(from 0deg at center, var(--cer-gradient-stops));`,"bg-conic-at-t":`background-image:conic-gradient(from 0deg at top, var(--cer-gradient-stops));`,"bg-conic-at-tr":`background-image:conic-gradient(from 0deg at top right, var(--cer-gradient-stops));`,"bg-conic-at-r":`background-image:conic-gradient(from 0deg at right, var(--cer-gradient-stops));`,"bg-conic-at-br":`background-image:conic-gradient(from 0deg at bottom right, var(--cer-gradient-stops));`,"bg-conic-at-b":`background-image:conic-gradient(from 0deg at bottom, var(--cer-gradient-stops));`,"bg-conic-at-bl":`background-image:conic-gradient(from 0deg at bottom left, var(--cer-gradient-stops));`,"bg-conic-at-l":`background-image:conic-gradient(from 0deg at left, var(--cer-gradient-stops));`,"bg-conic-at-tl":`background-image:conic-gradient(from 0deg at top left, var(--cer-gradient-stops));`}),Object.assign(t,{"prose-invert":`
2
+ --cer-prose-body:var(--cer-color-neutral-200);
3
+ --cer-prose-headings:var(--cer-color-neutral-50);
4
+ --cer-prose-lead:var(--cer-color-neutral-300);
5
+ --cer-prose-bold:var(--cer-color-neutral-50);
6
+ --cer-prose-quotes:var(--cer-color-neutral-300);
7
+ --cer-prose-quote-border:var(--cer-color-neutral-700);
8
+ --cer-prose-code:var(--cer-color-neutral-200);
9
+ --cer-prose-code-bg:var(--cer-color-neutral-900);
10
+ --cer-prose-pre-code:var(--cer-color-neutral-200);
11
+ --cer-prose-pre-bg:var(--cer-color-neutral-900);
12
+ --cer-prose-pre-border:var(--cer-color-neutral-800);
13
+ --cer-prose-hr:var(--cer-color-neutral-700);
14
+ --cer-prose-caps:var(--cer-color-neutral-400);
15
+ --cer-prose-list-marker:var(--cer-color-neutral-400);
16
+ --cer-prose-list-marker-strong:var(--cer-color-neutral-300);
17
+ --cer-prose-counters:var(--cer-color-neutral-300);
18
+ --cer-prose-bullets:var(--cer-color-neutral-300);
19
+ --cer-prose-img-caption:var(--cer-color-neutral-400);
20
+ --cer-prose-table-border:var(--cer-color-neutral-700);
21
+ --cer-prose-table-head:var(--cer-color-neutral-200);
22
+ --cer-prose-links:var(--cer-prose-invert-links,var(--cer-color-neutral-300));
23
+ --cer-prose-links-hover:var(--cer-prose-invert-links-hover,var(--cer-color-neutral-100));
24
+ `.replace(/\s+/g,``),"prose-primary":`
25
+ --cer-prose-links:var(--cer-color-primary-700);
26
+ --cer-prose-links-hover:var(--cer-color-primary-500);
27
+ --cer-prose-invert-links:var(--cer-color-primary-300);
28
+ --cer-prose-invert-links-hover:var(--cer-color-primary-100);
29
+ `.replace(/\s+/g,``),"prose-secondary":`
30
+ --cer-prose-links:var(--cer-color-secondary-700);
31
+ --cer-prose-links-hover:var(--cer-color-secondary-500);
32
+ --cer-prose-invert-links:var(--cer-color-secondary-300);
33
+ --cer-prose-invert-links-hover:var(--cer-color-secondary-100);
34
+ `.replace(/\s+/g,``),"prose-success":`
35
+ --cer-prose-links:var(--cer-color-success-700);
36
+ --cer-prose-links-hover:var(--cer-color-success-500);
37
+ --cer-prose-invert-links:var(--cer-color-success-300);
38
+ --cer-prose-invert-links-hover:var(--cer-color-success-100);
39
+ `.replace(/\s+/g,``),"prose-warning":`
40
+ --cer-prose-links:var(--cer-color-warning-700);
41
+ --cer-prose-links-hover:var(--cer-color-warning-500);
42
+ --cer-prose-invert-links:var(--cer-color-warning-300);
43
+ --cer-prose-invert-links-hover:var(--cer-color-warning-100);
44
+ `.replace(/\s+/g,``),"prose-error":`
45
+ --cer-prose-links:var(--cer-color-error-700);
46
+ --cer-prose-links-hover:var(--cer-color-error-500);
47
+ --cer-prose-invert-links:var(--cer-color-error-300);
48
+ --cer-prose-invert-links-hover:var(--cer-color-error-100);
49
+ `.replace(/\s+/g,``),"prose-info":`
50
+ --cer-prose-links:var(--cer-color-info-700);
51
+ --cer-prose-links-hover:var(--cer-color-info-500);
52
+ --cer-prose-invert-links:var(--cer-color-info-300);
53
+ --cer-prose-invert-links-hover:var(--cer-color-info-100);
54
+ `.replace(/\s+/g,``)}),t[`flow-root`]=`display:flow-root;`,t[`text-start`]=`text-align:start;`,t[`text-end`]=`text-align:end;`,t[`grid-cols-subgrid`]=`grid-template-columns:subgrid;`,t[`grid-rows-subgrid`]=`grid-template-rows:subgrid;`,Object.assign(t,{"text-shadow-xs":`--cer-text-shadow-color:rgb(0 0 0 / 0.05);text-shadow:0 1px 1px var(--cer-text-shadow-color, rgb(0 0 0 / 0.05));`,"text-shadow-sm":`--cer-text-shadow-color:rgb(0 0 0 / 0.15);text-shadow:0 1px 2px var(--cer-text-shadow-color, rgb(0 0 0 / 0.15));`,"text-shadow":`--cer-text-shadow-color:rgb(0 0 0 / 0.3);text-shadow:0 1px 3px var(--cer-text-shadow-color, rgb(0 0 0 / 0.3));`,"text-shadow-md":`--cer-text-shadow-color:rgb(0 0 0 / 0.3);text-shadow:0 2px 4px var(--cer-text-shadow-color, rgb(0 0 0 / 0.3));`,"text-shadow-lg":`--cer-text-shadow-color:rgb(0 0 0 / 0.3);text-shadow:0 4px 8px var(--cer-text-shadow-color, rgb(0 0 0 / 0.3));`,"text-shadow-xl":`--cer-text-shadow-color:rgb(0 0 0 / 0.3);text-shadow:0 6px 16px var(--cer-text-shadow-color, rgb(0 0 0 / 0.3));`,"text-shadow-2xl":`--cer-text-shadow-color:rgb(0 0 0 / 0.3);text-shadow:0 8px 24px var(--cer-text-shadow-color, rgb(0 0 0 / 0.3));`,"text-shadow-none":`text-shadow:none;`}),Object.assign(t,{"mask-none":`mask-image:none;`,"mask-linear-to-t":`mask-image:linear-gradient(to top,black,transparent);`,"mask-linear-to-tr":`mask-image:linear-gradient(to top right,black,transparent);`,"mask-linear-to-r":`mask-image:linear-gradient(to right,black,transparent);`,"mask-linear-to-br":`mask-image:linear-gradient(to bottom right,black,transparent);`,"mask-linear-to-b":`mask-image:linear-gradient(to bottom,black,transparent);`,"mask-linear-to-bl":`mask-image:linear-gradient(to bottom left,black,transparent);`,"mask-linear-to-l":`mask-image:linear-gradient(to left,black,transparent);`,"mask-linear-to-tl":`mask-image:linear-gradient(to top left,black,transparent);`,"mask-radial":`mask-image:radial-gradient(ellipse at center,black,transparent);`,"mask-radial-from-center":`mask-image:radial-gradient(ellipse at center,black 0%,transparent 100%);`,"mask-size-contain":`mask-size:contain;`,"mask-size-cover":`mask-size:cover;`,"mask-no-repeat":`mask-repeat:no-repeat;`,"mask-repeat":`mask-repeat:repeat;`,"mask-alpha":`mask-mode:alpha;`,"mask-luminance":`mask-mode:luminance;`}),t[`field-sizing-content`]=`field-sizing:content;`,t[`field-sizing-fixed`]=`field-sizing:fixed;`,Object.assign(t,{"scheme-light":`color-scheme:light;`,"scheme-dark":`color-scheme:dark;`,"scheme-both":`color-scheme:light dark;`,"scheme-only-light":`color-scheme:only light;`,"scheme-only-dark":`color-scheme:only dark;`,"scheme-normal":`color-scheme:normal;`}),Object.assign(t,{"font-stretch-ultra-condensed":`font-stretch:ultra-condensed;`,"font-stretch-extra-condensed":`font-stretch:extra-condensed;`,"font-stretch-condensed":`font-stretch:condensed;`,"font-stretch-semi-condensed":`font-stretch:semi-condensed;`,"font-stretch-normal":`font-stretch:normal;`,"font-stretch-semi-expanded":`font-stretch:semi-expanded;`,"font-stretch-expanded":`font-stretch:expanded;`,"font-stretch-extra-expanded":`font-stretch:extra-expanded;`,"font-stretch-ultra-expanded":`font-stretch:ultra-expanded;`}),Object.assign(t,{"cursor-zoom-in":`cursor:zoom-in;`,"cursor-zoom-out":`cursor:zoom-out;`,"cursor-cell":`cursor:cell;`,"cursor-crosshair":`cursor:crosshair;`,"cursor-copy":`cursor:copy;`,"cursor-alias":`cursor:alias;`,"cursor-context-menu":`cursor:context-menu;`,"cursor-vertical-text":`cursor:vertical-text;`,"cursor-no-drop":`cursor:no-drop;`,"cursor-progress":`cursor:progress;`,"cursor-col-resize":`cursor:col-resize;`,"cursor-row-resize":`cursor:row-resize;`,"cursor-ew-resize":`cursor:ew-resize;`,"cursor-ns-resize":`cursor:ns-resize;`,"cursor-nesw-resize":`cursor:nesw-resize;`,"cursor-nwse-resize":`cursor:nwse-resize;`,"cursor-all-scroll":`cursor:all-scroll;`}),Object.assign(t,{"border-s":`border-inline-start-width:1px;`,"border-e":`border-inline-end-width:1px;`,"border-s-0":`border-inline-start-width:0px;`,"border-e-0":`border-inline-end-width:0px;`,"border-s-2":`border-inline-start-width:2px;`,"border-e-2":`border-inline-end-width:2px;`,"border-s-4":`border-inline-start-width:4px;`,"border-e-4":`border-inline-end-width:4px;`,"border-s-8":`border-inline-start-width:8px;`,"border-e-8":`border-inline-end-width:8px;`}),Object.assign(t,{"rounded-s-none":`border-start-start-radius:0;border-end-start-radius:0;`,"rounded-e-none":`border-start-end-radius:0;border-end-end-radius:0;`,"rounded-s-sm":`border-start-start-radius:0.125rem;border-end-start-radius:0.125rem;`,"rounded-e-sm":`border-start-end-radius:0.125rem;border-end-end-radius:0.125rem;`,"rounded-s":`border-start-start-radius:0.25rem;border-end-start-radius:0.25rem;`,"rounded-e":`border-start-end-radius:0.25rem;border-end-end-radius:0.25rem;`,"rounded-s-md":`border-start-start-radius:0.375rem;border-end-start-radius:0.375rem;`,"rounded-e-md":`border-start-end-radius:0.375rem;border-end-end-radius:0.375rem;`,"rounded-s-lg":`border-start-start-radius:0.5rem;border-end-start-radius:0.5rem;`,"rounded-e-lg":`border-start-end-radius:0.5rem;border-end-end-radius:0.5rem;`,"rounded-s-xl":`border-start-start-radius:0.75rem;border-end-start-radius:0.75rem;`,"rounded-e-xl":`border-start-end-radius:0.75rem;border-end-end-radius:0.75rem;`,"rounded-s-2xl":`border-start-start-radius:1rem;border-end-start-radius:1rem;`,"rounded-e-2xl":`border-start-end-radius:1rem;border-end-end-radius:1rem;`,"rounded-s-3xl":`border-start-start-radius:1.5rem;border-end-start-radius:1.5rem;`,"rounded-e-3xl":`border-start-end-radius:1.5rem;border-end-end-radius:1.5rem;`,"rounded-s-full":`border-start-start-radius:9999px;border-end-start-radius:9999px;`,"rounded-e-full":`border-start-end-radius:9999px;border-end-end-radius:9999px;`}),t})();function k(e){return/^prose(?:-(sm|lg|xl|2xl))?$/.test(e)?(f(e),``):null}function A(e){return/^prose-([a-z0-9]+):(.+)$/.test(e)?a(e,O,L,R,K,W,G,q):null}function j(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i===`[`||i===`(`)n++;else if((i===`]`||i===`)`)&&n>0)n--;else if(n===0&&(i===`>`||i===`+`||i===`~`||i===` `))return e.slice(0,r)+t+e.slice(r)}return e+t}var M={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${j(e,`:hover`)}{${t}}`,focus:(e,t)=>`${j(e,`:focus`)}{${t}}`,active:(e,t)=>`${j(e,`:active`)}{${t}}`,disabled:(e,t)=>`${j(e,`:disabled`)}{${t}}`,visited:(e,t)=>`${j(e,`:visited`)}{${t}}`,checked:(e,t)=>`${j(e,`:checked`)}{${t}}`,first:(e,t)=>`${j(e,`:first-child`)}{${t}}`,last:(e,t)=>`${j(e,`:last-child`)}{${t}}`,odd:(e,t)=>`${j(e,`:nth-child(odd)`)}{${t}}`,even:(e,t)=>`${j(e,`:nth-child(even)`)}{${t}}`,"focus-within":(e,t)=>`${j(e,`:focus-within`)}{${t}}`,"focus-visible":(e,t)=>`${j(e,`:focus-visible`)}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`,"dark-class":(e,t)=>`:host(.dark) ${e}{${t}}`,rtl:(e,t)=>`[dir=rtl] ${e}{${t}}`,ltr:(e,t)=>`[dir=ltr] ${e}{${t}}`,placeholder:(e,t)=>`${e}::placeholder{${t}}`,file:(e,t)=>`${e}::file-selector-button{${t}}`,marker:(e,t)=>`${e}::marker{${t}}`,selection:(e,t)=>`${e}::selection{${t}}`,open:(e,t)=>`${j(e,`[open]`)}{${t}}`,inert:(e,t)=>`${j(e,`[inert]`)}{${t}}`},N={sm:`(min-width:640px)`,md:`(min-width:768px)`,lg:`(min-width:1024px)`,xl:`(min-width:1280px)`,"2xl":`(min-width:1536px)`,dark:`(prefers-color-scheme: dark)`,"motion-reduce":`(prefers-reduced-motion: reduce)`,"motion-safe":`(prefers-reduced-motion: no-preference)`,print:`print`,"forced-colors":`(forced-colors: active)`},P={xs:`(min-width:20rem)`,sm:`(min-width:24rem)`,md:`(min-width:28rem)`,lg:`(min-width:32rem)`,xl:`(min-width:36rem)`,"2xl":`(min-width:42rem)`,"3xl":`(min-width:48rem)`,"4xl":`(min-width:56rem)`,"5xl":`(min-width:64rem)`,"6xl":`(min-width:72rem)`,"7xl":`(min-width:80rem)`},F=[`sm`,`md`,`lg`,`xl`,`2xl`,`motion-reduce`,`motion-safe`,`print`,`forced-colors`],I=[`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`7xl`];function L(t){let n=t.startsWith(`-`),r=n?t.slice(1):t,i=r.lastIndexOf(`-`);if(i===-1)return null;let a=r.slice(0,i),o=r.slice(i+1);if(!D[a])return null;if(o.includes(`/`)){let[e,t]=o.split(`/`).map(e=>parseFloat(e));if(Number.isNaN(e)||Number.isNaN(t)||t===0)return null;let n=e/t*100;return D[a].map(e=>`${e}:${n}%;`).join(``)}let s=parseFloat(o);if(Number.isNaN(s))return null;let c=n?`-`:``;return D[a].map(t=>`${t}:calc(${c}${e.p} * ${s});`).join(``)}function R(t){let n=t.startsWith(`-`),r=(n?t.slice(1):t).match(/^space-(x|y)-(.+)$/);if(!r)return null;let[,i,a]=r,o=i===`x`;if(a===`reverse`)return o?`--cer-space-x-reverse:1;`:`--cer-space-y-reverse:1;`;if(a.includes(`/`)){let[e,t]=a.split(`/`).map(e=>parseFloat(e));if(Number.isNaN(e)||Number.isNaN(t)||t===0)return null;let r=e/t*100,i=n?`-`:``;return o?`--cer-space-x-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-inline-start:calc(${i}${r}% * calc(1 - var(--cer-space-x-reverse)));margin-inline-end:calc(${i}${r}% * var(--cer-space-x-reverse));}`:`--cer-space-y-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-top:calc(${i}${r}% * calc(1 - var(--cer-space-y-reverse)));margin-bottom:calc(${i}${r}% * var(--cer-space-y-reverse));}`}let s=parseFloat(a);if(Number.isNaN(s))return null;let c=`calc(${n?`-`:``}${e.p} * ${s})`;return o?`--cer-space-x-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-inline-start:calc(${c} * calc(1 - var(--cer-space-x-reverse)));margin-inline-end:calc(${c} * var(--cer-space-x-reverse));}`:`--cer-space-y-reverse:0;& > :not([hidden]) ~ :not([hidden]){margin-top:calc(${c} * calc(1 - var(--cer-space-y-reverse)));margin-bottom:calc(${c} * var(--cer-space-y-reverse));}`}function z(e){let t=e.replace(`#`,``);t.length===3&&(t=t.split(``).map(e=>e+e).join(``));let n=parseInt(t,16);return`${n>>16&255} ${n>>8&255} ${n&255}`}var B=/^(text-shadow|bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke|ring|divide)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/,V={bg:`background-color`,decoration:`text-decoration-color`,text:`color`,border:`border-color`,outline:`outline-color`,caret:`caret-color`,accent:`accent-color`,fill:`fill`,stroke:`stroke`};function H(e){let t=B.exec(e);if(!t)return null;let[,n,r,i=`DEFAULT`]=t,a=m[r]?.[i];if(!a)return null;if(n===`shadow`)return`--cer-shadow-color:${a};`;if(n===`ring`)return`--cer-ring-color:${a};`;if(n===`divide`)return`border-color:${a};`;if(n===`text-shadow`)return`--cer-text-shadow-color:${a};`;let o=V[n];return o?`${o}:${a};`:null}function U(e){let t=e.indexOf(`/`);if(t===-1)return{base:e};let n=e.slice(0,t),r=e.slice(t+1),i=parseInt(r,10);return isNaN(i)||i<0||i>100?{base:n}:{base:n,opacity:i/100}}function W(e){let{base:t,opacity:n}=U(e),r=H(t);if(r){if(n!==void 0){if(r.includes(`var(`)){let e=/var\([^)]*\)/.exec(r);if(e){let t=e[0],i=n*100,a=`color-mix(in srgb, ${t} ${i}%, rgba(0 0 0 / 0) ${100-i}%)`,o=/#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(t),s=/^([a-z-]+):/.exec(r),c=s?s[1]:`background-color`;if(o){let e=`rgb(${z(o[0])} / ${n})`;return`${c}:${t.replace(/#([0-9a-f]{6}|[0-9a-f]{3})/i,e)};__CE_COLOR_MIX_SPLIT__${c}:${a};`}return`${c}:${a};`}}let e=/#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(r);if(e){let t=z(e[0]);return r.replace(/#([0-9a-f]{6}|[0-9a-f]{3})/i,`rgb(${t} / ${n})`)}}return r}let i=q(t);if(i&&n!==void 0){if(i.includes(`var(`)){let e=/var\([^)]*\)/.exec(i);if(e){let t=e[0],r=n*100,a=`color-mix(in srgb, ${t} ${r}%, rgba(0 0 0 / 0) ${100-r}%)`,o=/#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(t),s=/^([a-z-]+):/.exec(i),c=s?s[1]:null;if(o&&c){let e=`rgb(${z(o[0])} / ${n})`;return`${c}:${t.replace(/#([0-9a-f]{6}|[0-9a-f]{3})/i,e)};__CE_COLOR_MIX_SPLIT__${c}:${a};`}return i.replace(t,a)}}let e=/#([0-9a-f]{6}|[0-9a-f]{3})/i.exec(i);if(e){let t=z(e[0]);return i.replace(/#([0-9a-f]{6}|[0-9a-f]{3})/i,`rgb(${t} / ${n})`)}}return i}function G(e){let t=/^(from|to|via)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;let[,n,r,i=`DEFAULT`]=t,a=m[r]?.[i];if(!a)return null;switch(n){case`from`:return`--cer-gradient-from:${a} var(--cer-gradient-from-position);--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), var(--cer-gradient-to);`;case`to`:return`--cer-gradient-to:${a} var(--cer-gradient-to-position);`;case`via`:return`--cer-gradient-to:rgb(255 255 255 / 0) var(--cer-gradient-to-position);--cer-gradient-stops:var(--cer-gradient-from), ${a} var(--cer-gradient-via-position), var(--cer-gradient-to);`;default:return null}}function K(e){let t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;let n=parseInt(t[1],10);return n<0||n>100?null:`opacity:${n/100};`}function q(e){if(e.startsWith(`[`)&&e.endsWith(`]`)&&!e.includes(`-[`)){let t=e.slice(1,-1).trim(),n=t.indexOf(`:`);if(n===-1)return null;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();return/^[a-zA-Z][a-zA-Z0-9-]*$/.test(r)?(i=i.replace(/_/g,` `),i=i.replace(/url\('\s*([^']*?)\s*'\)/g,`url("$1")`),i=i.replace(/^'([^']*)'$/g,`"$1"`),`${r}:${i};`):null}let t=e.indexOf(`-[`);if(t<=0||!e.endsWith(`]`))return null;let n=e.slice(0,t),r=e.slice(t+2,-1).replace(/_/g,` `),i={bg:`background-color`,shadow:`box-shadow`,p:`padding`,px:`padding-inline`,py:`padding-block`,m:`margin`,mx:`margin-inline`,my:`margin-block`,w:`width`,h:`height`,"min-w":`min-width`,"max-w":`max-width`,"min-h":`min-height`,"max-h":`max-height`,"border-t":`border-top-width`,"border-b":`border-bottom-width`,"border-l":`border-left-width`,"border-r":`border-right-width`,"border-x":`border-inline-width`,"border-y":`border-block-width`,"grid-cols":`grid-template-columns`,"grid-rows":`grid-template-rows`,transition:`transition-property`,ease:`transition-timing-function`,delay:`transition-delay`,duration:`transition-duration`,list:`list-style`,break:`word-break`,flex:`flex-direction`,items:`align-items`,justify:`justify-content`,content:`content`,self:`align-self`,basis:`flex-basis`,tracking:`letter-spacing`,leading:`line-height`,z:`z-index`,opacity:`opacity`};if(n===`text`)return/^\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex)$/.test(r)?`font-size:${r};`:`color:${r};`;if(n===`rotate`)return`transform:rotate(${r});`;if(n===`scale`)return`transform:scale(${r});`;if(n===`translate-x`)return`transform:translateX(${r});`;if(n===`translate-y`)return`transform:translateY(${r});`;let a=i[n]??n.replace(/_/g,`-`);return a&&r?`${a}:${r};`:null}function J(e){if(e.startsWith(`[`)&&e.endsWith(`]`)){let t=e.slice(1,-1);return t.includes(`&`)?t:e}let t=e.indexOf(`-[`);if(t>0&&e.endsWith(`]`)){let n=e.slice(t+2,-1).replace(/_/g,`-`);return n.includes(`&`)?n:e.replace(/_/g,`-`)}return null}function Y(e){let t=[],n;for(X.lastIndex=0;n=X.exec(e);){let e=n[2].split(/\s+/).filter(Boolean);e.length&&t.push(...e)}return t}var X=/class\s*=\s*(['"])([\s\S]*?)\1/g,te={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},ne={xs:320,sm:384,md:448,lg:512,xl:576,"2xl":672,"3xl":768,"4xl":896,"5xl":1024,"6xl":1152,"7xl":1280};function Z(e){for(let[t,n]of Object.entries(te))if(e.includes(`@media ${N[t]}`))return n;return-1}function Q(e){for(let[t,n]of Object.entries(ne))if(e.includes(`@container ${P[t]}`))return n;if(e.includes(`@container (min-width:`)){let t=/@container \(min-width:(\d+(?:\.\d+)?)(px|rem|em)/.exec(e);if(t){let e=parseFloat(t[1]),n=t[2];return n===`rem`||n===`em`?e*16:e}}return-1}var $=new Map,re=1e3;function ie(t){let n=Y(t);if(!n.length)return``;let i=new Set(n),a=Array.from(i).sort().join(`\0`),o=$.get(a);if(o!==void 0)return $.delete(a),$.set(a,o),o;let s=[[],[],[],[],[]],c={},l=(e,t=!1)=>{let n=t?`dark|${e}`:e;if(n in c)return c[n];let r=p(e,t);return c[n]=r,r},u=e=>{let t=e.some(e=>F.includes(e)),n=e.some(e=>e.startsWith(`@`)&&(I.includes(e.slice(1))||e.match(/^@\[.+\]$/))),r=e.includes(`dark`);return e.length?!t&&!r&&!n?1:r&&(t||n)?4:r?3:2:0},d=e=>{let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`[`||a===`(`?r++:(a===`]`||a===`)`)&&r--,a===`:`&&r===0?(t.push(n),n=``):n+=a}return n&&t.push(n),t},f={hover:`:hover`,focus:`:focus`,active:`:active`,visited:`:visited`,disabled:`:disabled`,checked:`:checked`,first:`:first-child`,last:`:last-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,"focus-within":`:focus-within`,"focus-visible":`:focus-visible`},p=(t,n=!1)=>{let r=d(t),i=``,a=!1;for(let e of r){let t=e;if(t.startsWith(`!`)&&(a=!0,t=t.slice(1)),t.endsWith(`!`)&&(a=!0,t=t.slice(0,-1)),!(t.startsWith(`data-[`)&&t.endsWith(`]`)||t.startsWith(`has-[`)&&t.endsWith(`]`)||t.startsWith(`not-[`)&&t.endsWith(`]`)||t.startsWith(`in-[`)&&t.endsWith(`]`)||t.startsWith(`supports-[`)&&t.endsWith(`]`)||t===`starting`)&&(O[t]||L(t)||R(t)||K(t)||W(t)||G(t)||q(t))){i=e;break}}if(!i)return null;let o=i.replace(/^!/,``).replace(/!$/,``),s=O[o]??L(o)??R(o)??K(o)??W(o)??G(o)??q(o);if(!s)return null;let c=r.indexOf(i),l=c>=0?r.slice(0,c):[];n&&(l=l.filter(e=>e!==`dark`));let u=e.c(t),p=a?s.replace(/;/g,` !important;`):s,m=`__SUBJECT__`,h=m,_=[];for(let e of l)e.startsWith(`group-`)?(h=`.group:${e.slice(6)} ${h}`,_.push(e)):e.startsWith(`peer-`)&&(h=h.replace(m,`.peer:${e.slice(5)}~${m}`),_.push(e));l=l.filter(e=>!_.includes(e));let v=[],y=[],b=null,x=!1,S=[];for(let e of l){if(e===`dark`||F.includes(e)||e.startsWith(`@`)&&(I.includes(e.slice(1))||e.match(/^@\[.+\]$/)))continue;if(e.startsWith(`data-[`)&&e.endsWith(`]`)){let t=e.slice(6,-1),n=t.includes(`=`)?`[data-`+t.replace(/^([^=]+)=(.+)$/,`$1="$2"`)+`]`:`[data-`+t+`]`;v.push(n);continue}if(e.startsWith(`has-[`)&&e.endsWith(`]`)){let t=e.slice(5,-1).replace(/_/g,` `);v.push(`:has(${t})`);continue}if(e.startsWith(`not-[`)&&e.endsWith(`]`)){let t=e.slice(5,-1).replace(/_/g,` `);v.push(`:not(${t})`);continue}if(e.startsWith(`in-[`)&&e.endsWith(`]`)){h=`:is(`+e.slice(4,-1).replace(/_/g,` `)+`) `+h;continue}if(e===`starting`){x=!0;continue}if(e.startsWith(`supports-[`)&&e.endsWith(`]`)){S.push(e);continue}let t=J(e);if(t){b=t;continue}let n=f[e];if(n){b?y.push(n):v.push(n);continue}let r=M[e];typeof r==`function`&&(h=r(h,p).split(`{`)[0])}let C=v.join(``),w=y.join(``);function ee(e,t){if(!t)return e;let n=0,r=0;if(e.length&&(e[0]===`>`||e[0]===`+`||e[0]===`~`||e[0]===` `)){let i=1;for(;i<e.length&&e[i]===` `;)i++;for(;i<e.length;i++){let a=e[i];if(a===`[`?n++:a===`]`&&n>0?n--:a===`(`?r++:a===`)`&&r>0&&r--,n===0&&r===0&&(e[i]===`>`||e[i]===`+`||e[i]===`~`||e[i]===` `))return e.slice(0,i)+t+e.slice(i)}return e+t}for(let i=0;i<e.length;i++){let a=e[i];if(a===`[`?n++:a===`]`&&n>0?n--:a===`(`?r++:a===`)`&&r>0&&r--,n===0&&r===0&&(a===`>`||a===`+`||a===`~`||a===` `))return e.slice(0,i)+t+e.slice(i)}return e+t}if(b)if(b.includes(`&`)){let e=b.indexOf(`&`),t=b.slice(0,e),n=b.slice(e+1),r=m+C;if(v.length===0)h=h.replace(m,t+r+w+n);else{let e=ee(n,w);h=h.replace(m,t+r+e)}}else h=h.replace(m,`${b}${m+C}`),w&&(h=h.replace(m,`${m}${w}`));else h=h.replace(m,m+C+w);h=h.replace(new RegExp(m,`g`),u);let T=`__CE_COLOR_MIX_SPLIT__`,E=p.includes(T)?p.split(T).map(e=>`${h}{${e}}`):[`${h}{${p}}`],D=l.filter(e=>F.includes(e)),k=l.filter(e=>e.startsWith(`@`)&&(I.includes(e.slice(1))||e.match(/^@\[.+\]$/))),A=D.length?D[D.length-1]:null,j=k.length?k[k.length-1]:null,z=l.includes(`dark`),B=g.disableVariants??[];if(B.length>0&&(B.includes(`dark`)&&z||B.includes(`responsive`)&&D.length>0||B.includes(`container`)&&k.length>0||B.includes(`motion`)&&l.some(e=>e===`motion-reduce`||e===`motion-safe`)||B.includes(`print`)&&l.includes(`print`)))return null;let V=``,H=``;if(z&&A?V=`@media (prefers-color-scheme: dark) and ${N[A]}`:z?V=`@media (prefers-color-scheme: dark)`:A&&(V=`@media ${N[A]}`),j)if(j.startsWith(`@[`)&&j.endsWith(`]`)){let e=j.slice(2,-1);if(!/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|cm|mm|in|pt|pc)$/.test(e))return null;H=`@container (min-width:${e})`}else{let e=j.slice(1);H=`@container ${P[e]||`(min-width:${e})`}`}let U=``;if(S.length>0){let e=S[S.length-1].slice(10,-1).replace(/_/g,` `);U=`@supports ${e.startsWith(`not(`)||e.startsWith(`selector(`)||e.startsWith(`(`)?e:`(${e})`}`}return E.map(e=>{let t=e;return x&&(t=`@starting-style{${t}}`),U&&(t=`${U}{${t}}`),V&&H?`${V}${H}{${t}}`:V?`${V}{${t}}`:H?`${H}{${t}}`:t}).join(``)};for(let t of i){let n=d(t),i=n.slice(0,-1),a=n[n.length-1];if(k(a)!==null){if(i.length===0)s[0].push(`${e.c(t)}{}`);else{let n=r(a);if(!n)continue;let o=e.c(t),c=e.c(a),l=n.replace(new RegExp(e.l(c),`g`),o),d=i.filter(e=>F.includes(e));d.length>0&&(l=`${`@media ${N[d[d.length-1]]}`}{${l}}`),i.includes(`dark`)&&(l=`@media (prefers-color-scheme: dark){${l}}`),s[u(i)].push(l)}continue}let o=-1;for(let e=n.length-1;e>=0;e--)if(A(n.slice(e).join(`:`))){o=e;break}if(o>=0){let r=n.slice(o).join(`:`),i=n.slice(0,o),a=A(r);if(!a)continue;if(i.length===0){s[0].push(a);continue}let c=e.s(t),l=e.s(r),d=[...a.replace(RegExp(`\\.${l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}`,`g`),`.${c}`).matchAll(/(.+?)\s+(.+?)\{([^}]+)\}/g)];if(d.length===0){s[0].push(a);continue}let f=u(i),p={hover:`:hover`,focus:`:focus`,active:`:active`,visited:`:visited`,disabled:`:disabled`,checked:`:checked`,first:`:first-child`,last:`:last-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,"focus-within":`:focus-within`,"focus-visible":`:focus-visible`},m=[],h=[],g=[],_=[],v=[],y=!1;for(let e of i)e.startsWith(`group-`)||e.startsWith(`peer-`)?m.push(e):e===`dark`||e===`dark-class`?y=!0:F.includes(e)?_.push(e):e.startsWith(`@`)&&(I.includes(e.slice(1))||e.match(/^@\[.+\]$/))?v.push(e):e.startsWith(`[`)&&e.endsWith(`]`)?g.push(e):(p[e]||M[e])&&h.push(e);for(let e of d){let[,n,r,i]=e,a=`${n} ${r}`;for(let e of m)if(e.startsWith(`group-`)){let t=e.slice(6);a=`.group${p[t]||`:${t}`} ${a}`}else if(e.startsWith(`peer-`)){let t=e.slice(5);a=`.peer${p[t]||`:${t}`}~${a}`}if(h.length>0){let e=h.map(e=>p[e]||`:${e}`).join(``);a=`${a}${e}`}for(let e of g){let t=J(e);if(t&&t.includes(`&`)){let e=t.indexOf(`&`),n=t.slice(0,e),r=t.slice(e+1);a=`${n}${a}${r}`}}let o=`${a}{${i}}`;if(y&&(o=`@media (prefers-color-scheme: dark){${o}}`),v.length>0){let e=v[v.length-1];if(e.startsWith(`@[`)&&e.endsWith(`]`)){let t=e.slice(2,-1);/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|cm|mm|in|pt|pc)$/.test(t)&&(o=`@container (min-width:${t}){${o}}`)}else{let n=e.slice(1),r={xs:`20rem`,sm:`24rem`,md:`28rem`,lg:`32rem`,xl:`36rem`,"2xl":`42rem`,"3xl":`48rem`,"4xl":`56rem`,"5xl":`64rem`,"6xl":`72rem`,"7xl":`80rem`}[n];if(r){let e=t.match(/@([^/]+)\//)?.[1]||``;o=e?`@container ${e} (min-width: ${r}){${o}}`:`@container (min-width: ${r}){${o}}`}}}_.length>0&&(o=`${`@media ${N[_[_.length-1]]}`}{${o}}`),s[f].push(o)}continue}let c=n.find(e=>{let t=e.replace(/^!/,``).replace(/!$/,``);return O[t]||L(t)||R(t)||K(t)||W(t)||G(t)||q(t)});if(!c)continue;let f=n.indexOf(c),p=u(f>=0?n.slice(0,f):[]),m=l(t);m&&s[p].push(m)}let m=/^(from|via|to)-[a-z]+-?\d{2,3}?$/,h=s.flat().join(``);for(let t of i)if(m.test(t)){if(h.includes(e.c(t)))continue;let n=l(t);n&&s[0].push(n)}let _=e=>e.sort((e,t)=>{let n=Z(e),r=Z(t),i=Q(e),a=Q(t);return n>=0&&r>=0&&n!==r?n-r:i>=0&&a>=0&&i!==a?i-a:0});s[2]=_(s[2]),s[4]=_(s[4]);let v=s.flat().join(``);if($.size>=re){let e=Math.floor(re/2);for(let t of $.keys()){if(e--===0)break;$.delete(t)}}return $.set(a,v),v}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return O}});
55
+ //# sourceMappingURL=style-A8l3aQ52.cjs.map