@tenphi/tasty 3.9.9 → 3.9.10

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 (65) hide show
  1. package/dist/{babel-C5mN2_fA.d.ts → babel-rZcEwPLM.d.ts} +2 -3
  2. package/dist/chunks/{build-config-iyzPTrZa.js → build-config-CL4eRu2z.js} +6 -6
  3. package/dist/chunks/{build-config-iyzPTrZa.js.map → build-config-CL4eRu2z.js.map} +1 -1
  4. package/dist/chunks/{collector-C4ouIOgI.js → collector-D2ARGT2L.js} +4 -4
  5. package/dist/chunks/{collector-C4ouIOgI.js.map → collector-D2ARGT2L.js.map} +1 -1
  6. package/dist/chunks/{config-engine-BAldIMv7.js → config-engine-DEmmPPdp.js} +17 -12
  7. package/dist/chunks/{config-engine-BAldIMv7.js.map → config-engine-DEmmPPdp.js.map} +1 -1
  8. package/dist/chunks/{css-definitions-BIgGXRLz.js → css-definitions-DotDkIXt.js} +6 -5
  9. package/dist/chunks/{css-definitions-BIgGXRLz.js.map → css-definitions-DotDkIXt.js.map} +1 -1
  10. package/dist/chunks/{css-resources-BN8apgxt.js → css-resources-P7IBUUZs.js} +2 -2
  11. package/dist/chunks/{css-resources-BN8apgxt.js.map → css-resources-P7IBUUZs.js.map} +1 -1
  12. package/dist/chunks/{debug-CUDFFYpM.js → debug-D8pg9RGI.js} +20 -19
  13. package/dist/chunks/{debug-CUDFFYpM.js.map → debug-D8pg9RGI.js.map} +1 -1
  14. package/dist/chunks/{dsl-C5yuAn41.js → dsl-DRhFWQzo.js} +42 -37
  15. package/dist/chunks/{dsl-C5yuAn41.js.map → dsl-DRhFWQzo.js.map} +1 -1
  16. package/dist/chunks/{react-runtime-46TyXx9v.js → react-runtime-BpxlOTbO.js} +28 -23
  17. package/dist/chunks/{react-runtime-46TyXx9v.js.map → react-runtime-BpxlOTbO.js.map} +1 -1
  18. package/dist/chunks/{runtime-engine-B_4lx2DJ.js → runtime-engine-CKFXUH-A.js} +27 -19
  19. package/dist/chunks/runtime-engine-CKFXUH-A.js.map +1 -0
  20. package/dist/chunks/{runtime-state-BMtykrat.js → runtime-state-BxaLhVdP.js} +2 -2
  21. package/dist/chunks/{runtime-state-BMtykrat.js.map → runtime-state-BxaLhVdP.js.map} +1 -1
  22. package/dist/chunks/{shared-utils-DWA4LjIa.js → shared-utils-y-HjvPN4.js} +16 -12
  23. package/dist/chunks/{shared-utils-DWA4LjIa.js.map → shared-utils-y-HjvPN4.js.map} +1 -1
  24. package/dist/chunks/{style-engine-BpgmapBp.js → style-engine-BBbBuSkT.js} +87 -75
  25. package/dist/chunks/{style-engine-BpgmapBp.js.map → style-engine-BBbBuSkT.js.map} +1 -1
  26. package/dist/chunks/{zero-engine-DcjMs3WX.js → zero-engine-gJrKBRiw.js} +6 -4
  27. package/dist/chunks/{zero-engine-DcjMs3WX.js.map → zero-engine-gJrKBRiw.js.map} +1 -1
  28. package/dist/{collector-CViSMO84.d.ts → collector-w4mBj5gd.d.ts} +2 -3
  29. package/dist/{config-CbDtZzZy.d.ts → config-CZWCzBr6.d.ts} +3 -12
  30. package/dist/core/index.d.ts +4 -4
  31. package/dist/core/index.js +8 -8
  32. package/dist/{index-oiXaHBxR.d.ts → index-G9JuwM9p.d.ts} +110 -158
  33. package/dist/index.d.ts +4 -4
  34. package/dist/index.js +9 -9
  35. package/dist/{merge-styles-Dp3eKkK9.d.ts → merge-styles-VXwJ0Frr.d.ts} +2 -3
  36. package/dist/ssr/astro-client.d.ts +1 -1
  37. package/dist/ssr/astro-middleware-extract-static.d.ts +1 -2
  38. package/dist/ssr/astro-middleware-extract.d.ts +1 -2
  39. package/dist/ssr/astro-middleware-static.d.ts +1 -2
  40. package/dist/ssr/astro-middleware.d.ts +1 -2
  41. package/dist/ssr/astro.d.ts +8 -16
  42. package/dist/ssr/astro.js +5 -4
  43. package/dist/ssr/astro.js.map +1 -1
  44. package/dist/ssr/index.d.ts +5 -6
  45. package/dist/ssr/index.js +2 -2
  46. package/dist/ssr/next-config.d.ts +3 -5
  47. package/dist/ssr/next-config.js +10 -6
  48. package/dist/ssr/next-config.js.map +1 -1
  49. package/dist/ssr/next.d.ts +3 -9
  50. package/dist/ssr/next.js +5 -4
  51. package/dist/ssr/next.js.map +1 -1
  52. package/dist/static/index.d.ts +8 -9
  53. package/dist/static/index.js +4 -4
  54. package/dist/static/index.js.map +1 -1
  55. package/dist/static/inject.d.ts +1 -2
  56. package/dist/{types-Ji9PGExW.d.ts → types-JEY8PVYP.d.ts} +5 -58
  57. package/dist/zero/babel.d.ts +1 -1
  58. package/dist/zero/babel.js +23 -18
  59. package/dist/zero/babel.js.map +1 -1
  60. package/dist/zero/index.d.ts +6 -7
  61. package/dist/zero/index.js +1 -1
  62. package/dist/zero/next.d.ts +3 -5
  63. package/dist/zero/next.js.map +1 -1
  64. package/package.json +31 -31
  65. package/dist/chunks/runtime-engine-B_4lx2DJ.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { L as DEFAULT_PROPERTIES } from "./css-definitions-BIgGXRLz.js";
1
+ import { L as DEFAULT_PROPERTIES } from "./css-definitions-DotDkIXt.js";
2
2
  //#region src/config-resources.ts
