@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.1

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 (474) hide show
  1. package/dist/cjs/createComponent.cjs +12 -1
  2. package/dist/cjs/createComponent.native.cjs +12 -1
  3. package/dist/cjs/createComponent.native.js +12 -1
  4. package/dist/cjs/createComponent.native.js.map +1 -1
  5. package/dist/cjs/createStyledHOC.cjs +1 -1
  6. package/dist/cjs/createStyledHOC.native.cjs +1 -1
  7. package/dist/cjs/createStyledHOC.native.js +1 -1
  8. package/dist/cjs/createStyledHOC.native.js.map +1 -1
  9. package/dist/cjs/createVariable.cjs +0 -10
  10. package/dist/cjs/createVariable.native.cjs +0 -10
  11. package/dist/cjs/createVariable.native.js +0 -10
  12. package/dist/cjs/createVariable.native.js.map +1 -1
  13. package/dist/cjs/helpers/borderComponents.cjs +62 -0
  14. package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
  15. package/dist/cjs/helpers/borderComponents.native.js +84 -0
  16. package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
  17. package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
  18. package/dist/cjs/helpers/createStyledContext.cjs +10 -18
  19. package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
  20. package/dist/cjs/helpers/createStyledContext.native.js +14 -18
  21. package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
  22. package/dist/cjs/helpers/formatDiagnostic.cjs +6 -6
  23. package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
  24. package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
  25. package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
  26. package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
  27. package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
  28. package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
  29. package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
  30. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
  31. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
  32. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
  33. package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  34. package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
  35. package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
  36. package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
  37. package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
  38. package/dist/cjs/helpers/getSplitStyles.cjs +1042 -1715
  39. package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
  40. package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
  41. package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
  42. package/dist/cjs/helpers/grammarConfig.cjs +163 -1
  43. package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
  44. package/dist/cjs/helpers/grammarConfig.native.js +186 -1
  45. package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
  46. package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
  47. package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
  48. package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
  49. package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
  50. package/dist/cjs/helpers/log.cjs +9 -8
  51. package/dist/cjs/helpers/log.native.cjs +9 -8
  52. package/dist/cjs/helpers/log.native.js +9 -8
  53. package/dist/cjs/helpers/log.native.js.map +1 -1
  54. package/dist/cjs/helpers/mergeVariants.cjs +44 -13
  55. package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
  56. package/dist/cjs/helpers/mergeVariants.native.js +79 -14
  57. package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
  58. package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
  59. package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
  60. package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
  61. package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
  62. package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
  63. package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
  64. package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
  65. package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
  66. package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
  67. package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
  68. package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
  69. package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
  70. package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
  71. package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
  72. package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
  73. package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
  74. package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
  75. package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
  76. package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
  77. package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
  78. package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
  79. package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
  80. package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
  81. package/dist/cjs/helpers/styleStaticConfig.cjs +1 -50
  82. package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
  83. package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
  84. package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
  85. package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
  86. package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
  87. package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
  88. package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
  89. package/dist/cjs/helpers/styledDynamic.cjs +160 -0
  90. package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
  91. package/dist/cjs/helpers/styledDynamic.native.js +197 -0
  92. package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
  93. package/dist/cjs/helpers/tokenCategories.cjs +15 -38
  94. package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
  95. package/dist/cjs/helpers/tokenCategories.native.js +15 -40
  96. package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
  97. package/dist/cjs/helpers/variableValue.cjs +17 -12
  98. package/dist/cjs/helpers/variableValue.native.cjs +46 -23
  99. package/dist/cjs/helpers/variableValue.native.js +46 -23
  100. package/dist/cjs/helpers/variableValue.native.js.map +1 -1
  101. package/dist/cjs/helpers/warnOnce.cjs +5 -4
  102. package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
  103. package/dist/cjs/helpers/warnOnce.native.js +6 -4
  104. package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
  105. package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
  106. package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
  107. package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
  108. package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
  109. package/dist/cjs/hooks/useComponentState.cjs +41 -82
  110. package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
  111. package/dist/cjs/hooks/useComponentState.native.js +45 -84
  112. package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
  113. package/dist/cjs/hooks/useMedia.cjs +2 -2
  114. package/dist/cjs/hooks/useMedia.native.cjs +2 -2
  115. package/dist/cjs/hooks/useMedia.native.js +2 -2
  116. package/dist/cjs/hooks/useMedia.native.js.map +1 -1
  117. package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
  118. package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
  119. package/dist/cjs/hooks/useStyle.native.js +34 -0
  120. package/dist/cjs/hooks/useStyle.native.js.map +1 -0
  121. package/dist/cjs/hooks/useThemeState.cjs +25 -90
  122. package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
  123. package/dist/cjs/hooks/useThemeState.native.js +34 -94
  124. package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
  125. package/dist/cjs/index.cjs +6 -3
  126. package/dist/cjs/index.native.cjs +6 -3
  127. package/dist/cjs/index.native.js +6 -3
  128. package/dist/cjs/index.native.js.map +1 -1
  129. package/dist/cjs/static-resolve.cjs +2 -2
  130. package/dist/cjs/static-resolve.native.cjs +2 -2
  131. package/dist/cjs/static-resolve.native.js +2 -2
  132. package/dist/cjs/static-resolve.native.js.map +1 -1
  133. package/dist/cjs/style.cjs +91 -0
  134. package/dist/cjs/style.native.cjs +98 -0
  135. package/dist/cjs/style.native.js +100 -0
  136. package/dist/cjs/style.native.js.map +1 -0
  137. package/dist/cjs/styled.cjs +11 -6
  138. package/dist/cjs/styled.native.cjs +11 -6
  139. package/dist/cjs/styled.native.js +11 -6
  140. package/dist/cjs/styled.native.js.map +1 -1
  141. package/dist/cjs/types.cjs +6 -4
  142. package/dist/cjs/types.native.cjs +6 -4
  143. package/dist/cjs/types.native.js +6 -4
  144. package/dist/cjs/types.native.js.map +1 -1
  145. package/dist/cjs/views/TamaguiProvider.cjs +1 -2
  146. package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
  147. package/dist/cjs/views/TamaguiProvider.native.js +1 -2
  148. package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
  149. package/dist/cjs/views/Text.cjs +17 -12
  150. package/dist/cjs/views/Text.native.cjs +1 -0
  151. package/dist/cjs/views/Text.native.js +1 -0
  152. package/dist/cjs/views/Text.native.js.map +1 -1
  153. package/dist/cjs/views/Theme.cjs +3 -3
  154. package/dist/cjs/views/Theme.native.cjs +3 -3
  155. package/dist/cjs/views/Theme.native.js +3 -3
  156. package/dist/cjs/views/Theme.native.js.map +1 -1
  157. package/dist/cjs/views/ThemeDebug.cjs +1 -4
  158. package/dist/esm/createComponent.mjs +12 -1
  159. package/dist/esm/createComponent.mjs.map +1 -1
  160. package/dist/esm/createComponent.native.js +12 -1
  161. package/dist/esm/createComponent.native.js.map +1 -1
  162. package/dist/esm/createStyledHOC.mjs +1 -1
  163. package/dist/esm/createStyledHOC.mjs.map +1 -1
  164. package/dist/esm/createStyledHOC.native.js +1 -1
  165. package/dist/esm/createStyledHOC.native.js.map +1 -1
  166. package/dist/esm/createVariable.mjs +1 -9
  167. package/dist/esm/createVariable.mjs.map +1 -1
  168. package/dist/esm/createVariable.native.js +1 -9
  169. package/dist/esm/createVariable.native.js.map +1 -1
  170. package/dist/esm/helpers/borderComponents.mjs +37 -0
  171. package/dist/esm/helpers/borderComponents.mjs.map +1 -0
  172. package/dist/esm/helpers/borderComponents.native.js +55 -0
  173. package/dist/esm/helpers/borderComponents.native.js.map +1 -0
  174. package/dist/esm/helpers/createDesignSystem.mjs +0 -2
  175. package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
  176. package/dist/esm/helpers/createStyledContext.mjs +10 -18
  177. package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
  178. package/dist/esm/helpers/createStyledContext.native.js +14 -18
  179. package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
  180. package/dist/esm/helpers/formatDiagnostic.mjs +6 -6
  181. package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
  182. package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
  183. package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
  184. package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
  185. package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
  186. package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
  187. package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
  188. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
  189. package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
  190. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
  191. package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
  192. package/dist/esm/helpers/getDynamicVal.mjs +5 -1
  193. package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
  194. package/dist/esm/helpers/getDynamicVal.native.js +5 -1
  195. package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
  196. package/dist/esm/helpers/getSplitStyles.mjs +1034 -1705
  197. package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
  198. package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
  199. package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
  200. package/dist/esm/helpers/grammarConfig.mjs +164 -2
  201. package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
  202. package/dist/esm/helpers/grammarConfig.native.js +187 -2
  203. package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
  204. package/dist/esm/helpers/insertStyleRule.mjs +5 -2
  205. package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
  206. package/dist/esm/helpers/insertStyleRule.native.js +7 -2
  207. package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
  208. package/dist/esm/helpers/log.mjs +9 -8
  209. package/dist/esm/helpers/log.mjs.map +1 -1
  210. package/dist/esm/helpers/log.native.js +9 -8
  211. package/dist/esm/helpers/log.native.js.map +1 -1
  212. package/dist/esm/helpers/mergeVariants.mjs +44 -13
  213. package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
  214. package/dist/esm/helpers/mergeVariants.native.js +79 -14
  215. package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
  216. package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
  217. package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
  218. package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
  219. package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
  220. package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
  221. package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
  222. package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
  223. package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
  224. package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
  225. package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
  226. package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
  227. package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
  228. package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
  229. package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
  230. package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
  231. package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
  232. package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
  233. package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
  234. package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
  235. package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
  236. package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
  237. package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
  238. package/dist/esm/helpers/styleStaticConfig.mjs +1 -50
  239. package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
  240. package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
  241. package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
  242. package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
  243. package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
  244. package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
  245. package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
  246. package/dist/esm/helpers/styledDynamic.mjs +136 -0
  247. package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
  248. package/dist/esm/helpers/styledDynamic.native.js +169 -0
  249. package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
  250. package/dist/esm/helpers/tokenCategories.mjs +15 -36
  251. package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
  252. package/dist/esm/helpers/tokenCategories.native.js +15 -38
  253. package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
  254. package/dist/esm/helpers/variableValue.mjs +17 -12
  255. package/dist/esm/helpers/variableValue.mjs.map +1 -1
  256. package/dist/esm/helpers/variableValue.native.js +46 -23
  257. package/dist/esm/helpers/variableValue.native.js.map +1 -1
  258. package/dist/esm/helpers/warnOnce.mjs +5 -4
  259. package/dist/esm/helpers/warnOnce.mjs.map +1 -1
  260. package/dist/esm/helpers/warnOnce.native.js +6 -4
  261. package/dist/esm/helpers/warnOnce.native.js.map +1 -1
  262. package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
  263. package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
  264. package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
  265. package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
  266. package/dist/esm/hooks/useComponentState.mjs +41 -82
  267. package/dist/esm/hooks/useComponentState.mjs.map +1 -1
  268. package/dist/esm/hooks/useComponentState.native.js +45 -84
  269. package/dist/esm/hooks/useComponentState.native.js.map +1 -1
  270. package/dist/esm/hooks/useMedia.mjs +2 -2
  271. package/dist/esm/hooks/useMedia.mjs.map +1 -1
  272. package/dist/esm/hooks/useMedia.native.js +2 -2
  273. package/dist/esm/hooks/useMedia.native.js.map +1 -1
  274. package/dist/esm/hooks/useStyle.mjs +11 -0
  275. package/dist/esm/hooks/useStyle.mjs.map +1 -0
  276. package/dist/esm/hooks/useStyle.native.js +11 -0
  277. package/dist/esm/hooks/useStyle.native.js.map +1 -0
  278. package/dist/esm/hooks/useThemeState.mjs +25 -90
  279. package/dist/esm/hooks/useThemeState.mjs.map +1 -1
  280. package/dist/esm/hooks/useThemeState.native.js +34 -94
  281. package/dist/esm/hooks/useThemeState.native.js.map +1 -1
  282. package/dist/esm/index.js +6 -4
  283. package/dist/esm/index.mjs +6 -4
  284. package/dist/esm/index.native.js +6 -4
  285. package/dist/esm/static-resolve.mjs +3 -3
  286. package/dist/esm/static-resolve.mjs.map +1 -1
  287. package/dist/esm/static-resolve.native.js +3 -3
  288. package/dist/esm/static-resolve.native.js.map +1 -1
  289. package/dist/esm/style.mjs +58 -0
  290. package/dist/esm/style.mjs.map +1 -0
  291. package/dist/esm/style.native.js +63 -0
  292. package/dist/esm/style.native.js.map +1 -0
  293. package/dist/esm/styled.mjs +12 -6
  294. package/dist/esm/styled.mjs.map +1 -1
  295. package/dist/esm/styled.native.js +12 -6
  296. package/dist/esm/styled.native.js.map +1 -1
  297. package/dist/esm/types.mjs +3 -4
  298. package/dist/esm/types.mjs.map +1 -1
  299. package/dist/esm/types.native.js +3 -4
  300. package/dist/esm/types.native.js.map +1 -1
  301. package/dist/esm/views/TamaguiProvider.mjs +1 -2
  302. package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
  303. package/dist/esm/views/TamaguiProvider.native.js +1 -2
  304. package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
  305. package/dist/esm/views/Text.mjs +17 -12
  306. package/dist/esm/views/Text.mjs.map +1 -1
  307. package/dist/esm/views/Theme.mjs +3 -3
  308. package/dist/esm/views/Theme.mjs.map +1 -1
  309. package/dist/esm/views/Theme.native.js +3 -3
  310. package/dist/esm/views/Theme.native.js.map +1 -1
  311. package/dist/esm/views/ThemeDebug.mjs +1 -4
  312. package/dist/esm/views/ThemeDebug.mjs.map +1 -1
  313. package/package.json +15 -15
  314. package/src/createComponent.tsx +21 -1
  315. package/src/createStyledHOC.tsx +4 -2
  316. package/src/createVariable.ts +0 -10
  317. package/src/helpers/borderComponents.ts +62 -0
  318. package/src/helpers/createDesignSystem.ts +0 -2
  319. package/src/helpers/createStyledContext.tsx +15 -53
  320. package/src/helpers/formatDiagnostic.ts +9 -9
  321. package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
  322. package/src/helpers/getCSSStylesAtomic.ts +192 -207
  323. package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
  324. package/src/helpers/getDynamicVal.ts +4 -0
  325. package/src/helpers/getSplitStyles.tsx +2080 -3270
  326. package/src/helpers/grammarConfig.ts +218 -1
  327. package/src/helpers/insertStyleRule.tsx +4 -2
  328. package/src/helpers/log.ts +12 -11
  329. package/src/helpers/mergeVariants.ts +55 -18
  330. package/src/helpers/nativeOnlyProps.ts +0 -1
  331. package/src/helpers/nativeStyleEngine.ts +55 -14
  332. package/src/helpers/normalizeValueWithProperty.ts +10 -12
  333. package/src/helpers/parseBorderShorthand.native.ts +23 -45
  334. package/src/helpers/parseOutlineShorthand.native.ts +9 -40
  335. package/src/helpers/resolveSafeArea.ts +34 -101
  336. package/src/helpers/resolveVariantStyle.ts +77 -0
  337. package/src/helpers/styleFrontend.ts +8 -5
  338. package/src/helpers/styleStaticConfig.ts +5 -72
  339. package/src/helpers/styleStaticConfigCore.ts +110 -0
  340. package/src/helpers/styledDynamic.ts +191 -0
  341. package/src/helpers/tokenCategories.ts +40 -65
  342. package/src/helpers/variableValue.ts +20 -15
  343. package/src/helpers/warnOnce.ts +5 -4
  344. package/src/hooks/useAnimationDriver.ts +6 -2
  345. package/src/hooks/useComponentState.ts +55 -183
  346. package/src/hooks/useMedia.tsx +10 -8
  347. package/src/hooks/useStyle.ts +10 -0
  348. package/src/hooks/useThemeState.ts +51 -264
  349. package/src/index.ts +6 -6
  350. package/src/internalRuntimeTypes.ts +1 -0
  351. package/src/static-resolve.ts +7 -4
  352. package/src/style.ts +97 -0
  353. package/src/styled.tsx +39 -68
  354. package/src/types.tsx +105 -169
  355. package/src/views/TamaguiProvider.tsx +0 -2
  356. package/src/views/Text.tsx +20 -14
  357. package/src/views/Theme.tsx +13 -9
  358. package/src/views/ThemeDebug.tsx +0 -1
  359. package/types/createComponent.d.ts.map +1 -1
  360. package/types/createStyledHOC.d.ts +1 -1
  361. package/types/createStyledHOC.d.ts.map +1 -1
  362. package/types/createVariable.d.ts +0 -2
  363. package/types/createVariable.d.ts.map +1 -1
  364. package/types/helpers/borderComponents.d.ts +10 -0
  365. package/types/helpers/borderComponents.d.ts.map +1 -0
  366. package/types/helpers/createDesignSystem.d.ts.map +1 -1
  367. package/types/helpers/createStyledContext.d.ts.map +1 -1
  368. package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
  369. package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
  370. package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
  371. package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
  372. package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
  373. package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
  374. package/types/helpers/getDynamicVal.d.ts.map +1 -1
  375. package/types/helpers/getSplitStyles.d.ts +3 -5
  376. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  377. package/types/helpers/grammarConfig.d.ts +25 -2
  378. package/types/helpers/grammarConfig.d.ts.map +1 -1
  379. package/types/helpers/insertStyleRule.d.ts +1 -0
  380. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  381. package/types/helpers/log.d.ts.map +1 -1
  382. package/types/helpers/mergeVariants.d.ts.map +1 -1
  383. package/types/helpers/nativeOnlyProps.d.ts +0 -1
  384. package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
  385. package/types/helpers/nativeStyleEngine.d.ts +6 -0
  386. package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
  387. package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
  388. package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
  389. package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
  390. package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
  391. package/types/helpers/resolveSafeArea.d.ts +0 -1
  392. package/types/helpers/resolveSafeArea.d.ts.map +1 -1
  393. package/types/helpers/resolveVariantStyle.d.ts +3 -0
  394. package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
  395. package/types/helpers/styleFrontend.d.ts +3 -5
  396. package/types/helpers/styleFrontend.d.ts.map +1 -1
  397. package/types/helpers/styleStaticConfig.d.ts +4 -9
  398. package/types/helpers/styleStaticConfig.d.ts.map +1 -1
  399. package/types/helpers/styleStaticConfigCore.d.ts +4 -0
  400. package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
  401. package/types/helpers/styledDynamic.d.ts +18 -0
  402. package/types/helpers/styledDynamic.d.ts.map +1 -0
  403. package/types/helpers/tokenCategories.d.ts +0 -1
  404. package/types/helpers/tokenCategories.d.ts.map +1 -1
  405. package/types/helpers/variableValue.d.ts.map +1 -1
  406. package/types/helpers/warnOnce.d.ts.map +1 -1
  407. package/types/helpers/webPropsToSkip.native.d.ts +68 -68
  408. package/types/hooks/useAnimationDriver.d.ts.map +1 -1
  409. package/types/hooks/useComponentState.d.ts.map +1 -1
  410. package/types/hooks/useMedia.d.ts.map +1 -1
  411. package/types/hooks/useStyle.d.ts +4 -0
  412. package/types/hooks/useStyle.d.ts.map +1 -0
  413. package/types/hooks/useThemeState.d.ts +1 -11
  414. package/types/hooks/useThemeState.d.ts.map +1 -1
  415. package/types/index.d.ts +6 -4
  416. package/types/index.d.ts.map +1 -1
  417. package/types/internalRuntimeTypes.d.ts +1 -1
  418. package/types/internalRuntimeTypes.d.ts.map +1 -1
  419. package/types/static-resolve.d.ts.map +1 -1
  420. package/types/style.d.ts +18 -0
  421. package/types/style.d.ts.map +1 -0
  422. package/types/styled.d.ts +10 -10
  423. package/types/styled.d.ts.map +1 -1
  424. package/types/types.d.ts +74 -49
  425. package/types/types.d.ts.map +1 -1
  426. package/types/views/TamaguiProvider.d.ts +1 -1
  427. package/types/views/TamaguiProvider.d.ts.map +1 -1
  428. package/types/views/Text.d.ts.map +1 -1
  429. package/types/views/Theme.d.ts.map +1 -1
  430. package/types/views/ThemeDebug.d.ts.map +1 -1
  431. package/dist/cjs/helpers/directStyleCSS.cjs +0 -345
  432. package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
  433. package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
  434. package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
  435. package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
  436. package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
  437. package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
  438. package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
  439. package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
  440. package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
  441. package/dist/cjs/helpers/variantResolvers.cjs +0 -87
  442. package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
  443. package/dist/cjs/helpers/variantResolvers.native.js +0 -142
  444. package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
  445. package/dist/esm/helpers/directStyleCSS.mjs +0 -317
  446. package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
  447. package/dist/esm/helpers/directStyleCSS.native.js +0 -1
  448. package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
  449. package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
  450. package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
  451. package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
  452. package/dist/esm/helpers/getVariantExtras.mjs +0 -69
  453. package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
  454. package/dist/esm/helpers/getVariantExtras.native.js +0 -70
  455. package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
  456. package/dist/esm/helpers/variantResolvers.mjs +0 -65
  457. package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
  458. package/dist/esm/helpers/variantResolvers.native.js +0 -116
  459. package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
  460. package/src/helpers/directStyleCSS.native.ts +0 -1
  461. package/src/helpers/directStyleCSS.ts +0 -513
  462. package/src/helpers/directStyleCSSCompiled.ts +0 -32
  463. package/src/helpers/getVariantExtras.tsx +0 -95
  464. package/src/helpers/variantResolvers.ts +0 -121
  465. package/types/helpers/directStyleCSS.d.ts +0 -28
  466. package/types/helpers/directStyleCSS.d.ts.map +0 -1
  467. package/types/helpers/directStyleCSS.native.d.ts +0 -2
  468. package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
  469. package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
  470. package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
  471. package/types/helpers/getVariantExtras.d.ts +0 -4
  472. package/types/helpers/getVariantExtras.d.ts.map +0 -1
  473. package/types/helpers/variantResolvers.d.ts +0 -9
  474. package/types/helpers/variantResolvers.d.ts.map +0 -1
@@ -4,8 +4,8 @@ var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target2, all) => {
8
- for (var name in all) __defProp(target2, name, {
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
9
  get: all[name],
10
10
  enumerable: true
11
11
  });
@@ -19,22 +19,19 @@ var __copyProps = (to, from, except, desc) => {
19
19
  }
20
20
  return to;
21
21
  };
22
- var __reExport = (target2, mod, secondTarget) => (__copyProps(target2, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
23
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
24
  var getSplitStyles_exports = {};
25
25
  __export(getSplitStyles_exports, {
26
26
  STYLE_TOKEN_PROVENANCE_KEY: () => import_styleProvenance2.STYLE_TOKEN_PROVENANCE_KEY,
27
- clearDirectStyle: () => clearDirectStyle,
28
- contributeStyleString: () => contributeStyleString,
29
- directStyleSignature: () => import_directStyleCSS2.directStyleSignature,
30
- flushDirectStyles: () => import_directStyleCSS2.flushDirectStyles,
31
- getDirectDynamicThemeAccess: () => getDirectDynamicThemeAccess,
27
+ emitVariantStyle: () => emitVariantStyle,
32
28
  getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
33
29
  getSplitStyles: () => getSplitStyles,
34
30
  getStyleStaticConfig: () => import_styleStaticConfig.getStyleStaticConfig,
35
31
  getStyleTokenProvenance: () => import_styleProvenance2.getStyleTokenProvenance,
36
32
  isValidStyleKey: () => isValidStyleKey,
37
- styleOriginalValues: () => import_styleOriginalValues.styleOriginalValues
33
+ styleOriginalValues: () => import_styleOriginalValues.styleOriginalValues,
34
+ walkConditionalValue: () => walkConditionalValue
38
35
  });
39
36
  module.exports = __toCommonJS(getSplitStyles_exports);
40
37
  var import_constants = require("@tamagui/constants");
@@ -42,347 +39,246 @@ var import_helpers = require("@tamagui/helpers");
42
39
  var import_runtime = require("@tamagui/style-grammar/runtime");
43
40
  var import_config = require("../config.native.js");
44
41
  var import_isDevTools = require("../constants/isDevTools.native.js");
42
+ var import_defaultComponentState = require("../defaultComponentState.native.js");
45
43
  var import_createVariable = require("../createVariable.native.js");
46
- var import_directStyleCSS = require("./directStyleCSS.native.js");
44
+ var import_types = require("../types.native.js");
45
+ var import_getCSSStylesAtomic = require("./getCSSStylesAtomic.native.js");
47
46
  var import_expandStyle = require("./expandStyle.native.js");
47
+ var import_borderComponents = require("./borderComponents.native.js");
48
48
  var import_expandStyles = require("./expandStyles.native.js");
49
49
  var import_grammarConfig = require("./grammarConfig.native.js");
50
50
  var import_mediaState = require("./mediaState.native.js");
51
51
  var import_styleStaticConfig = require("./styleStaticConfig.native.js");
52
- require("./styleToCSS.native.js");
53
- var import_variantResolvers = require("./variantResolvers.native.js");
52
+ var import_nativeStyleEngine = require("./nativeStyleEngine.native.js");
54
53
  var import_warnOnce = require("./warnOnce.native.js");
55
- var import_directStyleCSS2 = require("./directStyleCSS.native.js");
56
54
  var import_getDynamicVal = require("./getDynamicVal.native.js");
57
- var import_getVariantExtras = require("./getVariantExtras.native.js");
58
- require("./insertStyleRule.native.js");
59
- var import_isObj = require("./isObj.native.js");
55
+ var import_styledDynamic = require("./styledDynamic.native.js");
56
+ var import_insertStyleRule = require("./insertStyleRule.native.js");
60
57
  var import_log = require("./log.native.js");
61
58
  var import_normalizeColor = require("./normalizeColor.native.js");
62
- var import_normalizeStyle = require("./normalizeStyle.native.js");
63
59
  var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.native.js");
64
60
  var import_parseNativeStyle = require("./parseNativeStyle.native.js");
65
61
  var import_parseNativeTransform = require("./parseNativeTransform.native.js");
66
- var import_resolveRem = require("./resolveRem.native.js");
67
- var import_resolveSafeArea = require("./resolveSafeArea.native.js");
68
- var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.native.js");
69
62
  var import_resolveVariableValue = require("./resolveVariableValue.native.js");
70
63
  var import_skipProps = require("./skipProps.native.js");
71
64
  var import_styleOriginalValues = require("./styleOriginalValues.native.js");
72
65
  var import_styleProvenance = require("./styleProvenance.native.js");
73
66
  var import_themeRef = require("./themeRef.native.js");
74
- var import_tokenCategories = require("./tokenCategories.native.js");
75
67
  var import_transformsToString = require("./transformsToString.native.js");
68
+ var import_style = require("../style.native.js");
76
69
  var import_styleProvenance2 = require("./styleProvenance.native.js");
77
70
  __reExport(getSplitStyles_exports, require("./tokenCategories.native.js"), module.exports);
78
71
  function _type_of(obj) {
79
72
  "@swc/helpers - typeof";
80
73
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
81
74
  }
82
- var TAMAGUI_CLASS_PROPS = "$$tamaguiClassProps";
83
75
  var shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
84
- var conditionWidth = 4;
85
- var conditionValueOffset = 0;
86
- var conditionFlagsOffset = 1;
87
- var conditionPrecedenceOffset = 2;
88
- var conditionWrapperOffset = 3;
89
- var conditionActiveFlag = 1;
90
- var conditionEmitFlag = 2;
91
- var conditionResolvedFlag = 4;
92
- var conditionEnterFlag = 8;
93
- var conditionExitFlag = 16;
76
+ var conditionValue = 0;
77
+ var conditionPlatform = 1;
78
+ var conditionKey = 2;
79
+ var conditionSelector = 3;
80
+ var conditionTheme = 4;
81
+ var conditionWrappers = 5;
82
+ var conditionAtoms = 6;
83
+ var conditionRanks = 7;
84
+ var conditionResolvedFlag = 16;
94
85
  var conditionPlatformPseudoFlag = 32;
95
- var conditionInitialFlags = conditionActiveFlag | conditionEmitFlag | conditionResolvedFlag;
96
- var conditionTextWidth = 5;
97
- var conditionKeyOffset = 0;
98
- var conditionSelectorOffset = 1;
99
- var conditionThemeOffset = 2;
100
- var conditionUnsupportedStateOffset = 3;
101
- var conditionUnresolvedNameOffset = 4;
102
- var conditionNumbers = new Float64Array(2048);
103
- var conditionTexts = [];
104
- var conditionWrappers = [];
105
- var conditionWrapperTop = 0;
106
- var conditionCursorTop = conditionWidth;
107
- function reserveConditionCursor(cursor) {
108
- var required = cursor + conditionWidth;
109
- if (required > conditionTexts.length) {
110
- var previous = conditionTexts.length;
111
- conditionTexts.length = required;
112
- conditionTexts.fill("", previous);
113
- }
114
- if (required <= conditionNumbers.length) return;
115
- var length = conditionNumbers.length * 2;
116
- while (length < required) length *= 2;
117
- var previous1 = conditionNumbers;
118
- conditionNumbers = new Float64Array(length);
119
- conditionNumbers.set(previous1);
86
+ function createCondition(parent) {
87
+ return parent ? [
88
+ parent[conditionValue] & 63,
89
+ parent[conditionPlatform],
90
+ "",
91
+ parent[conditionSelector],
92
+ parent[conditionTheme],
93
+ parent[conditionWrappers].slice(),
94
+ parent[conditionAtoms].slice(),
95
+ parent[conditionRanks].slice()
96
+ ] : [
97
+ 19,
98
+ 0,
99
+ "",
100
+ "",
101
+ "",
102
+ [],
103
+ [],
104
+ []
105
+ ];
120
106
  }
121
- function setConditionUnresolved(cursor) {
107
+ function setConditionUnresolved(condition) {
122
108
  var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
123
- conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionResolvedFlag;
124
- if (name) {
125
- var _conditionTexts, _text;
126
- var text = cursor + conditionUnresolvedNameOffset;
127
- (_conditionTexts = conditionTexts)[_text = text] || (_conditionTexts[_text] = name);
128
- }
129
- }
130
- function appendConditionWrapper(cursor, wrapper) {
131
- conditionWrappers[conditionWrapperTop++] = wrapper;
132
- conditionNumbers[cursor + conditionWrapperOffset]++;
133
- }
134
- function copyConditionCursor(target2, source) {
135
- for (var offset = 0; offset <= conditionPrecedenceOffset; offset++) conditionNumbers[target2 + offset] = conditionNumbers[source + offset];
136
- for (var offset1 = 0; offset1 < conditionTextWidth; offset1++) conditionTexts[target2 + offset1] = conditionTexts[source + offset1] || "";
137
- var wrapper = conditionNumbers[source + conditionWrapperOffset];
138
- var wrapperStart = wrapper >> 3;
139
- var wrapperCount = wrapper & 7;
140
- for (var index = 0; index < wrapperCount; index++) conditionWrappers[conditionWrapperTop++] = conditionWrappers[wrapperStart + index];
141
- conditionNumbers[target2 + conditionWrapperOffset] += wrapperCount;
142
- }
143
- function resetConditionCursor(cursor, parent) {
144
- conditionNumbers[cursor + conditionValueOffset] = 0;
145
- conditionNumbers[cursor + conditionFlagsOffset] = conditionInitialFlags;
146
- conditionNumbers[cursor + conditionPrecedenceOffset] = 0;
147
- conditionNumbers[cursor + conditionWrapperOffset] = conditionWrapperTop << 3;
148
- conditionTexts.fill("", cursor, cursor + conditionTextWidth);
149
- if (parent) copyConditionCursor(cursor, parent);
150
- }
151
- function acquireConditionCursor() {
152
- var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
153
- var cursor = conditionCursorTop;
154
- conditionCursorTop += conditionWidth;
155
- reserveConditionCursor(cursor);
156
- resetConditionCursor(cursor, parent);
157
- return cursor;
158
- }
159
- function releaseConditionCursors(watermark) {
160
- if (watermark >= conditionCursorTop) return;
161
- conditionTexts.fill("", watermark, conditionCursorTop);
162
- conditionCursorTop = watermark;
163
- }
164
- function releaseConditionPayloads(wrapperBase) {
165
- conditionWrappers.fill("", wrapperBase, conditionWrapperTop);
166
- conditionWrapperTop = wrapperBase;
167
- }
168
- function accumulateConditionAtom(state, cursor, kind, rank, name) {
169
- var keySlot = cursor + conditionKeyOffset;
170
- var key = conditionTexts[keySlot];
171
- if (!key) conditionTexts[keySlot] = name;
172
- else {
173
- var slotStart = 0;
174
- var inserted = false;
175
- while (slotStart <= key.length) {
176
- var slotEnd = key.indexOf(":", slotStart);
177
- if (slotEnd === -1) slotEnd = key.length;
178
- var order = 0;
179
- var compareLength = Math.min(name.length, slotEnd - slotStart);
180
- for (var offset = 0; offset < compareLength; offset++) {
181
- order = name.charCodeAt(offset) - key.charCodeAt(slotStart + offset);
182
- if (order) break;
183
- }
184
- order || (order = name.length - (slotEnd - slotStart));
185
- if (!order) return;
186
- if (order < 0) {
187
- conditionTexts[keySlot] = `${key.slice(0, slotStart)}${name}:${key.slice(slotStart)}`;
188
- inserted = true;
189
- break;
190
- }
191
- if (slotEnd === key.length) break;
192
- slotStart = slotEnd + 1;
193
- }
194
- if (!inserted) conditionTexts[keySlot] = `${key}:${name}`;
109
+ var _condition;
110
+ condition[conditionValue] &= ~conditionResolvedFlag;
111
+ if (process.env.NODE_ENV !== "production") (_condition = condition).problem || (_condition.problem = name);
112
+ }
113
+ function appendConditionWrapper(condition, wrapper) {
114
+ var wrappers = condition[conditionWrappers];
115
+ if (!wrappers.includes(wrapper)) wrappers.push(wrapper);
116
+ }
117
+ function resolveConditionModifier(state, condition, authored) {
118
+ var modifier = (0, import_grammarConfig.getConfigRevisionState)(state.conf).resolveCondition(authored);
119
+ if (!modifier) {
120
+ setConditionUnresolved(condition, authored);
121
+ return;
195
122
  }
196
- if (kind === import_runtime.modifierKindPlatform) {
197
- var precedence = conditionNumbers[cursor + conditionPrecedenceOffset];
198
- if (rank > precedence >>> 26) conditionNumbers[cursor + conditionPrecedenceOffset] = precedence & 67108863 | rank << 26;
199
- if (!(0, import_constants.platformMatches)(name)) conditionNumbers[cursor + conditionFlagsOffset] &= ~(conditionActiveFlag | conditionEmitFlag);
123
+ var [name, kind, rank] = modifier;
124
+ var atoms = condition[conditionAtoms];
125
+ var atomIndex = 0;
126
+ while (atomIndex < atoms.length && atoms[atomIndex] < name) atomIndex++;
127
+ if (atoms[atomIndex] === name) return;
128
+ for (var index = atoms.length; index > atomIndex; index--) atoms[index] = atoms[index - 1];
129
+ atoms[atomIndex] = name;
130
+ if (kind === 3) {
131
+ condition[conditionPlatform] = Math.max(condition[conditionPlatform], rank);
132
+ if (!modifier[6]) condition[conditionValue] &= -4;
200
133
  return;
201
134
  }
202
- var precedence1 = conditionNumbers[cursor + conditionPrecedenceOffset];
203
- var depth = Math.min((precedence1 >> 23 & 7) + 1, 7);
204
- var nextCategory = kind === import_runtime.modifierKindMedia ? 0 : kind === 6 ? 1 : kind === import_runtime.modifierKindTheme ? 2 : kind === 5 ? 3 : 4;
205
- var categoryRank = precedence1 >> 20 & 7;
206
- var withinRank = precedence1 & 1048575;
207
- if (nextCategory > categoryRank) {
208
- categoryRank = nextCategory;
209
- withinRank = rank;
210
- } else if (nextCategory === categoryRank && rank > withinRank) withinRank = rank;
211
- precedence1 = precedence1 & -67108864 | depth << 23 | categoryRank << 20 | withinRank;
212
- conditionNumbers[cursor + conditionPrecedenceOffset] = precedence1;
213
- var buildCSS = import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses;
214
- if (kind === import_runtime.modifierKindMedia) {
135
+ var precedence = kind === 2 ? 1 + Math.min(rank, 63) : kind === 6 ? 65 + Math.min(rank, 63) : kind === 4 ? 129 : kind === 5 ? 161 + rank : 225 + rank;
136
+ var ranks = condition[conditionRanks];
137
+ var rankIndex = 0;
138
+ while (rankIndex < ranks.length && ranks[rankIndex] >= precedence) rankIndex++;
139
+ for (var index1 = ranks.length; index1 > rankIndex; index1--) ranks[index1] = ranks[index1 - 1];
140
+ ranks[rankIndex] = precedence;
141
+ var buildCSS = import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses;
142
+ if (kind === 2) {
215
143
  var _state_flatMediaState;
216
144
  var _state;
217
- var query = (0, import_grammarConfig.getConfigRevisionState)(state.conf).mediaQueries[name];
218
- if (!query) {
219
- setConditionUnresolved(cursor, name);
220
- return;
221
- }
222
- if (buildCSS) appendConditionWrapper(cursor, `@media ${query}`);
223
- if (!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[name])) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
145
+ var query = modifier[3];
146
+ if (!query) return setConditionUnresolved(condition, name);
147
+ if (buildCSS) appendConditionWrapper(condition, `@media ${query}`);
148
+ if (!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[name])) condition[conditionValue] &= -2;
224
149
  ((_state = state).flatMediaKeys || (_state.flatMediaKeys = /* @__PURE__ */ new Set())).add(name);
225
- } else if (kind === import_runtime.modifierKindTheme) {
150
+ return;
151
+ }
152
+ if (kind === 4) {
226
153
  var _state_flatThemeName;
227
- conditionTexts[cursor + conditionThemeOffset] = name;
228
- if (buildCSS) {
229
- var selector = cursor + conditionSelectorOffset;
230
- conditionTexts[selector] += `:where(.t_${name}, .t_${name} *)`;
231
- }
232
- if (state.flatThemeName !== name && ((_state_flatThemeName = state.flatThemeName) === null || _state_flatThemeName === void 0 ? void 0 : _state_flatThemeName.startsWith(`${name}_`)) !== true) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
233
- } else if (kind === 5) {
234
- var _state_componentState_group, _state_flatGroupContext, _this;
235
- var _state1;
236
- var slash = name.indexOf("/");
237
- var groupName = slash === -1 ? "true" : name.slice(slash + 1);
238
- var stateSelector = import_runtime.stateModifierSelectors[rank];
239
- var conditionStateName = import_runtime.canonicalStateModifierNames[rank];
154
+ condition[conditionTheme] = name;
155
+ if (buildCSS) condition[conditionSelector] += `:where(.t_${name}, .t_${name} *)`;
156
+ if (state.flatThemeName !== name && ((_state_flatThemeName = state.flatThemeName) === null || _state_flatThemeName === void 0 ? void 0 : _state_flatThemeName.startsWith(`${name}_`)) !== true) condition[conditionValue] &= -2;
157
+ return;
158
+ }
159
+ if (kind === 6) {
160
+ var _state_componentState_group, _state_flatGroupContext, _state_flatGroupContext1, _component_media;
161
+ var _state1, _state2;
162
+ var size = modifier[4];
163
+ var containerName = modifier[5];
164
+ var groupName = `@${containerName}`;
240
165
  if (buildCSS) {
241
- var selector1 = cursor + conditionSelectorOffset;
242
- conditionTexts[selector1] += `:where(.t_group_${groupName}${stateSelector} *)`;
243
- if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
166
+ var query1 = modifier[3];
167
+ appendConditionWrapper(condition, containerName ? `@container ${containerName} ${query1}` : `@container ${query1}`);
244
168
  }
245
169
  var component = (_state_componentState_group = state.componentState.group) === null || _state_componentState_group === void 0 ? void 0 : _state_componentState_group[groupName];
246
170
  var context = (_state_flatGroupContext = state.flatGroupContext) === null || _state_flatGroupContext === void 0 ? void 0 : _state_flatGroupContext[groupName];
247
- var _component_pseudo;
248
- if (!((_this = (_component_pseudo = component === null || component === void 0 ? void 0 : component.pseudo) !== null && _component_pseudo !== void 0 ? _component_pseudo : context === null || context === void 0 ? void 0 : context.state.pseudo) === null || _this === void 0 ? void 0 : _this[conditionStateName])) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
171
+ if (process.env.NODE_ENV === "development" && containerName && !component && !context && ((_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[containerName])) (0, import_warnOnce.warnOnce)(`group-container:${containerName}`, `@${size}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
172
+ var match = component === null || component === void 0 ? void 0 : (_component_media = component.media) === null || _component_media === void 0 ? void 0 : _component_media[size];
173
+ if (!(match !== null && match !== void 0 ? match : (context === null || context === void 0 ? void 0 : context.state.layout) && (0, import_mediaState.mediaKeyMatch)(size, context.state.layout))) condition[conditionValue] &= -2;
249
174
  ((_state1 = state).flatGroupKeys || (_state1.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName);
250
- } else if (kind === 6) {
251
- var _state_componentState_group1, _state_flatGroupContext1, _state_flatGroupContext2, _component_media;
252
- var _state2, _state3;
253
- var slash1 = name.indexOf("/");
254
- var containerSize = name.slice(1, slash1 === -1 ? name.length : slash1);
255
- var containerName = slash1 === -1 ? "" : name.slice(slash1 + 1);
256
- var containerQuery = (0, import_grammarConfig.getConfigRevisionState)(state.conf).mediaQueries[containerSize];
257
- var groupKey = `@${containerName}`;
258
- if (buildCSS) appendConditionWrapper(cursor, containerName ? `@container ${containerName} ${containerQuery}` : `@container ${containerQuery}`);
259
- var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupKey];
260
- var context1 = (_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[groupKey];
261
- if (process.env.NODE_ENV === "development" && containerName && !component1 && !context1 && ((_state_flatGroupContext2 = state.flatGroupContext) === null || _state_flatGroupContext2 === void 0 ? void 0 : _state_flatGroupContext2[containerName])) (0, import_warnOnce.warnOnce)(`group-container:${containerName}`, `@${containerSize}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
262
- var match = component1 === null || component1 === void 0 ? void 0 : (_component_media = component1.media) === null || _component_media === void 0 ? void 0 : _component_media[containerSize];
263
- if (!(match === void 0 ? (context1 === null || context1 === void 0 ? void 0 : context1.state.layout) && (0, import_mediaState.mediaKeyMatch)(containerSize, context1.state.layout) : match)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
264
- ((_state2 = state).flatGroupKeys || (_state2.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupKey);
265
- ((_state3 = state).flatGroupMedia || (_state3.flatGroupMedia = /* @__PURE__ */ new Set())).add(containerSize);
266
- } else {
267
- var stateSelector1 = import_runtime.stateModifierSelectors[rank];
268
- conditionNumbers[cursor + conditionFlagsOffset] += 64;
269
- if (stateSelector1[0] === "[" && name !== "disabled") conditionTexts[cursor + conditionUnsupportedStateOffset] = name;
270
- if (rank === 6) conditionNumbers[cursor + conditionFlagsOffset] |= conditionEnterFlag;
271
- else if (rank === 7) conditionNumbers[cursor + conditionFlagsOffset] |= conditionExitFlag;
272
- else if (rank === 0 || rank === 2 || rank === 4) conditionNumbers[cursor + conditionFlagsOffset] |= conditionPlatformPseudoFlag;
273
- if (buildCSS) {
274
- var selector2 = cursor + conditionSelectorOffset;
275
- if (stateSelector1[0] === ".") conditionTexts[selector2] += `:is(${stateSelector1}, ${stateSelector1} *)`;
276
- else conditionTexts[selector2] += stateSelector1;
277
- if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
278
- }
279
- var component2 = state.componentState;
280
- if (!(rank === 0 ? !!component2.hover : rank === 4 ? !!(component2.press || component2.pressIn) : rank === 2 ? !!component2.focus : rank === 3 ? !!component2.focusVisible : rank === 1 ? !!component2.focusWithin : rank === 5 ? !!(component2.disabled || state.props.disabled) : rank === 6 ? !!component2.unmounted : rank === 7 ? !!state.styleProps.isExiting : false)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
281
- if (stateSelector1[0] === ":") {
282
- var _state4;
283
- ((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
284
- }
285
- }
286
- }
287
- function resolveConditionModifier(state, cursor, modifier) {
288
- var compiled = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
289
- var code = compiled.modifiers[modifier];
290
- var kind = code & 7;
291
- var rank = code >> 3;
292
- if (kind === import_runtime.modifierKindState) {
293
- accumulateConditionAtom(state, cursor, kind, rank, import_runtime.canonicalStateModifierNames[rank]);
175
+ ((_state2 = state).flatGroupMedia || (_state2.flatGroupMedia = /* @__PURE__ */ new Set())).add(size);
294
176
  return;
295
177
  }
296
- if (!kind && modifier.startsWith("group-")) {
297
- var slash = modifier.indexOf("/");
298
- var authoredState = modifier.slice(6, slash === -1 ? void 0 : slash);
299
- code = compiled.modifiers[authoredState];
300
- if ((code & 7) === import_runtime.modifierKindState) {
301
- rank = code >> 3;
302
- var groupName = slash === -1 ? "true" : modifier.slice(slash + 1);
303
- if (rank !== 6 && rank !== 7 && (slash === -1 || (0, import_runtime.isModifierName)(groupName, 0, groupName.length))) {
304
- var stateName = import_runtime.canonicalStateModifierNames[rank];
305
- accumulateConditionAtom(state, cursor, 5, rank, `group-${stateName}${slash === -1 ? "" : modifier.slice(slash)}`);
306
- return;
307
- }
308
- }
309
- } else if (!kind && modifier.charCodeAt(0) === 64) {
310
- var slash1 = modifier.indexOf("/");
311
- var containerSize = modifier.slice(1, slash1 === -1 ? void 0 : slash1);
312
- var containerName = slash1 === -1 ? "" : modifier.slice(slash1 + 1);
313
- var containerQuery = "";
314
- if ((0, import_runtime.isModifierName)(containerSize, 0, containerSize.length) && (slash1 === -1 || (0, import_runtime.isModifierName)(containerName, 0, containerName.length)) && ((code = compiled.modifiers[containerSize]) & 7) === import_runtime.modifierKindMedia && (containerQuery = compiled.mediaQueries[containerSize]) && (0, import_runtime.isContainerSizeQueryText)(containerQuery)) {
315
- accumulateConditionAtom(state, cursor, 6, code >> 3, modifier);
316
- return;
317
- }
318
- } else if (kind) {
319
- accumulateConditionAtom(state, cursor, kind, rank, modifier);
320
- return;
178
+ var selector = modifier[3];
179
+ if (kind === 5) {
180
+ var _state_componentState_group1, _state_flatGroupContext2, _this;
181
+ var _state3;
182
+ var groupName1 = modifier[4];
183
+ if (buildCSS) condition[conditionSelector] += `:where(.t_group_${groupName1}${selector} *)`;
184
+ var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupName1];
185
+ var context1 = (_state_flatGroupContext2 = state.flatGroupContext) === null || _state_flatGroupContext2 === void 0 ? void 0 : _state_flatGroupContext2[groupName1];
186
+ var _component_pseudo;
187
+ if (!((_this = (_component_pseudo = component1 === null || component1 === void 0 ? void 0 : component1.pseudo) !== null && _component_pseudo !== void 0 ? _component_pseudo : context1 === null || context1 === void 0 ? void 0 : context1.state.pseudo) === null || _this === void 0 ? void 0 : _this[modifier[5]])) condition[conditionValue] &= -2;
188
+ ((_state3 = state).flatGroupKeys || (_state3.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName1);
189
+ } else {
190
+ var _state4;
191
+ if (rank === 0 || rank === 2 || rank === 4) condition[conditionValue] |= conditionPlatformPseudoFlag;
192
+ else if (rank === 6) condition[conditionValue] |= 4;
193
+ else if (rank === 7) condition[conditionValue] |= 8;
194
+ if (buildCSS) condition[conditionSelector] += `:where(${selector}${selector[0] === "." ? `, ${selector} *` : ""})`;
195
+ var component2 = state.componentState;
196
+ if (!(rank === 1 ? component2.focusWithin : rank === 3 ? component2.focusVisible : rank === 4 ? component2.press || component2.pressIn : rank === 5 ? component2.disabled || state.props.disabled : rank === 6 ? component2.unmounted : rank === 7 ? state.styleProps.isExiting : component2[name])) condition[conditionValue] &= -2;
197
+ if (selector[0] === ":") ((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
321
198
  }
322
- setConditionUnresolved(cursor, modifier);
199
+ if (rank === 0 && buildCSS) appendConditionWrapper(condition, "@media (hover: hover)");
323
200
  }
324
- function resolveConditionText(state, cursor, text) {
201
+ function resolveConditionText(state, condition, text) {
325
202
  var start = 0;
326
203
  for (var index = 0; index <= text.length; index++) {
327
204
  if (index !== text.length && text.charCodeAt(index) !== 58) continue;
328
205
  if (index === start) {
329
- setConditionUnresolved(cursor);
206
+ setConditionUnresolved(condition);
330
207
  return;
331
208
  }
332
- if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) return;
333
- resolveConditionModifier(state, cursor, text.slice(start, index));
209
+ if (!(condition[conditionValue] & conditionResolvedFlag)) return;
210
+ resolveConditionModifier(state, condition, text.slice(start, index));
334
211
  start = index + 1;
335
212
  }
336
213
  }
337
- function commitConditionCursor(state, cursor) {
338
- if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
339
- conditionNumbers[cursor + conditionValueOffset] = 0;
214
+ function commitCondition(condition) {
215
+ if (!(condition[conditionValue] & conditionResolvedFlag)) {
216
+ condition[conditionValue] = 0;
340
217
  return 0;
341
218
  }
342
- var key = conditionTexts[cursor + conditionKeyOffset] || "";
343
- var precedence = conditionNumbers[cursor + conditionPrecedenceOffset];
344
- var depth = precedence >> 23 & 7;
345
- if (depth > 5) throw new Error(`a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${key}:"`);
346
- var flags = conditionNumbers[cursor + conditionFlagsOffset];
347
- var condition = precedence * 256 + (flags >> 6) * 32 + 16 + (flags & conditionActiveFlag ? 1 : 0) + (flags & conditionEmitFlag ? 2 : 0) + (flags & conditionEnterFlag ? 4 : 0) + (flags & conditionExitFlag ? 8 : 0);
348
- conditionNumbers[cursor + conditionValueOffset] = condition;
349
- return condition;
350
- }
351
- function acquireConditionKeyCursor(state, key) {
352
- var cursor = acquireConditionCursor();
353
- if (key) {
354
- resolveConditionText(state, cursor, key);
355
- commitConditionCursor(state, cursor);
219
+ condition[conditionKey] = condition[conditionAtoms].join(":");
220
+ var ranks = condition[conditionRanks];
221
+ var depth = ranks.length;
222
+ if (depth > 5) {
223
+ if (process.env.NODE_ENV !== "production") throw new Error(`a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${condition[conditionKey]}:"`);
224
+ return 0;
356
225
  }
357
- return cursor;
226
+ var precedence = condition[conditionPlatform] * 6 + depth;
227
+ for (var index = 0; index < 5; index++) precedence = precedence * 256 + (ranks[index] || 0);
228
+ var value = precedence * 256 + condition[conditionValue];
229
+ condition[conditionValue] = value;
230
+ return value;
231
+ }
232
+ function conditionFromKey(state, key, parent) {
233
+ if (!key) return createCondition(parent);
234
+ if (!parent) {
235
+ var direct = state;
236
+ var cache = direct.flatConditions;
237
+ if (cache === void 0 || direct.flatConditionsClassed !== state.flatShouldDoClasses) {
238
+ cache = direct.flatConditions = /* @__PURE__ */ new Map();
239
+ direct.flatConditionsClassed = state.flatShouldDoClasses;
240
+ }
241
+ var known = cache.get(key);
242
+ if (known !== void 0) return known;
243
+ var resolved = createCondition(null);
244
+ resolveConditionText(state, resolved, key);
245
+ commitCondition(resolved);
246
+ cache.set(key, resolved);
247
+ return resolved;
248
+ }
249
+ var condition = createCondition(parent);
250
+ resolveConditionText(state, condition, key);
251
+ commitCondition(condition);
252
+ return condition;
358
253
  }
359
- function classifyConditionalObject(value, state, isChain, firstCursor) {
254
+ function classifyConditionalObject(value, state, isChain, firstCondition) {
360
255
  if ("default" in value) return -1;
361
256
  for (var key in value) {
362
257
  if (!key.length) return 0;
363
258
  if (!state) return (isChain === null || isChain === void 0 ? void 0 : isChain(key)) ? 1 : 0;
364
- var watermark = conditionCursorTop;
365
- var cursor = firstCursor || acquireConditionCursor();
366
- try {
367
- resolveConditionText(state, cursor, key);
368
- return commitConditionCursor(state, cursor);
369
- } finally {
370
- if (!firstCursor) releaseConditionCursors(watermark);
371
- }
259
+ var condition = firstCondition || createCondition();
260
+ resolveConditionText(state, condition, key);
261
+ return commitCondition(condition);
372
262
  }
373
263
  return 0;
374
264
  }
375
- var passStyleState = 0;
376
- var passClassName = 21;
377
- var passShouldDoClasses = 22;
378
- var passFrontendGroup = 26;
379
- var passFrontendContainer = 27;
380
- var passFrontendContainerType = 28;
381
- var passHocMappedProperties = 29;
382
- var passHocMappedClasses = 30;
383
- var passParentCursor = 35;
384
- var passMapSourceKey = 36;
385
- var passMapFlags = 37;
265
+ var passClassName = 20;
266
+ var passShouldDoClasses = 21;
267
+ var passContainerValue = 22;
268
+ var passContainerName = 23;
269
+ var passContainerType = 24;
270
+ var passFrontendGroup = 25;
271
+ var passFrontendContainer = 26;
272
+ var passFrontendContainerType = 27;
273
+ var passSourceLayer = 28;
274
+ var passParentCursor = 29;
275
+ var passMapSourceKey = 30;
276
+ var passFlags = 13;
277
+ var sourceLayerBase = 0;
278
+ var sourceLayerVariant = 1;
279
+ var sourceLayerResolver = 2;
280
+ var sourceLayerProps = 3;
281
+ var sourceLayerStyle = 4;
386
282
  var passNoSkipFlag = 1;
387
283
  var passDisableShorthandsFlag = 2;
388
284
  var passNoExpandFlag = 4;
@@ -391,357 +287,269 @@ var passHocFlag = 16;
391
287
  var passTextFlag = 32;
392
288
  var passInputFlag = 64;
393
289
  var passAsChildStyleFlag = 128;
394
- function forEachPropInForwardOrder(pass) {
395
- var styleState = pass[passStyleState];
396
- var processedProps = styleState.props;
397
- var styleStaticConfig = styleState.flatStyleStaticConfig;
398
- var baseStyle = styleStaticConfig.baseStyle;
399
- var baseVariantProps = styleStaticConfig.baseVariantProps;
400
- var conditionWrapperBase = conditionWrapperTop;
401
- try {
402
- var appliesBaseStyle = baseStyle && !processedProps.asChild;
403
- if (appliesBaseStyle) for (var key in baseStyle) contributeProp(pass, key, baseVariantProps && Object.hasOwn(baseVariantProps, key) && Object.hasOwn(processedProps, key) ? processedProps[key] : baseStyle[key]);
404
- for (var key1 in processedProps) {
405
- if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key1)) continue;
406
- contributeProp(pass, key1, processedProps[key1]);
407
- }
408
- } catch (error) {
409
- releaseConditionPayloads(conditionWrapperBase);
410
- throw error;
411
- }
412
- }
413
- function isValidStyleKey(key, validStyles, accept) {
414
- return Boolean(key in validStyles || accept && key in accept);
415
- }
416
- function flushForwardStylesToClasses(pass) {
417
- var styleState = pass[passStyleState];
418
- if (!pass[passShouldDoClasses]) return;
419
- (0, import_directStyleCSS.completeStreamingCSS)(styleState);
420
- (0, import_directStyleCSS.flushDirectStyles)(styleState, true);
290
+ function isValidStyleKey(key, validStyles) {
291
+ return key in validStyles;
421
292
  }
422
293
  function effectiveLifecycleKeys(keys) {
423
294
  if (!keys) return;
424
295
  var out = /* @__PURE__ */ new Set();
425
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
296
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
426
297
  try {
427
- for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
428
- var key = _step2.value;
298
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
299
+ var key = _step.value;
429
300
  out.add(key === "--t-x" || key === "--t-y" ? "translate" : key === "--t-scale-x" || key === "--t-scale-y" ? "scale" : key);
430
301
  }
431
302
  } catch (err) {
432
- _didIteratorError2 = true;
433
- _iteratorError2 = err;
303
+ _didIteratorError = true;
304
+ _iteratorError = err;
434
305
  } finally {
435
306
  try {
436
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
307
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
437
308
  } finally {
438
- if (_didIteratorError2) throw _iteratorError2;
309
+ if (_didIteratorError) throw _iteratorError;
439
310
  }
440
311
  }
441
312
  return out;
442
313
  }
443
- function mapContributedProp(styleState, key, val, originalVal, condition) {
444
- var pass = styleState.flatPass;
445
- var keyInit = pass[passMapSourceKey];
446
- var disablePropMap = Boolean(pass[passMapFlags]);
447
- var [, conf, props, viewProps, , validStyles, accept, , variants, inlineProps, parentVariants, , styledContext, styledContextKeys, flags, debug] = pass;
314
+ function contributeProp(pass, keyOg, valOg) {
315
+ var originalOg = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : valOg, disabled = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
316
+ var [styleState, conf, props, viewProps, , validStyles, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, , defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
317
+ var noSkip = Boolean(flags & passNoSkipFlag);
318
+ var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
319
+ var noExpand = Boolean(flags & passNoExpandFlag);
320
+ var noMergeStyle = Boolean(flags & passNoMergeFlag);
448
321
  var isHOC = Boolean(flags & passHocFlag);
322
+ var isText = Boolean(flags & passTextFlag);
323
+ var isInput = Boolean(flags & passInputFlag);
324
+ var shorthands = conf.shorthands;
325
+ var shouldSkipDirectProps = !noSkip && !isHOC;
326
+ var shouldCheckSkipProps = !noSkip;
327
+ var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
328
+ var isTextOrInput = isText || isInput;
449
329
  var hocParentVariants = isHOC ? parentVariants : void 0;
450
- var canResolveContextPrograms = !isHOC;
451
- var isStyledContextProp = (styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(key)) || styledContext && key in styledContext;
452
- if (key === "className") return;
453
- if (canResolveContextPrograms && disablePropMap && !isStyledContextProp) {
454
- if (key in import_helpers.stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
455
- if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
456
- return;
457
- }
458
- viewProps[key] = val;
459
- return;
460
- }
461
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
462
- console.groupCollapsed(" 💠 expanded", keyInit, "=>", key);
463
- (0, import_log.log)(val);
464
- console.groupEnd();
465
- }
466
- if (val == null) return;
467
- if (accept && key in accept) {
468
- viewProps[key] = val;
469
- return;
470
- }
471
- var isHostStyleKey = isValidStyleKey(key, validStyles, accept) || import_constants.isAndroid && key === "elevation";
472
- var isContextProgramKey = canResolveContextPrograms && Boolean(isStyledContextProp);
473
- if (condition !== void 0) {
474
- var conditionCursor = condition;
475
- if (isHostStyleKey || isContextProgramKey) contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey, conditionCursor);
476
- else if (isHOC) {
477
- var structured = mergeConditionTransport(styleState, viewProps[key], conditionCursor, val);
478
- if (key in viewProps) delete viewProps[key];
479
- viewProps[key] = structured;
480
- } else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is not a valid style on this component; the conditional variant value is dropped.`);
481
- return;
482
- }
483
- if (isHostStyleKey || isContextProgramKey) {
484
- contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey);
485
- return;
486
- }
487
- var isVariant = Boolean(variants && key in variants);
488
- if (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key)) {
489
- var _props_key;
490
- viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
491
- }
492
- if (Boolean(hocParentVariants && hocParentVariants[keyInit])) {
493
- passDownProp(viewProps, key, val);
494
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
495
- console.groupCollapsed(` - passing down prop ${key}`);
496
- (0, import_log.log)({
497
- val,
498
- after: { ...viewProps[key] }
499
- });
500
- console.groupEnd();
501
- }
330
+ var keyInit = keyOg;
331
+ var valInit = valOg;
332
+ if (keyInit === "children") {
333
+ viewProps[keyInit] = valInit;
502
334
  return;
503
335
  }
504
- if (!isVariant) {
505
- if (isStyledContextProp) return;
506
- if (key in import_helpers.stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
507
- if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
508
- return;
509
- }
510
- viewProps[key] = val;
336
+ if (keyInit === "ref") return;
337
+ if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
338
+ if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
339
+ if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
340
+ if (!disableExpandShorthands) {
341
+ if (keyInit in shorthands) keyInit = shorthands[keyInit];
511
342
  }
512
- }
513
- function contributeProp(pass, keyOg, valOg, parentConditionKey) {
514
- var parentWatermark = conditionCursorTop;
515
- if (parentConditionKey) pass[passParentCursor] = acquireConditionKeyCursor(pass[passStyleState], parentConditionKey);
516
- try {
517
- var [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
518
- var noSkip = Boolean(flags & passNoSkipFlag);
519
- var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
520
- var noExpand = Boolean(flags & passNoExpandFlag);
521
- var noMergeStyle = Boolean(flags & passNoMergeFlag);
522
- var isHOC = Boolean(flags & passHocFlag);
523
- var isText = Boolean(flags & passTextFlag);
524
- var isInput = Boolean(flags & passInputFlag);
525
- var shorthands = conf.shorthands;
526
- var shouldSkipDirectProps = !noSkip && !isHOC;
527
- var shouldCheckSkipProps = !noSkip;
528
- var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
529
- var isTextOrInput = isText || isInput;
530
- var hocParentVariants = isHOC ? parentVariants : void 0;
531
- var keyInit = keyOg;
532
- var valInit = valOg;
533
- if (keyInit === "children") {
534
- viewProps[keyInit] = valInit;
535
- return;
536
- }
537
- if (keyInit === "ref") return;
538
- if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
539
- if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
540
- if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
541
- if (accept) {
542
- var accepted = accept[keyInit];
543
- if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
544
- viewProps[keyInit] = resolveAcceptedStyle(styleState, valInit);
343
+ if (keyInit === "className") {
344
+ if (pass[passParentCursor]) return;
345
+ if (typeof valInit === "string" && valInit && (styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName)) {
346
+ if (noMergeStyle) {
347
+ viewProps.className = valInit;
545
348
  return;
546
349
  }
547
- }
548
- if (!disableExpandShorthands) {
549
- if (keyInit in shorthands) keyInit = shorthands[keyInit];
550
- }
551
- if (keyInit === "className") {
552
- if (typeof valInit === "string" && valInit && (styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.getClassPlan)) {
553
- if (noMergeStyle) {
554
- viewProps.className = valInit;
555
- return;
350
+ var resolveClassName = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName;
351
+ var sink = function(entry) {
352
+ var property2 = entry[0];
353
+ if (entry[2] !== void 0) {
354
+ if (isValidStyleKey(property2, validStyles)) contributeValue(styleState, property2, entry[1], void 0, false, entry[2]);
355
+ else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property2}" is not a valid style on this component; the frontend value is dropped.`);
356
+ } else {
357
+ if (property2 === "group") pass[passFrontendGroup] = entry[1];
358
+ else if (property2 === "container") pass[passFrontendContainer] = entry[1];
359
+ else if (property2 === "containerType") pass[passFrontendContainerType] = entry[1];
360
+ contributeProp(pass, property2, entry[1]);
556
361
  }
557
- var hocClassNames = props[import_skipProps.HOC_CLASSNAME_MARKER];
558
- if (hocClassNames && (typeof hocClassNames === "undefined" ? "undefined" : _type_of(hocClassNames)) === "object") {
559
- flushForwardStylesToClasses(pass);
560
- for (var property in hocClassNames) {
561
- var _pass, _passHocMappedProperties, _pass1, _passHocMappedClasses;
562
- var generatedClass = hocClassNames[property];
563
- if (typeof generatedClass !== "string") continue;
564
- clearDirectStyle(styleState, property);
565
- styleState.classNames[property] = generatedClass;
566
- ((_pass = pass)[_passHocMappedProperties = passHocMappedProperties] || (_pass[_passHocMappedProperties] = /* @__PURE__ */ new Set())).add(property);
567
- ((_pass1 = pass)[_passHocMappedClasses = passHocMappedClasses] || (_pass1[_passHocMappedClasses] = /* @__PURE__ */ new Set())).add(generatedClass);
568
- }
362
+ };
363
+ var start = 0;
364
+ for (var index = 0; index <= valInit.length; index++) {
365
+ if (index !== valInit.length && valInit.charCodeAt(index) > 32) continue;
366
+ if (index === start) {
367
+ start = index + 1;
368
+ continue;
569
369
  }
570
- var getClassPlan = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.getClassPlan;
571
- var start = 0;
572
- for (var index = 0; index <= valInit.length; index++) {
573
- var _pass_passHocMappedClasses;
574
- if (index !== valInit.length && valInit.charCodeAt(index) > 32) continue;
575
- if (index === start) {
576
- start = index + 1;
577
- continue;
578
- }
579
- var candidate = valInit.slice(start, index);
580
- if ((_pass_passHocMappedClasses = pass[passHocMappedClasses]) === null || _pass_passHocMappedClasses === void 0 ? void 0 : _pass_passHocMappedClasses.has(candidate)) {
581
- start = index + 1;
582
- continue;
583
- }
584
- var plan = getClassPlan ? getClassPlan(candidate, conf) : "raw";
585
- if (plan === null) {
586
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
587
- } else if (plan === "raw") {
588
- pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
589
- if (getClassPlan) {
590
- flushForwardStylesToClasses(pass);
591
- pass[passShouldDoClasses] = false;
592
- styleState.flatShouldDoClasses = false;
593
- }
594
- } else {
595
- var parentPlan = plan;
596
- if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
597
- pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
598
- flushForwardStylesToClasses(pass);
599
- pass[passShouldDoClasses] = false;
600
- styleState.flatShouldDoClasses = false;
601
- }
602
- var entries = Array.isArray(plan) ? plan : parentPlan.entries;
603
- for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
604
- var entry = entries[entryIndex];
605
- if (entry[2] !== void 0) {
606
- if (isValidStyleKey(entry[0], validStyles, accept)) contributeValue(styleState, entry[0], entry[1], mergeStyle, void 0, false, entry[2]);
607
- else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${entry[0]}" is not a valid style on this component; the frontend value is dropped.`);
608
- } else {
609
- if (entry[0] === "group") pass[passFrontendGroup] = entry[1];
610
- else if (entry[0] === "container") pass[passFrontendContainer] = entry[1];
611
- else if (entry[0] === "containerType") pass[passFrontendContainerType] = entry[1];
612
- contributeProp(pass, entry[0], entry[1]);
613
- }
370
+ var candidate = valInit.slice(start, index);
371
+ var preserveRaw = resolveClassName ? resolveClassName(candidate, conf, sink) : true;
372
+ if (preserveRaw === null) {
373
+ if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
374
+ } else if (preserveRaw) {
375
+ pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
376
+ if (resolveClassName) {
377
+ if (pass[passShouldDoClasses]) {
378
+ completeResolvedStyles(styleState);
379
+ (0, import_getCSSStylesAtomic.flushDirectStyles)(styleState, true);
614
380
  }
381
+ pass[passShouldDoClasses] = false;
382
+ styleState.flatShouldDoClasses = false;
615
383
  }
616
- start = index + 1;
617
- }
618
- if (props[import_skipProps.HOC_CLASSNAME_MARKER] !== void 0) {
619
- flushForwardStylesToClasses(pass);
620
- pass[passShouldDoClasses] = false;
621
- styleState.flatShouldDoClasses = false;
622
384
  }
385
+ start = index + 1;
623
386
  }
624
- return;
625
387
  }
626
- if (keyInit === "style") {
627
- if (!valInit) return;
628
- if (noMergeStyle) {
629
- viewProps.style = valInit;
630
- return;
631
- }
632
- var isArray = Array.isArray(valInit);
633
- var length = isArray ? valInit.length : 1;
634
- for (var index1 = 0; index1 < length; index1++) {
635
- var style = isArray ? valInit[index1] : valInit;
636
- if (!style) continue;
637
- var hocClassNames1 = style[TAMAGUI_CLASS_PROPS];
638
- if (hocClassNames1) {
639
- for (var property1 in hocClassNames1) {
640
- var _pass2, _passHocMappedProperties1;
641
- clearDirectStyle(styleState, property1);
642
- styleState.classNames[property1] = hocClassNames1[property1];
643
- ((_pass2 = pass)[_passHocMappedProperties1 = passHocMappedProperties] || (_pass2[_passHocMappedProperties1] = /* @__PURE__ */ new Set())).add(property1);
644
- }
645
- continue;
646
- }
647
- var normalized = (0, import_normalizeStyle.normalizeStyle)(style, false, true);
648
- var styleOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style) : void 0;
649
- for (var key in normalized) {
650
- var _pass_passHocMappedProperties;
651
- if (normalized[key] == null) continue;
652
- if ((_pass_passHocMappedProperties = pass[passHocMappedProperties]) === null || _pass_passHocMappedProperties === void 0 ? void 0 : _pass_passHocMappedProperties.delete(key)) clearDirectStyle(styleState, key);
653
- contributeValue(styleState, key, normalized[key], mergeStyle, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key]);
654
- }
388
+ return;
389
+ }
390
+ if (keyInit === import_skipProps.HOC_CLASSNAME_MARKER) {
391
+ if (valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
392
+ var _direct;
393
+ var layers = (_direct = styleState).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
394
+ for (var property in valInit) {
395
+ clearDirectStyle(styleState, property);
396
+ styleState.classNames[property] = valInit[property];
397
+ layers.set(property, pass[passSourceLayer]);
655
398
  }
656
- return;
657
399
  }
658
- if (defaultProps) {
659
- var _defaultProps_keyOg;
660
- var defaultVal = (_defaultProps_keyOg = defaultProps[keyOg]) !== null && _defaultProps_keyOg !== void 0 ? _defaultProps_keyOg : defaultProps[keyInit];
661
- if (defaultVal !== void 0 && valInit === defaultVal) return;
400
+ return;
401
+ }
402
+ if (keyInit === "style") {
403
+ if (!valInit) return;
404
+ if (noMergeStyle) {
405
+ viewProps.style = valInit;
406
+ return;
662
407
  }
663
- if (keyInit in import_skipProps.skipProps && shouldSkipDirectProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) if (keyInit === "transition" && typeof valInit === "string") return;
664
- else return;
665
- var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
666
- if (!isValidStyleKeyInit) {
667
- if (!import_constants.isAndroid) {
668
- if (keyInit === "elevationAndroid") return;
669
- }
670
- if (keyInit === "userSelect") {
671
- keyInit = "selectable";
672
- valInit = valInit !== "none";
673
- } else if (keyInit === "textOverflow") {
674
- if (isText && valInit === "ellipsis") {
675
- var _viewProps, _viewProps1;
676
- var _numberOfLines;
677
- (_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
678
- var _ellipsizeMode;
679
- (_ellipsizeMode = (_viewProps1 = viewProps).ellipsizeMode) !== null && _ellipsizeMode !== void 0 || (_viewProps1.ellipsizeMode = "tail");
408
+ var layerBeforeStyle = pass[passSourceLayer];
409
+ pass[passSourceLayer] = sourceLayerStyle;
410
+ var isArray = Array.isArray(valInit);
411
+ var length = isArray ? valInit.length : 1;
412
+ for (var index1 = 0; index1 < length; index1++) {
413
+ var style = isArray ? valInit[index1] : valInit;
414
+ if (!style) continue;
415
+ if ((0, import_style.isStylePiece)(style)) {
416
+ var resolvedPiece = resolveStylePiece(styleState, style);
417
+ var pieceOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style[import_types.stylePieceSymbol].styleObject) : void 0;
418
+ for (var key in resolvedPiece) {
419
+ if (resolvedPiece[key] == null) continue;
420
+ contributeValue(styleState, key, resolvedPiece[key], pieceOriginals === null || pieceOriginals === void 0 ? void 0 : pieceOriginals[key]);
680
421
  }
681
- return;
682
- } else if (keyInit.startsWith("data-")) return;
683
- }
684
- var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
685
- var isStyleLikeKey = isValidStyleKeyInit || isVariant;
686
- var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
687
- if (isStyleProp && asChildExceptStyleLike) return;
688
- var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
689
- var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
690
- var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in import_skipProps.skipProps));
691
- var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
692
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
693
- console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
694
- (0, import_log.log)({
695
- isVariant,
696
- valInit,
697
- shouldPassProp
698
- });
699
- if (import_constants.isClient) (0, import_log.log)({
700
- variants,
701
- variant: variants === null || variants === void 0 ? void 0 : variants[keyInit],
702
- isVariant,
703
- isHOCShouldPassThrough,
704
- parentStaticConfig
705
- });
706
- }
707
- if (shouldPassThrough) {
708
- passDownProp(viewProps, keyInit, valInit);
709
- if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
710
- if (!isVariant) return;
711
- }
712
- if (shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
713
- if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
714
- if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
715
- return;
422
+ continue;
423
+ }
424
+ var styleOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style) : void 0;
425
+ for (var key1 in style) {
426
+ if (style[key1] == null) continue;
427
+ contributeValue(styleState, key1, style[key1], styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
716
428
  }
717
429
  }
718
- if (isTextOrInput) {
719
- if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
720
- }
721
- var disablePropMap = !isStyleLikeKey;
722
- if (isValidStyleKeyInit && valInit != null && !(valInit === "unset") && !(variants && keyInit in variants) && !(accept && keyInit in accept) && !((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext)) {
723
- contributeValue(styleState, keyInit, valInit, mergeStyle);
430
+ pass[passSourceLayer] = layerBeforeStyle;
431
+ return;
432
+ }
433
+ if (defaultProps) {
434
+ var _defaultProps_keyOg;
435
+ var defaultVal = (_defaultProps_keyOg = defaultProps[keyOg]) !== null && _defaultProps_keyOg !== void 0 ? _defaultProps_keyOg : defaultProps[keyInit];
436
+ if (defaultVal !== void 0 && valInit === defaultVal) return;
437
+ }
438
+ var isNativeInputColor = isInput && keyInit in import_nativeStyleEngine.nativeTextInputColorProps;
439
+ if (!isNativeInputColor && keyInit in import_skipProps.skipProps && shouldSkipDirectProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) if (keyInit === "transition" && typeof valInit === "string") return;
440
+ else return;
441
+ var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles);
442
+ if (!isValidStyleKeyInit) {
443
+ if (!import_constants.isAndroid) {
444
+ if (keyInit === "elevationAndroid") return;
445
+ }
446
+ if (keyInit === "userSelect") {
447
+ keyInit = "selectable";
448
+ valInit = valInit !== "none";
449
+ } else if (keyInit === "textOverflow") {
450
+ if (isText && valInit === "ellipsis") {
451
+ var _viewProps, _viewProps1;
452
+ var _numberOfLines;
453
+ (_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
454
+ var _ellipsizeMode;
455
+ (_ellipsizeMode = (_viewProps1 = viewProps).ellipsizeMode) !== null && _ellipsizeMode !== void 0 || (_viewProps1.ellipsizeMode = "tail");
456
+ }
457
+ return;
458
+ } else if (keyInit.startsWith("data-")) return;
459
+ }
460
+ var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
461
+ var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
462
+ if (isStyleProp && asChildExceptStyleLike) return;
463
+ var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
464
+ var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
465
+ var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in import_skipProps.skipProps));
466
+ var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
467
+ if (process.env.NODE_ENV === "development" && debug === "verbose") {
468
+ console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
469
+ (0, import_log.log)({
470
+ isVariant,
471
+ valInit,
472
+ shouldPassProp
473
+ });
474
+ if (import_constants.isClient) (0, import_log.log)({
475
+ variants,
476
+ variant: variants === null || variants === void 0 ? void 0 : variants[keyInit],
477
+ isVariant,
478
+ isHOCShouldPassThrough,
479
+ parentStaticConfig: pass[15]
480
+ });
481
+ }
482
+ if (shouldPassThrough) {
483
+ if (keyInit in viewProps) delete viewProps[keyInit];
484
+ viewProps[keyInit] = valInit;
485
+ if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
486
+ if (!isVariant) return;
487
+ }
488
+ if (!isNativeInputColor && shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
489
+ if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
490
+ if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
724
491
  return;
725
492
  }
493
+ }
494
+ if (isTextOrInput) {
495
+ if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
496
+ }
497
+ if (isValidStyleKeyInit && valInit != null && !(valInit === "unset") && !(variants && keyInit in variants) && !((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext)) {
498
+ contributeValue(styleState, keyInit, valInit, originalOg);
499
+ return;
500
+ }
501
+ if (variants && keyInit in variants && !noExpand && !disabled) {
502
+ var _variantConfig_variantStyleResolver;
503
+ var previousLayer = pass[passSourceLayer];
504
+ pass[passSourceLayer] = previousLayer ? sourceLayerVariant : sourceLayerBase;
726
505
  pass[passMapSourceKey] = keyInit;
727
- pass[passMapFlags] = disablePropMap ? 1 : 0;
728
- contributeMappedValue(keyInit, valInit, styleState, disablePropMap);
729
- if (process.env.NODE_ENV === "development" && debug === "verbose") {
730
- try {
731
- (0, import_log.log)(` \u2714\uFE0F expand complete`, keyInit);
732
- (0, import_log.log)("style", { ...styleState.style });
733
- (0, import_log.log)("viewProps", { ...viewProps });
734
- (0, import_log.log)("transforms", styleState.transformAccumulator);
735
- } catch (e) {}
736
- console.groupEnd();
737
- }
738
- } finally {
739
- if (parentConditionKey) pass[passParentCursor] = null;
740
- releaseConditionCursors(parentWatermark);
506
+ var variantConfig = styleState.flatStyleStaticConfig;
507
+ (_variantConfig_variantStyleResolver = variantConfig.variantStyleResolver) === null || _variantConfig_variantStyleResolver === void 0 || _variantConfig_variantStyleResolver.call(variantConfig, styleState, variantConfig.variants, keyInit, valInit, keyInit, pass[passParentCursor]);
508
+ pass[passSourceLayer] = previousLayer;
509
+ return;
510
+ }
511
+ var isStyledContextProp = !isHOC && ((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext);
512
+ if (isStyledContextProp) {
513
+ var _styleState1, _styleState2;
514
+ ((_styleState1 = styleState).overriddenContextProps || (_styleState1.overriddenContextProps = {}))[keyInit] = originalOg;
515
+ ((_styleState2 = styleState).originalContextPropValues || (_styleState2.originalContextPropValues = {}))[keyInit] = originalOg;
516
+ }
517
+ var isHostStyleKey = isValidStyleKeyInit || import_constants.isAndroid && keyInit === "elevation";
518
+ if (isHostStyleKey || isStyledContextProp) {
519
+ if (valInit === "unset") {
520
+ var expanded = (0, import_expandStyle.expandStyle)(keyInit, valInit, conf.settings.styleCompat || "web");
521
+ clearDirectStyle(styleState, keyInit);
522
+ if (expanded) for (var index2 = 0; index2 < expanded.length; index2++) clearDirectStyle(styleState, expanded[index2][0]);
523
+ } else contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
524
+ return;
525
+ }
526
+ var condition = pass[passParentCursor];
527
+ if (condition) {
528
+ if (isHOC) {
529
+ var previous = viewProps[keyInit];
530
+ var transport = previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous) && "default" in previous ? previous : { default: previous };
531
+ transport[condition[conditionKey]] = valInit;
532
+ viewProps[keyInit] = transport;
533
+ } else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is not a valid style on this component; the conditional variant value is dropped.`);
534
+ return;
535
+ }
536
+ if (keyInit in import_helpers.stylePropsAll) {
537
+ if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
538
+ return;
539
+ }
540
+ viewProps[keyInit] = valInit;
541
+ if (process.env.NODE_ENV === "development" && debug === "verbose") {
542
+ try {
543
+ (0, import_log.log)(` \u2714\uFE0F expand complete`, keyInit);
544
+ (0, import_log.log)("style", { ...styleState.style });
545
+ (0, import_log.log)("viewProps", { ...viewProps });
546
+ (0, import_log.log)("transforms", styleState.transformAccumulator);
547
+ } catch (e) {}
548
+ console.groupEnd();
741
549
  }
742
550
  }
743
551
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
744
- var _styleState_style;
552
+ var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_style;
745
553
  var conf = (0, import_config.getConfig)();
746
554
  styleStaticConfig || (styleStaticConfig = (0, import_styleStaticConfig.getStyleStaticConfig)(staticConfig, conf));
747
555
  var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
@@ -764,7 +572,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
764
572
  var staticPassthroughClassName = "";
765
573
  var className = staticPassthroughClassName;
766
574
  if (staticPassthroughClassName) shouldDoClasses = false;
767
- var validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles);
575
+ var validStyles = staticConfig.validStyles || (staticConfig.isInput ? import_helpers.stylePropsInput : staticConfig.isText ? import_helpers.stylePropsText : import_helpers.validStyles);
768
576
  if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-setup`;
769
577
  var styleState = {
770
578
  classNames,
@@ -786,7 +594,6 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
786
594
  animationDriver: resolvedDriver
787
595
  };
788
596
  styleState.flatStyleStaticConfig = styleStaticConfig;
789
- if (import_directStyleCSS.canGenerateCSS && shouldDoClasses && styleProps.canPlatformPseudo) styleState.flatDeferCSS = true;
790
597
  if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
791
598
  if (process.env.NODE_ENV === "development" && debug === "verbose" && import_constants.isClient) {
792
599
  if (import_isDevTools.isDevTools) {
@@ -804,21 +611,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
804
611
  }
805
612
  }
806
613
  var { asChild } = props;
807
- var { accept, neverSkipProps } = staticConfig;
614
+ var { neverSkipProps } = staticConfig;
808
615
  var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext } = styleProps;
809
616
  var styledContextKeys = styleStaticConfig.styledContextKeys;
810
617
  var styleFrontend = staticConfig.styleFrontend;
811
618
  var frontendGroup;
812
619
  var frontendContainer;
813
620
  var frontendContainerType;
621
+ var processedProps = props;
814
622
  var parentVariants = parentStaticConfig ? (0, import_styleStaticConfig.getStyleStaticConfig)(parentStaticConfig, conf).variants : void 0;
815
623
  var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
816
624
  var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
817
625
  var containerValue;
818
626
  var containerName;
819
627
  var containerType;
820
- var hocMappedClassProperties;
821
- var hocMappedClasses;
822
628
  var pass = [
823
629
  styleState,
824
630
  conf,
@@ -826,7 +632,6 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
826
632
  viewProps,
827
633
  staticConfig,
828
634
  validStyles,
829
- accept,
830
635
  neverSkipProps,
831
636
  variants,
832
637
  inlineProps,
@@ -848,36 +653,103 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
848
653
  containerType,
849
654
  frontendGroup,
850
655
  frontendContainer,
851
- frontendContainerType,
852
- hocMappedClassProperties,
853
- hocMappedClasses
656
+ frontendContainerType
854
657
  ];
855
658
  styleState.flatPass = pass;
856
659
  var conditionalStates = null;
857
660
  var usesSafeArea = false;
858
- var conditionWrapperBase = conditionWrapperTop;
859
- try {
860
- var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia;
861
- forEachPropInForwardOrder(pass);
862
- [, , , , , , , , , , , , , , , , , , , , , className, shouldDoClasses, containerValue, containerName, containerType, frontendGroup, frontendContainer, frontendContainerType, hocMappedClassProperties, hocMappedClasses] = pass;
863
- if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
864
- conditionalStates = styleState.flatStateKeys || null;
865
- usesSafeArea = !!styleState.flatUsesSafeArea;
866
- hasMedia = ((_styleState_flatMediaKeys = styleState.flatMediaKeys) === null || _styleState_flatMediaKeys === void 0 ? void 0 : _styleState_flatMediaKeys.size) ? styleState.flatMediaKeys : false;
867
- pseudoGroups = ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) ? styleState.flatGroupKeys : void 0;
868
- mediaGroups = ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) ? styleState.flatGroupMedia : void 0;
869
- if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
870
- shouldDoClasses = false;
871
- styleState.flatShouldDoClasses = false;
872
- if (styleState.transformAccumulator) {
873
- mergeStyle(styleState, "transform", (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator), true);
874
- styleState.transformAccumulator = void 0;
661
+ var baseStyle = styleStaticConfig.baseStyle;
662
+ var baseVariantProps = styleStaticConfig.baseVariantProps;
663
+ var appliesBaseStyle = baseStyle && !processedProps.asChild;
664
+ pass[passSourceLayer] = sourceLayerBase;
665
+ if (appliesBaseStyle && baseVariantProps) {
666
+ var callerKeys;
667
+ for (var key in baseVariantProps) if (Object.hasOwn(processedProps, key) && processedProps[key] !== baseVariantProps[key]) (callerKeys || (callerKeys = /* @__PURE__ */ new Set())).add(key);
668
+ styleState.flatCallerVariantKeys = callerKeys;
669
+ }
670
+ if (appliesBaseStyle) for (var key1 in baseStyle) {
671
+ var _styleStaticConfig_baseStylePieces;
672
+ var baseValue = baseVariantProps && Object.hasOwn(baseVariantProps, key1) && Object.hasOwn(processedProps, key1) ? processedProps[key1] : baseStyle[key1];
673
+ var expandedKey = shorthands[key1] || key1;
674
+ if ((isText || isInput) && baseValue && expandedKey === "fontFamily" && baseValue in conf.fontsParsed) styleState.fontFamily = baseValue;
675
+ (_styleStaticConfig_baseStylePieces = styleStaticConfig.baseStylePieces) === null || _styleStaticConfig_baseStylePieces === void 0 || _styleStaticConfig_baseStylePieces[key1];
676
+ contributeProp(pass, key1, baseValue);
677
+ }
678
+ pass[passSourceLayer] = sourceLayerProps;
679
+ for (var key2 in processedProps) {
680
+ if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key2)) continue;
681
+ contributeProp(pass, key2, processedProps[key2]);
682
+ }
683
+ var resolvers = staticConfig.resolvers;
684
+ if (resolvers && !noExpand) {
685
+ pass[passSourceLayer] = sourceLayerResolver;
686
+ var flagsBefore = pass[passFlags];
687
+ pass[passFlags] = flagsBefore | passNoExpandFlag;
688
+ var env = (0, import_styledDynamic.getDynamicEnv)(styleState);
689
+ for (var index = 0; index < resolvers.length; index++) {
690
+ var resolved = resolvers[index](processedProps, env);
691
+ if (resolved) for (var key3 in resolved) {
692
+ if (resolved[key3] == null) continue;
693
+ contributeProp(pass, key3, resolved[key3]);
875
694
  }
876
- convertDeferredInline(styleState, mergeStyle);
877
695
  }
878
- completeStreaming(styleState, mergeStyle);
879
- } finally {
880
- releaseConditionPayloads(conditionWrapperBase);
696
+ pass[passFlags] = flagsBefore;
697
+ }
698
+ className = pass[passClassName];
699
+ shouldDoClasses = pass[passShouldDoClasses];
700
+ containerValue = pass[passContainerValue];
701
+ containerName = pass[passContainerName];
702
+ containerType = pass[passContainerType];
703
+ frontendGroup = pass[passFrontendGroup];
704
+ frontendContainer = pass[passFrontendContainer];
705
+ frontendContainerType = pass[passFrontendContainerType];
706
+ if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
707
+ conditionalStates = styleState.flatStateKeys || null;
708
+ usesSafeArea = !!styleState.flatUsesSafeArea;
709
+ hasMedia = ((_styleState_flatMediaKeys = styleState.flatMediaKeys) === null || _styleState_flatMediaKeys === void 0 ? void 0 : _styleState_flatMediaKeys.size) ? styleState.flatMediaKeys : false;
710
+ pseudoGroups = ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) ? styleState.flatGroupKeys : void 0;
711
+ mediaGroups = ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) ? styleState.flatGroupMedia : void 0;
712
+ if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
713
+ shouldDoClasses = false;
714
+ styleState.flatShouldDoClasses = false;
715
+ if (styleState.transformAccumulator) {
716
+ mergeStyle(styleState, "transform", (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator), true);
717
+ styleState.transformAccumulator = void 0;
718
+ }
719
+ }
720
+ if (styleProps.stylePieceEntries) {
721
+ var slots = styleState.flatSlots;
722
+ if (slots) {
723
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
724
+ try {
725
+ for (var _iterator = slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
726
+ var [slot, entries] = _step.value;
727
+ styleProps.stylePieceEntries[slot] = entries;
728
+ }
729
+ } catch (err) {
730
+ _didIteratorError = true;
731
+ _iteratorError = err;
732
+ } finally {
733
+ try {
734
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
735
+ } finally {
736
+ if (_didIteratorError) throw _iteratorError;
737
+ }
738
+ }
739
+ }
740
+ }
741
+ completeResolvedStyles(styleState);
742
+ if (styleProps.isStatic) for (var property in classNames) {
743
+ var identifier = classNames[property];
744
+ if (rulesToInsert[identifier]) continue;
745
+ var rules = (0, import_insertStyleRule.getRulesForIdentifier)(identifier);
746
+ if (rules) rulesToInsert[identifier] = [
747
+ property,
748
+ "",
749
+ identifier,
750
+ void 0,
751
+ rules
752
+ ];
881
753
  }
882
754
  var effectiveTransition = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transition;
883
755
  if (effectiveTransition != null && styleState.style && true) delete styleState.style.transition;
@@ -886,21 +758,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
886
758
  if ("containerName" in styleState.style) delete styleState.style.containerName;
887
759
  }
888
760
  if (!(noNormalize === false)) {
889
- if (styleState.style) {
890
- (0, import_expandStyles.fixStyles)(styleState.style);
891
- if (!noExpand && !noMergeStyle) {}
892
- }
761
+ if (styleState.style) (0, import_expandStyles.fixStyles)(styleState.style);
893
762
  if (styleState.transformAccumulator && !styleState.flatShouldDoClasses) {
894
763
  var _styleState;
895
764
  (_styleState = styleState).style || (_styleState.style = {});
896
765
  styleState.style.transform = (0, import_runtime.finalizeTransformAccumulator)(styleState.transformAccumulator);
897
766
  }
898
767
  if (parentSplitStyles) {
899
- if (!shouldDoClasses) for (var key1 in parentSplitStyles.style) {
768
+ if (!shouldDoClasses) for (var key5 in parentSplitStyles.style) {
900
769
  var _styleState1;
901
- if (key1 in classNames || styleState.style && key1 in styleState.style) continue;
770
+ if (key5 in classNames || styleState.style && key5 in styleState.style) continue;
902
771
  (_styleState1 = styleState).style || (_styleState1.style = {});
903
- styleState.style[key1] = parentSplitStyles.style[key1];
772
+ styleState.style[key5] = parentSplitStyles.style[key5];
904
773
  }
905
774
  }
906
775
  }
@@ -929,9 +798,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
929
798
  if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
930
799
  var provenance = {};
931
800
  var hasProvenance = false;
932
- for (var key2 in styleState.tokenProvenance) {
933
- provenance[key2] = {
934
- token: styleState.tokenProvenance[key2],
801
+ for (var key6 in styleState.tokenProvenance) {
802
+ provenance[key6] = {
803
+ token: styleState.tokenProvenance[key6],
935
804
  theme: themeName
936
805
  };
937
806
  hasProvenance = true;
@@ -952,7 +821,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
952
821
  if (effectiveTransition != null) result.effectiveTransition = effectiveTransition;
953
822
  if (conditionalStates) result.programStates = conditionalStates;
954
823
  if (usesSafeArea) result.usesSafeArea = true;
955
- if (getDirectDynamicThemeAccess(styleState)) result.dynamicThemeAccess = true;
824
+ if (styleState.flatDynamicThemeAccess) result.dynamicThemeAccess = true;
956
825
  if (styleState.flatEnterKeys || styleState.flatExitKeys) result.programLifecycleStyleKeys = {
957
826
  enter: effectiveLifecycleKeys(styleState.flatEnterKeys),
958
827
  exit: effectiveLifecycleKeys(styleState.flatExitKeys)
@@ -982,7 +851,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
982
851
  rulesToInsert,
983
852
  parentSplitStyles
984
853
  };
985
- for (var key4 in logs) (0, import_log.log)(key4, logs[key4]);
854
+ for (var key8 in logs) (0, import_log.log)(key8, logs[key8]);
986
855
  } catch (e) {}
987
856
  console.groupEnd();
988
857
  }
@@ -990,6 +859,36 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
990
859
  if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
991
860
  return result;
992
861
  };
862
+ var stylePieceStaticConfig = {
863
+ acceptsClassName: true,
864
+ isText: true,
865
+ validStyles: import_helpers.stylePropsAll
866
+ };
867
+ var compileStylePieceRuntime = function(piece, layer) {};
868
+ (0, import_style.setStylePieceCompiler)(compileStylePieceRuntime);
869
+ (0, import_style.setStylePieceResolver)(function(piece, theme, themeName) {
870
+ var split = getSplitStyles({ style: piece }, stylePieceStaticConfig, theme, themeName, import_defaultComponentState.defaultComponentStateMounted, {
871
+ isAnimated: false,
872
+ resolveValues: "value"
873
+ });
874
+ return (split === null || split === void 0 ? void 0 : split.style) || {};
875
+ });
876
+ var resolvedStylePieceCache = /* @__PURE__ */ new WeakMap();
877
+ function resolveStylePiece(styleState, piece) {
878
+ var definition = piece[import_types.stylePieceSymbol].styleObject;
879
+ if (!(0, import_style.isStylePieceCacheable)(piece)) return resolveStyleObject(styleState, definition);
880
+ var themeCache = resolvedStylePieceCache.get(piece);
881
+ if (!themeCache) {
882
+ themeCache = /* @__PURE__ */ new WeakMap();
883
+ resolvedStylePieceCache.set(piece, themeCache);
884
+ }
885
+ var theme = styleState.theme;
886
+ var cached = themeCache.get(theme);
887
+ if (cached) return cached;
888
+ var resolved = resolveStyleObject(styleState, definition);
889
+ themeCache.set(theme, resolved);
890
+ return resolved;
891
+ }
993
892
  function mergeStyle(styleState, key, val) {
994
893
  arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
995
894
  var originalVal = arguments.length > 4 ? arguments[4] : void 0;
@@ -1009,7 +908,7 @@ function mergeStyle(styleState, key, val) {
1009
908
  (0, import_runtime.addTransformValue)(styleState.transformAccumulator, key, val);
1010
909
  } else {
1011
910
  var out = val;
1012
- if (staticConfig.accept && key in staticConfig.accept) viewProps[key] = out;
911
+ if (staticConfig.isInput && key in import_nativeStyleEngine.nativeTextInputColorProps) viewProps[import_nativeStyleEngine.nativeTextInputColorProps[key]] = out;
1013
912
  else {
1014
913
  var _styleState2;
1015
914
  (_styleState2 = styleState).style || (_styleState2.style = {});
@@ -1033,7 +932,7 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
1033
932
  ((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
1034
933
  } else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
1035
934
  }
1036
- var resolveAcceptedStyle = function(styleState, styleIn) {
935
+ var resolveStyleObject = function(styleState, styleIn) {
1037
936
  var { conf, styleProps } = styleState;
1038
937
  var styleOut = {};
1039
938
  var originalValues;
@@ -1046,12 +945,9 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
1046
945
  style: styleOut,
1047
946
  transformAccumulator: void 0
1048
947
  };
1049
- childState.flatUsed = void 0;
1050
- childState.flatTransitions = void 0;
1051
948
  childState.flatAtomics = void 0;
1052
- childState.flatSingleEntries = void 0;
1053
949
  childState.flatSlots = void 0;
1054
- childState.flatBorderDefaultRequests = void 0;
950
+ childState.flatPropertyLayers = void 0;
1055
951
  var mergeAccepted = function(_state, key2, value2, disableNormalize, originalValue) {
1056
952
  styleOut[key2] = disableNormalize || styleProps.noNormalize ? value2 : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value2, key2);
1057
953
  var _styleInOriginalValues_key;
@@ -1062,92 +958,63 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
1062
958
  var value = styleIn[key];
1063
959
  key = conf.shorthands[key] || key;
1064
960
  if (key in import_skipProps.skipProps || value == null) continue;
1065
- contributeValue(childState, key, value, mergeAccepted);
961
+ contributeValue(childState, key, value);
1066
962
  }
1067
- completeStreaming(childState, mergeAccepted);
963
+ completeResolvedStyles(childState, mergeAccepted);
1068
964
  if (childState.transformAccumulator) styleOut.transform = (0, import_runtime.finalizeTransformAccumulator)(childState.transformAccumulator);
1069
965
  if (!styleProps.noNormalize) (0, import_expandStyles.fixStyles)(styleOut);
1070
966
  if (originalValues) import_styleOriginalValues.styleOriginalValues.set(styleOut, originalValues);
1071
967
  return styleOut;
1072
968
  };
1073
- function passDownProp(viewProps, key, val) {
1074
- if (key in viewProps) delete viewProps[key];
1075
- viewProps[key] = val;
1076
- }
1077
969
  var frameSequence = 0;
1078
- function streamWriteCSS(state, property, value, cursor, original) {
1079
- var conditionOverride = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : -1;
1080
- var direct = state;
1081
- var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
1082
- var identity = cursor ? conditionTexts[cursor + conditionKeyOffset] || "" : "";
1083
- if (property.charCodeAt(0) === 116 && property.startsWith("transition")) {
1084
- var _direct;
1085
- var transitions = (_direct = direct).flatTransitions || (_direct.flatTransitions = []);
1086
- for (var index = 0; index < transitions.length; index++) if (transitions[index][0] === property && transitions[index][3] === identity) {
1087
- transitions[index][1] = value;
1088
- transitions[index][2] = condition;
1089
- return;
1090
- }
1091
- transitions.push([
1092
- property,
1093
- value,
1094
- condition,
1095
- identity,
1096
- cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
1097
- cursor ? conditionWrappers : void 0,
1098
- cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0,
1099
- cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0
1100
- ]);
1101
- return;
1102
- }
1103
- (0, import_directStyleCSS.streamAtomic)(state, property, value, condition, identity, cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0, false, original);
1104
- }
1105
- function streamWriteInline(state, property, value, cursor, merge, original) {
1106
- var normalize = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, conditionOverride = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : -1;
1107
- var _direct;
1108
- var direct = state;
1109
- var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
1110
- var importance = condition ? Math.floor(condition / 256) + 1 : 0;
1111
- var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
1112
- var previous = used[property];
1113
- if (previous !== void 0 && previous > importance) return;
1114
- used[property] = importance;
1115
- merge(state, property, value, !normalize, original);
1116
- }
1117
- function streamRetractInline(state, property, cursor) {
970
+ var recordInline = 1;
971
+ var recordNormalize = 2;
972
+ var recordRetract = 4;
973
+ var recordDefault = 8;
974
+ var recordCSS = 16;
975
+ function writeStyleRecord(state, property, value, cursor, original, flags) {
976
+ var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
977
+ var _state_flatPass;
1118
978
  var _direct;
1119
- var direct = state;
1120
- var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
1121
- var importance = condition ? Math.floor(condition / 256) + 1 : 0;
1122
- var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
1123
- var previous = used[property];
1124
- if (previous !== void 0 && previous > importance) return;
1125
- used[property] = importance;
1126
- if (state.style) delete state.style[property];
1127
- }
1128
- function convertDeferredInline(state, merge) {
1129
- var direct = state;
1130
- var consume = function(entries) {
1131
- for (var index = 0; index < entries.length; index++) {
1132
- var entry = entries[index];
1133
- var condition = entry[2];
1134
- if (condition && !(condition & 1)) continue;
1135
- streamWriteInline(state, entry[0], entry[1], null, merge, entry[8] !== void 0 ? entry[8] : entry[1], false, condition);
979
+ var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
980
+ var identity = cursor ? cursor[conditionKey] : "";
981
+ var slots = (_direct = state).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
982
+ var slot = property.startsWith("transition") ? "transition" : property;
983
+ var list = slots.get(slot);
984
+ if (!list) slots.set(slot, list = []);
985
+ for (var index = 0; index < list.length; index++) {
986
+ var entry = list[index];
987
+ var entryFlags = entry[7];
988
+ if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
989
+ if (entry[0] !== property) continue;
990
+ if (flags & recordDefault) {
991
+ if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
992
+ } else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
993
+ list.splice(index--, 1);
994
+ continue;
995
+ }
996
+ if (entry[3] === identity) {
997
+ list.splice(index, 1);
998
+ break;
1136
999
  }
1137
- };
1138
- var slots = direct.flatSlots;
1139
- if (slots) {
1140
- direct.flatSlots = void 0;
1141
- for (var property in slots) consume(slots[property]);
1142
- }
1143
- var transitions = direct.flatTransitions;
1144
- if (transitions) {
1145
- direct.flatTransitions = void 0;
1146
- consume(transitions);
1147
1000
  }
1148
- direct.flatBorderDefaultRequests = void 0;
1001
+ list.push([
1002
+ property,
1003
+ value,
1004
+ condition,
1005
+ identity,
1006
+ cursor ? cursor[conditionSelector] : "",
1007
+ cursor ? cursor[conditionWrappers] : void 0,
1008
+ original,
1009
+ flags | (((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passSourceLayer]) || 0) << 5
1010
+ ]);
1149
1011
  }
1150
- function completeStreaming(state, merge) {
1012
+ function streamWriteInline(state, property, value, cursor, original) {
1013
+ var normalize = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : property === "lineHeight", conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1, force = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;
1014
+ writeStyleRecord(state, property, value, cursor, original, (normalize ? recordNormalize : 0) | (force ? recordInline : 0), conditionOverride);
1015
+ }
1016
+ function completeResolvedStyles(state) {
1017
+ var merge = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : mergeStyle;
1151
1018
  var direct = state;
1152
1019
  var shadow = direct.flatWebShadow;
1153
1020
  if (shadow && (direct.flatBoxShadowSequence || 0) <= shadow[4]) {
@@ -1159,275 +1026,116 @@ function completeStreaming(state, merge) {
1159
1026
  var color = (0, import_normalizeColor.normalizeColor)(shadow[0], (_shadow_ = shadow[2]) !== null && _shadow_ !== void 0 ? _shadow_ : 1);
1160
1027
  if (color) {
1161
1028
  var next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow[3])} ${color}`;
1162
- emitProperty(state, "boxShadow", direct.flatBoxShadow ? `${direct.flatBoxShadow}, ${next}` : next, null, merge, shadow[5], shadow[6]);
1029
+ emitProperty(state, "boxShadow", direct.flatBoxShadow ? `${direct.flatBoxShadow}, ${next}` : next, null, shadow[5], shadow[6]);
1030
+ }
1031
+ direct.flatWebShadow = void 0;
1032
+ }
1033
+ if (state.flatShouldDoClasses && state.transformAccumulator) {
1034
+ var transform = (0, import_runtime.finalizeTransformAccumulator)(state.transformAccumulator);
1035
+ state.transformAccumulator = void 0;
1036
+ writeStyleRecord(state, "transform", Array.isArray(transform) ? (0, import_transformsToString.transformsToString)(transform) : transform, null, transform, 0);
1037
+ }
1038
+ var slots = direct.flatSlots;
1039
+ if (!slots) return;
1040
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1041
+ try {
1042
+ for (var _iterator = slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1043
+ var [property, entries] = _step.value;
1044
+ var cssEntries = void 0;
1045
+ var inlineWinner = void 0;
1046
+ var importance = -1;
1047
+ for (var index = 0; index < entries.length; index++) {
1048
+ var entry = entries[index];
1049
+ var flags = entry[7];
1050
+ if (flags & recordCSS || state.flatShouldDoClasses && !(flags & recordInline)) {
1051
+ cssEntries || (cssEntries = []);
1052
+ var precedence = entry[2] ? Math.floor(entry[2] / 256) : -1;
1053
+ var layer = flags >> 5;
1054
+ var index1 = cssEntries.length;
1055
+ while (index1 > 0) {
1056
+ var before = cssEntries[index1 - 1];
1057
+ var beforeLayer = before[7] >> 5;
1058
+ if (beforeLayer < layer || beforeLayer === layer && (before[2] ? Math.floor(before[2] / 256) : -1) <= precedence) break;
1059
+ index1--;
1060
+ }
1061
+ if (index1 === cssEntries.length) cssEntries.push(entry);
1062
+ else cssEntries.splice(index1, 0, entry);
1063
+ } else if (!entry[2] || entry[2] & 1) {
1064
+ var next1 = entry[2] ? Math.floor(entry[2] / 256) : 0;
1065
+ if (next1 >= importance) {
1066
+ importance = next1;
1067
+ inlineWinner = entry;
1068
+ }
1069
+ }
1070
+ }
1071
+ if (cssEntries) (0, import_getCSSStylesAtomic.registerAtomicSlot)(direct, property, cssEntries);
1072
+ if (inlineWinner) if (inlineWinner[7] & recordRetract) {
1073
+ if (state.style) delete state.style[inlineWinner[0]];
1074
+ } else merge(state, inlineWinner[0], inlineWinner[1], !(inlineWinner[7] & recordNormalize), inlineWinner[6] !== void 0 ? inlineWinner[6] : inlineWinner[1]);
1075
+ }
1076
+ } catch (err) {
1077
+ _didIteratorError = true;
1078
+ _iteratorError = err;
1079
+ } finally {
1080
+ try {
1081
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1082
+ } finally {
1083
+ if (_didIteratorError) throw _iteratorError;
1163
1084
  }
1164
1085
  }
1165
- (0, import_directStyleCSS.completeStreamingCSS)(state);
1086
+ direct.flatSlots = void 0;
1166
1087
  }
1167
- function emitAtParentCondition(state, property, value, merge, originalValue, contextOnly) {
1088
+ function emitAtParentCondition(state, property, value, originalValue, contextOnly) {
1168
1089
  var _state_flatPass;
1169
- emitValue(state, property, value, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null, merge, originalValue, contextOnly);
1170
- }
1171
- function emitUnderCondition(state, property, value, cursor, merge, originalValue, contextOnly, warnMode, warnSource) {
1172
- var condition = conditionNumbers[cursor + conditionValueOffset];
1173
- if (!(conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag)) {
1174
- if (warnMode && process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, warnSource, `unknown modifier "${conditionTexts[cursor + conditionUnresolvedNameOffset] || ""}"`);
1090
+ var cursor = (_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor];
1091
+ if (cursor) emitUnderCondition(state, property, value, cursor, originalValue, contextOnly, 0, value);
1092
+ else emitValue(state, property, value, null, originalValue, contextOnly);
1093
+ }
1094
+ function emitUnderCondition(state, property, value, cursor, originalValue, contextOnly, warnMode, warnSource) {
1095
+ var condition = cursor[conditionValue];
1096
+ if (!(condition & conditionResolvedFlag)) {
1097
+ if (warnMode && process.env.NODE_ENV !== "production") (0, import_warnOnce.warnRefusedValue)(property, warnSource, `unknown modifier "${cursor.problem}"`);
1175
1098
  return 0;
1176
1099
  }
1177
- var unsupportedState = conditionTexts[cursor + conditionUnsupportedStateOffset] || "";
1178
- if (warnMode && unsupportedState && process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`${property}: "${unsupportedState}:" has no native component-state source; dropping the clause`);
1179
- if (merge && property && condition & 2 && (condition & 1 || import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses || warnMode === 1 && conditionTexts[cursor + conditionThemeOffset] && import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property))) {
1180
- emitValue(state, property, value, cursor, merge, warnMode === 2 ? originalValue : originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
1181
- var flags = conditionNumbers[cursor + conditionFlagsOffset];
1182
- if (flags & conditionEnterFlag) state.flatHasEnterStyle = true;
1183
- if (flags & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
1184
- } else if (merge && property && condition & 2) {
1185
- var flags1 = conditionNumbers[cursor + conditionFlagsOffset];
1186
- if (flags1 & conditionEnterFlag) state.flatHasEnterStyle = true;
1187
- if (flags1 & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
1100
+ emitValue(state, property, value, cursor, warnMode === 2 ? originalValue : originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
1101
+ if (condition & 2) {
1102
+ if (condition & 4) state.flatHasEnterStyle = true;
1103
+ if (condition & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
1188
1104
  }
1189
1105
  return condition;
1190
1106
  }
1191
- var directStyleHandler = {
1192
- segment(state, start, end, isBase, valid, source, chainStart, chainEnd, chainValid, chainCount, _result, failure, failureIndex, property, merge, originalValue, contextOnly) {
1193
- if (isBase) {
1194
- if (start === end) return;
1195
- if (!valid) {
1196
- if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
1197
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
1198
- return;
1199
- }
1200
- var value = source.slice(start, end);
1201
- emitAtParentCondition(state, property, value, merge, value, contextOnly);
1202
- return 5;
1203
- }
1204
- if (!chainValid) {
1205
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
1206
- return;
1207
- }
1208
- if (start === end) {
1209
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, "a conditional clause has no value");
1210
- return;
1211
- }
1212
- if (property === "aspectRatio" && chainCount === 1) {
1213
- var left = Number(source.slice(chainStart, chainEnd));
1214
- var right = Number(source.slice(start, end));
1215
- if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
1216
- }
1217
- var cursor = state.flatScanCursor;
1218
- var condition = valid ? emitUnderCondition(state, property, source.slice(start, end), cursor, merge, void 0, contextOnly, 1, source) : conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
1219
- if (!condition) return;
1220
- if (!valid) {
1221
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
1222
- return;
1223
- }
1224
- return 4 | (condition & 12 ? 2 : 0);
1225
- },
1226
- modifier(state, start, end, valid, first, source) {
1227
- var directState = state;
1228
- var cursor = directState.flatScanCursor;
1229
- if (!cursor) {
1230
- var _directState_flatPass;
1231
- cursor = directState.flatScanCursor = acquireConditionCursor(((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null);
1232
- } else if (first) {
1233
- var _directState_flatPass1;
1234
- resetConditionCursor(cursor, ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passParentCursor]) || null);
1235
- }
1236
- if (!valid) {
1237
- setConditionUnresolved(cursor);
1238
- return;
1239
- }
1240
- if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
1241
- },
1242
- chain(state, _start, _end, valid) {
1243
- var cursor = state.flatScanCursor;
1244
- if (cursor) {
1245
- if (!valid) setConditionUnresolved(cursor);
1246
- if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
1247
- }
1248
- return true;
1249
- },
1250
- end(state, source, result, lastPayloadStart, chainCount, property, merge, originalValue, contextOnly, failure, failureIndex) {
1251
- var hasBase = !!(result & 1);
1252
- if (result & 16) {
1253
- if (chainCount === 0) {
1254
- emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
1255
- hasBase = true;
1256
- } else if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
1257
- }
1258
- if (result & 8 && chainCount === 1) {
1259
- emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
1260
- hasBase = true;
1261
- }
1262
- if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && property in import_helpers.propToTokenCategoryCode && splitComponents(source.slice(lastPayloadStart)).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
1263
- if ((!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
1264
- var value = implicitLifecycleBase(property);
1265
- if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
1266
- }
1267
- }
1107
+ var formatScanFailure = function(failure, source, failureIndex) {
1108
+ return failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"";
1268
1109
  };
1269
- function implicitLifecycleBase(property) {
1270
- return property === "opacity" || property === "scale" || property === "scaleX" || property === "scaleY" ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
1271
- }
1272
- var legacyTransformParts = /* @__PURE__ */ new Set([
1273
- "matrix",
1274
- "perspective",
1275
- "rotateX",
1276
- "rotateY",
1277
- "rotateZ",
1278
- "scaleZ",
1279
- "skewX",
1280
- "skewY"
1281
- ]);
1282
- var webShadowParts = {
1283
- shadowColor: 1,
1284
- shadowOffset: 2,
1285
- shadowOpacity: 3,
1286
- shadowRadius: 4
1110
+ var warnScanFailure = function(property, source, failure, failureIndex) {
1111
+ if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, formatScanFailure(failure, source, failureIndex));
1287
1112
  };
1288
- var webTextShadowParts = /* @__PURE__ */ new Set([
1289
- "textShadowColor",
1290
- "textShadowOffset",
1291
- "textShadowRadius"
1292
- ]);
1293
- var lineStyles = /* @__PURE__ */ new Set([
1294
- "none",
1295
- "hidden",
1296
- "dotted",
1297
- "dashed",
1298
- "solid",
1299
- "double",
1300
- "groove",
1301
- "ridge",
1302
- "inset",
1303
- "outset"
1304
- ]);
1305
1113
  var borderTargets = {
1306
- border: {
1307
- width: [
1308
- "borderTopWidth",
1309
- "borderRightWidth",
1310
- "borderBottomWidth",
1311
- "borderLeftWidth"
1312
- ],
1313
- style: [
1314
- "borderTopStyle",
1315
- "borderRightStyle",
1316
- "borderBottomStyle",
1317
- "borderLeftStyle"
1318
- ],
1319
- color: [
1320
- "borderTopColor",
1321
- "borderRightColor",
1322
- "borderBottomColor",
1323
- "borderLeftColor"
1324
- ]
1325
- },
1326
- borderTop: {
1327
- width: ["borderTopWidth"],
1328
- style: ["borderTopStyle"],
1329
- color: ["borderTopColor"]
1330
- },
1331
- borderRight: {
1332
- width: ["borderRightWidth"],
1333
- style: ["borderRightStyle"],
1334
- color: ["borderRightColor"]
1335
- },
1336
- borderBottom: {
1337
- width: ["borderBottomWidth"],
1338
- style: ["borderBottomStyle"],
1339
- color: ["borderBottomColor"]
1340
- },
1341
- borderLeft: {
1342
- width: ["borderLeftWidth"],
1343
- style: ["borderLeftStyle"],
1344
- color: ["borderLeftColor"]
1345
- },
1346
- outline: {
1347
- width: ["outlineWidth"],
1348
- style: ["outlineStyle"],
1349
- color: ["outlineColor"]
1350
- },
1351
- borderBlock: {
1352
- width: ["borderBlockStartWidth", "borderBlockEndWidth"],
1353
- style: ["borderBlockStartStyle", "borderBlockEndStyle"],
1354
- color: ["borderBlockStartColor", "borderBlockEndColor"]
1355
- },
1356
- borderInline: {
1357
- width: ["borderInlineStartWidth", "borderInlineEndWidth"],
1358
- style: ["borderInlineStartStyle", "borderInlineEndStyle"],
1359
- color: ["borderInlineStartColor", "borderInlineEndColor"]
1360
- }
1114
+ border: [
1115
+ "Top",
1116
+ "Right",
1117
+ "Bottom",
1118
+ "Left"
1119
+ ],
1120
+ borderTop: ["Top"],
1121
+ borderRight: ["Right"],
1122
+ borderBottom: ["Bottom"],
1123
+ borderLeft: ["Left"],
1124
+ outline: [""],
1125
+ borderBlock: ["BlockStart", "BlockEnd"],
1126
+ borderInline: ["InlineStart", "InlineEnd"]
1361
1127
  };
1362
- var tokenLookup = {
1363
- value: void 0,
1364
- fromTheme: false,
1365
- themeKey: ""
1366
- };
1367
- function fillTokenLookup(value, fromTheme, themeKey) {
1368
- tokenLookup.value = value;
1369
- tokenLookup.fromTheme = fromTheme;
1370
- tokenLookup.themeKey = themeKey;
1371
- return tokenLookup;
1372
- }
1373
- function tokenVariable(state, property, name) {
1374
- var _state_theme, _state_conf_themes_, _state_conf_themes, _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
1375
- var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
1376
- if (property === "fontFamily") {
1377
- var _state_conf_fontsParsed_lookupName;
1378
- var family = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
1379
- return family ? fillTokenLookup(family, false, lookupName) : void 0;
1380
- }
1381
- var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : void 0;
1382
- if (fontKey) {
1383
- var _font_fontKey;
1384
- var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
1385
- var value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
1386
- return value ? fillTokenLookup(value, false, lookupName) : void 0;
1387
- }
1388
- var category = (0, import_tokenCategories.getTokenCategoryForProperty)(property);
1389
- var dot = lookupName.indexOf(".");
1390
- if (dot !== -1) {
1391
- var prefix = lookupName.slice(0, dot);
1392
- if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
1393
- }
1394
- if (category) {
1395
- var _state_conf_tokensParsed_category;
1396
- var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
1397
- if (own) return fillTokenLookup(own, false, lookupName);
1398
- } else {
1399
- var first = lookupName.charCodeAt(0);
1400
- if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
1401
- }
1402
- var theme = ((_state_theme = state.theme) === null || _state_theme === void 0 ? void 0 : _state_theme[lookupName]) || ((_state_conf_themes = state.conf.themes) === null || _state_conf_themes === void 0 ? void 0 : (_state_conf_themes_ = _state_conf_themes[state.flatThemeName || ""]) === null || _state_conf_themes_ === void 0 ? void 0 : _state_conf_themes_[lookupName]);
1403
- if (theme) return fillTokenLookup(theme, true, lookupName);
1404
- if (category) return;
1405
- var token = ((_state_conf_tokensParsed_space = state.conf.tokensParsed.space) === null || _state_conf_tokensParsed_space === void 0 ? void 0 : _state_conf_tokensParsed_space[lookupName]) || ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[lookupName]);
1406
- return token ? fillTokenLookup(token, false, lookupName) : void 0;
1407
- }
1408
- var literalMissConf = null;
1409
- var literalMissRevision = -1;
1410
- var literalMisses = /* @__PURE__ */ new WeakMap();
1411
- var literalMissRootTheme = {};
1412
- function isFontKeyedProperty(property) {
1413
- return property === "fontFamily" || property === "fontSize" || property === "fontWeight" || property === "lineHeight" || property === "letterSpacing";
1414
- }
1415
- function literalMissSet(state) {
1416
- var revision = (0, import_grammarConfig.getConfigRevisionState)(state.conf).revision;
1417
- if (state.conf !== literalMissConf || revision !== literalMissRevision) {
1418
- literalMissConf = state.conf;
1419
- literalMissRevision = revision;
1420
- literalMisses = /* @__PURE__ */ new WeakMap();
1421
- }
1422
- var themeKey = state.theme && _type_of(state.theme) === "object" ? state.theme : literalMissRootTheme;
1423
- var set = literalMisses.get(themeKey);
1424
- if (!set) {
1425
- set = /* @__PURE__ */ new Set();
1426
- literalMisses.set(themeKey, set);
1427
- }
1428
- return set;
1429
- }
1128
+ var valueCacheConf;
1129
+ var valueCacheRevision = -1;
1130
+ var valueCaches = /* @__PURE__ */ new WeakMap();
1131
+ var valueCacheEntries = 0;
1132
+ var valueCacheRoot = {};
1133
+ var parsedSlices = /* @__PURE__ */ new WeakMap();
1134
+ var fontProperties = /* @__PURE__ */ new Map();
1430
1135
  function configuredValue(state, property, raw) {
1136
+ var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
1137
+ var _maps;
1138
+ var grammar = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
1431
1139
  var name = raw;
1432
1140
  var opacity;
1433
1141
  var slash = raw.lastIndexOf("/");
@@ -1438,157 +1146,142 @@ function configuredValue(state, property, raw) {
1438
1146
  opacity = amount;
1439
1147
  }
1440
1148
  }
1441
- var safeArea = (0, import_resolveSafeAreaVariable.resolveSafeAreaVariable)(name);
1149
+ var safeArea = grammar.safeAreaVariable(name);
1442
1150
  if (safeArea !== void 0) {
1443
1151
  state.flatUsesSafeArea = true;
1444
1152
  return safeArea;
1445
1153
  }
1446
- var cacheable = !isFontKeyedProperty(property);
1447
- var misses;
1448
- var missKey = "";
1449
- if (cacheable) {
1450
- misses = literalMissSet(state);
1451
- missKey = `${state.flatThemeName || ""}${property}${name}`;
1452
- if (misses.has(missKey)) return raw;
1453
- }
1454
- if (process.env.NODE_ENV === "development") {
1455
- var _state_conf_tokensParsed_color;
1456
- var category = (0, import_tokenCategories.getTokenCategoryForProperty)(property);
1457
- if (category && category !== "color" && ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[name])) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"`);
1154
+ var fontProperty = fontProperties.get(property);
1155
+ if (fontProperty === void 0) {
1156
+ fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
1157
+ fontProperties.set(property, fontProperty);
1458
1158
  }
1459
- var lookup = tokenVariable(state, property, name);
1460
- if (!lookup || !(0, import_createVariable.isVariable)(lookup.value)) {
1461
- if (misses) misses.add(missKey);
1462
- return raw;
1159
+ var revision = grammar.revision;
1160
+ if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
1161
+ valueCacheConf = state.conf;
1162
+ valueCacheRevision = revision;
1163
+ valueCaches = /* @__PURE__ */ new WeakMap();
1164
+ valueCacheEntries = 0;
1165
+ state.flatValueScope = void 0;
1463
1166
  }
1464
1167
  var resolveValues = state.styleProps.resolveValues;
1465
- if (resolveValues === "except-theme" && lookup.fromTheme) return `${import_themeRef.THEME_REF_PREFIX}${lookup.themeKey}${opacity !== void 0 ? `/${opacity}` : ""}`;
1466
- var value = (0, import_resolveVariableValue.resolveVariableValue)(property, lookup.value, resolveValues);
1467
- if (opacity !== void 0) value = (0, import_normalizeColor.normalizeColor)(value, opacity / 100);
1468
- return value;
1469
- }
1470
- function resolveEmbeddedTokens(state, property, raw) {
1471
- var copyFrom = 0;
1472
- var out = "";
1473
- var quote = 0;
1474
- for (var index = 0; index < raw.length; index++) {
1475
- var code = raw.charCodeAt(index);
1476
- if (quote) {
1477
- if (code === 92) index++;
1478
- else if (code === quote) quote = 0;
1479
- continue;
1480
- }
1481
- if (code === 34 || code === 39) {
1482
- quote = code;
1483
- continue;
1484
- }
1485
- if (!(code === 36 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) continue;
1486
- var end = index + 1;
1487
- while (end < raw.length) {
1488
- var next = raw.charCodeAt(end);
1489
- if (next === 36 || next === 45 || next === 46 || next === 95 || next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122) end++;
1490
- else break;
1491
- }
1492
- if (raw.charCodeAt(end) === 47) {
1493
- var suffix = end + 1;
1494
- while (suffix < raw.length) {
1495
- var next1 = raw.charCodeAt(suffix);
1496
- if (next1 < 48 || next1 > 57) break;
1497
- suffix++;
1498
- }
1499
- if (suffix > end + 1) end = suffix;
1500
- }
1501
- var before = raw.charCodeAt(index - 1);
1502
- if (code !== 36 && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(index - 2) === 45 || raw.charCodeAt(end) === 40)) {
1503
- index = end - 1;
1504
- continue;
1505
- }
1506
- var word = raw.slice(index, end);
1507
- var value = configuredValue(state, property, word);
1508
- if (value !== word) {
1509
- out += raw.slice(copyFrom, index);
1510
- out += String(value);
1511
- copyFrom = end;
1512
- }
1513
- index = end - 1;
1168
+ var direct = state;
1169
+ var scope = direct.flatValueScope;
1170
+ if (scope === void 0 || direct.flatValueScopeKind !== resolveValues) {
1171
+ var themeObject = state.theme && _type_of(state.theme) === "object" ? state.theme : valueCacheRoot;
1172
+ var byScope = valueCaches.get(themeObject);
1173
+ if (!byScope) valueCaches.set(themeObject, byScope = /* @__PURE__ */ new Map());
1174
+ var scopeKey = `${state.flatThemeName || ""}${resolveValues}`;
1175
+ scope = byScope.get(scopeKey);
1176
+ if (!scope) byScope.set(scopeKey, scope = /* @__PURE__ */ new Map());
1177
+ direct.flatValueScope = scope;
1178
+ direct.flatValueScopeKind = resolveValues;
1179
+ }
1180
+ var maps = scope.get(property);
1181
+ if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
1182
+ var byRaw = embedded ? (_maps = maps).embedded || (_maps.embedded = /* @__PURE__ */ new Map()) : maps.direct;
1183
+ if (!fontProperty) {
1184
+ var known = byRaw.get(raw);
1185
+ if (known !== void 0 || byRaw.has(raw)) return known;
1514
1186
  }
1515
- return copyFrom ? out + raw.slice(copyFrom) : raw;
1516
- }
1517
- function normalizeTransitionNames(state, raw) {
1518
- var quote = 0;
1519
- var depth = 0;
1520
- var copyFrom = 0;
1521
- var out = "";
1522
- for (var index = 0; index < raw.length; index++) {
1523
- var code = raw.charCodeAt(index);
1524
- if (quote) {
1525
- if (code === 92) index++;
1526
- else if (code === quote) quote = 0;
1527
- continue;
1528
- }
1529
- if (code === 34 || code === 39) {
1530
- quote = code;
1531
- continue;
1532
- }
1533
- if (code === 40) {
1534
- depth++;
1535
- continue;
1536
- }
1537
- if (code === 41) {
1538
- depth--;
1539
- continue;
1540
- }
1541
- if (depth || !(code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95) || index > 1 && raw.charCodeAt(index - 1) === 45 && raw.charCodeAt(index - 2) === 45) continue;
1542
- var end = index + 1;
1543
- while (end < raw.length) {
1544
- var next = raw.charCodeAt(end);
1545
- if (next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 45 || next === 95) end++;
1546
- else break;
1547
- }
1548
- if (raw.charCodeAt(end) !== 40) {
1549
- var authored = raw.slice(index, end);
1550
- var property = state.conf.shorthands[authored] || authored;
1551
- if (property === "x" || property === "y") property = "translate";
1552
- else if (property === "scaleX" || property === "scaleY") property = "scale";
1553
- else if (legacyTransformParts.has(property)) property = "transform";
1554
- var hasUpper = false;
1555
- for (var offset = 0; offset < property.length; offset++) {
1556
- var letter = property.charCodeAt(offset);
1557
- if (letter >= 65 && letter <= 90) {
1558
- hasUpper = true;
1559
- break;
1560
- }
1187
+ var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
1188
+ var value;
1189
+ var fromTheme = false;
1190
+ if (property === "fontFamily") {
1191
+ var _state_conf_fontsParsed_lookupName;
1192
+ value = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
1193
+ } else {
1194
+ var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : "";
1195
+ if (fontKey) {
1196
+ var _font_fontKey;
1197
+ var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
1198
+ value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
1199
+ } else {
1200
+ var _state_conf_tokensParsed_category;
1201
+ var category = grammar.tokenCategory(property);
1202
+ var dot = lookupName.indexOf(".");
1203
+ if (dot !== -1) {
1204
+ var prefix = lookupName.slice(0, dot);
1205
+ if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
1561
1206
  }
1562
- if (property !== authored || hasUpper) {
1563
- out += raw.slice(copyFrom, index);
1564
- for (var offset1 = 0; offset1 < property.length; offset1++) {
1565
- var letter1 = property.charCodeAt(offset1);
1566
- out += letter1 >= 65 && letter1 <= 90 ? `-${String.fromCharCode(letter1 + 32)}` : property[offset1];
1207
+ value = category ? (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName] : void 0;
1208
+ if (!value) {
1209
+ var first = lookupName.charCodeAt(0);
1210
+ if (category || !(first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46)) {
1211
+ var _state_theme, _state_conf_themes_, _state_conf_themes;
1212
+ value = ((_state_theme = state.theme) === null || _state_theme === void 0 ? void 0 : _state_theme[lookupName]) || ((_state_conf_themes = state.conf.themes) === null || _state_conf_themes === void 0 ? void 0 : (_state_conf_themes_ = _state_conf_themes[state.flatThemeName || ""]) === null || _state_conf_themes_ === void 0 ? void 0 : _state_conf_themes_[lookupName]);
1213
+ fromTheme = !!value;
1214
+ if (!value && !category) {
1215
+ var _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
1216
+ value = ((_state_conf_tokensParsed_space = state.conf.tokensParsed.space) === null || _state_conf_tokensParsed_space === void 0 ? void 0 : _state_conf_tokensParsed_space[lookupName]) || ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[lookupName]);
1217
+ }
1567
1218
  }
1568
- copyFrom = end;
1569
1219
  }
1570
1220
  }
1571
- index = end - 1;
1572
1221
  }
1573
- return copyFrom ? out + raw.slice(copyFrom) : raw;
1222
+ if (process.env.NODE_ENV === "development") {
1223
+ var _state_conf_tokensParsed_color1;
1224
+ var category1 = grammar.tokenCategory(property);
1225
+ if (category1 && category1 !== "color" && ((_state_conf_tokensParsed_color1 = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color1 === void 0 ? void 0 : _state_conf_tokensParsed_color1[name])) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"`);
1226
+ }
1227
+ var out = raw;
1228
+ if ((0, import_createVariable.isVariable)(value)) {
1229
+ out = resolveValues === "except-theme" && fromTheme ? `${import_themeRef.THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : (0, import_resolveVariableValue.resolveVariableValue)(property, value, resolveValues);
1230
+ if (opacity !== void 0) {
1231
+ var _normalizeColor;
1232
+ out = (_normalizeColor = (0, import_normalizeColor.normalizeColor)(out, opacity / 100)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
1233
+ }
1234
+ }
1235
+ if (embedded && out === raw) {
1236
+ var usedSafeArea = state.flatUsesSafeArea;
1237
+ out = grammar.embeddedTokens(raw, function(word) {
1238
+ return configuredValue(state, property, word);
1239
+ });
1240
+ if (!usedSafeArea && state.flatUsesSafeArea) return out;
1241
+ }
1242
+ if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
1243
+ valueCaches = /* @__PURE__ */ new WeakMap();
1244
+ valueCacheEntries = 0;
1245
+ } else {
1246
+ valueCacheEntries++;
1247
+ byRaw.set(raw, out);
1248
+ }
1249
+ return out;
1574
1250
  }
1575
- function getDirectDynamicThemeAccess(state) {
1576
- return state.flatDynamicThemeAccess;
1251
+ function ownsSourceLayer(state, property) {
1252
+ var conditional = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1253
+ var _direct_flatPass;
1254
+ var _direct;
1255
+ var direct = state;
1256
+ var layer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
1257
+ var layers = (_direct = direct).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
1258
+ var previous = layers.get(property);
1259
+ if (previous !== void 0) {
1260
+ if (previous > layer) return false;
1261
+ if (previous < layer) {
1262
+ if (conditional) return true;
1263
+ clearDirectStyle(state, property);
1264
+ }
1265
+ } else if (conditional) return true;
1266
+ layers.set(property, layer);
1267
+ return true;
1577
1268
  }
1578
- function emitProperty(state, property, value, cursor, merge, originalValue, contextOnly) {
1269
+ function emitProperty(state, property, value, cursor, originalValue, contextOnly) {
1579
1270
  var _state_animationDriver;
1580
1271
  var _state, _state1;
1272
+ if (!ownsSourceLayer(state, property, cursor !== null)) return;
1581
1273
  var direct = state;
1582
- var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
1274
+ var condition = cursor ? cursor[conditionValue] : 0;
1275
+ if (condition && (!(condition & 2) || !(condition & 1) && !(import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses) && !(cursor[conditionTheme] && import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property)))) return;
1583
1276
  if (condition & 4) ((_state = state).flatEnterKeys || (_state.flatEnterKeys = /* @__PURE__ */ new Set())).add(property);
1584
1277
  if (condition & 8) ((_state1 = state).flatExitKeys || (_state1.flatExitKeys = /* @__PURE__ */ new Set())).add(property);
1585
- var theme = cursor ? conditionTexts[cursor + conditionThemeOffset] || "" : "";
1278
+ var theme = cursor ? cursor[conditionTheme] : "";
1586
1279
  if (theme) {
1587
1280
  if (import_constants.supportsDynamicColorIOS && (0, import_getDynamicVal.isColorStyleKey)(property)) {
1588
1281
  var _direct, _ref, _property;
1589
1282
  var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
1590
- schemes[theme] = typeof originalValue === "string" && isAsciiLetters(originalValue) ? originalValue : value;
1591
- streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor, merge, originalValue, true, condition & 1 ? condition : condition + 1);
1283
+ schemes[theme] = typeof originalValue === "string" && /^[a-z]+$/i.test(originalValue) ? originalValue : value;
1284
+ streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor, originalValue, true, condition & 1 ? condition : condition + 1);
1592
1285
  return;
1593
1286
  }
1594
1287
  direct.flatDynamicThemeAccess = true;
@@ -1600,23 +1293,23 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
1600
1293
  }
1601
1294
  return;
1602
1295
  }
1603
- if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
1296
+ if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
1604
1297
  var _state4;
1605
1298
  if (process.env.NODE_ENV === "development" && state.transformAccumulator) {
1606
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1299
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1607
1300
  try {
1608
- for (var _iterator2 = (0, import_runtime.getTransformPartKeys)(state.transformAccumulator)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1609
- var part3 = _step2.value;
1610
- (0, import_warnOnce.warnOnce)(`legacy transform part "${part3}" is dropped because "transform" owns the property`);
1301
+ for (var _iterator = (0, import_runtime.getTransformPartKeys)(state.transformAccumulator)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1302
+ var part = _step.value;
1303
+ (0, import_warnOnce.warnOnce)(`legacy transform part "${part}" is dropped because "transform" owns the property`);
1611
1304
  }
1612
1305
  } catch (err) {
1613
- _didIteratorError2 = true;
1614
- _iteratorError2 = err;
1306
+ _didIteratorError = true;
1307
+ _iteratorError = err;
1615
1308
  } finally {
1616
1309
  try {
1617
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1310
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1618
1311
  } finally {
1619
- if (_didIteratorError2) throw _iteratorError2;
1312
+ if (_didIteratorError) throw _iteratorError;
1620
1313
  }
1621
1314
  }
1622
1315
  }
@@ -1624,44 +1317,12 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
1624
1317
  (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1625
1318
  return;
1626
1319
  }
1627
- var shouldPromoteAnimatedStyle = import_directStyleCSS.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in import_helpers.nonAnimatableStyleProps;
1628
- if (import_directStyleCSS.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
1629
- if (!condition && state.style && !(direct.flatUsed && direct.flatUsed[property])) delete state.style[property];
1630
- streamWriteCSS(state, property, value, cursor, originalValue);
1320
+ var shouldPromoteAnimatedStyle = import_getCSSStylesAtomic.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in import_helpers.nonAnimatableStyleProps;
1321
+ if (import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
1322
+ writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
1631
1323
  return;
1632
1324
  }
1633
- if (condition && !(condition & 1)) return;
1634
- streamWriteInline(state, property, value, cursor, merge, originalValue);
1635
- }
1636
- function splitComponents(value) {
1637
- var parts = [];
1638
- var start = 0;
1639
- var quote = 0;
1640
- var depth = 0;
1641
- for (var index = 0; index <= value.length; index++) {
1642
- var code = index === value.length ? 32 : value.charCodeAt(index);
1643
- if (quote) {
1644
- if (code === 92) index++;
1645
- else if (code === quote) quote = 0;
1646
- continue;
1647
- }
1648
- if (code === 34 || code === 39) quote = code;
1649
- else if (code === 40) depth++;
1650
- else if (code === 41) depth--;
1651
- else if (!depth && code <= 32) {
1652
- if (index > start) parts.push(value.slice(start, index));
1653
- start = index + 1;
1654
- }
1655
- }
1656
- return parts;
1657
- }
1658
- function isAsciiLetters(value) {
1659
- if (!value) return false;
1660
- for (var index = 0; index < value.length; index++) {
1661
- var code = value.charCodeAt(index) | 32;
1662
- if (code < 97 || code > 122) return false;
1663
- }
1664
- return true;
1325
+ streamWriteInline(state, property, value, cursor, originalValue);
1665
1326
  }
1666
1327
  function numericUnitValue(value, first, second) {
1667
1328
  var unitLength = value.endsWith(first) || second !== void 0 && value.endsWith(second) ? first.length : 0;
@@ -1669,858 +1330,391 @@ function numericUnitValue(value, first, second) {
1669
1330
  var numeric = Number(value.slice(0, value.length - unitLength));
1670
1331
  return Number.isFinite(numeric) ? numeric : NaN;
1671
1332
  }
1672
- function isNumericCSSComponent(value) {
1673
- var index = 0;
1674
- if (value.charCodeAt(index) === 43 || value.charCodeAt(index) === 45) index++;
1675
- var digits = 0;
1676
- var dot = false;
1677
- for (; index < value.length; index++) {
1678
- var code = value.charCodeAt(index);
1679
- if (code >= 48 && code <= 57) {
1680
- digits++;
1681
- continue;
1682
- }
1683
- if (code === 46 && !dot) {
1684
- dot = true;
1685
- continue;
1686
- }
1687
- break;
1688
- }
1689
- if (!digits) return false;
1690
- for (; index < value.length; index++) {
1691
- var code1 = value.charCodeAt(index);
1692
- if (code1 !== 37 && (code1 < 97 || code1 > 122)) return false;
1693
- }
1694
- return true;
1695
- }
1696
- function startsValueFunction(value) {
1697
- var index = 0;
1698
- while (index < value.length) {
1699
- var code = value.charCodeAt(index);
1700
- if (code === 45 || code >= 97 && code <= 122) {
1701
- index++;
1702
- continue;
1703
- }
1704
- break;
1705
- }
1706
- return index > 0 && value.charCodeAt(index) === 40;
1707
- }
1708
- function emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly) {
1333
+ function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
1709
1334
  if (property === "borderBlock" || property === "borderInline") {
1710
1335
  if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`RN has no logical border shorthand "${property}"; dropping it`);
1711
1336
  return;
1712
1337
  }
1713
- var width;
1714
- var style;
1715
- var color;
1716
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1717
- try {
1718
- for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1719
- var part3 = _step2.value;
1720
- if (lineStyles.has(part3) || property === "outline" && part3 === "auto") style = part3;
1721
- else if (part3 === "thin" || part3 === "medium" || part3 === "thick" || isNumericCSSComponent(part3) || startsValueFunction(part3)) width = part3;
1722
- else color = part3;
1723
- }
1724
- } catch (err) {
1725
- _didIteratorError2 = true;
1726
- _iteratorError2 = err;
1727
- } finally {
1728
- try {
1729
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1730
- } finally {
1731
- if (_didIteratorError2) throw _iteratorError2;
1732
- }
1733
- }
1338
+ var { width, style, color } = (0, import_borderComponents.classifyBorderComponents)(raw, property === "outline");
1734
1339
  if (style === "none" && width === void 0) width = "0";
1735
- var targets = borderTargets[property];
1736
1340
  if (width !== void 0) {
1737
- var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
1738
- try {
1739
- for (var _iterator12 = targets.width[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
1740
- var target2 = _step12.value;
1741
- emitResolved(state, target2, width, cursor, merge, originalValue, contextOnly);
1742
- }
1743
- } catch (err) {
1744
- _didIteratorError12 = true;
1745
- _iteratorError12 = err;
1746
- } finally {
1747
- try {
1748
- if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
1749
- } finally {
1750
- if (_didIteratorError12) throw _iteratorError12;
1751
- }
1752
- }
1341
+ if (width === "thin") width = "1px";
1342
+ else if (width === "medium") width = "3px";
1343
+ else if (width === "thick") width = "5px";
1753
1344
  }
1754
- if (style !== void 0) {
1755
- var styleTargets = property === "border" ? ["borderStyle"] : targets.style;
1756
- var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
1757
- try {
1758
- for (var _iterator22 = styleTargets[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
1759
- var target1 = _step22.value;
1760
- emitProperty(state, target1, style, cursor, merge, originalValue, contextOnly);
1761
- }
1762
- } catch (err) {
1763
- _didIteratorError22 = true;
1764
- _iteratorError22 = err;
1765
- } finally {
1766
- try {
1767
- if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
1768
- } finally {
1769
- if (_didIteratorError22) throw _iteratorError22;
1770
- }
1771
- }
1772
- }
1773
- if (color !== void 0) {
1774
- var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
1775
- try {
1776
- for (var _iterator3 = targets.color[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
1777
- var target22 = _step3.value;
1778
- emitResolved(state, target22, color, cursor, merge, originalValue, contextOnly);
1779
- }
1780
- } catch (err) {
1781
- _didIteratorError3 = true;
1782
- _iteratorError3 = err;
1783
- } finally {
1784
- try {
1785
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) _iterator3.return();
1786
- } finally {
1787
- if (_didIteratorError3) throw _iteratorError3;
1788
- }
1789
- }
1790
- }
1791
- }
1792
- function emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly) {
1793
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1345
+ var targets = borderTargets[property];
1346
+ var prefix = property === "outline" ? "outline" : "border";
1347
+ if (style !== void 0 && property === "border") emitProperty(state, "borderStyle", style, cursor, originalValue, contextOnly);
1348
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1794
1349
  try {
1795
- for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1796
- var part3 = _step2.value;
1797
- emitResolved(state, part3 === "solid" || part3 === "double" || part3 === "dotted" || part3 === "dashed" || part3 === "wavy" ? "textDecorationStyle" : part3 === "underline" || part3 === "overline" || part3 === "line-through" || part3 === "none" ? "textDecorationLine" : "textDecorationColor", part3, cursor, merge, originalValue, contextOnly);
1350
+ for (var _iterator = targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1351
+ var propBase = `${prefix}${_step.value}`;
1352
+ if (width !== void 0) emitResolved(state, `${propBase}Width`, width, cursor, originalValue, contextOnly);
1353
+ if (style !== void 0 && !(property === "border")) emitProperty(state, `${propBase}Style`, style, cursor, originalValue, contextOnly);
1354
+ if (color !== void 0) emitResolved(state, `${propBase}Color`, color, cursor, originalValue, contextOnly);
1798
1355
  }
1799
1356
  } catch (err) {
1800
- _didIteratorError2 = true;
1801
- _iteratorError2 = err;
1357
+ _didIteratorError = true;
1358
+ _iteratorError = err;
1802
1359
  } finally {
1803
1360
  try {
1804
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1361
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1805
1362
  } finally {
1806
- if (_didIteratorError2) throw _iteratorError2;
1363
+ if (_didIteratorError) throw _iteratorError;
1807
1364
  }
1808
1365
  }
1809
1366
  }
1810
- function emitTransform(state, property, value, cursor, merge, originalValue, contextOnly) {
1811
- if (!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) {
1812
- emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
1813
- return;
1814
- }
1815
- var targets = property === "scale" ? ["--t-scale-x", "--t-scale-y"] : [property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : "rotate"];
1816
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1367
+ function emitTextDecoration(state, raw, cursor, originalValue, contextOnly) {
1368
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1817
1369
  try {
1818
- for (var _iterator2 = targets[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1819
- var target2 = _step2.value;
1820
- var targetValue = value;
1821
- if (typeof targetValue === "number") {
1822
- if (target2 === "--t-x" || target2 === "--t-y") targetValue = `${targetValue}px`;
1823
- else if (target2 === "rotate") targetValue = `${targetValue}deg`;
1824
- }
1825
- emitProperty(state, target2, targetValue, cursor, merge, originalValue, contextOnly);
1826
- if (target2 === "--t-x" || target2 === "--t-y") (0, import_directStyleCSS.addComposition)(state, "translate");
1827
- else if (target2.startsWith("--t-scale")) (0, import_directStyleCSS.addComposition)(state, "scale");
1370
+ for (var _iterator = (0, import_borderComponents.splitComponents)(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1371
+ var part = _step.value;
1372
+ emitResolved(state, part === "solid" || part === "double" || part === "dotted" || part === "dashed" || part === "wavy" ? "textDecorationStyle" : part === "underline" || part === "overline" || part === "line-through" || part === "none" ? "textDecorationLine" : "textDecorationColor", part, cursor, originalValue, contextOnly);
1828
1373
  }
1829
1374
  } catch (err) {
1830
- _didIteratorError2 = true;
1831
- _iteratorError2 = err;
1375
+ _didIteratorError = true;
1376
+ _iteratorError = err;
1832
1377
  } finally {
1833
1378
  try {
1834
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1379
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1835
1380
  } finally {
1836
- if (_didIteratorError2) throw _iteratorError2;
1381
+ if (_didIteratorError) throw _iteratorError;
1837
1382
  }
1838
1383
  }
1839
1384
  }
1840
- function emitResolved(state, property, raw, cursor, merge, originalValue, contextOnly) {
1841
- var value = configuredValue(state, property, raw);
1842
- if (value === raw) value = resolveEmbeddedTokens(state, property, raw);
1385
+ function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
1386
+ var value = configuredValue(state, property, raw, true);
1843
1387
  if (typeof value === "string") {
1844
1388
  var unitValue = numericUnitValue(value, "px", "dp");
1845
1389
  if (Number.isFinite(unitValue)) value = unitValue;
1846
1390
  else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
1847
1391
  }
1848
- emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
1392
+ emitProperty(state, property, value, cursor, originalValue, contextOnly);
1849
1393
  }
1850
- var emitKindTransition = 1;
1851
- var emitKindTransformPart = 2;
1852
- var emitKindWebShadow = 3;
1853
- var emitKindWebTextShadow = 4;
1854
- var emitKindTransform = 5;
1855
- var emitKindBorder = 6;
1856
- var emitKindTextDecoration = 7;
1857
- var emitKindBackground = 8;
1858
- var emitKindAxis = 9;
1859
- var emitKindBorderRadius = 10;
1860
- var emitKindBorderWidth = 11;
1861
- var emitValueKinds = {
1862
- transition: emitKindTransition,
1863
- transitionProperty: emitKindTransition,
1864
- transform: emitKindTransform,
1865
- textDecoration: emitKindTextDecoration,
1866
- background: emitKindBackground,
1867
- x: emitKindAxis,
1868
- y: emitKindAxis,
1869
- scale: emitKindAxis,
1870
- scaleX: emitKindAxis,
1871
- scaleY: emitKindAxis,
1872
- rotate: emitKindAxis,
1873
- borderRadius: emitKindBorderRadius,
1874
- borderWidth: emitKindBorderWidth,
1875
- borderTopWidth: emitKindBorderWidth,
1876
- borderRightWidth: emitKindBorderWidth,
1877
- borderBottomWidth: emitKindBorderWidth,
1878
- borderLeftWidth: emitKindBorderWidth
1879
- };
1880
- var _iteratorNormalCompletion = true;
1881
- var _didIteratorError = false;
1882
- var _iteratorError = void 0;
1883
- try {
1884
- for (var _iterator = legacyTransformParts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1885
- var part = _step.value;
1886
- emitValueKinds[part] = emitKindTransformPart;
1887
- }
1888
- } catch (err) {
1889
- _didIteratorError = true;
1890
- _iteratorError = err;
1891
- } finally {
1892
- try {
1893
- if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1894
- } finally {
1895
- if (_didIteratorError) throw _iteratorError;
1896
- }
1897
- }
1898
- for (var part1 in webShadowParts) emitValueKinds[part1] = emitKindWebShadow;
1899
- var _iteratorNormalCompletion1 = true;
1900
- var _didIteratorError1 = false;
1901
- var _iteratorError1 = void 0;
1902
- try {
1903
- for (var _iterator1 = webTextShadowParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1904
- var part2 = _step1.value;
1905
- emitValueKinds[part2] = emitKindWebTextShadow;
1906
- }
1907
- } catch (err) {
1908
- _didIteratorError1 = true;
1909
- _iteratorError1 = err;
1910
- } finally {
1911
- try {
1912
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
1913
- } finally {
1914
- if (_didIteratorError1) throw _iteratorError1;
1915
- }
1394
+ function shadowUnit(part) {
1395
+ return typeof part === "number" ? `${part}px` : part || "0px";
1916
1396
  }
1917
- for (var target in borderTargets) emitValueKinds[target] = emitKindBorder;
1918
- function shadowUnit(part3) {
1919
- return typeof part3 === "number" ? `${part3}px` : part3 || "0px";
1920
- }
1921
- function emitValue(state, property, raw, cursor, merge, originalValue, contextOnly) {
1922
- var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
1397
+ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
1398
+ var condition = cursor ? cursor[conditionValue] : 0;
1399
+ var grammar = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
1923
1400
  if ((0, import_createVariable.isVariable)(raw)) raw = (0, import_resolveVariableValue.resolveVariableValue)(property, raw, state.styleProps.resolveValues);
1924
- var emitKind = emitValueKinds[property];
1925
- if (emitKind !== void 0) switch (emitKind) {
1926
- case emitKindTransition:
1927
- if (typeof raw === "string") raw = normalizeTransitionNames(state, raw);
1928
- break;
1929
- case emitKindBorderWidth:
1930
- (0, import_directStyleCSS.requestBorderStyleDefault)(state, property, condition, cursor ? conditionTexts[cursor + conditionKeyOffset] || "" : "", cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0);
1931
- break;
1932
- case emitKindTransformPart:
1933
- var value = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
1934
- if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && !condition) {
1935
- var _state;
1936
- (_state = state).transformAccumulator || (_state.transformAccumulator = (0, import_runtime.createTransformAccumulator)());
1937
- (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1938
- } else if (condition && import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses) emitProperty(state, "transform", `${property}(${value})`, cursor, merge, originalValue, contextOnly);
1939
- else streamWriteInline(state, property, value, cursor, merge, originalValue, true);
1940
- return;
1941
- case emitKindWebShadow: break;
1942
- case emitKindWebTextShadow: break;
1943
- case emitKindTransform:
1944
- if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
1945
- if (typeof raw === "string") {
1946
- var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
1947
- if (transform) {
1948
- emitProperty(state, property, transform, cursor, merge, originalValue, contextOnly);
1949
- return;
1950
- }
1951
- }
1952
- break;
1953
- case emitKindBorder:
1954
- if (typeof raw === "string") {
1955
- emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly);
1956
- return;
1957
- }
1958
- break;
1959
- case emitKindTextDecoration:
1960
- if (typeof raw === "string") {
1961
- emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly);
1401
+ if (typeof raw === "string" && (property === "transition" || property === "transitionProperty")) raw = grammar.normalizeTransition(raw);
1402
+ if ((property === "borderWidth" || property === "borderTopWidth" || property === "borderRightWidth" || property === "borderBottomWidth" || property === "borderLeftWidth") && state.styleProps.noNormalize !== false) writeStyleRecord(state, "borderStyle", "solid", cursor, originalValue, recordDefault);
1403
+ if (grammar.propertyKind(property) === 5) {
1404
+ var value = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
1405
+ if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && !condition) {
1406
+ var _state;
1407
+ (_state = state).transformAccumulator || (_state.transformAccumulator = (0, import_runtime.createTransformAccumulator)());
1408
+ (0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
1409
+ } else if (condition && import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses) emitProperty(state, "transform", `${property}(${value})`, cursor, originalValue, contextOnly);
1410
+ else streamWriteInline(state, property, value, cursor, originalValue, true);
1411
+ return;
1412
+ }
1413
+ if (property === "transform") {
1414
+ if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
1415
+ if (typeof raw === "string") {
1416
+ var transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
1417
+ if (transform) {
1418
+ emitProperty(state, property, transform, cursor, originalValue, contextOnly);
1962
1419
  return;
1963
1420
  }
1964
- break;
1965
- case emitKindBackground:
1966
- if (typeof raw === "string") {
1967
- var parts = splitComponents(raw);
1968
- if (parts.length === 1 && !startsValueFunction(parts[0])) {
1969
- emitResolved(state, "backgroundColor", parts[0], cursor, merge, originalValue, contextOnly);
1970
- return;
1421
+ }
1422
+ }
1423
+ if (typeof raw === "string" && borderTargets[property]) {
1424
+ emitBorder(state, property, raw, cursor, originalValue, contextOnly);
1425
+ return;
1426
+ }
1427
+ if (typeof raw === "string" && property === "textDecoration") {
1428
+ emitTextDecoration(state, raw, cursor, originalValue, contextOnly);
1429
+ return;
1430
+ }
1431
+ if (typeof raw === "string" && property === "background") {
1432
+ var parts = (0, import_borderComponents.splitComponents)(raw);
1433
+ if (parts.length === 1 && !(0, import_borderComponents.startsValueFunction)(parts[0])) {
1434
+ emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
1435
+ return;
1436
+ }
1437
+ if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native background cannot represent "${raw}"; dropping it`);
1438
+ return;
1439
+ }
1440
+ if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
1441
+ var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
1442
+ if (typeof value2 === "string" && !value2.startsWith(import_themeRef.THEME_REF_PREFIX)) {
1443
+ if (property === "rotate" && !Number.isFinite(numericUnitValue(value2, "deg", "rad"))) {
1444
+ if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value2}"; dropping it`);
1445
+ if (condition & 1) {
1446
+ (0, import_runtime.removeTransformValue)(state.transformAccumulator, property);
1447
+ writeStyleRecord(state, property, void 0, cursor, void 0, recordRetract);
1971
1448
  }
1972
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native background cannot represent "${raw}"; dropping it`);
1973
1449
  return;
1974
1450
  }
1975
- break;
1976
- case emitKindAxis:
1977
- var value3 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
1978
- if (typeof value3 === "string" && !value3.startsWith(import_themeRef.THEME_REF_PREFIX)) {
1979
- if (property === "rotate" && !Number.isFinite(numericUnitValue(value3, "deg", "rad"))) {
1980
- if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value3}"; dropping it`);
1981
- if (condition & 1) {
1982
- (0, import_runtime.removeTransformValue)(state.transformAccumulator, property);
1983
- streamRetractInline(state, property, cursor);
1984
- }
1985
- return;
1451
+ var unitValue = numericUnitValue(value2, "px", "dp");
1452
+ if (Number.isFinite(unitValue)) value2 = unitValue;
1453
+ else if (Number.isFinite(Number(value2))) value2 = Number(value2);
1454
+ }
1455
+ if (!import_getCSSStylesAtomic.canGenerateCSS || !state.flatShouldDoClasses) {
1456
+ emitProperty(state, property, value2, cursor, originalValue, contextOnly);
1457
+ return;
1458
+ }
1459
+ var targets = property === "scale" ? ["--t-scale-x", "--t-scale-y"] : [property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : "rotate"];
1460
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1461
+ try {
1462
+ for (var _iterator = targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1463
+ var target1 = _step.value;
1464
+ var targetValue = value2;
1465
+ if (typeof targetValue === "number") {
1466
+ if (target1 === "--t-x" || target1 === "--t-y") targetValue = `${targetValue}px`;
1467
+ else if (target1 === "rotate") targetValue = `${targetValue}deg`;
1986
1468
  }
1987
- var unitValue = numericUnitValue(value3, "px", "dp");
1988
- if (Number.isFinite(unitValue)) value3 = unitValue;
1989
- else if (Number.isFinite(Number(value3))) value3 = Number(value3);
1469
+ emitProperty(state, target1, targetValue, cursor, originalValue, contextOnly);
1470
+ if (target1 === "--t-x" || target1 === "--t-y") (0, import_getCSSStylesAtomic.addComposition)(state, "translate");
1471
+ else if (target1.startsWith("--t-scale")) (0, import_getCSSStylesAtomic.addComposition)(state, "scale");
1990
1472
  }
1991
- emitTransform(state, property, value3, cursor, merge, originalValue, contextOnly);
1992
- return;
1993
- case emitKindBorderRadius: break;
1994
- }
1995
- var value4 = raw;
1996
- if (typeof raw === "string") {
1997
- value4 = configuredValue(state, property, raw);
1998
- if (value4 === raw) value4 = resolveEmbeddedTokens(state, property, raw);
1473
+ } catch (err) {
1474
+ _didIteratorError = true;
1475
+ _iteratorError = err;
1476
+ } finally {
1477
+ try {
1478
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
1479
+ } finally {
1480
+ if (_didIteratorError) throw _iteratorError;
1481
+ }
1482
+ }
1483
+ return;
1999
1484
  }
2000
- if (typeof value4 === "string") {
2001
- var unitValue1 = numericUnitValue(value4, "px", "dp");
2002
- if (Number.isFinite(unitValue1)) value4 = unitValue1;
2003
- else if (value4 !== "" && Number.isFinite(Number(value4))) value4 = Number(value4);
1485
+ var value3 = raw;
1486
+ if (typeof raw === "string") value3 = configuredValue(state, property, raw, true);
1487
+ if (typeof value3 === "string") {
1488
+ var unitValue1 = numericUnitValue(value3, "px", "dp");
1489
+ if (Number.isFinite(unitValue1)) value3 = unitValue1;
1490
+ else if (value3 !== "" && Number.isFinite(Number(value3))) value3 = Number(value3);
2004
1491
  }
2005
- if (import_directStyleCSS.canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
2006
- state.flatBoxShadow = value4;
1492
+ if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
1493
+ state.flatBoxShadow = value3;
2007
1494
  state.flatBoxShadowSequence = frameSequence + 1;
2008
1495
  }
2009
- if (typeof value4 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
2010
- var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value4);
1496
+ if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
1497
+ var parsed = (0, import_parseNativeStyle.parseNativeStyle)(property, value3);
2011
1498
  if (parsed) {
2012
1499
  if (property === "textShadow") {
2013
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1500
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
2014
1501
  try {
2015
- for (var _iterator2 = parsed[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2016
- var [key, parsedValue] = _step2.value;
2017
- emitProperty(state, key, parsedValue, cursor, merge, originalValue, contextOnly);
1502
+ for (var _iterator1 = parsed[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1503
+ var [key, parsedValue] = _step1.value;
1504
+ emitProperty(state, key, parsedValue, cursor, originalValue, contextOnly);
2018
1505
  }
2019
1506
  } catch (err) {
2020
- _didIteratorError2 = true;
2021
- _iteratorError2 = err;
1507
+ _didIteratorError1 = true;
1508
+ _iteratorError1 = err;
2022
1509
  } finally {
2023
1510
  try {
2024
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1511
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
2025
1512
  } finally {
2026
- if (_didIteratorError2) throw _iteratorError2;
1513
+ if (_didIteratorError1) throw _iteratorError1;
2027
1514
  }
2028
1515
  }
2029
- } else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor, merge, originalValue, contextOnly);
1516
+ } else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor, originalValue, contextOnly);
2030
1517
  return;
2031
1518
  }
2032
1519
  }
2033
- if (property === "fontVariant" && typeof value4 === "string") {
1520
+ if (property === "fontVariant" && typeof value3 === "string") {
2034
1521
  var variants = [];
2035
1522
  var start = 0;
2036
- for (var index = 0; index <= value4.length; index++) {
2037
- var code = index === value4.length ? 32 : value4.charCodeAt(index);
1523
+ for (var index = 0; index <= value3.length; index++) {
1524
+ var code = index === value3.length ? 32 : value3.charCodeAt(index);
2038
1525
  if (code !== 44 && code > 32) continue;
2039
- if (start < index) variants.push(value4.slice(start, index));
1526
+ if (start < index) variants.push(value3.slice(start, index));
2040
1527
  start = index + 1;
2041
1528
  }
2042
- value4 = variants;
1529
+ value3 = variants;
2043
1530
  }
2044
- var expanded = state.styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(property, value4, state.conf.settings.styleCompat || "web");
1531
+ var expanded = !state.styleProps.noExpand ? (0, import_expandStyle.expandStyle)(property, value3, state.conf.settings.styleCompat || "web") : null;
2045
1532
  if (!expanded) {
2046
- emitProperty(state, property, value4, cursor, merge, originalValue, contextOnly);
1533
+ emitProperty(state, property, value3, cursor, originalValue, contextOnly);
2047
1534
  return;
2048
1535
  }
2049
1536
  if (typeof raw === "string" && expanded.length > 1) {
2050
- var parts1 = splitComponents(raw);
1537
+ var parts1 = (0, import_borderComponents.splitComponents)(raw);
2051
1538
  if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
2052
1539
  for (var index1 = 0; index1 < expanded.length; index1++) {
2053
1540
  var partIndex = index1 === 0 || parts1.length === 1 ? 0 : index1 === 1 || index1 === 3 && parts1.length < 4 ? 1 : index1 === 2 && parts1.length < 3 ? 0 : index1;
2054
- emitResolved(state, expanded[index1][0], parts1[partIndex], cursor, merge, originalValue, contextOnly);
1541
+ emitResolved(state, expanded[index1][0], parts1[partIndex], cursor, originalValue, contextOnly);
2055
1542
  }
2056
1543
  return;
2057
1544
  }
2058
1545
  }
2059
- for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor, merge, originalValue, contextOnly);
1546
+ for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor, originalValue, contextOnly);
2060
1547
  }
2061
- function contributeStyleString(state, property, source, merge, originalValue) {
2062
- var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
2063
- var directState = state;
2064
- var watermark = conditionCursorTop;
2065
- var previousCursor = directState.flatScanCursor;
2066
- var previousExpectMulti = directState.flatExpectMulti;
2067
- directState.flatScanCursor = null;
2068
- directState.flatExpectMulti = source.indexOf(":") !== -1;
2069
- try {
2070
- (0, import_runtime.scanFlatValue)(source, directStyleHandler, state, property, merge, originalValue, contextOnly);
2071
- } finally {
2072
- directState.flatScanCursor = previousCursor;
2073
- directState.flatExpectMulti = previousExpectMulti;
2074
- releaseConditionCursors(watermark);
2075
- }
2076
- return true;
2077
- }
2078
- function contributeStyleObject(state, property, value, merge, contextOnly) {
2079
- var outerState = state;
2080
- var previousExpectMulti = outerState.flatExpectMulti;
2081
- outerState.flatExpectMulti = true;
2082
- try {
2083
- return contributeStyleObjectInner(state, property, value, merge, contextOnly);
2084
- } finally {
2085
- outerState.flatExpectMulti = previousExpectMulti;
2086
- }
2087
- }
2088
- function contributeStyleObjectInner(state, property, value, merge, contextOnly) {
2089
- var _directState_flatPass;
2090
- var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
2091
- var hasDefault = "default" in value;
1548
+ function walkConditionalValue(state, property, value, parent, sink) {
1549
+ var warnMode = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0;
1550
+ var parentCondition = parent || null;
2092
1551
  var hasBase = false;
2093
- var base = hasDefault ? value.default : void 0;
2094
- if (base != null) {
2095
- emitAtParentCondition(state, property, base, merge, base, contextOnly);
2096
- hasBase = true;
2097
- }
2098
1552
  var conditions = 0;
2099
- var firstCondition = !hasDefault;
2100
- for (var key in value) {
2101
- if (key === "default") continue;
2102
- var payload = value[key];
2103
- var watermark = conditionCursorTop;
2104
- var cursor = acquireConditionCursor(parent);
2105
- resolveConditionText(state, cursor, key);
2106
- var condition = commitConditionCursor(state, cursor);
2107
- if (firstCondition) {
2108
- firstCondition = false;
2109
- if (!condition) {
2110
- releaseConditionCursors(watermark);
2111
- return false;
1553
+ var lastPayload = "";
1554
+ if (typeof value === "string") {
1555
+ var parsed = (0, import_grammarConfig.getConfigRevisionState)(state.conf).parseFlatValue(value);
1556
+ var [segments, failure, failureIndex] = parsed;
1557
+ var slices = parsedSlices.get(parsed);
1558
+ if (slices === void 0) parsedSlices.set(parsed, slices = []);
1559
+ var chainCount = segments.length / 5 - 1;
1560
+ if (property === "aspectRatio" && chainCount === 1) {
1561
+ var left = Number(value.slice(segments[7], segments[8]));
1562
+ var right = Number(value.slice(segments[5], segments[6]));
1563
+ if (left > 0 && right > 0 && Number.isFinite(left) && Number.isFinite(right)) return false;
1564
+ }
1565
+ for (var index = 0; index < segments.length; index += 5) {
1566
+ var start = segments[index];
1567
+ var end = segments[index + 1];
1568
+ var flags = segments[index + 4];
1569
+ if (!(flags & 1)) continue;
1570
+ if (start === end) continue;
1571
+ if (flags & 2) {
1572
+ var _slices, _index;
1573
+ var _;
1574
+ var payload = (_ = (_slices = slices)[_index = index]) !== null && _ !== void 0 ? _ : _slices[_index] = value.slice(start, end);
1575
+ sink(payload, parentCondition, payload);
1576
+ hasBase = true;
1577
+ } else if (process.env.NODE_ENV !== "production" && warnMode && !chainCount && (failure === "invalid-character" || failure === "stray-comment-close")) {
1578
+ sink(value, parentCondition, value);
1579
+ hasBase = true;
1580
+ } else if (warnMode) warnScanFailure(property, value, failure, failureIndex);
1581
+ }
1582
+ var lastPayloadStart = 0;
1583
+ for (var index1 = 0; index1 < segments.length; index1 += 5) {
1584
+ var _slices1, _ref;
1585
+ var start1 = segments[index1];
1586
+ var end1 = segments[index1 + 1];
1587
+ var flags1 = segments[index1 + 4];
1588
+ if (flags1 & 1) continue;
1589
+ if (!(flags1 & 4) || !(flags1 & 2)) {
1590
+ if (warnMode) warnScanFailure(property, value, failure, failureIndex);
1591
+ continue;
2112
1592
  }
1593
+ lastPayloadStart = start1;
1594
+ if (start1 === end1) {
1595
+ if (warnMode && process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, value, "a conditional clause has no value");
1596
+ continue;
1597
+ }
1598
+ var _1;
1599
+ var cursor = conditionFromKey(state, (_1 = (_slices1 = slices)[_ref = index1 + 2]) !== null && _1 !== void 0 ? _1 : _slices1[_ref] = value.slice(segments[index1 + 2], segments[index1 + 3]), parentCondition);
1600
+ conditions |= cursor[conditionValue];
1601
+ if (cursor[conditionValue] & conditionResolvedFlag || warnMode) {
1602
+ var _slices2, _index1;
1603
+ var _2;
1604
+ sink((_2 = (_slices2 = slices)[_index1 = index1]) !== null && _2 !== void 0 ? _2 : _slices2[_index1] = value.slice(start1, end1), cursor, value);
1605
+ }
1606
+ }
1607
+ if (process.env.NODE_ENV !== "production") lastPayload = value.slice(lastPayloadStart);
1608
+ } else {
1609
+ if (!value || (typeof value === "undefined" ? "undefined" : _type_of(value)) !== "object" || Array.isArray(value) || (0, import_createVariable.isVariable)(value) || !classifyConditionalObject(value, state)) return false;
1610
+ if (value.default != null) {
1611
+ sink(value.default, parentCondition, value.default);
1612
+ hasBase = true;
1613
+ }
1614
+ for (var key in value) {
1615
+ if (key === "default" || value[key] == null) continue;
1616
+ var cursor1 = conditionFromKey(state, key, parentCondition);
1617
+ conditions |= cursor1[conditionValue];
1618
+ if (cursor1[conditionValue] & conditionResolvedFlag || warnMode) sink(value[key], cursor1, value[key]);
2113
1619
  }
2114
- if (payload != null) conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
2115
- releaseConditionCursors(watermark);
2116
1620
  }
2117
- if (!hasDefault && firstCondition) return false;
2118
- if ((!import_directStyleCSS.canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
2119
- var resting = implicitLifecycleBase(property);
2120
- if (resting !== null) emitAtParentCondition(state, property, resting, merge, resting, contextOnly);
1621
+ if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && (0, import_grammarConfig.getConfigRevisionState)(state.conf).tokenCategory(property) && (0, import_borderComponents.splitComponents)(lastPayload).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
1622
+ if (warnMode === 1 && (!import_getCSSStylesAtomic.canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
1623
+ var _state_flatPropertyLayers;
1624
+ var resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
1625
+ if (resting !== null && !((_state_flatPropertyLayers = state.flatPropertyLayers) === null || _state_flatPropertyLayers === void 0 ? void 0 : _state_flatPropertyLayers.has(property))) sink(resting, parentCondition, resting);
2121
1626
  }
2122
1627
  return true;
2123
1628
  }
2124
- function contributeValue(state, property, value, merge, originalValue) {
2125
- var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false, condition = arguments.length > 6 ? arguments[6] : void 0;
2126
- if (isConditionTransport(value)) {
2127
- if (value[transportHasBase]) {
2128
- var base = value[transportBase];
2129
- contributeValue(state, property, base, merge, base, contextOnly);
2130
- }
2131
- for (var offset = transportEntries; offset < value.length;) {
2132
- var entryValue = value[offset];
2133
- var watermark = conditionCursorTop;
2134
- try {
2135
- var _state_flatPass;
2136
- emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value, offset, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null), merge, entryValue, contextOnly, 2, entryValue);
2137
- } finally {
2138
- releaseConditionCursors(watermark);
2139
- }
2140
- offset += transportEntryWidth;
2141
- }
2142
- return true;
2143
- }
1629
+ function contributeValue(state, property, value, originalValue) {
1630
+ var contextOnly = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, condition = arguments.length > 5 ? arguments[5] : void 0;
1631
+ var _state_flatPass;
2144
1632
  if (condition !== void 0) {
2145
1633
  var _directState_flatPass;
2146
1634
  var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
2147
- var watermark1 = conditionCursorTop;
2148
- try {
2149
- var effective;
2150
- if (typeof condition === "string") {
2151
- effective = acquireConditionCursor(parent);
2152
- resolveConditionText(state, effective, condition);
2153
- commitConditionCursor(state, effective);
2154
- } else if (parent) {
2155
- effective = acquireConditionCursor(parent);
2156
- var conditionKey = conditionTexts[condition + conditionKeyOffset] || "";
2157
- if (conditionKey) resolveConditionText(state, effective, conditionKey);
2158
- if (!(conditionNumbers[condition + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(effective);
2159
- commitConditionCursor(state, effective);
2160
- } else effective = condition;
2161
- var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
2162
- var objectHasDefault = isObjectValue && "default" in value;
2163
- var firstChild = isObjectValue && !objectHasDefault ? acquireConditionCursor(effective) : null;
2164
- if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
2165
- var useFirstChild = firstChild !== null;
2166
- for (var key in value) {
2167
- var payload = value[key];
2168
- if (payload == null) continue;
2169
- if (key === "default") emitUnderCondition(state, property, payload, effective, merge, payload, contextOnly, 2, payload);
2170
- else {
2171
- var keyWatermark = conditionCursorTop;
2172
- var child = useFirstChild ? firstChild : acquireConditionCursor(effective);
2173
- if (useFirstChild) useFirstChild = false;
2174
- else {
2175
- resolveConditionText(state, child, key);
2176
- commitConditionCursor(state, child);
2177
- }
2178
- emitUnderCondition(state, property, payload, child, merge, payload, contextOnly, 2, payload);
2179
- if (child !== firstChild) releaseConditionCursors(keyWatermark);
2180
- }
2181
- }
2182
- return true;
2183
- }
2184
- emitUnderCondition(state, property, value, effective, merge, originalValue, contextOnly, 2, value);
2185
- return true;
2186
- } finally {
2187
- releaseConditionCursors(watermark1);
2188
- }
1635
+ var effective;
1636
+ if (typeof condition === "string") effective = conditionFromKey(state, condition, parent);
1637
+ else if (parent) {
1638
+ effective = conditionFromKey(state, condition[conditionKey], parent);
1639
+ if (!(condition[conditionValue] & conditionResolvedFlag)) setConditionUnresolved(effective);
1640
+ commitCondition(effective);
1641
+ } else effective = condition;
1642
+ if (typeof value !== "string" && walkConditionalValue(state, property, value, effective, function(payload, cursor, source) {
1643
+ return emitUnderCondition(state, property, payload, cursor, payload, contextOnly, 2, source);
1644
+ }, 2)) return true;
1645
+ emitUnderCondition(state, property, value, effective, originalValue, contextOnly, 2, value);
1646
+ return true;
1647
+ }
1648
+ var compositeKind = 0;
1649
+ if (compositeKind > 0 && compositeKind < 6 && (typeof value === "string" && value.indexOf(":") !== -1 || value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && classifyConditionalObject(value, state))) {
1650
+ if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`conditional "${property}" needs its composite property; dropping it`);
1651
+ return true;
2189
1652
  }
2190
- if (value === "safe" && (0, import_resolveSafeArea.isSafeAreaKey)(property)) {
2191
- var expanded = (0, import_resolveSafeArea.expandSafeAreaValue)(property);
1653
+ if (value === "safe") {
1654
+ var expanded = (0, import_grammarConfig.getConfigRevisionState)(state.conf).expandSafeArea(property);
2192
1655
  if (expanded) {
2193
1656
  state.flatUsesSafeArea = true;
2194
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1657
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2195
1658
  try {
2196
- for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2197
- var [key1, resolved] = _step2.value;
2198
- emitAtParentCondition(state, key1, resolved, merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
1659
+ for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1660
+ var [key, resolved] = _step.value;
1661
+ emitAtParentCondition(state, key, resolved, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
2199
1662
  }
2200
1663
  } catch (err) {
2201
- _didIteratorError2 = true;
2202
- _iteratorError2 = err;
1664
+ _didIteratorError = true;
1665
+ _iteratorError = err;
2203
1666
  } finally {
2204
1667
  try {
2205
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
1668
+ if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
2206
1669
  } finally {
2207
- if (_didIteratorError2) throw _iteratorError2;
1670
+ if (_didIteratorError) throw _iteratorError;
2208
1671
  }
2209
1672
  }
2210
1673
  return true;
2211
1674
  }
2212
1675
  }
2213
- if (typeof value === "string") return contributeStyleString(state, property, value, merge, originalValue, contextOnly);
2214
- if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && contributeStyleObject(state, property, value, merge, contextOnly)) return true;
1676
+ if (walkConditionalValue(state, property, value, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null, function(payload, cursor, source) {
1677
+ return cursor ? emitUnderCondition(state, property, payload, cursor, void 0, contextOnly, 1, source) : emitValue(state, property, payload, null, payload, contextOnly);
1678
+ }, 1)) return true;
2215
1679
  if (value != null) {
2216
- emitAtParentCondition(state, property, value, merge, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
1680
+ emitAtParentCondition(state, property, value, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
2217
1681
  return true;
2218
1682
  }
2219
1683
  return false;
2220
1684
  }
2221
1685
  function clearDirectStyle(state, property) {
1686
+ var _direct_flatAtomics;
2222
1687
  var direct = state;
2223
- var atomicKey = property.startsWith("transition") ? "transition" : webShadowParts[property] ? "boxShadow" : webTextShadowParts.has(property) ? "textShadow" : legacyTransformParts.has(property) ? "transform" : property;
2224
- (0, import_directStyleCSS.clearFrameAtomic)(state, atomicKey);
2225
- var used = direct.flatUsed;
2226
- if (used) delete used[atomicKey];
2227
- if (atomicKey === "transform") state.transformAccumulator = void 0;
2228
- if (state.style) delete state.style[atomicKey];
2229
- delete state.classNames[atomicKey];
2230
- }
2231
- var conditionTransportTag = /* @__PURE__ */ Symbol();
2232
- var transportHasBase = 1;
2233
- var transportBase = 2;
2234
- var transportEntries = 3;
2235
- var transportEntryWidth = 2;
2236
- function isConditionTransport(value) {
2237
- return Array.isArray(value) && value[0] === conditionTransportTag;
2238
- }
2239
- function appendConditionEntry(transport, cursor, value) {
2240
- transport.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
2241
- }
2242
- function acquireTransportCursor(state, transport, offset, parent) {
2243
- var cursor = acquireConditionCursor(parent);
2244
- var key = transport[offset + 1];
2245
- if (key) resolveConditionText(state, cursor, key);
2246
- commitConditionCursor(state, cursor);
2247
- return cursor;
2248
- }
2249
- function mergeConditionTransport(state, prev, cursor, value) {
2250
- var transport;
2251
- if (isConditionTransport(prev)) transport = prev;
2252
- else {
2253
- transport = [
2254
- conditionTransportTag,
2255
- false,
2256
- void 0
2257
- ];
2258
- if (prev != null) {
2259
- var isObjectValue = (typeof prev === "undefined" ? "undefined" : _type_of(prev)) === "object" && !Array.isArray(prev) && !(0, import_createVariable.isVariable)(prev);
2260
- var objectHasDefault = isObjectValue && "default" in prev;
2261
- var authoredWatermark = conditionCursorTop;
2262
- try {
2263
- var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
2264
- if (isObjectValue && classifyConditionalObject(prev, state, void 0, firstCursor || void 0)) {
2265
- var useFirstCursor = firstCursor !== null;
2266
- for (var key in prev) {
2267
- var payload = prev[key];
2268
- if (payload == null) continue;
2269
- if (key === "default") {
2270
- transport[transportHasBase] = true;
2271
- transport[transportBase] = payload;
2272
- continue;
2273
- }
2274
- var watermark = conditionCursorTop;
2275
- var keyCursor = useFirstCursor ? firstCursor : acquireConditionCursor();
2276
- if (useFirstCursor) useFirstCursor = false;
2277
- else {
2278
- resolveConditionText(state, keyCursor, key);
2279
- commitConditionCursor(state, keyCursor);
2280
- }
2281
- appendConditionEntry(transport, keyCursor, payload);
2282
- if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
2283
- }
2284
- } else {
2285
- transport[transportHasBase] = true;
2286
- transport[transportBase] = prev;
2287
- }
2288
- } finally {
2289
- releaseConditionCursors(authoredWatermark);
1688
+ var propertyKind = (0, import_grammarConfig.getConfigRevisionState)(state.conf).propertyKind(property);
1689
+ var atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
1690
+ var slot = atomicKey;
1691
+ (_direct_flatAtomics = direct.flatAtomics) === null || _direct_flatAtomics === void 0 || _direct_flatAtomics.delete(slot);
1692
+ if (direct.flatSlots) {
1693
+ if (slot !== atomicKey) {
1694
+ var entries = direct.flatSlots.get(slot);
1695
+ if (entries) {
1696
+ for (var index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
2290
1697
  }
2291
1698
  }
1699
+ direct.flatSlots.delete(atomicKey);
2292
1700
  }
2293
- var cursorKey = conditionTexts[cursor + conditionKeyOffset] || "";
2294
- for (var offset = transportEntries; offset < transport.length; offset += transportEntryWidth) if (transport[offset + 1] === cursorKey) {
2295
- transport.splice(offset, transportEntryWidth);
2296
- break;
2297
- }
2298
- appendConditionEntry(transport, cursor, value);
2299
- return transport;
2300
- }
2301
- var variantValueHandler = {
2302
- segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
2303
- var state = ctx[0];
2304
- if (start === end) return;
2305
- if (isBase) {
2306
- if (!valid) return;
2307
- emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
2308
- return;
2309
- }
2310
- if (!valid || !chainValid) return;
2311
- var cursor = state.flatScanCursor;
2312
- if (!(cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0)) return;
2313
- emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
2314
- },
2315
- modifier(ctx, start, end, valid, first, source) {
2316
- var directState = ctx[0];
2317
- var cursor = directState.flatScanCursor;
2318
- if (!cursor) cursor = directState.flatScanCursor = acquireConditionCursor();
2319
- else if (first) resetConditionCursor(cursor, 0);
2320
- if (!valid) {
2321
- setConditionUnresolved(cursor);
2322
- return;
2323
- }
2324
- if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(ctx[0], cursor, source.slice(start, end));
2325
- },
2326
- chain(ctx, _start, _end, valid) {
2327
- var cursor = ctx[0].flatScanCursor;
2328
- if (cursor) {
2329
- if (!valid) setConditionUnresolved(cursor);
2330
- if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(ctx[0], cursor);
2331
- }
2332
- return true;
2333
- }
2334
- };
2335
- function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
2336
- var nested = nestedCondition;
2337
- var parent = parentCondition;
2338
- var resolvedCondition = nested !== null && nested !== void 0 ? nested : parent;
2339
- var watermark = conditionCursorTop;
2340
- if (nested && parent) {
2341
- var composed = acquireConditionCursor(parent);
2342
- var nestedKey = conditionTexts[nested + conditionKeyOffset] || "";
2343
- if (nestedKey) resolveConditionText(styleState, composed, nestedKey);
2344
- if (!(conditionNumbers[nested + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(composed);
2345
- commitConditionCursor(styleState, composed);
2346
- resolvedCondition = composed;
2347
- }
2348
- var conf = styleState.conf;
2349
- if (key === "fontFamily" || key === conf.inverseShorthands.fontFamily) styleState.fontFamily = getFontFamilyFromNameOrVariable(value, conf);
2350
- mapContributedProp(styleState, key, value, originalValue !== null && originalValue !== void 0 ? originalValue : fallbackOriginal, resolvedCondition);
2351
- releaseConditionCursors(watermark);
2352
- }
2353
- var contributeMappedValue = function(key, value, styleState, disabled, parentCondition, fallbackOriginal) {
2354
- if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
2355
- var { conf, styleProps } = styleState;
2356
- var variants = styleState.flatStyleStaticConfig.variants;
2357
- var { disableExpandShorthands, noExpand, resolveValues } = styleProps;
2358
- var shorthands = conf.shorthands;
2359
- if (value === "unset") {
2360
- var expandedKey = !disableExpandShorthands && shorthands[key] || key;
2361
- var expanded = noExpand ? null : (0, import_expandStyle.expandStyle)(expandedKey, value, conf.settings.styleCompat || "web");
2362
- var used = styleState.flatUsed;
2363
- if (expanded) {
2364
- var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
2365
- try {
2366
- for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2367
- var [nkey] = _step2.value;
2368
- if (used) delete used[nkey];
2369
- if (styleState.style) delete styleState.style[nkey];
2370
- }
2371
- } catch (err) {
2372
- _didIteratorError2 = true;
2373
- _iteratorError2 = err;
2374
- } finally {
2375
- try {
2376
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
2377
- } finally {
2378
- if (_didIteratorError2) throw _iteratorError2;
2379
- }
2380
- }
2381
- } else {
2382
- if (used) delete used[expandedKey];
2383
- if (styleState.style) delete styleState.style[expandedKey];
2384
- }
2385
- return;
2386
- }
2387
- if (!noExpand) {
2388
- if (variants && key in variants) {
2389
- resolveVariants(key, value, styleProps, styleState, key);
2390
- return;
2391
- }
2392
- }
2393
- if (!disableExpandShorthands) {
2394
- if (key in shorthands) key = shorthands[key];
2395
- }
2396
- var originalValue = value;
2397
- if (value === "safe" && (0, import_resolveSafeArea.isSafeAreaKey)(key)) {
2398
- var expanded1 = (0, import_resolveSafeArea.expandSafeAreaValue)(key);
2399
- if (expanded1) {
2400
- for (var i = 0; i < expanded1.length; i++) {
2401
- var [nkey1, nvalue] = expanded1[i];
2402
- emitMappedValue(styleState, nkey1, nvalue, originalValue, void 0, parentCondition, fallbackOriginal);
2403
- }
2404
- return;
2405
- }
2406
- }
2407
- if (value != null) {
2408
- if (typeof value === "string") value = (0, import_resolveRem.isRemValue)(value) ? (0, import_resolveRem.resolveRem)(value) : value;
2409
- else if ((0, import_createVariable.isVariable)(value)) value = (0, import_resolveVariableValue.resolveVariableValue)(key, value, resolveValues);
2410
- else if ((0, import_resolveRem.isRemValue)(value)) value = (0, import_resolveRem.resolveRem)(value);
2411
- }
2412
- if (value != null) {
2413
- if (key === "fontFamily" && typeof originalValue === "string") {
2414
- if (originalValue in conf.fontsParsed) styleState.fontFamily = originalValue;
2415
- }
2416
- var expanded2 = noExpand || typeof value === "string" ? null : (0, import_expandStyle.expandStyle)(key, value, conf.settings.styleCompat || "web");
2417
- if (expanded2) {
2418
- var max = expanded2.length;
2419
- for (var i1 = 0; i1 < max; i1++) {
2420
- var [nkey2, nvalue1, noriginalValue] = expanded2[i1];
2421
- emitMappedValue(styleState, nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue, void 0, parentCondition, fallbackOriginal);
2422
- }
2423
- } else emitMappedValue(styleState, key, value, originalValue, void 0, parentCondition, fallbackOriginal);
2424
- }
2425
- };
2426
- function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
2427
- var _styleState_flatStyleStaticConfig_variants;
2428
- var variantDefinition = (_styleState_flatStyleStaticConfig_variants = styleState.flatStyleStaticConfig.variants) === null || _styleState_flatStyleStaticConfig_variants === void 0 ? void 0 : _styleState_flatStyleStaticConfig_variants[key];
2429
- if (isConditionTransport(value)) {
2430
- if (value[transportHasBase]) emitResolvedVariant(key, value[transportBase], styleState, parentVariantKey, null);
2431
- for (var offset = transportEntries; offset < value.length;) {
2432
- var entryValue = value[offset];
2433
- var watermark = conditionCursorTop;
2434
- try {
2435
- emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value, offset, null));
2436
- } finally {
2437
- releaseConditionCursors(watermark);
2438
- }
2439
- offset += transportEntryWidth;
2440
- }
2441
- return;
2442
- }
2443
- if (typeof value === "string" && !(variantDefinition && (typeof variantDefinition === "undefined" ? "undefined" : _type_of(variantDefinition)) === "object" && value in variantDefinition)) {
2444
- var directState = styleState;
2445
- var watermark1 = conditionCursorTop;
2446
- var previousCursor = directState.flatScanCursor;
2447
- directState.flatScanCursor = null;
2448
- try {
2449
- (0, import_runtime.scanFlatValue)(value, variantValueHandler, [
2450
- styleState,
2451
- key,
2452
- parentVariantKey
2453
- ]);
2454
- } finally {
2455
- directState.flatScanCursor = previousCursor;
2456
- releaseConditionCursors(watermark1);
2457
- }
2458
- return;
2459
- }
2460
- var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value);
2461
- var objectHasDefault = isObjectValue && "default" in value;
2462
- var objectWatermark = conditionCursorTop;
2463
- try {
2464
- var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
2465
- if (isObjectValue && classifyConditionalObject(value, styleState, void 0, firstCursor || void 0)) {
2466
- var useFirstCursor = firstCursor !== null;
2467
- for (var objKey in value) {
2468
- var payload = value[objKey];
2469
- if (payload == null) continue;
2470
- if (objKey === "default") {
2471
- emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
2472
- continue;
2473
- }
2474
- var watermark2 = conditionCursorTop;
2475
- var cursor1 = useFirstCursor ? firstCursor : acquireConditionCursor();
2476
- conditionNumbers[cursor1 + conditionValueOffset];
2477
- if (useFirstCursor) useFirstCursor = false;
2478
- else {
2479
- resolveConditionText(styleState, cursor1, objKey);
2480
- commitConditionCursor(styleState, cursor1);
2481
- }
2482
- emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor1);
2483
- if (cursor1 !== firstCursor) releaseConditionCursors(watermark2);
2484
- }
2485
- return;
2486
- }
2487
- } finally {
2488
- releaseConditionCursors(objectWatermark);
2489
- }
2490
- emitResolvedVariant(key, value, styleState, parentVariantKey, null);
2491
- }
2492
- function emitResolvedVariant(key, value, styleState, parentVariantKey, conditionCursor) {
2493
- var { conf, debug } = styleState;
2494
- var styleProps = styleState.styleProps;
2495
- var variants = styleState.flatStyleStaticConfig.variants;
2496
- if (!variants) return;
2497
- var variant = variants[key];
2498
- var variantValue = (0, import_variantResolvers.getVariantDefinition)(variant, value, conf, styleState);
2499
- if (!variantValue) return;
2500
- if (typeof variantValue === "function") {
2501
- variantValue = variantValue(value, (0, import_getVariantExtras.getVariantExtras)(styleState));
2502
- if (process.env.NODE_ENV === "development" && debug === "verbose" && false);
2503
- }
2504
- if (!(0, import_isObj.isObj)(variantValue)) return;
2505
- if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
2506
- var { noSkip } = styleProps;
2507
- var originals = import_styleOriginalValues.styleOriginalValues.get(variantValue);
2508
- for (var outputKey in variantValue) {
2509
- if (!noSkip && outputKey in import_skipProps.skipProps) continue;
2510
- var rawOutputValue = variantValue[outputKey];
2511
- var outputValue = styleProps.noNormalize ? rawOutputValue : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(rawOutputValue, conf.shorthands[outputKey] || outputKey);
2512
- var _originals_outputKey;
2513
- var originalValue = (_originals_outputKey = originals === null || originals === void 0 ? void 0 : originals[outputKey]) !== null && _originals_outputKey !== void 0 ? _originals_outputKey : rawOutputValue;
2514
- var contextPropSet = styleState.flatStyleStaticConfig.styledContextKeys;
2515
- if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(outputKey)) {
2516
- var _styleState, _styleState1;
2517
- (_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
2518
- styleState.overriddenContextProps[outputKey] = originalValue;
2519
- (_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {});
2520
- styleState.originalContextPropValues[outputKey] = originalValue;
2521
- }
2522
- contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
2523
- }
1701
+ if (atomicKey === "transform") state.transformAccumulator = void 0;
1702
+ if (state.style) delete state.style[atomicKey];
1703
+ delete state.classNames[atomicKey];
1704
+ delete state.classNames[slot];
1705
+ }
1706
+ function emitVariantStyle(state, key, value, original, condition, disabled) {
1707
+ var _state_flatCallerVariantKeys, _state_flatStyleStaticConfig_styledContextKeys;
1708
+ var pass = state.flatPass;
1709
+ if (key !== pass[passMapSourceKey] && ((_state_flatCallerVariantKeys = state.flatCallerVariantKeys) === null || _state_flatCallerVariantKeys === void 0 ? void 0 : _state_flatCallerVariantKeys.has(key))) return;
1710
+ if ((_state_flatStyleStaticConfig_styledContextKeys = state.flatStyleStaticConfig.styledContextKeys) === null || _state_flatStyleStaticConfig_styledContextKeys === void 0 ? void 0 : _state_flatStyleStaticConfig_styledContextKeys.has(key)) {
1711
+ var _state, _state1;
1712
+ ((_state = state).overriddenContextProps || (_state.overriddenContextProps = {}))[key] = ((_state1 = state).originalContextPropValues || (_state1.originalContextPropValues = {}))[key] = original;
1713
+ }
1714
+ var parent = pass[passParentCursor];
1715
+ pass[passParentCursor] = condition;
1716
+ contributeProp(pass, key, value, original, disabled);
1717
+ pass[passParentCursor] = parent;
2524
1718
  }
2525
1719
  function getFontFamilyFromNameOrVariable(input, conf) {
2526
1720
  if ((0, import_createVariable.isVariable)(input)) {