3
3
  let runtimeConfig = null;
4
4
  let globalFontFace = null;
@@ -124,4 +124,4 @@ function getRegisteredSSRCollector() {
124
124
  //#endregion
125
125
  export { resetConfigResources as _, getGlobalConfigTokens as a, getGlobalFunctions as c, mergeGlobalConfigTokens as d, mergeGlobalCounterStyles as f, mergeGlobalStyles as g, mergeGlobalProperties as h, getEffectiveProperties as i, getGlobalStyles as l, mergeGlobalFunctions as m, registerSSRCollectorGetter as n, getGlobalCounterStyles as o, mergeGlobalFontFaces as p, registerSSRCollectorGetterGlobal as r, getGlobalFontFaces as s, getRegisteredSSRCollector as t, getRuntimeConfigState as u, setRuntimeConfigState as v };
126
126
 
127
- //# sourceMappingURL=runtime-state-BMtykrat.js.map
127
+ //# sourceMappingURL=runtime-state-BxaLhVdP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-state-BMtykrat.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB,KAAa,OAAsB;CAC1D,WAAwC,OAAO;AACjD;AAEA,SAAS,kBAAqB,KAA4B;CACxD,OAAQ,WAAuC;AACjD;AAEA,SAAgB,wBAAmD;CACjE,OAAO;AACT;AAEA,SAAgB,sBAAsB,QAAkC;CACtE,gBAAgB;AAClB;AAEA,SAAgB,yBAA6D;CAC3E,MAAM,aACJ,oBACA,kBAAsD,gBAAgB;CACxE,OAAO,aACH;EAAE,GAAG;EAAoB,GAAG;CAAW,IACvC;AACN;AAEA,SAAgB,qBAA2D;CACzE,OACE,kBACA,kBAAiD,eAAe,KAChE;AAEJ;AAEA,SAAgB,yBAG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AAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
1
+ {"version":3,"file":"runtime-state-BxaLhVdP.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AAC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;EAAE,GAAG;EAAoB,GAAG;CAAO,IACnC;CACJ,gBAAgB,cAAc,kBAAkB;AAClD;AAEA,SAAgB,kBAAkB,QAAsC;CACtE,IAAI,cACF,KAAK,MAAM,CAAC,UAAU,mBAAmB,OAAO,QAAQ,MAAM,GAC5D,aAAa,YAAY,aAAa,YAClC;EAAE,GAAG,aAAa;EAAW,GAAG;CAAe,IAC/C;MAGN,eAAe,EAAE,GAAG,OAAO;CAE7B,gBAAgB,qBAAqB,YAAY;AACnD;AAEA,SAAgB,uBAA6B;CAC3C,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,eAAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
@@ -5,7 +5,8 @@ function isDevEnv() {
5
5
  if (forceTastyDebug !== null && forceTastyDebug.toLowerCase() === "true") return true;
6
6
  } catch {}
7
7
  if (typeof process === "undefined") return false;
8
- return true;
8
+ const nodeEnv = process.env.NODE_ENV;
9
+ return nodeEnv !== "test" && nodeEnv !== "production";
9
10
  }
10
11
  //#endregion
11
12
  //#region src/utils/warnings.ts
@@ -74,9 +75,10 @@ function resolveExtendMode(parentMap, childMap) {
74
75
  }
75
76
  for (const key of childKeys) {
76
77
  const value = childMap[key];
77
- if (value === INHERIT_VALUE) if (key in parentMap) result[key] = parentMap[key];
78
- else warnMissingInherit(key);
79
- else if (value !== null && !(key in parentMap)) result[key] = value;
78
+ if (value === INHERIT_VALUE) {
79
+ if (key in parentMap) result[key] = parentMap[key];
80
+ else warnMissingInherit(key);
81
+ } else if (value !== null && !(key in parentMap)) result[key] = value;
80
82
  }
81
83
  return result;
82
84
  }
@@ -84,9 +86,10 @@ function resolveReplaceMode(parentMap, childMap) {
84
86
  const result = {};
85
87
  for (const key of Object.keys(childMap)) {
86
88
  const val = childMap[key];
87
- if (val === INHERIT_VALUE) if (key in parentMap) result[key] = parentMap[key];
88
- else warnMissingInherit(key);
89
- else if (val !== null) result[key] = val;
89
+ if (val === INHERIT_VALUE) {
90
+ if (key in parentMap) result[key] = parentMap[key];
91
+ else warnMissingInherit(key);
92
+ } else if (val !== null) result[key] = val;
90
93
  }
91
94
  return result;
92
95
  }
@@ -118,7 +121,7 @@ function mergeStyles(...objects) {
118
121
  ...newStyles
119
122
  };
120
123
  const newSelectorKeys = Object.keys(newStyles).filter(isSelector);
121
- const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);
124
+ const allSelectorKeys = /* @__PURE__ */ new Set([...selectorKeys, ...newSelectorKeys]);
122
125
  for (const key of allSelectorKeys) {
123
126
  const newValue = newStyles?.[key];
124
127
  if (newValue === false || newValue === null) delete resultStyles[key];
@@ -128,9 +131,10 @@ function mergeStyles(...objects) {
128
131
  for (const key of Object.keys(newStyles)) {
129
132
  if (isSelector(key)) continue;
130
133
  const newValue = newStyles[key];
131
- if (newValue === void 0) if (key in styles) resultStyles[key] = styles[key];
132
- else delete resultStyles[key];
133
- else if (newValue === null) delete resultStyles[key];
134
+ if (newValue === void 0) {
135
+ if (key in styles) resultStyles[key] = styles[key];
136
+ else delete resultStyles[key];
137
+ } else if (newValue === null) delete resultStyles[key];
134
138
  else if (isStateMap(newValue)) resultStyles[key] = resolveStateMap(styles[key], newValue);
135
139
  }
136
140
  styles = resultStyles;
@@ -142,4 +146,4 @@ function mergeStyles(...objects) {
142
146
  //#endregion
143
147
  export { warnOnceDev as a, warn as i, isSelector as n, isDevEnv as o, resetStyleWarnings as r, mergeStyles as t };
144
148
 
145
- //# sourceMappingURL=shared-utils-DWA4LjIa.js.map
149
+ //# sourceMappingURL=shared-utils-y-HjvPN4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-utils-DWA4LjIa.js","names":[],"sources":["../../src/utils/is-dev-env.ts","../../src/utils/warnings.ts","../../src/utils/is-selector.ts","../../src/utils/merge-styles.ts"],"sourcesContent":["/**\n * Check if we're in a development environment at runtime\n * Uses bracket notation to avoid bundler compilation\n * Also checks for TASTY_DEBUG localStorage setting\n */\nexport function isDevEnv(): boolean {\n // Check localStorage for DEBUG_TASTY setting (browser environment)\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n const forceTastyDebug = window.localStorage.getItem('TASTY_DEBUG');\n if (\n forceTastyDebug !== null &&\n forceTastyDebug.toLowerCase() === 'true'\n ) {\n return true;\n }\n } catch {\n // localStorage might not be available (private browsing, etc.)\n // Continue with other checks\n }\n }\n\n // Check NODE_ENV for Node.js environments\n if (typeof process === 'undefined') return false;\n\n // Use bracket notation to avoid bundler replacement\n const nodeEnv = process.env?.['NODE_ENV'];\n return nodeEnv !== 'test' && nodeEnv !== 'production';\n}\n","import { isDevEnv } from './is-dev-env';\n\nconst PREFIX = '[Tasty]';\n\n/** Warning keys already emitted, so each distinct diagnostic warns once. */\nconst emittedWarnings = new Set<string>();\n\nexport function warn(...args: unknown[]) {\n console.warn(PREFIX, ...args);\n}\n\n/** Emit a warning at most once per key. No-op outside development mode. */\nexport function warnOnceDev(key: string, message: string): void {\n if (emittedWarnings.has(key)) return;\n emittedWarnings.add(key);\n\n if (!isDevEnv()) return;\n\n console.warn(`${PREFIX} ${message}`);\n}\n\n/** Forget emitted style warnings. Called by `resetConfig()` for test isolation. */\nexport function resetStyleWarnings(): void {\n emittedWarnings.clear();\n}\n","/** Check whether a style-object key identifies a nested CSS selector. */\nexport function isSelector(key: string): boolean {\n const first = key.charCodeAt(0);\n return (\n first === 38 || // &\n first === 46 || // .\n (first >= 65 && first <= 90) // A-Z\n );\n}\n","import type { Styles, StylesWithoutSelectors } from '../styles/types';\n\nimport { isDevEnv } from './is-dev-env';\nimport { isSelector } from './is-selector';\n\nconst devMode = isDevEnv();\n\nconst INHERIT_VALUE = '@inherit';\n\nfunction warnMissingInherit(key: string): void {\n if (devMode) {\n console.warn(\n `[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`,\n );\n }\n}\n\n/**\n * Check if a value is a state map (object, not array).\n */\nfunction isStateMap(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Normalize a parent value to a state map.\n * - Already a state map → return as-is\n * - Non-null, non-false primitive → wrap as `{ '': value }`\n * - null / undefined / false → return null (no parent to merge with)\n */\nfunction normalizeToStateMap(value: unknown): Record<string, unknown> | null {\n if (isStateMap(value)) return value as Record<string, unknown>;\n if (value != null && value !== false) return { '': value };\n return null;\n}\n\n/**\n * Resolve a child state map against a parent value.\n *\n * Mode is determined by whether the child contains a `''` (default) key:\n * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions\n * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent\n *\n * In both modes:\n * - `@inherit` value → resolve from parent state map\n * - `null` value → remove this state from the result\n * - `false` value → tombstone, persists through all layers, blocks recipe\n */\nfunction resolveStateMap(\n parentValue: unknown,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const isExtend = !('' in childMap);\n const parentMap = normalizeToStateMap(parentValue);\n\n if (!parentMap) {\n // No parent to merge with — strip nulls and @inherit, return child entries\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === null || val === INHERIT_VALUE) continue;\n result[key] = val;\n }\n return result;\n }\n\n if (isExtend) {\n return resolveExtendMode(parentMap, childMap);\n }\n\n return resolveReplaceMode(parentMap, childMap);\n}\n\n/**\n * Extend mode: parent entries are preserved, child entries add/override/reposition.\n */\nfunction resolveExtendMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n // 1. Parent entries in order (skip removed, skip repositioned, apply overrides)\n const result: Record<string, unknown> = {};\n const childKeys = Object.keys(childMap);\n const childKeySet = new Set(childKeys);\n for (const key of Object.keys(parentMap)) {\n if (!childKeySet.has(key)) {\n result[key] = parentMap[key];\n continue;\n }\n const childValue = childMap[key];\n if (childValue === null || childValue === INHERIT_VALUE) continue;\n result[key] = childValue;\n }\n\n // 2. Append new + repositioned entries in child declaration order\n for (const key of childKeys) {\n const value = childMap[key];\n if (value === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (value !== null && !(key in parentMap)) {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Replace mode: child entries define the result, `@inherit` pulls from parent.\n */\nfunction resolveReplaceMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (val !== null) {\n result[key] = val;\n }\n }\n\n return result;\n}\n\n/**\n * Merge sub-element properties with state map / null / undefined support.\n */\nfunction mergeSubElementStyles(\n parentSub: StylesWithoutSelectors | undefined,\n childSub: StylesWithoutSelectors,\n): StylesWithoutSelectors {\n const parent = parentSub as Record<string, unknown> | undefined;\n const child = childSub as Record<string, unknown>;\n const merged: Record<string, unknown> = { ...parent, ...child };\n\n for (const key of Object.keys(child)) {\n const val = child[key];\n\n if (val === undefined) {\n if (parent && key in parent) {\n merged[key] = parent[key];\n }\n } else if (val === null) {\n delete merged[key];\n } else if (isStateMap(val)) {\n merged[key] = resolveStateMap(\n parent ? parent[key] : undefined,\n val as Record<string, unknown>,\n );\n }\n }\n\n return merged as StylesWithoutSelectors;\n}\n\nexport function mergeStyles(...objects: (Styles | undefined | null)[]): Styles {\n let styles: Styles = objects[0] ? { ...objects[0] } : {};\n let pos = 1;\n\n while (pos in objects) {\n const selectorKeys = Object.keys(styles).filter(\n (key) => isSelector(key) && styles[key],\n );\n const newStyles = objects[pos];\n\n if (newStyles) {\n const resultStyles = { ...styles, ...newStyles };\n\n // Collect all selector keys from both parent and child\n const newSelectorKeys = Object.keys(newStyles).filter(isSelector);\n const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);\n\n for (const key of allSelectorKeys) {\n const newValue = newStyles?.[key];\n\n if (newValue === false || newValue === null) {\n delete resultStyles[key];\n } else if (newValue === undefined) {\n resultStyles[key] = styles[key];\n } else if (newValue) {\n resultStyles[key] = mergeSubElementStyles(\n styles[key] as StylesWithoutSelectors,\n newValue as StylesWithoutSelectors,\n );\n }\n }\n\n // Handle non-selector properties: state maps, null, undefined\n for (const key of Object.keys(newStyles)) {\n if (isSelector(key)) continue;\n\n const newValue = newStyles[key];\n\n if (newValue === undefined) {\n if (key in styles) {\n resultStyles[key] = styles[key];\n } else {\n delete resultStyles[key];\n }\n } else if (newValue === null) {\n delete resultStyles[key];\n } else if (isStateMap(newValue)) {\n (resultStyles as Record<string, unknown>)[key] = resolveStateMap(\n styles[key],\n newValue as Record<string, unknown>,\n );\n }\n }\n\n styles = resultStyles;\n }\n\n pos++;\n }\n\n return styles;\n}\n"],"mappings":";AAKA,SAAgB,WAAoB;CAElC,IAAI,OAAO,WAAW,eAAe,OAAO,cAC1C,IAAI;EACF,MAAM,kBAAkB,OAAO,aAAa,QAAQ,aAAa;EACjE,IACE,oBAAoB,QACpB,gBAAgB,YAAY,MAAM,QAElC,OAAO;CAEX,QAAQ,CAGR;CAIF,IAAI,OAAO,YAAY,aAAa,OAAO;CAI3C,OAA6B;AAC/B;;;AC1BA,MAAM,SAAS;AAGf,MAAM,kCAAkB,IAAI,IAAY;AAExC,SAAgB,KAAK,GAAG,MAAiB;CACvC,Q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,QAAQ,GAAG,IAAI,CAAC;CACvD,IAAI,MAAM;CAEV,OAAO,OAAO,SAAS;EACrB,MAAM,eAAe,OAAO,KAAK,MAAM,CAAC,CAAC,QACtC,QAAQ,WAAW,GAAG,KAAK,OAAO,IACrC;EACA,MAAM,YAAY,QAAQ;EAE1B,IAAI,WAAW;GACb,MAAM,eAAe;IAAE,GAAG;IAAQ,GAAG;GAAU;GAG/C,MAAM,kBAAkB,OAAO,KAAK,SAAS,CAAC,CAAC,OAAO,UAAU;GAChE,MAAM,kBAAkB,IAAI,IAAI,CAAC,GAAG,cAAc,GAAG,eAAe,CAAC;GAErE,KAAK,MAAM,OAAO,iBAAiB;IACjC,MAAM,WAAW,YAAY;IAE7B,IAAI,aAAa,SAAS,aAAa,MACrC,OAAO,aAAa;SACf,IAAI,aAAa,KAAA,GACtB,aAAa,OAAO,OAAO;SACtB,IAAI,UACT,aAAa,OAAO,sBAClB,OAAO,MACP,QACF;GAEJ;GAGA,KAAK,MAAM,OAAO,OAAO,KAAK,SAAS,GAAG;IACxC,IAAI,WAAW,GAAG,GAAG;IAErB,MAAM,WAAW,UAAU;IAE3B,IAAI,aAAa,KAAA,GACf,IAAI,OAAO,QACT,aAAa,OAAO,OAAO;SAE3B,OAAO,aAAa;SAEjB,IAAI,aAAa,MACtB,OAAO,aAAa;SACf,IAAI,WAAW,QAAQ,GAC5B,aAA0C,OAAO,gBAC/C,OAAO,MACP,QACF;GAEJ;GAEA,SAAS;EACX;EAEA;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"shared-utils-y-HjvPN4.js","names":[],"sources":["../../src/utils/is-dev-env.ts","../../src/utils/warnings.ts","../../src/utils/is-selector.ts","../../src/utils/merge-styles.ts"],"sourcesContent":["/**\n * Check if we're in a development environment at runtime\n * Uses bracket notation to avoid bundler compilation\n * Also checks for TASTY_DEBUG localStorage setting\n */\nexport function isDevEnv(): boolean {\n // Check localStorage for DEBUG_TASTY setting (browser environment)\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n const forceTastyDebug = window.localStorage.getItem('TASTY_DEBUG');\n if (\n forceTastyDebug !== null &&\n forceTastyDebug.toLowerCase() === 'true'\n ) {\n return true;\n }\n } catch {\n // localStorage might not be available (private browsing, etc.)\n // Continue with other checks\n }\n }\n\n // Check NODE_ENV for Node.js environments\n if (typeof process === 'undefined') return false;\n\n // Use bracket notation to avoid bundler replacement\n const nodeEnv = process.env?.['NODE_ENV'];\n return nodeEnv !== 'test' && nodeEnv !== 'production';\n}\n","import { isDevEnv } from './is-dev-env';\n\nconst PREFIX = '[Tasty]';\n\n/** Warning keys already emitted, so each distinct diagnostic warns once. */\nconst emittedWarnings = new Set<string>();\n\nexport function warn(...args: unknown[]) {\n console.warn(PREFIX, ...args);\n}\n\n/** Emit a warning at most once per key. No-op outside development mode. */\nexport function warnOnceDev(key: string, message: string): void {\n if (emittedWarnings.has(key)) return;\n emittedWarnings.add(key);\n\n if (!isDevEnv()) return;\n\n console.warn(`${PREFIX} ${message}`);\n}\n\n/** Forget emitted style warnings. Called by `resetConfig()` for test isolation. */\nexport function resetStyleWarnings(): void {\n emittedWarnings.clear();\n}\n","/** Check whether a style-object key identifies a nested CSS selector. */\nexport function isSelector(key: string): boolean {\n const first = key.charCodeAt(0);\n return (\n first === 38 || // &\n first === 46 || // .\n (first >= 65 && first <= 90) // A-Z\n );\n}\n","import type { Styles, StylesWithoutSelectors } from '../styles/types';\n\nimport { isDevEnv } from './is-dev-env';\nimport { isSelector } from './is-selector';\n\nconst devMode = isDevEnv();\n\nconst INHERIT_VALUE = '@inherit';\n\nfunction warnMissingInherit(key: string): void {\n if (devMode) {\n console.warn(\n `[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`,\n );\n }\n}\n\n/**\n * Check if a value is a state map (object, not array).\n */\nfunction isStateMap(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Normalize a parent value to a state map.\n * - Already a state map → return as-is\n * - Non-null, non-false primitive → wrap as `{ '': value }`\n * - null / undefined / false → return null (no parent to merge with)\n */\nfunction normalizeToStateMap(value: unknown): Record<string, unknown> | null {\n if (isStateMap(value)) return value as Record<string, unknown>;\n if (value != null && value !== false) return { '': value };\n return null;\n}\n\n/**\n * Resolve a child state map against a parent value.\n *\n * Mode is determined by whether the child contains a `''` (default) key:\n * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions\n * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent\n *\n * In both modes:\n * - `@inherit` value → resolve from parent state map\n * - `null` value → remove this state from the result\n * - `false` value → tombstone, persists through all layers, blocks recipe\n */\nfunction resolveStateMap(\n parentValue: unknown,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const isExtend = !('' in childMap);\n const parentMap = normalizeToStateMap(parentValue);\n\n if (!parentMap) {\n // No parent to merge with — strip nulls and @inherit, return child entries\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === null || val === INHERIT_VALUE) continue;\n result[key] = val;\n }\n return result;\n }\n\n if (isExtend) {\n return resolveExtendMode(parentMap, childMap);\n }\n\n return resolveReplaceMode(parentMap, childMap);\n}\n\n/**\n * Extend mode: parent entries are preserved, child entries add/override/reposition.\n */\nfunction resolveExtendMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n // 1. Parent entries in order (skip removed, skip repositioned, apply overrides)\n const result: Record<string, unknown> = {};\n const childKeys = Object.keys(childMap);\n const childKeySet = new Set(childKeys);\n for (const key of Object.keys(parentMap)) {\n if (!childKeySet.has(key)) {\n result[key] = parentMap[key];\n continue;\n }\n const childValue = childMap[key];\n if (childValue === null || childValue === INHERIT_VALUE) continue;\n result[key] = childValue;\n }\n\n // 2. Append new + repositioned entries in child declaration order\n for (const key of childKeys) {\n const value = childMap[key];\n if (value === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (value !== null && !(key in parentMap)) {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Replace mode: child entries define the result, `@inherit` pulls from parent.\n */\nfunction resolveReplaceMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (val !== null) {\n result[key] = val;\n }\n }\n\n return result;\n}\n\n/**\n * Merge sub-element properties with state map / null / undefined support.\n */\nfunction mergeSubElementStyles(\n parentSub: StylesWithoutSelectors | undefined,\n childSub: StylesWithoutSelectors,\n): StylesWithoutSelectors {\n const parent = parentSub as Record<string, unknown> | undefined;\n const child = childSub as Record<string, unknown>;\n const merged: Record<string, unknown> = { ...parent, ...child };\n\n for (const key of Object.keys(child)) {\n const val = child[key];\n\n if (val === undefined) {\n if (parent && key in parent) {\n merged[key] = parent[key];\n }\n } else if (val === null) {\n delete merged[key];\n } else if (isStateMap(val)) {\n merged[key] = resolveStateMap(\n parent ? parent[key] : undefined,\n val as Record<string, unknown>,\n );\n }\n }\n\n return merged as StylesWithoutSelectors;\n}\n\nexport function mergeStyles(...objects: (Styles | undefined | null)[]): Styles {\n let styles: Styles = objects[0] ? { ...objects[0] } : {};\n let pos = 1;\n\n while (pos in objects) {\n const selectorKeys = Object.keys(styles).filter(\n (key) => isSelector(key) && styles[key],\n );\n const newStyles = objects[pos];\n\n if (newStyles) {\n const resultStyles = { ...styles, ...newStyles };\n\n // Collect all selector keys from both parent and child\n const newSelectorKeys = Object.keys(newStyles).filter(isSelector);\n const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);\n\n for (const key of allSelectorKeys) {\n const newValue = newStyles?.[key];\n\n if (newValue === false || newValue === null) {\n delete resultStyles[key];\n } else if (newValue === undefined) {\n resultStyles[key] = styles[key];\n } else if (newValue) {\n resultStyles[key] = mergeSubElementStyles(\n styles[key] as StylesWithoutSelectors,\n newValue as StylesWithoutSelectors,\n );\n }\n }\n\n // Handle non-selector properties: state maps, null, undefined\n for (const key of Object.keys(newStyles)) {\n if (isSelector(key)) continue;\n\n const newValue = newStyles[key];\n\n if (newValue === undefined) {\n if (key in styles) {\n resultStyles[key] = styles[key];\n } else {\n delete resultStyles[key];\n }\n } else if (newValue === null) {\n delete resultStyles[key];\n } else if (isStateMap(newValue)) {\n (resultStyles as Record<string, unknown>)[key] = resolveStateMap(\n styles[key],\n newValue as Record<string, unknown>,\n );\n }\n }\n\n styles = resultStyles;\n }\n\n pos++;\n }\n\n return styles;\n}\n"],"mappings":";AAKA,SAAgB,WAAoB;CAElC,IAAI,OAAO,WAAW,eAAe,OAAO,cAC1C,IAAI;EACF,MAAM,kBAAkB,OAAO,aAAa,QAAQ,aAAa;EACjE,IACE,oBAAoB,QACpB,gBAAgB,YAAY,MAAM,QAElC,OAAO;CAEX,QAAQ,CAGR;CAIF,IAAI,OAAO,YAAY,aAAa,OAAO;CAG3C,MAAM,UAAA,QAAA,IAAA;CACN,OAAO,YAAY,UAAU,YAAY;AAC3C;;;AC1BA,MAAM,SAAS;AAGf,MAAM,kCAAkB,IAAI,IAAY;AAExC,SAAgB,KAAK,GAAG,MAAiB;CACvC,QAAQ,KAAK,QAAQ,GAAG,IAAI;AAC9B;AAGA,SAAgB,YAAY,KAAa,SAAuB;CAC9D,IAAI,gBAAgB,IAAI,GAAG,GAAG;CAC9B,gBAAgB,IAAI,GAAG;CAEvB,IAAI,CAAC,SAAS,GAAG;CAEjB,QAAQ,KAAK,GAAG,OAAO,GAAG,SAAS;AACrC;AAGA,SAAgB,qBAA2B;CACzC,gBAAgB,MAAM;AACxB;;;ACvBA,SAAgB,WAAW,KAAsB;CAC/C,MAAM,QAAQ,IAAI,WAAW,CAAC;CAC9B,OACE,UAAU,MACV,UAAU,MACT,SAAS,MAAM,SAAS;AAE7B;;;ACHA,MAAM,UAA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AAC;GAErE,KAAK,MAAM,OAAO,iBAAiB;IACjC,MAAM,WAAW,YAAY;IAE7B,IAAI,aAAa,SAAS,aAAa,MACrC,OAAO,aAAa;SACf,IAAI,aAAa,KAAA,GACtB,aAAa,OAAO,OAAO;SACtB,IAAI,UACT,aAAa,OAAO,sBAClB,OAAO,MACP,QACF;GAEJ;GAGA,KAAK,MAAM,OAAO,OAAO,KAAK,SAAS,GAAG;IACxC,IAAI,WAAW,GAAG,GAAG;IAErB,MAAM,WAAW,UAAU;IAE3B,IAAI,aAAa,KAAA,GAAW;KAC1B,IAAI,OAAO,QACT,aAAa,OAAO,OAAO;UAE3B,OAAO,aAAa;IAExB,OAAO,IAAI,aAAa,MACtB,OAAO,aAAa;SACf,IAAI,WAAW,QAAQ,GAC5B,aAA0C,OAAO,gBAC/C,OAAO,MACP,QACF;GAEJ;GAEA,SAAS;EACX;EAEA;CACF;CAEA,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
- import { M as toSnakeCase, N as CSS_WIDE_KEYWORDS, T as makeEmptyDetails, _ as stringifyStyles, d as parseColor, f as parseStyle, h as resolveCustomProperties, i as DIRECTIONS, j as normalizeDslName, u as normalizeColorTokenValue, w as Lru } from "./dsl-C5yuAn41.js";
2
- import { a as warnOnceDev, i as warn, n as isSelector, o as isDevEnv } from "./shared-utils-DWA4LjIa.js";
1
+ import { M as toSnakeCase, N as CSS_WIDE_KEYWORDS, T as makeEmptyDetails, _ as stringifyStyles, d as parseColor, f as parseStyle, h as resolveCustomProperties, i as DIRECTIONS, j as normalizeDslName, u as normalizeColorTokenValue, w as Lru } from "./dsl-DRhFWQzo.js";
2
+ import { a as warnOnceDev, i as warn, n as isSelector, o as isDevEnv } from "./shared-utils-y-HjvPN4.js";
3
3
  //#region src/config-state.ts
4
4
  let stylesGenerated = false;
5
5
  let globalPolyfills = null;
@@ -32,7 +32,7 @@ function resetGlobalPolyfillsState() {
32
32
  }
33
33
  //#endregion
34
34
  //#region src/states/index.ts
35
- const BUILTIN_STATES = new Set([
35
+ const BUILTIN_STATES = /* @__PURE__ */ new Set([
36
36
  "@starting",
37
37
  "@keyframes",
38
38
  "@property",
@@ -514,22 +514,25 @@ function dimensionStyle(name) {
514
514
  flag = true;
515
515
  break;
516
516
  }
517
- default: break;
518
517
  }
519
- if (!flag || !mods.length) if (values.length === 2) {
520
- styles[minStyle] = values[0];
521
- styles[maxStyle] = values[1];
522
- } else if (values.length === 3) {
523
- styles[minStyle] = values[0];
524
- styles[name] = values[1];
525
- styles[maxStyle] = values[2];
526
- } else styles[name] = values[0] || "auto";
527
- if (styles[name] === "stretch") if (name === "width") styles[name] = [
528
- "stretch",
529
- "-webkit-fill-available",
530
- "-moz-available"
531
- ];
532
- else styles[name] = "auto";
518
+ if (!flag || !mods.length) {
519
+ if (values.length === 2) {
520
+ styles[minStyle] = values[0];
521
+ styles[maxStyle] = values[1];
522
+ } else if (values.length === 3) {
523
+ styles[minStyle] = values[0];
524
+ styles[name] = values[1];
525
+ styles[maxStyle] = values[2];
526
+ } else styles[name] = values[0] || "auto";
527
+ }
528
+ if (styles[name] === "stretch") {
529
+ if (name === "width") styles[name] = [
530
+ "stretch",
531
+ "-webkit-fill-available",
532
+ "-moz-available"
533
+ ];
534
+ else styles[name] = "auto";
535
+ }
533
536
  }
534
537
  const minVal = parseDimensionValue(min);
535
538
  const maxVal = parseDimensionValue(max);
@@ -893,28 +896,30 @@ function processDirectionalStyle(config, props) {
893
896
  left: defaultInit
894
897
  };
895
898
  let useLonghand = false;
896
- if (main != null) if (typeof main === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${main}px`;
897
- else {
898
- const strMain = main === true ? trueValue : String(main);
899
- if (strMain) {
900
- const keyword = CSS_WIDE_KEYWORDS.has(strMain) ? strMain : null;
901
- if (keyword) dirs.top = dirs.right = dirs.bottom = dirs.left = keyword;
902
- else {
903
- const groups = parseStyle(strMain).groups ?? [];
904
- for (const group of groups) {
905
- const modFlags = directionModFlags(group.mods, spanModifiers);
906
- if (modFlags & DIRECTION_LONGHAND) useLonghand = true;
907
- const kw = extractCSSWideKeyword(group);
908
- if (kw) {
909
- const directions = modFlags & DIRECTION_MASK;
910
- if (!directions) dirs.top = dirs.right = dirs.bottom = dirs.left = kw;
911
- else {
912
- if (directions & DIRECTION_TOP) dirs.top = kw;
913
- if (directions & DIRECTION_RIGHT) dirs.right = kw;
914
- if (directions & DIRECTION_BOTTOM) dirs.bottom = kw;
915
- if (directions & DIRECTION_LEFT) dirs.left = kw;
916
- }
917
- } else applyGroup(dirs, group, modFlags, property, defaultValue);
899
+ if (main != null) {
900
+ if (typeof main === "number") dirs.top = dirs.right = dirs.bottom = dirs.left = `${main}px`;
901
+ else {
902
+ const strMain = main === true ? trueValue : String(main);
903
+ if (strMain) {
904
+ const keyword = CSS_WIDE_KEYWORDS.has(strMain) ? strMain : null;
905
+ if (keyword) dirs.top = dirs.right = dirs.bottom = dirs.left = keyword;
906
+ else {
907
+ const groups = parseStyle(strMain).groups ?? [];
908
+ for (const group of groups) {
909
+ const modFlags = directionModFlags(group.mods, spanModifiers);
910
+ if (modFlags & DIRECTION_LONGHAND) useLonghand = true;
911
+ const kw = extractCSSWideKeyword(group);
912
+ if (kw) {
913
+ const directions = modFlags & DIRECTION_MASK;
914
+ if (!directions) dirs.top = dirs.right = dirs.bottom = dirs.left = kw;
915
+ else {
916
+ if (directions & DIRECTION_TOP) dirs.top = kw;
917
+ if (directions & DIRECTION_RIGHT) dirs.right = kw;
918
+ if (directions & DIRECTION_BOTTOM) dirs.bottom = kw;
919
+ if (directions & DIRECTION_LEFT) dirs.left = kw;
920
+ }
921
+ } else applyGroup(dirs, group, modFlags, property, defaultValue);
922
+ }
918
923
  }
919
924
  }
920
925
  }
@@ -1126,28 +1131,30 @@ marginStyle.__lookupStyles = [
1126
1131
  //#region src/styles/outline.ts
1127
1132
  function outlineStyle({ outline, outlineOffset }) {
1128
1133
  const result = {};
1129
- if (outline != null && outline !== false) if (typeof outline === "string" && CSS_WIDE_KEYWORDS.has(outline)) result.outline = outline;
1130
- else {
1131
- let outlineValue = outline;
1132
- if (outline === true) outlineValue = "1ow";
1133
- if (outline === 0) outlineValue = "0";
1134
- const group = parseStyle(String(outlineValue)).groups[0];
1135
- if (group) {
1136
- const { parts } = group;
1137
- const outlinePart = parts[0] ?? {
1138
- values: [],
1139
- mods: [],
1140
- colors: []
1141
- };
1142
- const offsetPart = parts[1];
1143
- let lineStyle;
1144
- for (const mod of outlinePart.mods) if (BORDER_STYLES.includes(mod)) {
1145
- lineStyle = mod;
1146
- break;
1134
+ if (outline != null && outline !== false) {
1135
+ if (typeof outline === "string" && CSS_WIDE_KEYWORDS.has(outline)) result.outline = outline;
1136
+ else {
1137
+ let outlineValue = outline;
1138
+ if (outline === true) outlineValue = "1ow";
1139
+ if (outline === 0) outlineValue = "0";
1140
+ const group = parseStyle(String(outlineValue)).groups[0];
1141
+ if (group) {
1142
+ const { parts } = group;
1143
+ const outlinePart = parts[0] ?? {
1144
+ values: [],
1145
+ mods: [],
1146
+ colors: []
1147
+ };
1148
+ const offsetPart = parts[1];
1149
+ let lineStyle;
1150
+ for (const mod of outlinePart.mods) if (BORDER_STYLES.includes(mod)) {
1151
+ lineStyle = mod;
1152
+ break;
1153
+ }
1154
+ const slots = assignLineSlots(outlinePart.values, lineStyle, outlinePart.colors[0]);
1155
+ result.outline = `${outlinePart.values[0] || "var(--outline-width)"} ${slots.style || "solid"} ${slots.color || "var(--outline-color)"}`;
1156
+ if (offsetPart?.values[0]) result["outline-offset"] = offsetPart.values[0];
1147
1157
  }
1148
- const slots = assignLineSlots(outlinePart.values, lineStyle, outlinePart.colors[0]);
1149
- result.outline = `${outlinePart.values[0] || "var(--outline-width)"} ${slots.style || "solid"} ${slots.color || "var(--outline-color)"}`;
1150
- if (offsetPart?.values[0]) result["outline-offset"] = offsetPart.values[0];
1151
1158
  }
1152
1159
  }
1153
1160
  if (outlineOffset != null && result["outline-offset"] === void 0) {
@@ -1246,7 +1253,7 @@ placementStyle.__lookupStyles = [
1246
1253
  ];
1247
1254
  //#endregion
1248
1255
  //#region src/styles/preset.ts
1249
- const PRESET_MODIFIERS = new Set([
1256
+ const PRESET_MODIFIERS = /* @__PURE__ */ new Set([
1250
1257
  "strong",
1251
1258
  "bold",
1252
1259
  "italic",
@@ -1320,8 +1327,10 @@ function presetStyle({ preset, fontSize, lineHeight, textTransform, letterSpacin
1320
1327
  if (letterSpacingVal) styles["letter-spacing"] = letterSpacingVal;
1321
1328
  const fontWeightVal = toCSS(fontWeight, false);
1322
1329
  if (fontWeightVal) styles["font-weight"] = fontWeightVal;
1323
- if (fontStyle != null) if (typeof fontStyle === "string") styles["font-style"] = resolveCustomProperties(fontStyle);
1324
- else styles["font-style"] = fontStyle ? "italic" : "normal";
1330
+ if (fontStyle != null) {
1331
+ if (typeof fontStyle === "string") styles["font-style"] = resolveCustomProperties(fontStyle);
1332
+ else styles["font-style"] = fontStyle ? "italic" : "normal";
1333
+ }
1325
1334
  if (textTransform) styles["text-transform"] = resolveCustomProperties(textTransform);
1326
1335
  const fontFamily_ = resolveFontFamily(font, fontFamily);
1327
1336
  if (fontFamily_) styles["font-family"] = fontFamily_;
@@ -1489,7 +1498,7 @@ function scrollbarStyle({ scrollbar, overflow }) {
1489
1498
  ...values,
1490
1499
  ...colors
1491
1500
  ];
1492
- if (ignored.length && true) warn(`scrollbar="none" hides the scrollbar; other tokens are ignored: ${ignored.join(", ")}`);
1501
+ if (ignored.length && process.env.NODE_ENV !== "production") warn(`scrollbar="none" hides the scrollbar; other tokens are ignored: ${ignored.join(", ")}`);
1493
1502
  style["scrollbar-width"] = "none";
1494
1503
  return style;
1495
1504
  }
@@ -2917,8 +2926,10 @@ function conditionToCSSInner(node) {
2917
2926
  isImpossible: true
2918
2927
  };
2919
2928
  if (node.kind === "state") return stateToCSS(node);
2920
- if (node.kind === "compound") if (node.operator === "AND") return andToCSS(node.children);
2921
- else return orToCSS(node.children);
2929
+ if (node.kind === "compound") {
2930
+ if (node.operator === "AND") return andToCSS(node.children);
2931
+ else return orToCSS(node.children);
2932
+ }
2922
2933
  return {
2923
2934
  variants: [emptyVariant()],
2924
2935
  isImpossible: false
@@ -3049,9 +3060,10 @@ function dimensionToMediaParsed(dimension, lowerBound, upperBound, negated) {
3049
3060
  }
3050
3061
  function containerToParsed(state) {
3051
3062
  let condition;
3052
- if (state.subtype === "style") if (state.propertyValue) condition = `style(--${state.property}: ${state.propertyValue})`;
3053
- else condition = `style(--${state.property})`;
3054
- else if (state.subtype === "raw") condition = state.rawCondition;
3063
+ if (state.subtype === "style") {
3064
+ if (state.propertyValue) condition = `style(--${state.property}: ${state.propertyValue})`;
3065
+ else condition = `style(--${state.property})`;
3066
+ } else if (state.subtype === "raw") condition = state.rawCondition;
3055
3067
  else condition = buildDimensionCondition(state.dimension || "width", state.lowerBound, state.upperBound, "width");
3056
3068
  return {
3057
3069
  name: state.containerName,
@@ -3574,7 +3586,7 @@ function mergeVariantsIntoSelectorGroups(variants) {
3574
3586
  return result;
3575
3587
  }
3576
3588
  function factorAndGroup(variants) {
3577
- {
3589
+ if (process.env.NODE_ENV !== "production") {
3578
3590
  const key0 = getVariantContextKey(variants[0]);
3579
3591
  for (let i = 1; i < variants.length; i++) {
3580
3592
  const keyI = getVariantContextKey(variants[i]);
@@ -3693,7 +3705,7 @@ function buildAtRulesFromVariant(variant) {
3693
3705
  //#endregion
3694
3706
  //#region src/pipeline/warnings.ts
3695
3707
  const defaultWarningHandler = (warning) => {
3696
- console.warn(`[Tasty] ${warning.message}`);
3708
+ if (process.env.NODE_ENV !== "production") console.warn(`[Tasty] ${warning.message}`);
3697
3709
  };
3698
3710
  let warningHandler = defaultWarningHandler;
3699
3711
  function emitWarning(code, message) {
@@ -4031,7 +4043,7 @@ const INTERNAL_PSEUDO_PATTERN = /:-internal-[a-z0-9-]+/g;
4031
4043
  const SIMPLE_MODIFIER_PATTERN = /^[a-z][a-z0-9-]*$/i;
4032
4044
  const FUNCTION_START_PATTERN = /@(?:media|supports|root|parent|own)?\(|:(?:is|has|not|where)\(/iy;
4033
4045
  const SIMPLE_TOKEN_PATTERN = /@media:[a-z]+|@[a-z][a-z0-9-]*|[a-z][a-z0-9-]*(?:\^=|\$=|\*=|=)(?:"[^"]*"|'[^']*'|[^\s&|!^()]+)|[a-z][a-z0-9-]*|:[-a-z][a-z0-9-]*(?:\([^)]+\))?|\.[a-z][a-z0-9-]*/iy;
4034
- const OPERATOR_TOKENS = new Set([
4046
+ const OPERATOR_TOKENS = /* @__PURE__ */ new Set([
4035
4047
  "&",
4036
4048
  "|",
4037
4049
  "!",
@@ -5040,7 +5052,7 @@ const INNER_STYLES = [
5040
5052
  ];
5041
5053
  //#endregion
5042
5054
  //#region src/styles/base-props.ts
5043
- const RESERVED_PROP_NAMES = new Set([
5055
+ const RESERVED_PROP_NAMES = /* @__PURE__ */ new Set([
5044
5056
  "as",
5045
5057
  "styles",
5046
5058
  "variant",
@@ -5245,4 +5257,4 @@ function renderStylesForChunk(styles, chunkName, styleKeys, pipelineCacheKey) {
5245
5257
  //#endregion
5246
5258
  export { createStyle as A, createStateParserContext as B, splitSelectorsSafely as C, registerHandler as D, normalizeHandlerDefinition as E, FONT_CHUNK_STYLES as F, markStylesGeneratedState as G, setGlobalPredefinedStates as H, LAYOUT_CHUNK_STYLES as I, setGlobalPolyfillsState as J, resetGlobalPolyfillsState as K, POSITION_CHUNK_STYLES as L, CHUNK_NAMES as M, DIMENSION_CHUNK_STYLES as N, resetHandlers as O, DISPLAY_CHUNK_STYLES as P, STYLE_TO_CHUNK as R, camelToKebab as S, defineHandler as T, hasStylesGenerated as U, getGlobalPredefinedStates as V, isFunctionsPolyfillEnabled as W, POSITION_STYLES as _, registerBaseStyleProps as a, renderStyles as b, BLOCK_INNER_STYLES as c, COLOR_STYLES as d, CONTAINER_STYLES as f, OUTER_STYLES as g, INNER_STYLES as h, baseStylePropsRegistry as i, APPEARANCE_CHUNK_STYLES as j, styleHandlers as k, BLOCK_OUTER_STYLES as l, FLOW_STYLES as m, generateChunkCacheKey as n, resetBaseStyleProps as o, DIMENSION_STYLES as p, resetStylesGeneratedState as q, categorizeStyleKeys as r, BASE_STYLES as s, renderStylesForChunk as t, BLOCK_STYLES as u, TEXT_STYLES as v, STYLE_HANDLER_MAP as w, parseStateKey as x, clearPipelineCache as y, resetStyleChunks as z };
5247
5259
 
5248
- //# sourceMappingURL=style-engine-BpgmapBp.js.map
5260
+ //# sourceMappingURL=style-engine-BBbBuSkT.js.map