@pibbl/core 0.0.2 → 0.0.3-alpha.109.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 (549) hide show
  1. package/THIRD_PARTY_NOTICES.txt +81 -0
  2. package/dist/features/physics/2d-testing.d.ts +1 -1
  3. package/dist/features/physics/2d-testing.js +2 -2
  4. package/dist/features/physics/2d-testing.js.map +2 -2
  5. package/dist/features/physics/lib/2d/canvas/components.js +25 -21
  6. package/dist/features/physics/lib/2d/canvas/components.js.map +2 -2
  7. package/dist/features/physics/lib/2d/canvas/presentation.js +1 -2
  8. package/dist/features/physics/lib/2d/canvas/presentation.js.map +2 -2
  9. package/dist/features/physics/lib/2d/collision/casts.js +4 -2
  10. package/dist/features/physics/lib/2d/collision/casts.js.map +2 -2
  11. package/dist/features/physics/lib/2d/runtime/controller.js +1 -1
  12. package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
  13. package/dist/features/physics/lib/2d/runtime/obstacles.js +9 -11
  14. package/dist/features/physics/lib/2d/runtime/obstacles.js.map +2 -2
  15. package/dist/features/physics/lib/2d/shapes.js +8 -9
  16. package/dist/features/physics/lib/2d/shapes.js.map +2 -2
  17. package/dist/features/physics/lib/2d/world/rapier.js +22 -26
  18. package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
  19. package/dist/features/sprites/loader.js +6 -3
  20. package/dist/features/sprites/loader.js.map +2 -2
  21. package/dist/features/textures/index.d.ts +12 -2
  22. package/dist/features/textures/index.js +33 -1
  23. package/dist/features/textures/index.js.map +2 -2
  24. package/dist/features/textures/lib/chemical-field.d.ts +56 -0
  25. package/dist/features/textures/lib/chemical-field.js +154 -0
  26. package/dist/features/textures/lib/chemical-field.js.map +7 -0
  27. package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
  28. package/dist/features/textures/lib/chemical-recipes.js +275 -0
  29. package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
  30. package/dist/features/textures/lib/definitions.d.ts +3 -18
  31. package/dist/features/textures/lib/definitions.js +17 -24
  32. package/dist/features/textures/lib/definitions.js.map +2 -2
  33. package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
  34. package/dist/features/textures/lib/geometric-patterns.js +305 -0
  35. package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
  36. package/dist/features/textures/lib/gray-scott.d.ts +55 -0
  37. package/dist/features/textures/lib/gray-scott.js +37 -0
  38. package/dist/features/textures/lib/gray-scott.js.map +7 -0
  39. package/dist/features/textures/lib/palette.js +1 -3
  40. package/dist/features/textures/lib/palette.js.map +2 -2
  41. package/dist/features/textures/lib/patterns.d.ts +123 -0
  42. package/dist/features/textures/lib/patterns.js +344 -0
  43. package/dist/features/textures/lib/patterns.js.map +7 -0
  44. package/dist/features/textures/lib/rain-drops.js +2 -1
  45. package/dist/features/textures/lib/rain-drops.js.map +2 -2
  46. package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
  47. package/dist/features/textures/lib/reaction-diffusion.js +9 -20
  48. package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
  49. package/dist/features/textures/lib/simulation.d.ts +10 -4
  50. package/dist/features/textures/lib/simulation.js +23 -13
  51. package/dist/features/textures/lib/simulation.js.map +2 -2
  52. package/dist/features/textures/lib/wasm/electric.js +8 -1
  53. package/dist/features/textures/lib/wasm/electric.js.map +2 -2
  54. package/dist/features/textures/lib/water-surface.js +1 -3
  55. package/dist/features/textures/lib/water-surface.js.map +2 -2
  56. package/dist/features/viz/index.d.ts +68 -6
  57. package/dist/features/viz/index.js +164 -2
  58. package/dist/features/viz/index.js.map +2 -2
  59. package/dist/features/viz/inspection/bar.d.ts +79 -0
  60. package/dist/features/viz/inspection/bar.js +49 -0
  61. package/dist/features/viz/inspection/bar.js.map +7 -0
  62. package/dist/features/viz/inspection/candle.d.ts +156 -0
  63. package/dist/features/viz/inspection/candle.js +120 -0
  64. package/dist/features/viz/inspection/candle.js.map +7 -0
  65. package/dist/features/viz/inspection/capture-types.d.ts +65 -0
  66. package/dist/features/viz/inspection/capture.d.ts +16 -0
  67. package/dist/features/viz/inspection/capture.js +49 -0
  68. package/dist/features/viz/inspection/capture.js.map +7 -0
  69. package/dist/features/viz/inspection/handler.d.ts +36 -0
  70. package/dist/features/viz/inspection/handler.js +91 -0
  71. package/dist/features/viz/inspection/handler.js.map +7 -0
  72. package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
  73. package/dist/features/viz/inspection/ohlc-bar.js +118 -0
  74. package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
  75. package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
  76. package/dist/features/viz/inspection/owned-ref.js +99 -0
  77. package/dist/features/viz/inspection/owned-ref.js.map +7 -0
  78. package/dist/features/viz/inspection/painted-point.d.ts +22 -0
  79. package/dist/features/viz/inspection/painted-point.js +29 -0
  80. package/dist/features/viz/inspection/painted-point.js.map +7 -0
  81. package/dist/features/viz/inspection/queries.d.ts +100 -0
  82. package/dist/features/viz/inspection/queries.js +192 -0
  83. package/dist/features/viz/inspection/queries.js.map +7 -0
  84. package/dist/features/viz/inspection/query-types.d.ts +177 -0
  85. package/dist/features/viz/inspection/volume.d.ts +104 -0
  86. package/dist/features/viz/inspection/volume.js +95 -0
  87. package/dist/features/viz/inspection/volume.js.map +7 -0
  88. package/dist/features/viz/inspection.d.ts +19 -0
  89. package/dist/features/viz/inspection.js +54 -0
  90. package/dist/features/viz/inspection.js.map +7 -0
  91. package/dist/features/viz/inspection.mjs +1 -0
  92. package/dist/features/viz/lib/area-series.d.ts +62 -0
  93. package/dist/features/viz/lib/area-series.js +120 -0
  94. package/dist/features/viz/lib/area-series.js.map +7 -0
  95. package/dist/features/viz/lib/axis-title.js +2 -1
  96. package/dist/features/viz/lib/axis-title.js.map +2 -2
  97. package/dist/features/viz/lib/axis.js +1 -1
  98. package/dist/features/viz/lib/axis.js.map +2 -2
  99. package/dist/features/viz/lib/bar-series.d.ts +3 -1
  100. package/dist/features/viz/lib/bar-series.js +16 -1
  101. package/dist/features/viz/lib/bar-series.js.map +2 -2
  102. package/dist/features/viz/lib/baseline-series.d.ts +55 -0
  103. package/dist/features/viz/lib/baseline-series.js +136 -0
  104. package/dist/features/viz/lib/baseline-series.js.map +7 -0
  105. package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
  106. package/dist/features/viz/lib/candlestick-series.js +150 -0
  107. package/dist/features/viz/lib/candlestick-series.js.map +7 -0
  108. package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
  109. package/dist/features/viz/lib/censored-point-series.js +129 -0
  110. package/dist/features/viz/lib/censored-point-series.js.map +7 -0
  111. package/dist/features/viz/lib/color-context.d.ts +4 -0
  112. package/dist/features/viz/lib/color-context.js +41 -0
  113. package/dist/features/viz/lib/color-context.js.map +7 -0
  114. package/dist/features/viz/lib/color-math.d.ts +4 -0
  115. package/dist/features/viz/lib/color-math.js +31 -0
  116. package/dist/features/viz/lib/color-math.js.map +7 -0
  117. package/dist/features/viz/lib/color-types.d.ts +53 -0
  118. package/dist/features/viz/lib/curve-definition.d.ts +49 -0
  119. package/dist/features/viz/lib/curve-definition.js +142 -0
  120. package/dist/features/viz/lib/curve-definition.js.map +7 -0
  121. package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
  122. package/dist/features/viz/lib/diverging-color-scale.js +51 -0
  123. package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
  124. package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
  125. package/dist/features/viz/lib/domain-navigation.js +77 -0
  126. package/dist/features/viz/lib/domain-navigation.js.map +7 -0
  127. package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
  128. package/dist/features/viz/lib/editable-chart-elements.js +733 -0
  129. package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
  130. package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
  131. package/dist/features/viz/lib/financial-aggregation.js +116 -0
  132. package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
  133. package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
  134. package/dist/features/viz/lib/financial-autoscale.js +61 -0
  135. package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
  136. package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
  137. package/dist/features/viz/lib/financial-comparison.js +98 -0
  138. package/dist/features/viz/lib/financial-comparison.js.map +7 -0
  139. package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
  140. package/dist/features/viz/lib/financial-geometry.js +67 -0
  141. package/dist/features/viz/lib/financial-geometry.js.map +7 -0
  142. package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
  143. package/dist/features/viz/lib/financial-indicators.js +135 -0
  144. package/dist/features/viz/lib/financial-indicators.js.map +7 -0
  145. package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
  146. package/dist/features/viz/lib/financial-oscillators.js +265 -0
  147. package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
  148. package/dist/features/viz/lib/graph/bipartite.d.ts +14 -0
  149. package/dist/features/viz/lib/graph/bipartite.js +250 -0
  150. package/dist/features/viz/lib/graph/bipartite.js.map +7 -0
  151. package/dist/features/viz/lib/graph/chord.d.ts +44 -0
  152. package/dist/features/viz/lib/graph/chord.js +348 -0
  153. package/dist/features/viz/lib/graph/chord.js.map +7 -0
  154. package/dist/features/viz/lib/graph/dependency.d.ts +26 -0
  155. package/dist/features/viz/lib/graph/dependency.js +140 -0
  156. package/dist/features/viz/lib/graph/dependency.js.map +7 -0
  157. package/dist/features/viz/lib/graph/force.d.ts +28 -0
  158. package/dist/features/viz/lib/graph/force.js +580 -0
  159. package/dist/features/viz/lib/graph/force.js.map +7 -0
  160. package/dist/features/viz/lib/graph/hierarchy.d.ts +21 -0
  161. package/dist/features/viz/lib/graph/hierarchy.js +112 -0
  162. package/dist/features/viz/lib/graph/hierarchy.js.map +7 -0
  163. package/dist/features/viz/lib/graph/icicle.d.ts +16 -0
  164. package/dist/features/viz/lib/graph/icicle.js +153 -0
  165. package/dist/features/viz/lib/graph/icicle.js.map +7 -0
  166. package/dist/features/viz/lib/graph/matrix.d.ts +30 -0
  167. package/dist/features/viz/lib/graph/matrix.js +243 -0
  168. package/dist/features/viz/lib/graph/matrix.js.map +7 -0
  169. package/dist/features/viz/lib/graph/neighborhood.d.ts +11 -0
  170. package/dist/features/viz/lib/graph/neighborhood.js +281 -0
  171. package/dist/features/viz/lib/graph/neighborhood.js.map +7 -0
  172. package/dist/features/viz/lib/graph/routes.d.ts +35 -0
  173. package/dist/features/viz/lib/graph/routes.js +101 -0
  174. package/dist/features/viz/lib/graph/routes.js.map +7 -0
  175. package/dist/features/viz/lib/graph/sankey.d.ts +44 -0
  176. package/dist/features/viz/lib/graph/sankey.js +341 -0
  177. package/dist/features/viz/lib/graph/sankey.js.map +7 -0
  178. package/dist/features/viz/lib/graph/shared.d.ts +59 -0
  179. package/dist/features/viz/lib/graph/shared.js +301 -0
  180. package/dist/features/viz/lib/graph/shared.js.map +7 -0
  181. package/dist/features/viz/lib/graph/tree.d.ts +11 -0
  182. package/dist/features/viz/lib/graph/tree.js +232 -0
  183. package/dist/features/viz/lib/graph/tree.js.map +7 -0
  184. package/dist/features/viz/lib/graph/treemap.d.ts +20 -0
  185. package/dist/features/viz/lib/graph/treemap.js +227 -0
  186. package/dist/features/viz/lib/graph/treemap.js.map +7 -0
  187. package/dist/features/viz/lib/graph/types.d.ts +1097 -0
  188. package/dist/features/viz/lib/hover-card.js +8 -9
  189. package/dist/features/viz/lib/hover-card.js.map +2 -2
  190. package/dist/features/viz/lib/hover-data.d.ts +1 -1
  191. package/dist/features/viz/lib/hover-data.js +5 -2
  192. package/dist/features/viz/lib/hover-data.js.map +2 -2
  193. package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
  194. package/dist/features/viz/lib/interval-band-series.js +136 -0
  195. package/dist/features/viz/lib/interval-band-series.js.map +7 -0
  196. package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
  197. package/dist/features/viz/lib/interval-diamond-series.js +122 -0
  198. package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
  199. package/dist/features/viz/lib/interval-series.d.ts +79 -0
  200. package/dist/features/viz/lib/interval-series.js +158 -0
  201. package/dist/features/viz/lib/interval-series.js.map +7 -0
  202. package/dist/features/viz/lib/layout-pie.js +9 -13
  203. package/dist/features/viz/lib/layout-pie.js.map +2 -2
  204. package/dist/features/viz/lib/line-series.d.ts +1 -1
  205. package/dist/features/viz/lib/line-series.js +47 -28
  206. package/dist/features/viz/lib/line-series.js.map +2 -2
  207. package/dist/features/viz/lib/linear-scale.js +1 -1
  208. package/dist/features/viz/lib/linear-scale.js.map +2 -2
  209. package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
  210. package/dist/features/viz/lib/monotone-curve.js +63 -0
  211. package/dist/features/viz/lib/monotone-curve.js.map +7 -0
  212. package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
  213. package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
  214. package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
  215. package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
  216. package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
  217. package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
  218. package/dist/features/viz/lib/paired-series.d.ts +44 -0
  219. package/dist/features/viz/lib/paired-series.js +93 -0
  220. package/dist/features/viz/lib/paired-series.js.map +7 -0
  221. package/dist/features/viz/lib/pie-layout.js +2 -1
  222. package/dist/features/viz/lib/pie-layout.js.map +2 -2
  223. package/dist/features/viz/lib/plot-series.js +11 -6
  224. package/dist/features/viz/lib/plot-series.js.map +2 -2
  225. package/dist/features/viz/lib/plot-types.d.ts +4 -3
  226. package/dist/features/viz/lib/point-series.d.ts +1 -1
  227. package/dist/features/viz/lib/point-series.js +36 -9
  228. package/dist/features/viz/lib/point-series.js.map +2 -2
  229. package/dist/features/viz/lib/point-types.d.ts +5 -2
  230. package/dist/features/viz/lib/reference-band.js +4 -1
  231. package/dist/features/viz/lib/reference-band.js.map +2 -2
  232. package/dist/features/viz/lib/scale-context.d.ts +1 -1
  233. package/dist/features/viz/lib/scale-ticks.js +21 -6
  234. package/dist/features/viz/lib/scale-ticks.js.map +2 -2
  235. package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
  236. package/dist/features/viz/lib/sequential-color-scale.js +49 -0
  237. package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
  238. package/dist/features/viz/lib/series-position.d.ts +12 -0
  239. package/dist/features/viz/lib/series-position.js +44 -0
  240. package/dist/features/viz/lib/series-position.js.map +7 -0
  241. package/dist/features/viz/lib/step-curves.d.ts +19 -0
  242. package/dist/features/viz/lib/step-curves.js +53 -0
  243. package/dist/features/viz/lib/step-curves.js.map +7 -0
  244. package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
  245. package/dist/features/viz/lib/threshold-color-scale.js +59 -0
  246. package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
  247. package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
  248. package/dist/features/viz/lib/trading-time-mapping.js +89 -0
  249. package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
  250. package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
  251. package/dist/features/viz/lib/trading-time-scale.js +96 -0
  252. package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
  253. package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
  254. package/dist/features/viz/lib/trajectory-series.js +111 -0
  255. package/dist/features/viz/lib/trajectory-series.js.map +7 -0
  256. package/dist/features/viz/lib/types.d.ts +20 -4
  257. package/dist/features/viz/lib/use-continuous-scale.js +6 -1
  258. package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
  259. package/dist/features/viz/lib/utc-scale.js +11 -10
  260. package/dist/features/viz/lib/utc-scale.js.map +2 -2
  261. package/dist/features/viz/lib/volume-series.d.ts +59 -0
  262. package/dist/features/viz/lib/volume-series.js +117 -0
  263. package/dist/features/viz/lib/volume-series.js.map +7 -0
  264. package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
  265. package/dist/features/viz/lib/weighted-point-series.js +169 -0
  266. package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
  267. package/dist/filters/backdrop-contrast-gpu.d.ts +5 -0
  268. package/dist/filters/backdrop-contrast-gpu.js +33 -0
  269. package/dist/filters/backdrop-contrast-gpu.js.map +7 -0
  270. package/dist/filters/backdrop-contrast.d.ts +21 -0
  271. package/dist/filters/backdrop-contrast.js +61 -0
  272. package/dist/filters/backdrop-contrast.js.map +7 -0
  273. package/dist/filters/displacement.js +1 -1
  274. package/dist/filters/displacement.js.map +2 -2
  275. package/dist/filters/emboss-gpu.d.ts +4 -0
  276. package/dist/filters/emboss-gpu.js +39 -0
  277. package/dist/filters/emboss-gpu.js.map +7 -0
  278. package/dist/filters/emboss.d.ts +32 -0
  279. package/dist/filters/emboss.js +104 -0
  280. package/dist/filters/emboss.js.map +7 -0
  281. package/dist/filters/filter-executor.d.ts +11 -4
  282. package/dist/filters/filter-executor.js +104 -49
  283. package/dist/filters/filter-executor.js.map +2 -2
  284. package/dist/filters/reflected-light.js +1 -1
  285. package/dist/filters/reflected-light.js.map +2 -2
  286. package/dist/filters/reflection-gpu.d.ts +3 -1
  287. package/dist/filters/reflection-gpu.js +5 -2
  288. package/dist/filters/reflection-gpu.js.map +2 -2
  289. package/dist/filters/render-backdrop-contrast-boundary.d.ts +31 -0
  290. package/dist/filters/render-backdrop-contrast-boundary.js +116 -0
  291. package/dist/filters/render-backdrop-contrast-boundary.js.map +7 -0
  292. package/dist/filters/render-emboss-boundary.d.ts +13 -0
  293. package/dist/filters/render-emboss-boundary.js +131 -0
  294. package/dist/filters/render-emboss-boundary.js.map +7 -0
  295. package/dist/filters.d.ts +9 -5
  296. package/dist/filters.js +4 -0
  297. package/dist/filters.js.map +2 -2
  298. package/dist/index.d.ts +9 -5
  299. package/dist/index.js +18 -2
  300. package/dist/index.js.map +2 -2
  301. package/dist/internal.d.ts +4 -0
  302. package/dist/internal.js +6 -0
  303. package/dist/internal.js.map +2 -2
  304. package/dist/layout-kernel.d.ts +12 -0
  305. package/dist/layout-kernel.js +11 -0
  306. package/dist/layout-kernel.js.map +7 -0
  307. package/dist/layout-kernel.mjs +1 -0
  308. package/dist/lib/backend/types.d.ts +13 -1
  309. package/dist/lib/backend/types.js.map +2 -2
  310. package/dist/lib/components/arc-geometry.js +2 -1
  311. package/dist/lib/components/arc-geometry.js.map +2 -2
  312. package/dist/lib/components/g.js +2 -0
  313. package/dist/lib/components/g.js.map +2 -2
  314. package/dist/lib/components/html-box.js +2 -1
  315. package/dist/lib/components/html-box.js.map +2 -2
  316. package/dist/lib/components/img.js +3 -3
  317. package/dist/lib/components/img.js.map +2 -2
  318. package/dist/lib/components/layer.js +98 -16
  319. package/dist/lib/components/layer.js.map +3 -3
  320. package/dist/lib/components/text.d.ts +16 -0
  321. package/dist/lib/components/text.js +131 -24
  322. package/dist/lib/components/text.js.map +2 -2
  323. package/dist/lib/define-primitive.d.ts +4 -2
  324. package/dist/lib/define-primitive.js +3 -1
  325. package/dist/lib/define-primitive.js.map +2 -2
  326. package/dist/lib/element/metadata.d.ts +9 -0
  327. package/dist/lib/element/metadata.js +19 -0
  328. package/dist/lib/element/metadata.js.map +2 -2
  329. package/dist/lib/element/resolve-primitive-inputs.d.ts +2 -0
  330. package/dist/lib/element/resolve-primitive-inputs.js +17 -4
  331. package/dist/lib/element/resolve-primitive-inputs.js.map +2 -2
  332. package/dist/lib/events/event-facade.d.ts +18 -0
  333. package/dist/lib/events/event-facade.js +28 -2
  334. package/dist/lib/events/event-facade.js.map +2 -2
  335. package/dist/lib/events/hit-test.js +2 -1
  336. package/dist/lib/events/hit-test.js.map +2 -2
  337. package/dist/lib/events/propagation.d.ts +2 -1
  338. package/dist/lib/events/propagation.js +22 -16
  339. package/dist/lib/events/propagation.js.map +2 -2
  340. package/dist/lib/events/registrations.d.ts +10 -0
  341. package/dist/lib/events/registrations.js +160 -5
  342. package/dist/lib/events/registrations.js.map +2 -2
  343. package/dist/lib/execute-render.js +25 -1
  344. package/dist/lib/execute-render.js.map +2 -2
  345. package/dist/lib/filter/filter-region.js +3 -10
  346. package/dist/lib/filter/filter-region.js.map +2 -2
  347. package/dist/lib/focus/focus-manager.d.ts +8 -1
  348. package/dist/lib/focus/focus-manager.js +87 -43
  349. package/dist/lib/focus/focus-manager.js.map +2 -2
  350. package/dist/lib/focus/geometry.d.ts +2 -0
  351. package/dist/lib/focus/geometry.js +6 -0
  352. package/dist/lib/focus/geometry.js.map +2 -2
  353. package/dist/lib/geometry/path-bend-guide.js +1 -1
  354. package/dist/lib/geometry/path-bend-guide.js.map +2 -2
  355. package/dist/lib/geometry/path-geometry.js +12 -11
  356. package/dist/lib/geometry/path-geometry.js.map +2 -2
  357. package/dist/lib/geometry/path-transforms.js +17 -21
  358. package/dist/lib/geometry/path-transforms.js.map +2 -2
  359. package/dist/lib/geometry/path-warp-bezier.js +3 -1
  360. package/dist/lib/geometry/path-warp-bezier.js.map +2 -2
  361. package/dist/lib/geometry/path-warp.js +1 -1
  362. package/dist/lib/geometry/path-warp.js.map +2 -2
  363. package/dist/lib/global-state.js +2 -0
  364. package/dist/lib/global-state.js.map +2 -2
  365. package/dist/lib/html/html-events.d.ts +32 -0
  366. package/dist/lib/html/html-events.js +179 -0
  367. package/dist/lib/html/html-events.js.map +7 -0
  368. package/dist/lib/html/html-service.d.ts +8 -2
  369. package/dist/lib/html/html-service.js +198 -65
  370. package/dist/lib/html/html-service.js.map +2 -2
  371. package/dist/lib/html/overlay-config.js +7 -6
  372. package/dist/lib/html/overlay-config.js.map +2 -2
  373. package/dist/lib/html/types.d.ts +29 -2
  374. package/dist/lib/layout/absolute.d.ts +11 -5
  375. package/dist/lib/layout/absolute.js +329 -55
  376. package/dist/lib/layout/absolute.js.map +3 -3
  377. package/dist/lib/layout/allocation-checkpoint-owner.d.ts +11 -0
  378. package/dist/lib/layout/allocation-checkpoint-owner.js +86 -0
  379. package/dist/lib/layout/allocation-checkpoint-owner.js.map +7 -0
  380. package/dist/lib/layout/allocation-checkpoint.d.ts +53 -0
  381. package/dist/lib/layout/allocation-checkpoint.js +463 -0
  382. package/dist/lib/layout/allocation-checkpoint.js.map +7 -0
  383. package/dist/lib/layout/allocation-dependencies.d.ts +30 -0
  384. package/dist/lib/layout/allocation-dependencies.js +90 -0
  385. package/dist/lib/layout/allocation-dependencies.js.map +7 -0
  386. package/dist/lib/layout/allocation-revision.d.ts +13 -0
  387. package/dist/lib/layout/allocation-revision.js +67 -0
  388. package/dist/lib/layout/allocation-revision.js.map +7 -0
  389. package/dist/lib/layout/box-insets.d.ts +17 -0
  390. package/dist/lib/layout/box-insets.js +138 -0
  391. package/dist/lib/layout/box-insets.js.map +7 -0
  392. package/dist/lib/layout/box-sizing.d.ts +16 -0
  393. package/dist/lib/layout/box-sizing.js +77 -0
  394. package/dist/lib/layout/box-sizing.js.map +7 -0
  395. package/dist/lib/layout/box.js +42 -12
  396. package/dist/lib/layout/box.js.map +2 -2
  397. package/dist/lib/layout/canvas-measurement.d.ts +13 -0
  398. package/dist/lib/layout/canvas-measurement.js +57 -0
  399. package/dist/lib/layout/canvas-measurement.js.map +7 -0
  400. package/dist/lib/layout/context.d.ts +35 -6
  401. package/dist/lib/layout/context.js +72 -3
  402. package/dist/lib/layout/context.js.map +2 -2
  403. package/dist/lib/layout/define-layout-component.d.ts +23 -0
  404. package/dist/lib/layout/define-layout-component.js +84 -0
  405. package/dist/lib/layout/define-layout-component.js.map +7 -0
  406. package/dist/lib/layout/flex-allocation-cache.d.ts +42 -0
  407. package/dist/lib/layout/flex-baseline-mode.d.ts +2 -0
  408. package/dist/lib/layout/flex-baseline-mode.js +7 -0
  409. package/dist/lib/layout/flex-baseline-mode.js.map +7 -0
  410. package/dist/lib/layout/flex.d.ts +50 -15
  411. package/dist/lib/layout/flex.js +2124 -195
  412. package/dist/lib/layout/flex.js.map +3 -3
  413. package/dist/lib/layout/flow.js +225 -49
  414. package/dist/lib/layout/flow.js.map +2 -2
  415. package/dist/lib/layout/geometry-publication.d.ts +53 -0
  416. package/dist/lib/layout/geometry-publication.js +244 -0
  417. package/dist/lib/layout/geometry-publication.js.map +7 -0
  418. package/dist/lib/layout/grid-kernel.d.ts +63 -0
  419. package/dist/lib/layout/grid-kernel.js +168 -0
  420. package/dist/lib/layout/grid-kernel.js.map +7 -0
  421. package/dist/lib/layout/grid.d.ts +63 -4
  422. package/dist/lib/layout/grid.js +767 -171
  423. package/dist/lib/layout/grid.js.map +3 -3
  424. package/dist/lib/layout/measure.d.ts +55 -3
  425. package/dist/lib/layout/measure.js +448 -15
  426. package/dist/lib/layout/measure.js.map +2 -2
  427. package/dist/lib/layout/overlay.js +81 -23
  428. package/dist/lib/layout/overlay.js.map +2 -2
  429. package/dist/lib/layout/participation.d.ts +27 -0
  430. package/dist/lib/layout/participation.js +188 -0
  431. package/dist/lib/layout/participation.js.map +7 -0
  432. package/dist/lib/layout/place-child.js +1 -1
  433. package/dist/lib/layout/place-child.js.map +2 -2
  434. package/dist/lib/layout/positioning-diagnostics.d.ts +1 -1
  435. package/dist/lib/layout/positioning-diagnostics.js +13 -2
  436. package/dist/lib/layout/positioning-diagnostics.js.map +2 -2
  437. package/dist/lib/layout/prepared-root.d.ts +121 -0
  438. package/dist/lib/layout/prepared-root.js +360 -0
  439. package/dist/lib/layout/prepared-root.js.map +7 -0
  440. package/dist/lib/layout/standalone-kernel.d.ts +60 -0
  441. package/dist/lib/layout/standalone-kernel.js +722 -0
  442. package/dist/lib/layout/standalone-kernel.js.map +7 -0
  443. package/dist/lib/layout/topology.d.ts +21 -0
  444. package/dist/lib/layout/topology.js +113 -0
  445. package/dist/lib/layout/topology.js.map +7 -0
  446. package/dist/lib/layout/types.d.ts +5 -0
  447. package/dist/lib/layout/wasm/artifact.d.ts +1 -0
  448. package/dist/lib/layout/wasm/artifact.js +5 -0
  449. package/dist/lib/layout/wasm/artifact.js.map +7 -0
  450. package/dist/lib/layout/wasm/bytes.d.ts +1 -0
  451. package/dist/lib/layout/wasm/bytes.js +5 -0
  452. package/dist/lib/layout/wasm/bytes.js.map +7 -0
  453. package/dist/lib/layout/wasm/embedded.d.ts +2 -0
  454. package/dist/lib/layout/wasm/embedded.js +12 -0
  455. package/dist/lib/layout/wasm/embedded.js.map +7 -0
  456. package/dist/lib/layout/wasm/layout.wasm +0 -0
  457. package/dist/lib/layout/wasm/module.d.ts +8 -0
  458. package/dist/lib/layout/wasm/module.js +70 -0
  459. package/dist/lib/layout/wasm/module.js.map +7 -0
  460. package/dist/lib/layout/wasm/region.d.ts +267 -0
  461. package/dist/lib/layout/wasm/region.js +1018 -0
  462. package/dist/lib/layout/wasm/region.js.map +7 -0
  463. package/dist/lib/manipulation/controller.js +4 -7
  464. package/dist/lib/manipulation/controller.js.map +2 -2
  465. package/dist/lib/manipulation/frame.js +1 -1
  466. package/dist/lib/manipulation/frame.js.map +2 -2
  467. package/dist/lib/manipulation/handles.js +32 -33
  468. package/dist/lib/manipulation/handles.js.map +2 -2
  469. package/dist/lib/manipulation/solve.js +12 -10
  470. package/dist/lib/manipulation/solve.js.map +2 -2
  471. package/dist/lib/mount-pibbl.js +1 -0
  472. package/dist/lib/mount-pibbl.js.map +2 -2
  473. package/dist/lib/mount-prepared-pibbl.d.ts +5 -0
  474. package/dist/lib/mount-prepared-pibbl.js +29 -0
  475. package/dist/lib/mount-prepared-pibbl.js.map +7 -0
  476. package/dist/lib/mount-request.d.ts +8 -0
  477. package/dist/lib/mount-request.js +41 -0
  478. package/dist/lib/mount-request.js.map +7 -0
  479. package/dist/lib/pibbl.d.ts +21 -13
  480. package/dist/lib/pibbl.js +18 -16
  481. package/dist/lib/pibbl.js.map +2 -2
  482. package/dist/lib/recording/recording.d.ts +43 -0
  483. package/dist/lib/recording/recording.js +555 -0
  484. package/dist/lib/recording/recording.js.map +7 -0
  485. package/dist/lib/recording/types.d.ts +118 -0
  486. package/dist/lib/recording/wasm-bytes.d.ts +1 -0
  487. package/dist/lib/recording/wasm-bytes.js +5 -0
  488. package/dist/lib/recording/wasm-bytes.js.map +7 -0
  489. package/dist/lib/recording/worker-source.d.ts +1 -0
  490. package/dist/lib/recording/worker-source.js +5 -0
  491. package/dist/lib/recording/worker-source.js.map +7 -0
  492. package/dist/lib/render-layer/controller.d.ts +9 -3
  493. package/dist/lib/render-layer/controller.js +259 -110
  494. package/dist/lib/render-layer/controller.js.map +2 -2
  495. package/dist/lib/render-transaction.d.ts +12 -2
  496. package/dist/lib/render-transaction.js +69 -1
  497. package/dist/lib/render-transaction.js.map +2 -2
  498. package/dist/lib/render.js +32 -8
  499. package/dist/lib/render.js.map +2 -2
  500. package/dist/lib/scheduler/realm-scheduler.d.ts +2 -0
  501. package/dist/lib/scheduler/realm-scheduler.js +55 -26
  502. package/dist/lib/scheduler/realm-scheduler.js.map +2 -2
  503. package/dist/lib/scheduler/renderer-participant.js +1 -0
  504. package/dist/lib/scheduler/renderer-participant.js.map +2 -2
  505. package/dist/lib/series-inspection-frame.d.ts +18 -0
  506. package/dist/lib/series-inspection-frame.js +70 -0
  507. package/dist/lib/series-inspection-frame.js.map +7 -0
  508. package/dist/lib/signals/edge.d.ts +7 -4
  509. package/dist/lib/signals/edge.js +25 -3
  510. package/dist/lib/signals/edge.js.map +2 -2
  511. package/dist/lib/signals/graph.d.ts +16 -2
  512. package/dist/lib/signals/graph.js +54 -12
  513. package/dist/lib/signals/graph.js.map +2 -2
  514. package/dist/lib/signals/input-provision.d.ts +15 -0
  515. package/dist/lib/signals/input-provision.js +53 -3
  516. package/dist/lib/signals/input-provision.js.map +2 -2
  517. package/dist/lib/signals/render-consumer.d.ts +3 -0
  518. package/dist/lib/signals/render-consumer.js +22 -14
  519. package/dist/lib/signals/render-consumer.js.map +2 -2
  520. package/dist/lib/style/positioning.d.ts +50 -2
  521. package/dist/lib/style/positioning.js +28 -4
  522. package/dist/lib/style/positioning.js.map +2 -2
  523. package/dist/lib/style/resolve-built-in.d.ts +4 -3
  524. package/dist/lib/style/resolve-built-in.js +17 -3
  525. package/dist/lib/style/resolve-built-in.js.map +2 -2
  526. package/dist/lib/style/resolve-dispatch.d.ts +3 -0
  527. package/dist/lib/style/resolve-dispatch.js +77 -4
  528. package/dist/lib/style/resolve-dispatch.js.map +2 -2
  529. package/dist/lib/style/resolve-length.d.ts +2 -0
  530. package/dist/lib/style/resolve-length.js +13 -9
  531. package/dist/lib/style/resolve-length.js.map +2 -2
  532. package/dist/lib/style/sizing-length.d.ts +51 -0
  533. package/dist/lib/style/sizing-length.js +77 -0
  534. package/dist/lib/style/sizing-length.js.map +7 -0
  535. package/dist/lib/style/types.d.ts +63 -25
  536. package/dist/lib/surface/root-surface.js +10 -6
  537. package/dist/lib/surface/root-surface.js.map +2 -2
  538. package/dist/lib/textures/texture.js +10 -8
  539. package/dist/lib/textures/texture.js.map +2 -2
  540. package/dist/lib/transitions/capture.js +4 -1
  541. package/dist/lib/transitions/capture.js.map +2 -2
  542. package/dist/lib/transitions/embers-physics.js +17 -10
  543. package/dist/lib/transitions/embers-physics.js.map +2 -2
  544. package/dist/lib/types.d.ts +110 -1
  545. package/dist/sync.d.ts +16 -0
  546. package/dist/sync.js +13 -0
  547. package/dist/sync.js.map +7 -0
  548. package/dist/sync.mjs +1 -0
  549. package/package.json +26 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/layout/flex.ts"],
4
- "sourcesContent": ["import { preparedStyleValue, preparedStyleQuery, type PreparedQuery } from '../style/responsive.js';\nimport { definePrimitive } from '../define-primitive.js';\nimport { clonePibblElement } from '../element/create-element.js';\nimport { getChildPrimitiveReceiverToken } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport { layoutDiagnostic } from '../style/diagnostics.js';\nimport {\n type PibblStructuralEventProps,\n wireStructuralEvents,\n} from '../components/structural-events.js';\nimport { normalizeEdges } from '../style/normalize.js';\nimport { resolveLength } from '../style/resolve-length.js';\nimport { setPreNormalizedStyle } from '../style/resolve-dispatch.js';\nimport type {\n BoxStyle,\n FlexItemStyle,\n LayoutItemStyle,\n ResolvedBoxStyle,\n} from '../style/types.js';\nimport type {\n CanvasMeasurementService,\n PibblNodeInput,\n MeasureInput,\n MeasureResult,\n RenderingContext2D,\n SystemStyle,\n} from '../types.js';\nimport {\n childWithUsedSize,\n prepareDirectChildStyle,\n materializeLayoutChildren,\n placeDirectChildren,\n prepareLayoutChildren,\n resolveContainerBox,\n} from './absolute.js';\nimport { pushLayoutBox } from './context.js';\nimport { recordLayoutEvaluation } from './diagnostics.js';\nimport { assertSupportedChildPosition } from './positioning-diagnostics.js';\nimport { measureElement } from './measure.js';\nimport type { Constraints, LayoutBox } from './types.js';\n\ntype FlexDirection = 'row' | 'column';\ntype FlexWrap = 'nowrap' | 'wrap';\ntype MainAlignment =\n | 'flex-start'\n | 'flex-end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\ntype CrossAlignment = 'stretch' | 'flex-start' | 'flex-end' | 'center';\n\n/**\n * Supported geometry and presentation properties for Flex.\n *\n * @see {@link BoxStyle}\n * @see {@link LayoutItemStyle}\n * @see {@link Flex}\n */\nexport interface FlexStyle extends BoxStyle, LayoutItemStyle {\n /** The main axis along which flex children are placed. See {@link FlexDirection}. */\n flexDirection?: FlexDirection;\n /** Whether children may wrap onto additional flex lines. See {@link FlexWrap}. */\n flexWrap?: FlexWrap;\n /** Distribution of children along the main axis. See {@link MainAlignment}. */\n justifyContent?: MainAlignment;\n /** Default alignment of children on the cross or block axis. See {@link CrossAlignment}. */\n alignItems?: CrossAlignment;\n /**\n * Distribution of wrapped flex lines within the available cross-axis space. See\n * {@link CrossAlignment}, {@link MainAlignment}.\n */\n alignContent?: CrossAlignment | MainAlignment;\n /** Spacing between adjacent items. See {@link FlexStyle}. */\n gap?: number;\n /** Space between adjacent rows or items on the row axis. See {@link FlexStyle}. */\n rowGap?: number;\n /** Space between adjacent columns or items on the column axis. See {@link FlexStyle}. */\n columnGap?: number;\n}\n\n/**\n * Authored inputs for Flex, including the declared data and presentation options.\n *\n * @see {@link PibblNodeInput}\n * @see {@link Flex}\n */\nexport interface FlexProps extends PibblStructuralEventProps {\n /** Descendant content or the callback that supplies it. See {@link PibblNodeInput}. */\n children: PibblNodeInput;\n}\n\nexport interface FlexMeasurementInput {\n service: CanvasMeasurementService;\n measureElement(\n element: PibblElement<any>,\n constraints: Readonly<Constraints>,\n ): MeasureResult;\n}\n\ninterface ResolvedFlexStyle extends SystemStyle {\n box: ResolvedBoxStyle;\n overflow: 'visible' | 'clip';\n flexDirection: FlexDirection;\n flexWrap: FlexWrap;\n justifyContent: MainAlignment;\n alignItems: CrossAlignment;\n alignContent: CrossAlignment | MainAlignment;\n rowGap: number;\n columnGap: number;\n}\n\ninterface FlexItem {\n child: PibblElement<any>;\n normalized: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>;\n baseMain: number;\n targetMain: number;\n paddingMain: number;\n preferredCross: number;\n paddingCross: number;\n minMain: number;\n maxMain: number;\n minCross: number;\n maxCross: number;\n grow: number;\n shrink: number;\n crossAuto: boolean;\n alignSelf: CrossAlignment | 'auto';\n receiverToken: object;\n query?: PreparedQuery;\n}\n\ninterface FlexLine {\n items: FlexItem[];\n crossSize: number;\n crossOffset: number;\n}\n\ninterface FlexPlacement {\n box: LayoutBox;\n element: PibblElement<any>;\n}\n\nfunction renderFlex(\n props: FlexProps,\n style: Readonly<ResolvedFlexStyle>,\n ctx: RenderingContext2D,\n) {\n wireStructuralEvents(props);\n const children = prepareLayoutChildren(props.children, 'Flex');\n recordLayoutEvaluation();\n const content = style.box.contentBox;\n ctx.translate(content.x, content.y);\n const localContent = Object.freeze({\n x: 0,\n y: 0,\n width: content.width,\n height: content.height,\n });\n const releaseLayout = pushLayoutBox(localContent);\n GLOBAL_STATE.componentRefs!.onAfterRender = releaseLayout;\n const service = {\n measureText(value: string, font: string) {\n ctx.save();\n try {\n ctx.font = font;\n return ctx.measureText(value);\n } finally {\n ctx.restore();\n }\n },\n };\n const placements = resolveFlexPlacements(\n localContent,\n children,\n style,\n {\n service,\n measureElement: (element, constraints) =>\n measureElement(element, constraints, service),\n },\n );\n let index = 0;\n return placeDirectChildren(\n children,\n localContent,\n () => placements[index++],\n style.overflow,\n );\n}\n\n/**\n * Describes the supported Flexbox subset for JSX or createElement authoring.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link FlexProps}\n * @see {@link FlexStyle}\n */\nexport const Flex = definePrimitive<\n FlexProps,\n FlexStyle,\n FlexStyle,\n ResolvedFlexStyle\n>(renderFlex, {\n childInput: 'structural',\n resolveStyle: (style, context) => ({\n box: resolveContainerBox(style, context, 'Flex', 'flex'),\n overflow: style.overflow ?? 'visible',\n ...normalizeFlexOptions(style, context.allocation),\n }),\n measure: input => measureFlex(input),\n});\n\nfunction measureFlex(\n input: MeasureInput<FlexProps, FlexStyle>,\n): MeasureResult {\n const children = prepareLayoutChildren(input.props.children, 'Flex');\n const widthDefinite = input.style.width !== undefined &&\n input.style.width !== 'auto';\n const heightDefinite = input.style.height !== undefined &&\n input.style.height !== 'auto';\n if (widthDefinite && heightDefinite) {\n return { status: 'measured', size: {\n width: resolveMeasuredContainerLength(\n input.style.width!,\n input.constraints.maxWidth,\n 'width',\n input.constraints,\n ),\n height: resolveMeasuredContainerLength(\n input.style.height!,\n input.constraints.maxHeight,\n 'height',\n input.constraints,\n ),\n } };\n }\n if ((input.style.flexWrap ?? 'nowrap') !== 'nowrap') {\n return unsupportedIntrinsic('requires nowrap because wrapped intrinsic sizing is deferred');\n }\n const row = (input.style.flexDirection ?? 'row') === 'row';\n const diagnosticBox = {\n x: 0,\n y: 0,\n width: Number.isFinite(input.constraints.maxWidth) ?\n input.constraints.maxWidth : 0,\n height: Number.isFinite(input.constraints.maxHeight) ?\n input.constraints.maxHeight : 0,\n };\n const options = normalizeFlexOptions(input.style, diagnosticBox);\n const mainGap = row ? options.columnGap : options.rowGap;\n let intrinsicMain = 0;\n let intrinsicCross = 0;\n let count = 0;\n for (const child of children) {\n const receiverToken = getChildPrimitiveReceiverToken(\n GLOBAL_STATE.renderTransaction,\n GLOBAL_STATE.primitiveReceiverToken,\n count,\n );\n const prepared = prepareDirectChildStyle(child, receiverToken, diagnosticBox);\n const style = preparedStyleValue(prepared) as Readonly<\n BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>\n >;\n rejectUnsupportedItemFields(child, style, diagnosticBox);\n const grow = nonnegativeFactor(\n style.flexGrow ?? 0,\n 'flexGrow',\n child,\n diagnosticBox,\n );\n if (grow !== 0) {\n return unsupportedIntrinsic('does not support flexGrow during intrinsic measurement');\n }\n const shrink = nonnegativeFactor(\n style.flexShrink ?? 1,\n 'flexShrink',\n child,\n diagnosticBox,\n );\n const basis = style.flexBasis ?? 'auto';\n const mainProperty = row ? 'width' : 'height';\n const crossProperty = row ? 'height' : 'width';\n const minimumProperty = row ? 'minWidth' : 'minHeight';\n if ((shrink > 0 || basis === 'auto') && style[minimumProperty] === undefined) {\n throw childDiagnostic(\n child,\n minimumProperty,\n style[minimumProperty],\n diagnosticBox,\n 'an explicit main-axis minimum is required for shrink or auto basis',\n );\n }\n const mainValue = basis === 'auto' ? style[mainProperty] : basis;\n const crossValue = style[crossProperty];\n if (isPercentage(mainValue) || isPercentage(crossValue) ||\n hasPercentageBounds(style)) {\n return unsupportedIntrinsic('does not support percentage child sizes or bounds');\n }\n if (mainValue === undefined || mainValue === 'auto') {\n return unsupportedIntrinsic('requires a definite child basis; measured auto basis is deferred');\n }\n if (crossValue === undefined || crossValue === 'auto') {\n return unsupportedIntrinsic('requires a definite child cross size');\n }\n const baseMain = intrinsicNumber(mainValue, 'flexBasis');\n const baseCross = intrinsicNumber(crossValue, crossProperty);\n const minMain = intrinsicOptionalNumber(style[minimumProperty], 0, minimumProperty);\n const maxMainProperty = row ? 'maxWidth' : 'maxHeight';\n const maxMain = intrinsicOptionalNumber(\n style[maxMainProperty],\n Number.POSITIVE_INFINITY,\n maxMainProperty,\n );\n const minCrossProperty = row ? 'minHeight' : 'minWidth';\n const maxCrossProperty = row ? 'maxHeight' : 'maxWidth';\n const minCross = intrinsicOptionalNumber(style[minCrossProperty], 0, minCrossProperty);\n const maxCross = intrinsicOptionalNumber(\n style[maxCrossProperty],\n Number.POSITIVE_INFINITY,\n maxCrossProperty,\n );\n const padding = normalizeEdges(\n style.padding,\n 'padding',\n childContext(child, diagnosticBox),\n );\n const paddingMain = row ? padding.left + padding.right :\n padding.top + padding.bottom;\n const paddingCross = row ? padding.top + padding.bottom :\n padding.left + padding.right;\n intrinsicMain += clamp(baseMain, minMain, maxMain) + paddingMain;\n intrinsicCross = Math.max(\n intrinsicCross,\n clamp(baseCross, minCross, maxCross) + paddingCross,\n );\n count++;\n }\n intrinsicMain += Math.max(0, count - 1) * mainGap;\n return { status: 'measured', size: {\n width: widthDefinite ? resolveMeasuredContainerLength(\n input.style.width!,\n input.constraints.maxWidth,\n 'width',\n input.constraints,\n ) : row ? intrinsicMain : intrinsicCross,\n height: heightDefinite ? resolveMeasuredContainerLength(\n input.style.height!,\n input.constraints.maxHeight,\n 'height',\n input.constraints,\n ) : row ? intrinsicCross : intrinsicMain,\n } };\n}\n\nfunction resolveMeasuredContainerLength(\n value: Exclude<BoxStyle['width'], undefined>,\n reference: number,\n property: string,\n constraints: Readonly<Constraints>,\n): number {\n const resolved = resolveLength(value, reference, property, {\n component: 'Flex',\n algorithm: 'measurement',\n constraints,\n });\n if (resolved === undefined || resolved < 0) {\n throw layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'measurement',\n constraints,\n reason: 'requires a definite nonnegative container size',\n });\n }\n return resolved;\n}\n\nfunction intrinsicNumber(\n value: unknown,\n property: string,\n): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'measurement',\n reason: 'intrinsic measurement requires finite nonnegative numeric sizes',\n });\n }\n return value;\n}\n\nfunction intrinsicOptionalNumber(\n value: unknown,\n fallback: number,\n property: string,\n): number {\n return value === undefined ? fallback : intrinsicNumber(value, property);\n}\n\nfunction isPercentage(value: unknown): boolean {\n return typeof value === 'string' && value.endsWith('%');\n}\n\nfunction hasPercentageBounds(style: Readonly<BoxStyle>): boolean {\n return [\n style.minWidth,\n style.maxWidth,\n style.minHeight,\n style.maxHeight,\n ].some(isPercentage);\n}\n\nfunction unsupportedIntrinsic(reason: string): MeasureResult {\n return {\n status: 'unsupported',\n reason: `Flex intrinsic measurement ${reason}`,\n };\n}\n\nexport function layoutFlex(\n container: Readonly<LayoutBox>,\n children: PibblNodeInput,\n style: Readonly<FlexStyle>,\n measurement: FlexMeasurementInput,\n): LayoutBox[] {\n const prepared = materializeLayoutChildren(children, 'Flex');\n return resolveFlexPlacements(container, prepared, style, measurement)\n .map(placement => placement.box);\n}\n\nfunction resolveFlexPlacements(\n container: Readonly<LayoutBox>,\n children: readonly PibblElement<any>[],\n style: Readonly<FlexStyle>,\n measurement: FlexMeasurementInput,\n): FlexPlacement[] {\n assertFiniteBox(container);\n const options = normalizeFlexOptions(style, container);\n const row = options.flexDirection === 'row';\n const mainSize = row ? container.width : container.height;\n const crossSize = row ? container.height : container.width;\n const mainGap = row ? options.columnGap : options.rowGap;\n const crossGap = row ? options.rowGap : options.columnGap;\n const items: FlexItem[] = [];\n\n for (const child of children) {\n const receiverToken = getChildPrimitiveReceiverToken(\n GLOBAL_STATE.renderTransaction,\n GLOBAL_STATE.primitiveReceiverToken,\n items.length,\n );\n const prepared = prepareDirectChildStyle(child, receiverToken, container);\n const normalized = preparedStyleValue(prepared) as Readonly<\n BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>\n >;\n assertSupportedChildPosition('Flex', child, normalized);\n rejectUnsupportedItemFields(child, normalized, container);\n const grow = nonnegativeFactor(normalized.flexGrow ?? 0, 'flexGrow', child, container);\n const shrink = nonnegativeFactor(\n normalized.flexShrink ?? 1,\n 'flexShrink',\n child,\n container,\n );\n const basisValue = normalized.flexBasis ?? 'auto';\n const minimumProperty = row ? 'minWidth' : 'minHeight';\n if ((shrink > 0 || basisValue === 'auto') && normalized[minimumProperty] === undefined) {\n throw childDiagnostic(\n child,\n minimumProperty,\n normalized[minimumProperty],\n container,\n 'an explicit main-axis minimum is required for shrink or auto basis',\n );\n }\n\n const mainProperty = row ? 'width' : 'height';\n const crossProperty = row ? 'height' : 'width';\n const mainReference = mainSize;\n const crossReference = crossSize;\n let measured: { width: number; height: number } | undefined;\n const specifiedMain = normalized[mainProperty];\n const specifiedCross = normalized[crossProperty];\n const needsMeasuredMain = basisValue === 'auto' &&\n (specifiedMain === undefined || specifiedMain === 'auto');\n const crossAuto = specifiedCross === undefined || specifiedCross === 'auto';\n const alignment = normalizeItemAlignment(normalized.alignSelf, child, container);\n const needsMeasuredCross = crossAuto && alignment !== 'stretch' &&\n options.alignItems !== 'stretch';\n if (needsMeasuredMain || needsMeasuredCross || crossAuto) {\n const constraints = {\n minWidth: 0,\n maxWidth: container.width,\n minHeight: 0,\n maxHeight: container.height,\n };\n const measurementChild = clonePibblElement(child);\n setPreNormalizedStyle(\n measurementChild,\n normalized,\n child,\n receiverToken,\n preparedStyleQuery(prepared),\n );\n const result = measurement.measureElement(measurementChild, constraints);\n if (result.status === 'measured') {\n measured = result.size;\n } else if (needsMeasuredMain || (crossAuto && effectiveAlignment(\n alignment,\n options.alignItems,\n ) !== 'stretch')) {\n throw childDiagnostic(\n child,\n needsMeasuredMain ? mainProperty : crossProperty,\n 'auto',\n container,\n `measurement is required but unsupported: ${result.reason}`,\n );\n }\n }\n\n const baseMain = resolveBasis(\n basisValue,\n specifiedMain,\n measured?.[mainProperty],\n mainReference,\n mainProperty,\n child,\n container,\n );\n const preferredCross = crossAuto ?\n measured?.[crossProperty] ?? 0 :\n resolveItemLength(\n specifiedCross,\n crossReference,\n crossProperty,\n child,\n container,\n );\n const padding = normalizeEdges(normalized.padding, 'padding', childContext(child, container));\n const paddingMain = row ? padding.left + padding.right : padding.top + padding.bottom;\n const paddingCross = row ? padding.top + padding.bottom : padding.left + padding.right;\n const minMain = resolveOptionalBound(\n normalized[minimumProperty],\n mainReference,\n minimumProperty,\n 0,\n child,\n container,\n );\n const maximumProperty = row ? 'maxWidth' : 'maxHeight';\n const maxMain = resolveOptionalBound(\n normalized[maximumProperty],\n mainReference,\n maximumProperty,\n Number.POSITIVE_INFINITY,\n child,\n container,\n );\n const minCrossProperty = row ? 'minHeight' : 'minWidth';\n const maxCrossProperty = row ? 'maxHeight' : 'maxWidth';\n const minCross = resolveOptionalBound(\n normalized[minCrossProperty],\n crossReference,\n minCrossProperty,\n 0,\n child,\n container,\n );\n const maxCross = resolveOptionalBound(\n normalized[maxCrossProperty],\n crossReference,\n maxCrossProperty,\n Number.POSITIVE_INFINITY,\n child,\n container,\n );\n if (minMain > maxMain) {\n throw childDiagnostic(\n child,\n minimumProperty,\n minMain,\n container,\n 'minimum must not exceed maximum',\n );\n }\n if (minCross > maxCross) {\n throw childDiagnostic(\n child,\n minCrossProperty,\n minCross,\n container,\n 'minimum must not exceed maximum',\n );\n }\n items.push({\n child,\n normalized,\n baseMain,\n targetMain: baseMain,\n paddingMain,\n preferredCross: clamp(preferredCross, minCross, maxCross) + paddingCross,\n paddingCross,\n minMain,\n maxMain,\n minCross,\n maxCross,\n grow,\n shrink,\n crossAuto,\n alignSelf: alignment,\n receiverToken,\n query: preparedStyleQuery(prepared),\n });\n }\n\n const lines = collectLines(items, mainSize, mainGap, options.flexWrap);\n for (const line of lines) resolveFlexibleLengths(line, mainSize, mainGap);\n resolveLineCrossSizes(\n lines,\n crossSize,\n crossGap,\n options.alignContent,\n options.flexWrap === 'wrap',\n );\n\n const placements: FlexPlacement[] = [];\n for (const line of lines) {\n const occupied = line.items.reduce(\n (total, item) => total + item.targetMain + item.paddingMain,\n Math.max(0, line.items.length - 1) * mainGap,\n );\n const distribution = distributeAlignment(\n options.justifyContent,\n mainSize - occupied,\n line.items.length,\n );\n let mainCursor = distribution.start;\n for (const item of line.items) {\n const alignment = effectiveAlignment(item.alignSelf, options.alignItems);\n let outerCross = item.preferredCross;\n if (alignment === 'stretch' && item.crossAuto) {\n outerCross = clamp(\n Math.max(0, line.crossSize - item.paddingCross),\n item.minCross,\n item.maxCross,\n ) + item.paddingCross;\n }\n const crossOffset = alignmentOffset(\n alignment,\n line.crossSize,\n outerCross,\n );\n const outerMain = item.targetMain + item.paddingMain;\n const box = row ? {\n x: container.x + mainCursor,\n y: container.y + line.crossOffset + crossOffset,\n width: outerMain,\n height: outerCross,\n } : {\n x: container.x + line.crossOffset + crossOffset,\n y: container.y + mainCursor,\n width: outerCross,\n height: outerMain,\n };\n const usedStyle = {\n ...item.normalized,\n width: row ? item.targetMain : Math.max(0, outerCross - item.paddingCross),\n height: row ? Math.max(0, outerCross - item.paddingCross) : item.targetMain,\n };\n placements.push({\n box,\n element: childWithUsedSize(\n item.child,\n usedStyle,\n usedStyle.width,\n usedStyle.height,\n item.receiverToken,\n item.query,\n ),\n });\n mainCursor += outerMain + mainGap + distribution.between;\n }\n }\n return placements;\n}\n\nfunction collectLines(\n items: readonly FlexItem[],\n mainSize: number,\n gap: number,\n wrap: FlexWrap,\n): FlexLine[] {\n const lines: FlexLine[] = [];\n let current: FlexItem[] = [];\n let occupied = 0;\n for (const item of items) {\n const hypothetical = clamp(item.baseMain, item.minMain, item.maxMain) +\n item.paddingMain;\n const next = current.length === 0 ? hypothetical : occupied + gap + hypothetical;\n if (wrap === 'wrap' && current.length > 0 && next > mainSize) {\n lines.push({ items: current, crossSize: 0, crossOffset: 0 });\n current = [];\n occupied = 0;\n }\n occupied = current.length === 0 ? hypothetical : occupied + gap + hypothetical;\n current.push(item);\n }\n if (current.length > 0) {\n lines.push({ items: current, crossSize: 0, crossOffset: 0 });\n }\n return lines;\n}\n\nfunction resolveFlexibleLengths(\n line: FlexLine,\n mainSize: number,\n gap: number,\n): void {\n const gapSpace = Math.max(0, line.items.length - 1) * gap;\n const baseOuter = line.items.reduce(\n (total, item) => total + item.baseMain + item.paddingMain,\n 0,\n );\n const hypotheticalOuter = line.items.reduce(\n (total, item) => total +\n clamp(item.baseMain, item.minMain, item.maxMain) + item.paddingMain,\n 0,\n );\n const growing = hypotheticalOuter + gapSpace < mainSize;\n const initialFree = mainSize - gapSpace - baseOuter;\n const frozen = new Set<FlexItem>();\n for (const item of line.items) {\n item.targetMain = item.baseMain;\n const hypothetical = clamp(item.baseMain, item.minMain, item.maxMain);\n if (\n (growing ? item.grow : item.shrink) === 0 ||\n (growing && item.baseMain > hypothetical) ||\n (!growing && item.baseMain < hypothetical)\n ) {\n item.targetMain = hypothetical;\n frozen.add(item);\n }\n }\n\n while (frozen.size < line.items.length) {\n const fixed = line.items.reduce(\n (total, item) => total +\n (frozen.has(item) ? item.targetMain : item.baseMain) +\n item.paddingMain,\n gapSpace,\n );\n let free = mainSize - fixed;\n const unfrozen = line.items.filter(item => !frozen.has(item));\n const rawFactor = growing ?\n unfrozen.reduce((total, item) => total + item.grow, 0) :\n unfrozen.reduce((total, item) => total + item.shrink, 0);\n const scaledFactor = growing ? rawFactor :\n unfrozen.reduce((total, item) => total + item.shrink * item.baseMain, 0);\n if (scaledFactor === 0) {\n for (const item of unfrozen) {\n item.targetMain = clamp(item.baseMain, item.minMain, item.maxMain);\n frozen.add(item);\n }\n break;\n }\n if (rawFactor < 1) {\n const partialFree = initialFree * rawFactor;\n if (Math.abs(partialFree) < Math.abs(free)) free = partialFree;\n }\n const violations: { item: FlexItem; amount: number }[] = [];\n for (const item of unfrozen) {\n const share = growing ? item.grow / scaledFactor :\n item.shrink * item.baseMain / scaledFactor;\n const candidate = item.baseMain + free * share;\n const clamped = clamp(candidate, item.minMain, item.maxMain);\n item.targetMain = clamped;\n if (clamped !== candidate) {\n violations.push({ item, amount: clamped - candidate });\n }\n }\n if (violations.length === 0) break;\n const totalViolation = violations.reduce(\n (total, violation) => total + violation.amount,\n 0,\n );\n for (const violation of violations) {\n if (\n totalViolation === 0 ||\n (totalViolation > 0 && violation.amount > 0) ||\n (totalViolation < 0 && violation.amount < 0)\n ) {\n frozen.add(violation.item);\n }\n }\n }\n}\n\nfunction resolveLineCrossSizes(\n lines: FlexLine[],\n crossSize: number,\n gap: number,\n alignment: ResolvedFlexStyle['alignContent'],\n multiLine: boolean,\n): void {\n if (lines.length === 0) return;\n for (const line of lines) {\n line.crossSize = Math.max(0, ...line.items.map(item => item.preferredCross));\n }\n if (lines.length === 1 && !multiLine) {\n lines[0].crossSize = crossSize;\n lines[0].crossOffset = 0;\n return;\n }\n const occupied = lines.reduce(\n (total, line) => total + line.crossSize,\n Math.max(0, lines.length - 1) * gap,\n );\n const free = crossSize - occupied;\n if (alignment === 'stretch' && free > 0) {\n const addition = free / lines.length;\n for (const line of lines) line.crossSize += addition;\n }\n const distribution = alignment === 'stretch' ?\n { start: 0, between: 0 } :\n distributeAlignment(alignment, free, lines.length);\n let cursor = distribution.start;\n for (const line of lines) {\n line.crossOffset = cursor;\n cursor += line.crossSize + gap + distribution.between;\n }\n}\n\nfunction distributeAlignment(\n alignment: MainAlignment | CrossAlignment,\n free: number,\n count: number,\n): { start: number; between: number } {\n if (count === 0 || alignment === 'flex-start' || alignment === 'stretch') {\n return { start: 0, between: 0 };\n }\n if (free < 0) {\n if (alignment === 'flex-end') return { start: free, between: 0 };\n if (alignment === 'center' || alignment === 'space-around' ||\n alignment === 'space-evenly') {\n return { start: free / 2, between: 0 };\n }\n return { start: 0, between: 0 };\n }\n if (alignment === 'flex-end') return { start: free, between: 0 };\n if (alignment === 'center') return { start: free / 2, between: 0 };\n if (alignment === 'space-between') {\n return count === 1 ? { start: 0, between: 0 } :\n { start: 0, between: free / (count - 1) };\n }\n if (alignment === 'space-around') {\n const between = free / count;\n return { start: between / 2, between };\n }\n if (alignment === 'space-evenly') {\n const between = free / (count + 1);\n return { start: between, between };\n }\n return { start: 0, between: 0 };\n}\n\nfunction normalizeFlexOptions(\n style: Readonly<FlexStyle>,\n container: Readonly<LayoutBox>,\n) {\n const flexDirection = supported(style.flexDirection ?? 'row', ['row', 'column'], 'flexDirection', container);\n const flexWrap = supported(style.flexWrap ?? 'nowrap', ['nowrap', 'wrap'], 'flexWrap', container);\n const justifyContent = supported(\n style.justifyContent ?? 'flex-start',\n ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n 'justifyContent',\n container,\n );\n const alignItems = supported(\n style.alignItems ?? 'stretch',\n ['stretch', 'flex-start', 'flex-end', 'center'],\n 'alignItems',\n container,\n );\n const alignContent = supported(\n style.alignContent ?? 'stretch',\n ['stretch', 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n 'alignContent',\n container,\n );\n const gap = nonnegativeGap(style.gap ?? 0, 'gap', container);\n return {\n flexDirection: flexDirection as FlexDirection,\n flexWrap: flexWrap as FlexWrap,\n justifyContent: justifyContent as MainAlignment,\n alignItems: alignItems as CrossAlignment,\n alignContent: alignContent as CrossAlignment | MainAlignment,\n rowGap: nonnegativeGap(style.rowGap ?? gap, 'rowGap', container),\n columnGap: nonnegativeGap(style.columnGap ?? gap, 'columnGap', container),\n };\n}\n\nfunction supported(\n value: string,\n accepted: readonly string[],\n property: string,\n container: Readonly<LayoutBox>,\n): string {\n if (!accepted.includes(value)) throw optionDiagnostic(property, value, container);\n return value;\n}\n\nfunction nonnegativeGap(\n value: unknown,\n property: string,\n container: Readonly<LayoutBox>,\n): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw optionDiagnostic(property, value, container);\n }\n return value;\n}\n\nfunction nonnegativeFactor(\n value: number,\n property: string,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (!Number.isFinite(value) || value < 0) {\n throw childDiagnostic(\n child,\n property,\n value,\n container,\n 'must be finite and nonnegative',\n );\n }\n return value;\n}\n\nfunction resolveBasis(\n basis: FlexItemStyle['flexBasis'],\n specifiedMain: BoxStyle['width'],\n measuredMain: number | undefined,\n reference: number,\n property: 'width' | 'height',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n const value = basis === 'auto' || basis === undefined ? specifiedMain : basis;\n if (value === undefined || value === 'auto') {\n if (measuredMain === undefined) {\n throw childDiagnostic(\n child,\n property,\n value ?? 'auto',\n container,\n 'auto flex basis requires supported pure measurement',\n );\n }\n return measuredMain;\n }\n return resolveItemLength(value, reference, 'flexBasis', child, container);\n}\n\nfunction resolveItemLength(\n value: Exclude<BoxStyle['width'], undefined>,\n reference: number,\n property: string,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n const resolved = resolveLength(value, reference, property, childContext(child, container));\n if (resolved === undefined || resolved < 0) {\n throw childDiagnostic(\n child,\n property,\n value,\n container,\n 'must resolve to a finite nonnegative length',\n );\n }\n return resolved;\n}\n\nfunction resolveOptionalBound(\n value: BoxStyle['minWidth'],\n reference: number,\n property: string,\n fallback: number,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (value === undefined) return fallback;\n return resolveItemLength(value, reference, property, child, container);\n}\n\nfunction normalizeItemAlignment(\n value: LayoutItemStyle['alignSelf'],\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): CrossAlignment | 'auto' {\n if (value === undefined || value === 'auto') return 'auto';\n if (value === 'stretch' || value === 'flex-start' ||\n value === 'flex-end' || value === 'center') return value;\n throw childDiagnostic(\n child,\n 'alignSelf',\n value,\n container,\n 'uses an unsupported flex item alignment',\n );\n}\n\nfunction effectiveAlignment(\n value: CrossAlignment | 'auto',\n fallback: CrossAlignment,\n): CrossAlignment {\n return value === 'auto' ? fallback : value;\n}\n\nfunction alignmentOffset(\n alignment: CrossAlignment,\n lineSize: number,\n itemSize: number,\n): number {\n if (alignment === 'center') return (lineSize - itemSize) / 2;\n if (alignment === 'flex-end') return lineSize - itemSize;\n return 0;\n}\n\nfunction rejectUnsupportedItemFields(\n child: PibblElement<any>,\n style: Readonly<Record<string, unknown>>,\n container: Readonly<LayoutBox>,\n): void {\n for (const property of ['order', 'margin', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom']) {\n if (style[property] !== undefined) {\n throw childDiagnostic(\n child,\n property,\n style[property],\n container,\n 'uses an unsupported flex item feature',\n );\n }\n }\n}\n\nfunction clamp(value: number, minimum: number, maximum: number): number {\n return Math.min(maximum, Math.max(minimum, value));\n}\n\nfunction assertFiniteBox(container: Readonly<LayoutBox>): void {\n for (const [property, value] of Object.entries(container)) {\n if (!Number.isFinite(value) ||\n ((property === 'width' || property === 'height') && value < 0)) {\n throw optionDiagnostic(property, value, container);\n }\n }\n}\n\nfunction optionDiagnostic(\n property: string,\n value: unknown,\n container: Readonly<LayoutBox>,\n) {\n return layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'flex',\n constraints: constraintsFor(container),\n reason: 'uses an unsupported flex value',\n });\n}\n\nfunction childDiagnostic(\n child: PibblElement<any>,\n property: string,\n value: unknown,\n container: Readonly<LayoutBox>,\n reason: string,\n) {\n return layoutDiagnostic({\n component: child.type.name || 'Anonymous',\n property,\n value,\n algorithm: 'flex',\n constraints: constraintsFor(container),\n reason,\n });\n}\n\nfunction childContext(\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n) {\n return {\n component: child.type.name || 'Anonymous',\n algorithm: 'flex',\n constraints: constraintsFor(container),\n };\n}\n\nfunction constraintsFor(container: Readonly<LayoutBox>): Constraints {\n return {\n minWidth: 0,\n maxWidth: container.width,\n minHeight: 0,\n maxHeight: container.height,\n };\n}\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB,0BAA8C;AAC3E,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,sCAAsC;AAE/C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC;AAAA,EAEE;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAetC;AAAA,EACE;A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A;AAAA,IACA,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,IACrC,QAAQ;AAAA,EACV,CAAC;AACH;AAEA,SAAS,gBACP,OACA,UACA,OACA,WACA,QACA;AACA,SAAO,iBAAiB;AAAA,IACtB,WAAW,MAAM,KAAK,QAAQ;AAAA,IAC9B;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,IACrC;AAAA,EACF,CAAC;AACH;AAEA,SAAS,aACP,OACA,WACA;AACA,SAAO;AAAA,IACL,WAAW,MAAM,KAAK,QAAQ;AAAA,IAC9B,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,EACvC;AACF;AAEA,SAAS,eAAe,WAA6C;AACnE,SAAO;AAAA,IACL,UAAU;AAAA,IACV,UAAU,UAAU;AAAA,IACpB,WAAW;AAAA,IACX,WAAW,UAAU;AAAA,EACvB;AACF;",
6
- "names": []
4
+ "sourcesContent": ["import { allocationCheckpointPhaseOwner, retainAllocationCheckpointPhases } from './allocation-checkpoint-owner.js';\nimport { withAllocationCheckpoint, recordAllocationStyle, allocationMeasurement, declineUnrecordedAllocationMeasurement } from './allocation-checkpoint.js';\nimport { contentBoxStyle } from './box-sizing.js';\nimport { canvasMeasurementService, isCurrentCanvasMeasurementService, isGenericCanvasFont } from './canvas-measurement.js';\nimport { Grid } from './grid.js';\nimport { Flow } from './flow.js';\nimport type { PreparedFlexLayoutPlan, PreparedLayoutPlan, PreparedLayoutSlot } from './prepared-root.js';\nimport { currentPreparedReceiverSlot, isKnownLayoutType, registerKnownLayoutPreflight, stagePreparedChildStyle, claimPreparedFlexPlan, peekPreparedLayoutPlan, peekPreparedFlexPlan, stagePreparedLayoutPlan, preflightKnownLayout, attachPreparedLayoutSlot, stagePreparedIntrinsicMain, peekPreparedIntrinsicMain, takePreparedIntrinsicMain, type PreparedIntrinsicMainStage } from './prepared-root.js';\nimport { isLayoutComponent, prepareLayoutComponent } from './define-layout-component.js';\nimport { allocationInputRevision, allocationStructuralRevision } from './allocation-revision.js';\nimport { FLEX_BASELINE_GROUP, FLEX_LAST_BASELINE } from './flex-baseline-mode.js';\nimport type { CachedFlexPlacement } from './flex-allocation-cache.js';\nimport { nativeLayout, LayoutRegion, mountedLayoutRegion, solveTransientFlexMain, prepareTransientIntrinsicMainQueries, resolveTransientIntrinsicMain, resolveTransientKnownOwnerMain, type NumericFlexMainInput, recordWasmMeasurement, recordWasmAllocationPass, recordWasmAllocationItem, recordWasmAllocationCacheHit } from './wasm/region.js';\nimport { Rectangle } from '../components/rect.js';\nimport { Text, prepareLayoutTextContent as readLayoutTextContent, measureLayoutTextMinimumWidth, measureLayoutTextNaturalRun } from '../components/text.js';\n\nconst unsupportedProperties = ['order'] as const;\n\nimport { ResponsiveStylePreparation, UnsupportedResponsiveMeasurement, withStyleMeasurement, preparedStyleValue, preparedStyleQuery, type PreparedQuery } from '../style/responsive.js';\nimport { definePrimitive } from '../define-primitive.js';\nimport { clonePibblElement } from '../element/create-element.js';\nimport { getChildPrimitiveReceiverToken, getPrimitiveReceiverToken, getPrimitiveDefinition, getPrimitiveProgramProps, getElementMetadata, setElementMetadata } from '../element/metadata.js';\nimport type { PibblElement } from '../element/types.js';\nimport { GLOBAL_STATE } from '../global-state.js';\nimport { LayoutDiagnostic, layoutDiagnostic } from '../style/diagnostics.js';\nimport {\n type PibblStructuralEventProps,\n wireStructuralEvents,\n} from '../components/structural-events.js';\nimport { normalizeBoxInsets, hasPercentageBoxPadding, resolveAllocatedInsets } from './box-insets.js';\nimport { resolveScalarSizingLength } from '../style/sizing-length.js';\nimport { parsePercentage } from '../style/resolve-length.js';\nimport { isIntrinsicSizingValue, normalizeSizingLength, type NormalizedSizingLength } from '../style/sizing-length.js';\nimport { setPreNormalizedStyle, peekPreNormalizedStyle } from '../style/resolve-dispatch.js';\nimport type {\n BoxStyle,\n TextStyle,\n Percentage,\n FlexItemStyle,\n LayoutItemStyle,\n ResolvedBoxStyle,\n} from '../style/types.js';\nimport type {\n CanvasMeasurementService,\n PibblNodeInput,\n MeasureInput,\n MeasureResult,\n IntrinsicMeasureInput,\n IntrinsicSizesResult,\n RenderingContext2D,\n SystemStyle,\n} from '../types.js';\nimport {\n childWithUsedSize,\n prepareDirectChildStyle,\n materializeLayoutChildren,\n placeDirectChildren,\n prepareLayoutChildren,\n resolveContainerBox,\n resolveDirectChildBox,\n} from './absolute.js';\nimport { getLayoutDirection, getLogicalContainingBox, pushLayoutBox } from './context.js';\nimport { recordLayoutEvaluation } from './diagnostics.js';\nimport { assertSupportedChildPosition } from './positioning-diagnostics.js';\nimport { markDerivedAbsoluteAxes } from '../style/positioning.js';\nimport { measureElement, measureConstrainedLayoutChild, measureIntrinsicElement, measureConstrainedIntrinsicElement, measurePreparedLayoutElement, measureBaselineElement, setPreparedBaselineOwner, type BaselineMeasurementOptions, withIsolatedRenderState } from './measure.js';\nimport { isSignal, withSignalWriteForbidden } from '../signals/graph.js';\nimport type { Constraints, LayoutBox } from './types.js';\n\ntype FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';\ntype FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';\ntype MainAlignment =\n | 'flex-start'\n | 'flex-end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\ntype CrossAlignment = 'stretch' | 'flex-start' | 'flex-end' | 'center';\ntype ItemCrossAlignment = CrossAlignment | 'first-baseline' | 'last-baseline';\n\n/**\n * Supported geometry and presentation properties for Flex.\n *\n * @see {@link BoxStyle}\n * @see {@link LayoutItemStyle}\n * @see {@link Flex}\n */\nexport interface FlexStyle extends BoxStyle, LayoutItemStyle {\n /** Inherited inline direction. Roots default to LTR. See {@link Flex}. */\n layoutDirection?: 'ltr' | 'rtl';\n /** The main axis along which flex children are placed. See {@link FlexDirection}. */\n flexDirection?: FlexDirection;\n /** Whether children may wrap onto additional flex lines. See {@link FlexWrap}. */\n flexWrap?: FlexWrap;\n /** Distribution along the main axis. start/end follow layout direction independently of axis reversal. See {@link MainAlignment}. */\n justifyContent?: MainAlignment | 'start' | 'end';\n /** Cross alignment. start/end follow layout direction independently of wrap reversal. See {@link CrossAlignment}. */\n alignItems?: ItemCrossAlignment | 'start' | 'end';\n /**\n * Distribution of wrapped flex lines within the available cross-axis space. See\n * {@link CrossAlignment}, {@link MainAlignment}.\n */\n alignContent?: CrossAlignment | MainAlignment | 'start' | 'end';\n /** Numeric spacing, or experimental allocated-axis percentages. See {@link Percentage}, {@link FlexStyle}. */\n gap?: number | Percentage;\n /** Physical row spacing; experimental percentages use content height. See {@link Percentage}, {@link FlexStyle}. */\n rowGap?: number | Percentage;\n /** Physical column spacing; experimental percentages use content width. See {@link Percentage}, {@link FlexStyle}. */\n columnGap?: number | Percentage;\n}\n\n/**\n * Authored inputs for Flex, including the declared data and presentation options.\n *\n * @see {@link PibblNodeInput}\n * @see {@link Flex}\n */\nexport interface FlexProps extends PibblStructuralEventProps {\n /** Descendant content or the callback that supplies it. See {@link PibblNodeInput}. */\n children: PibblNodeInput;\n}\n\nexport interface FlexMeasurementInput {\n service: CanvasMeasurementService;\n measureElement(\n element: PibblElement<any>,\n constraints: Readonly<Constraints>,\n ): MeasureResult;\n}\n\n// Parent input is private metadata, not a recursively validated resolved value.\nconst FLEX_ABSOLUTE_BOX_STYLE = Symbol('pibbl.flex-absolute-box-style');\nconst FLEX_INHERITED_CONTAINING_BOX = Symbol('pibbl.flex-inherited-containing-box');\n\ninterface ResolvedFlexStyle extends SystemStyle {\n layoutDirection: 'ltr' | 'rtl';\n box: ResolvedBoxStyle;\n overflow: 'visible' | 'clip';\n flexDirection: FlexDirection;\n flexWrap: FlexWrap;\n justifyContent: MainAlignment;\n alignItems: CrossAlignment;\n /** True when first/last baseline requires a horizontal measured group. */\n [FLEX_BASELINE_GROUP]: boolean;\n [FLEX_LAST_BASELINE]: boolean;\n alignContent: CrossAlignment | MainAlignment;\n rowGap: number;\n columnGap: number;\n /** Original container input retained for lazy absolute padding-box derivation. */\n [FLEX_ABSOLUTE_BOX_STYLE]: Readonly<FlexStyle>;\n [FLEX_INHERITED_CONTAINING_BOX]?: Readonly<LayoutBox>;\n}\n\ninterface FlexItem {\n child: PibblElement<any>;\n normalized: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>;\n baseMain: number;\n targetMain: number;\n paddingMain: number;\n marginMainBefore: number;\n marginMainAfter: number;\n autoMainBefore: boolean;\n autoMainAfter: boolean;\n marginCrossBefore: number;\n marginCrossAfter: number;\n autoCrossBefore: boolean;\n autoCrossAfter: boolean;\n preferredCross: number;\n paddingCross: number;\n paddingCrossBefore: number;\n minMain: number;\n maxMain: number;\n minCross: number;\n maxCross: number;\n grow: number;\n shrink: number;\n crossAuto: boolean;\n aspectRatio?: number;\n alignSelf: CrossAlignment | 'auto';\n receiverToken: object;\n layoutToken?: object;\n query?: PreparedQuery;\n relativeX: number;\n relativeY: number;\n /** Signed selected baseline offset resolved after final main allocation. */\n firstBaseline?: number;\n /** Current transaction root of a transparent layout description. */\n baselineRoot?: PibblElement<any>;\n /** Existing known-Flex slot prepared before this outer baseline pass. */\n structuralBaselineSlot?: PreparedLayoutSlot;\n /** Unkeyed source-type occurrence, shared with known descendant preparation. */\n layoutOccurrence: number;\n /** Column natural cross size is measured only after native main allocation. */\n deferredColumnAutoCross: boolean;\n ordinaryColumnAutoCross: boolean;\n sourceIndex: number;\n}\n\ninterface FlexLine {\n items: FlexItem[];\n crossSize: number;\n crossOffset: number;\n}\n\n/** One current known-Flex baseline result, without claiming its staged region. */\ninterface PreparedKnownBaseline {\n readonly slot: PreparedLayoutSlot;\n readonly offset: number;\n}\n\nexport interface FlexPlacement extends CachedFlexPlacement {\n box: LayoutBox;\n element: PibblElement<any>;\n}\ninterface DeferredStaticAbsolutePlacement {\n readonly sourceIndex: number;\n readonly child: PibblElement<any>;\n readonly style: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>;\n readonly receiverToken: object;\n readonly query: PreparedQuery | undefined;\n readonly measurement: FlexMeasurementInput | undefined;\n readonly measurementToken: object | undefined;\n}\ninterface DeferredStaticPlacementState {\n /** Source-indexed descriptors keep source ordering without scanning pending entries. */\n readonly slots: Array<DeferredStaticAbsolutePlacement | undefined>;\n readonly style: Readonly<ResolvedFlexStyle>;\n}\nconst deferredStaticPlans = new WeakMap<PreparedFlexLayoutPlan, DeferredStaticPlacementState>();\nfunction deferredStaticPlacementSentinel(): FlexPlacement {\n const fail = (): never => { throw new Error('Deferred static Flex absolute placement was read before finalization.'); };\n return { get box() { return fail(); }, get layoutY() { return fail(); }, get usedWidth() { return fail(); }, get usedHeight() { return fail(); }, get element() { return fail(); } };\n}\n\nfunction renderFlex(\n props: FlexProps,\n style: Readonly<ResolvedFlexStyle>,\n ctx: RenderingContext2D,\n) {\n wireStructuralEvents(props);\n recordLayoutEvaluation();\n const content = style.box.contentBox;\n ctx.translate(content.x, content.y);\n const localContent = Object.freeze({\n x: 0,\n y: 0,\n width: content.width,\n height: content.height,\n });\n const specified = style[FLEX_ABSOLUTE_BOX_STYLE];\n const releaseLayout = pushLayoutBox(localContent, {\n layoutDirection: style.layoutDirection,\n logicalOffset: content,\n containingBlock: nativeLayout && specified?.position !== 'static'\n ? resolveFlexAbsolutePaddingBox(specified ?? {}, localContent) : undefined,\n });\n GLOBAL_STATE.componentRefs!.onAfterRender = releaseLayout;\n const service = flexMeasurementService(ctx);\n const prepared = nativeLayout ? claimPreparedFlexPlan(GLOBAL_STATE.componentRefs!.element, localContent) : undefined;\n const region = nativeLayout ? mountedLayoutRegion() : undefined;\n const plan = prepared ?? prepareFlexAllocation(props, style, localContent, service, region);\n if (nativeLayout && !prepared) prepareFlexDescendants(plan, style);\n const { children, placements } = plan;\n let index = 0;\n return placeDirectChildren(\n children,\n localContent,\n () => placements[index++],\n style.overflow,\n );\n}\n\nfunction flexMeasurementService(ctx: RenderingContext2D): CanvasMeasurementService {\n return canvasMeasurementService(ctx);\n}\nfunction prepareFlexAllocation(props: FlexProps, style: Readonly<ResolvedFlexStyle>, localContent: Readonly<LayoutBox>, service: CanvasMeasurementService, region?: LayoutRegion, parentSlot?: PreparedLayoutSlot, deferStaticAbsolute?: Array<DeferredStaticAbsolutePlacement | undefined>) {\n const revision = allocationInputRevision();\n const children = prepareLayoutChildren(props.children, 'Flex');\n const axis = isRowDirection(style.flexDirection) ? 'row' : 'column';\n const staged = takePreparedIntrinsicMain(\n GLOBAL_STATE.primitiveReceiverToken,\n children,\n axis,\n axis === 'row' ? localContent.width : localContent.height,\n revision,\n );\n const placements = withAllocationCheckpoint(region, {\n children, content: localContent, settings: { style, deferred: !!deferStaticAbsolute }, flexMargins: true,\n continuation: staged && { axis: staged.axis, contentMain: staged.contentMain, items: staged.items, autoMarginFreeMain: staged.autoMarginFreeMain },\n pending: deferStaticAbsolute && {\n read: index => {\n const entry = deferStaticAbsolute[index];\n return entry && { style: entry.style, data: { measured: !!entry.measurement, token: entry.measurementToken } };\n },\n replay: (index, normalized, receiverToken, query, data) => {\n const { measured, token } = data as { measured: boolean; token: object | undefined };\n deferStaticAbsolute[index] = { sourceIndex: index, child: children[index], style: normalized, receiverToken, query,\n measurement: measured ? { service, measureElement: (element, constraints) => measureElement(element, constraints, service) } : undefined,\n measurementToken: token };\n return deferredStaticPlacementSentinel();\n },\n },\n onHit: recordWasmAllocationCacheHit,\n calculate: () => resolveFlexPlacements(localContent, children, style, {\n service,\n measureElement: (element, constraints) => measureElement(element, constraints, service),\n }, region, staged, parentSlot, deferStaticAbsolute),\n });\n for (let index = 0; index < placements.length; index++) {\n if (deferStaticAbsolute?.[index]) continue;\n const placement = placements[index];\n attachPreparedLayoutSlot(placement.element, currentPreparedReceiverSlot(getPrimitiveReceiverToken(placement.element)));\n }\n if (region) retainAllocationCheckpointPhases(region, deferStaticAbsolute?.flatMap((entry, index) => entry ? [index] : []) ?? []);\n return { children, placements, revision, content: localContent, cached: false };\n}\n\n/**\n * Describes the supported Flexbox subset for JSX or createElement authoring.\n * Text automatic heights use the final allocated width in rows and nowrap columns\n * before dependent sibling placement. See {@link Text}.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link FlexProps}\n * @see {@link FlexStyle}\n */\nexport const Flex = definePrimitive<\n FlexProps,\n FlexStyle,\n FlexStyle,\n ResolvedFlexStyle\n>(renderFlex, {\n childInput: 'structural',\n resolveStyle: (style, context) => {\n const box = resolveContainerBox(style, context, 'Flex', 'flex');\n return {\n box,\n [FLEX_ABSOLUTE_BOX_STYLE]: style,\n [FLEX_INHERITED_CONTAINING_BOX]: nativeLayout ? getElementMetadata(GLOBAL_STATE.componentRefs!.element)?.absoluteContainingBlock : undefined,\n overflow: style.overflow ?? 'visible',\n ...normalizeFlexOptions(style, box.contentBox),\n };\n },\n measure: input => measureFlex(input),\n measureIntrinsic: input => measureFlexIntrinsic(input),\n});\n\n// A known Absolute sibling boundary resolves these receiver inputs before any\n// sibling's opaque component executes. Geometry still solves in normal traversal.\nlet allocatedIntrinsicMain: { receiver: object; main: number; rootMin?: number; rootMax?: number } | undefined;\n\n// A known Flex contributes its native adjusted line size while its parent is\n// measuring the same main axis. The scope is receiver-bound and only exists\n// through the immediate child measurement; ordinary public queries retain the\n// resolved outer size.\nlet requestedIntrinsicContribution: { receiver: object; axis: 'row' | 'column'; normalOwner?: boolean } | undefined;\nif (nativeLayout) registerKnownLayoutPreflight(Flex, (element, style, content, receiver, slot, parentMainAxis, preflightOptions) => {\n const options = normalizeFlexOptions(style as Readonly<FlexStyle>, content);\n const releaseLayout = pushLayoutBox(content, options);\n const previous = GLOBAL_STATE.primitiveReceiverToken;\n GLOBAL_STATE.primitiveReceiverToken = receiver;\n try {\n const children = prepareLayoutChildren(element.props.children, 'Flex');\n const axis = isRowDirection(options.flexDirection) ? 'row' : 'column';\n const main = axis === 'row' ? content.width : content.height;\n const contribution = parentMainAxis === axis ? peekPreparedIntrinsicMain(\n receiver, children, axis, main, allocationInputRevision(),\n ) : undefined;\n if (contribution && !contribution.normalOwner) {\n // A main-axis contribution sizes this owner, not its final descendants.\n // Rebind those descendants through native exact mode at the allocated main.\n const ctx = GLOBAL_STATE.renderContext;\n if (!ctx) throw new Error('Known layout preparation requires a Canvas measurement context.');\n const measuredRoot = clonePibblElement(element);\n setPreNormalizedStyle(measuredRoot, contribution.style, element, receiver);\n const previousPhase = allocatedIntrinsicMain;\n allocatedIntrinsicMain = { receiver, main, rootMin: contribution.rootMin, rootMax: contribution.rootMax };\n try {\n const result = measureConstrainedIntrinsicElement(measuredRoot, {\n minWidth: 0, maxWidth: content.width, minHeight: 0, maxHeight: content.height,\n }, flexMeasurementService(ctx));\n if (result.status !== 'measured') throw new Error(`Known Flex allocated-owner measurement is unsupported: ${result.reason}`);\n } finally { allocatedIntrinsicMain = previousPhase; }\n }\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n const token = getChildPrimitiveReceiverToken(GLOBAL_STATE.renderTransaction, receiver, index);\n let prepared = prepareDirectChildStyle(child, token, content, true);\n const specified = preparedStyleValue(prepared) as Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>>;\n const normalized = resolveAllocatedInsets(specified, { width: content.width, layoutDirection: options.layoutDirection, context: childContext(child, content) });\n if (normalized !== specified) {\n if (prepared instanceof ResponsiveStylePreparation) prepared.style = normalized;\n else prepared = normalized;\n }\n assertSupportedChildPosition('Flex', child, normalized, true);\n rejectUnsupportedItemFields(child, normalized, content);\n nonnegativeFactor(normalized.flexGrow ?? 0, 'flexGrow', child, content);\n nonnegativeFactor(normalized.flexShrink ?? 1, 'flexShrink', child, content);\n stagePreparedChildStyle(child, token, content, prepared);\n }\n const ctx = GLOBAL_STATE.renderContext;\n if (!ctx) throw new Error('Known layout preparation requires a Canvas measurement context.');\n const region = slot.acquire();\n const resolved = {\n box: { contentBox: content },\n [FLEX_ABSOLUTE_BOX_STYLE]: style as Readonly<FlexStyle>,\n [FLEX_INHERITED_CONTAINING_BOX]: getElementMetadata(element)?.absoluteContainingBlock,\n overflow: (style as Readonly<FlexStyle>).overflow ?? 'visible',\n ...normalizeFlexOptions(style as Readonly<FlexStyle>, content),\n } as Readonly<ResolvedFlexStyle>;\n const deferred = preflightOptions?.deferStaticContainingDescendants ? [] as Array<DeferredStaticAbsolutePlacement | undefined> : undefined;\n const plan = prepareFlexAllocation(element.props as FlexProps, resolved, content, flexMeasurementService(ctx), region, slot, deferred);\n const staged = { ...plan, region } as PreparedFlexLayoutPlan;\n if (deferred) {\n // Count represents the unresolved origin phase, even if this owner has no direct absolute child.\n staged.pending = { kind: 'static-flex-containing-origin', count: 1 };\n deferredStaticPlans.set(staged, { slots: deferred, style: resolved });\n // Prepare in-flow known descendants now; static descendants inherit this pending origin.\n prepareFlexDescendants(staged, resolved, slot, true);\n } else prepareFlexDescendants(staged, resolved, slot);\n stagePreparedLayoutPlan(slot, staged);\n } finally { GLOBAL_STATE.primitiveReceiverToken = previous; releaseLayout(); }\n});\n\nfunction deferredStaticState(plan: PreparedFlexLayoutPlan): DeferredStaticPlacementState | undefined {\n return deferredStaticPlans.get(plan);\n}\nfunction finalizeDeferredStaticAbsolutePlacements(plan: PreparedFlexLayoutPlan, style: Readonly<ResolvedFlexStyle>): void {\n const state = deferredStaticState(plan as PreparedFlexLayoutPlan);\n if (!state) return;\n let paddingBox: Readonly<LayoutBox> | undefined;\n for (let sourceIndex = 0; sourceIndex < state.slots.length; sourceIndex++) {\n const entry = state.slots[sourceIndex];\n if (!entry) continue;\n if (entry.sourceIndex !== sourceIndex || sourceIndex >= plan.placements.length) throw new Error('Deferred static absolute placement lost source ordering.');\n const containing = paddingBox ??= resolveFlexContainingBox(style, plan.content);\n const owner = plan.region && allocationCheckpointPhaseOwner(plan.region, sourceIndex);\n plan.placements[sourceIndex] = withAllocationCheckpoint(owner, {\n children: [entry.child], receiverTokens: [entry.receiverToken], content: plan.content,\n settings: { style, containing }, flexMargins: true, onHit: recordWasmAllocationCacheHit,\n calculate: () => {\n // This is a distinct numerical phase, after the containing origin settles.\n if (plan.region) { recordWasmAllocationPass(); recordWasmAllocationItem(); }\n recordAllocationStyle(entry.receiverToken, entry.query ? new ResponsiveStylePreparation(entry.style, entry.query) : entry.style);\n return [resolveAbsoluteFlexPlacement(containing, entry.child, entry.style, entry.receiverToken, entry.query,\n plan.content, style, entry.measurement, plan.region, entry.measurementToken)];\n },\n })[0];\n state.slots[sourceIndex] = undefined;\n }\n}\n\n/** Known descendants prepare only after this boundary's own allocation settles. */\nfunction prepareFlexDescendants(plan: Pick<PreparedFlexLayoutPlan, 'children' | 'placements' | 'content'> & { region?: LayoutRegion }, style: Readonly<ResolvedFlexStyle>, parentSlot?: PreparedLayoutSlot, unresolvedStaticOrigin = false): void {\n if (!unresolvedStaticOrigin) finalizeDeferredStaticAbsolutePlacements(plan as PreparedFlexLayoutPlan, style);\n let containingBox: Readonly<LayoutBox> | undefined;\n let flexOccurrence = 0;\n let descriptionOccurrences: Map<Function, number> | undefined;\n for (let index = 0; index < plan.children.length; index++) {\n const child = plan.children[index];\n if (!isKnownLayoutType(child.type) && !isLayoutComponent(child.type)) continue;\n let occurrence = 0;\n if (child.key === undefined) {\n if (child.type === Flex) occurrence = flexOccurrence++;\n else {\n descriptionOccurrences ??= new Map();\n occurrence = descriptionOccurrences.get(child.type) ?? 0;\n descriptionOccurrences.set(child.type, occurrence + 1);\n }\n }\n // A static owner has not received its containing origin yet. Its direct\n // absolute entries are descriptors, never settled placement objects.\n if (deferredStaticState(plan as PreparedFlexLayoutPlan)?.slots[index]) continue;\n const placement = plan.placements[index];\n const prepared = peekPreNormalizedStyle(placement.element);\n if (!prepared) throw new Error('Known layout preparation requires settled receiver inputs.');\n const receiver = getPrimitiveReceiverToken(placement.element);\n if (!receiver) throw new Error('Known layout preparation requires the current child receiver.');\n const preparedRoot = isLayoutComponent(child.type) ? prepareLayoutComponent(child, { receiverToken: receiver }) : child;\n const staticFlexRoot = preparedRoot.type === Flex && (prepared.style as FlexStyle).position === 'static';\n let preparationChild = child;\n // Declarative static Flex boxes pass the nearest owner's padding box through\n // existing placement metadata. Nothing is attached to authored props/styles.\n const unresolvedStaticChild = unresolvedStaticOrigin && staticFlexRoot;\n if (staticFlexRoot && !unresolvedStaticChild) {\n containingBox ??= resolveFlexContainingBox(style, plan.content);\n const insets = normalizeBoxInsets(prepared.style as FlexStyle, childContext(child, plan.content));\n const x = finiteRelativePlacement(containingBox.x - placement.box.x - insets.left, 'left', child, plan.content);\n const y = finiteRelativePlacement(containingBox.y - placement.box.y - insets.top, 'top', child, plan.content);\n setElementMetadata(placement.element, {\n ...getElementMetadata(placement.element),\n layoutDescriptionSource: getElementMetadata(child)?.layoutDescriptionSource ?? child,\n absoluteContainingBlock: Object.freeze({ x, y, width: containingBox.width, height: containingBox.height }),\n });\n preparationChild = placement.element;\n }\n const content = { x: 0, y: 0, width: placement.usedWidth, height: placement.usedHeight };\n const staged = getElementMetadata(placement.element)?.preparedLayoutSlot as PreparedLayoutSlot | undefined;\n // A baseline pass may have already staged this exact settled child. Retain\n // static containing-box metadata above, but never stage the slot twice.\n const current = staged && peekPreparedLayoutPlan(staged, content, (prepared.style as FlexStyle).layoutDirection ?? style.layoutDirection);\n if (current) {\n if (preparedRoot.type === Flex) {\n const stagedFlex = current as PreparedFlexLayoutPlan;\n const state = deferredStaticState(stagedFlex);\n if (state && !unresolvedStaticOrigin) {\n const inherited = getElementMetadata(placement.element)?.absoluteContainingBlock;\n if (!inherited) throw new Error('Static structural descendants require the settled containing box before finalization.');\n const nestedStyle = { ...state.style, [FLEX_INHERITED_CONTAINING_BOX]: inherited } as Readonly<ResolvedFlexStyle>;\n finalizeDeferredStaticAbsolutePlacements(stagedFlex, nestedStyle);\n prepareFlexDescendants(stagedFlex, nestedStyle, staged);\n stagedFlex.pending!.count = 0;\n deferredStaticPlans.delete(stagedFlex);\n }\n }\n continue;\n }\n const nested = preflightKnownLayout(preparationChild, prepared.style, content, receiver, occurrence, parentSlot, isRowDirection(style.flexDirection) ? 'row' : 'column',\n unresolvedStaticChild ? { deferStaticContainingDescendants: true } : undefined);\n attachPreparedLayoutSlot(placement.element, nested);\n }\n}\n\n\n/** Pure content contributions; final allocation still belongs to the native solver. */\nfunction measureFlexIntrinsic(input: IntrinsicMeasureInput<FlexProps, FlexStyle>): IntrinsicSizesResult {\n const width = input.constraints.width.kind === 'bounded' ? input.constraints.width.max : Number.POSITIVE_INFINITY;\n const height = input.constraints.height.kind === 'bounded' ? input.constraints.height.max : Number.POSITIVE_INFINITY;\n const owner = { x: 0, y: 0, width: Number.isFinite(width) ? width : 0, height: Number.isFinite(height) ? height : 0 };\n const row = isRowDirection(input.style.flexDirection);\n const wrap = (input.style.flexWrap ?? 'nowrap') !== 'nowrap';\n if (isPercentage(input.style.gap) || isPercentage(input.style.columnGap) || isPercentage(input.style.rowGap)) return { status: 'unsupported', reason: 'Flex intrinsic percentage gaps require a definite owning axis' };\n const options = normalizeFlexOptions(input.style, owner);\n const children = materializeLayoutChildren(input.props.children, 'Flex');\n let minMain = 0, maxMain = 0, minCross = 0, maxCross = 0, count = 0;\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n const receiver = getChildPrimitiveReceiverToken(GLOBAL_STATE.renderTransaction, GLOBAL_STATE.primitiveReceiverToken, index);\n const prepared = prepareDirectChildStyle(child, receiver, owner, true);\n let style = preparedStyleValue(prepared) as Readonly<BoxStyle & FlexItemStyle>;\n if (style.position === 'absolute') continue;\n if (style.boxSizing !== undefined) style = contentBoxStyle(style, { width: owner.width, height: owner.height, mainAxis: row ? 'width' : 'height', context: childContext(child, owner) });\n if (hasPercentageBoxPadding(style) || isPercentage(style.width) || isPercentage(style.height) ||\n isPercentage(style.flexBasis) || hasPercentageBounds(style)) return { status: 'unsupported', reason: 'Flex intrinsic percentage child sizes require a definite owning axis' };\n const measuredChild = clonePibblElement(child);\n setPreNormalizedStyle(measuredChild, style, child, receiver, preparedStyleQuery(prepared));\n const measured = typeof style.width === 'number' && typeof style.height === 'number' ? {\n status: 'measured' as const, minContent: { width: style.width, height: style.height }, maxContent: { width: style.width, height: style.height },\n } : measureIntrinsicElement(measuredChild, { minWidth: 0, maxWidth: width, minHeight: 0, maxHeight: height }, input.service);\n if (measured.status !== 'measured') return measured;\n const padding = normalizeBoxInsets(style, childContext(child, owner));\n const horizontal = padding.left + padding.right, vertical = padding.top + padding.bottom;\n const marginLeft = style.marginLeft ?? style.margin, marginRight = style.marginRight ?? style.margin;\n const marginTop = style.marginTop ?? style.margin, marginBottom = style.marginBottom ?? style.margin;\n const marginsX = allocatedMargin(marginLeft === 'auto' ? 0 : marginLeft, 'marginLeft', child, owner) + allocatedMargin(marginRight === 'auto' ? 0 : marginRight, 'marginRight', child, owner);\n const marginsY = allocatedMargin(marginTop === 'auto' ? 0 : marginTop, 'marginTop', child, owner) + allocatedMargin(marginBottom === 'auto' ? 0 : marginBottom, 'marginBottom', child, owner);\n const lowerWidth = intrinsicOptionalNumber(style.minWidth, 0, 'minWidth');\n const upperWidth = intrinsicOptionalNumber(style.maxWidth, Number.POSITIVE_INFINITY, 'maxWidth');\n const lowerHeight = intrinsicOptionalNumber(style.minHeight, 0, 'minHeight');\n const upperHeight = intrinsicOptionalNumber(style.maxHeight, Number.POSITIVE_INFINITY, 'maxHeight');\n if (lowerWidth > upperWidth) throw childDiagnostic(child, 'minWidth', lowerWidth, owner, 'minimum must not exceed maximum');\n if (lowerHeight > upperHeight) throw childDiagnostic(child, 'minHeight', lowerHeight, owner, 'minimum must not exceed maximum');\n const minimumWidth = clamp(typeof style.width === 'number' ? style.width : measured.minContent.width, lowerWidth, upperWidth) + horizontal + marginsX;\n const maximumWidth = clamp(typeof style.width === 'number' ? style.width : measured.maxContent.width, lowerWidth, upperWidth) + horizontal + marginsX;\n const minimumHeight = clamp(typeof style.height === 'number' ? style.height : measured.minContent.height, lowerHeight, upperHeight) + vertical + marginsY;\n const maximumHeight = clamp(typeof style.height === 'number' ? style.height : measured.maxContent.height, lowerHeight, upperHeight) + vertical + marginsY;\n const childMinMain = row ? minimumWidth : minimumHeight, childMaxMain = row ? maximumWidth : maximumHeight;\n const childMinCross = row ? minimumHeight : minimumWidth, childMaxCross = row ? maximumHeight : maximumWidth;\n minMain = wrap ? Math.max(minMain, childMinMain) : minMain + childMinMain;\n maxMain += childMaxMain;\n minCross = wrap ? minCross + childMinCross : Math.max(minCross, childMinCross);\n maxCross = Math.max(maxCross, childMaxCross);\n count++;\n }\n const mainGaps = Math.max(0, count - 1) * (row ? options.columnGap : options.rowGap);\n const crossGaps = Math.max(0, count - 1) * (row ? options.rowGap : options.columnGap);\n if (!wrap) minMain += mainGaps; else minCross += crossGaps;\n maxMain += mainGaps;\n return { status: 'measured', minContent: { width: Math.max(0, row ? minMain : minCross), height: Math.max(0, row ? minCross : minMain) }, maxContent: { width: Math.max(0, row ? maxMain : maxCross), height: Math.max(0, row ? maxCross : maxMain) } };\n}\n\n/** Finite-main native continuation for general intrinsic children. */\nfunction measureAllocatedFlex(input: MeasureInput<FlexProps, FlexStyle>, children: readonly PibblElement<any>[], measuredWidth: NonNullable<FlexStyle['width']>): MeasureResult {\n const width = resolveMeasuredContainerLength(measuredWidth, input.constraints.maxWidth, 'width', input.constraints);\n const height = Number.isFinite(input.constraints.maxHeight) ? input.constraints.maxHeight : 0;\n const region = new LayoutRegion();\n let placements: FlexPlacement[];\n try {\n placements = resolveFlexPlacements({ x: 0, y: 0, width, height }, children, {\n ...input.style, alignContent: 'flex-start',\n alignItems: input.style.alignItems === undefined || input.style.alignItems === 'stretch' ? 'flex-start' : input.style.alignItems,\n }, input, region);\n } catch (error) {\n if (error instanceof LayoutDiagnostic && error.message.includes('measurement is required but unsupported:')) return { status: 'unsupported', reason: error.message };\n throw error;\n } finally { region.dispose(); }\n let first = Number.POSITIVE_INFINITY, last = Number.NEGATIVE_INFINITY;\n const owner = { x: 0, y: 0, width, height };\n for (let index = 0; index < placements.length; index++) {\n const placement = placements[index];\n const style = peekPreNormalizedStyle(placement.element)?.style as Readonly<FlexItemStyle & BoxStyle>;\n if (style.position === 'absolute') continue;\n const top = style.marginTop ?? style.margin, bottom = style.marginBottom ?? style.margin;\n const before = top === 'auto' ? 0 : allocatedMargin(top, 'marginTop', placement.element, owner);\n const after = bottom === 'auto' ? 0 : allocatedMargin(bottom, 'marginBottom', placement.element, owner);\n first = Math.min(first, placement.layoutY - before);\n last = Math.max(last, placement.layoutY + placement.box.height + after);\n }\n return { status: 'measured', size: { width, height: Number.isFinite(first) ? Math.max(0, last - first) : 0 } };\n}\n\ninterface IntrinsicRowItem extends NumericFlexMainInput {\n readonly sourceIndex: number;\n readonly child: PibblElement<any>;\n /** Prepared direct paired root when the source child is a layout description. */\n readonly measuredChild: PibblElement<any>;\n readonly style: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>>;\n readonly receiverToken: object;\n readonly measureCross: boolean;\n readonly baseCross: number;\n readonly minCross: number;\n readonly maxCross: number;\n readonly paddingCross: number;\n readonly marginCross: number;\n}\n\nfunction measureFlex(\n input: MeasureInput<FlexProps, FlexStyle>,\n): MeasureResult {\n const children = prepareLayoutChildren(input.props.children, 'Flex');\n const phase = allocatedIntrinsicMain;\n if (phase && phase.receiver === GLOBAL_STATE.primitiveReceiverToken) {\n allocatedIntrinsicMain = undefined;\n try {\n const diagnosticBox = { x: 0, y: 0, width: input.constraints.maxWidth, height: input.constraints.maxHeight };\n const result = measureStagedNonexactMain(input, children, normalizeFlexOptions(input.style, diagnosticBox), diagnosticBox, phase);\n if (result) return result;\n return unsupportedIntrinsic('allocated known-owner continuation no longer matches its measured profile');\n } finally { allocatedIntrinsicMain = phase; }\n }\n // Exact caller availability supplies a definite main axis. A finite maximum\n // alone remains an availability limit, never a percentage containing size.\n const automaticWidth = input.style.width === undefined || input.style.width === 'auto';\n const exactRowWidth = nativeLayout && automaticWidth &&\n (input.style.flexDirection ?? 'row') === 'row' &&\n (input.style.flexWrap ?? 'nowrap') === 'nowrap' &&\n (input.style.layoutDirection ?? getLayoutDirection()) === 'ltr' &&\n input.constraints.minWidth === input.constraints.maxWidth &&\n Number.isFinite(input.constraints.maxWidth) && input.constraints.maxWidth >= 0 ?\n input.constraints.maxWidth : undefined;\n const automaticHeight = input.style.height === undefined || input.style.height === 'auto';\n const exactColumnHeight = nativeLayout && automaticHeight &&\n input.style.flexDirection === 'column' &&\n (input.style.flexWrap ?? 'nowrap') === 'nowrap' &&\n (input.style.layoutDirection ?? getLayoutDirection()) === 'ltr' &&\n input.constraints.minHeight === input.constraints.maxHeight &&\n Number.isFinite(input.constraints.maxHeight) && input.constraints.maxHeight >= 0 ?\n input.constraints.maxHeight : undefined;\n const measuredHeight = exactColumnHeight ?? input.style.height;\n const measuredWidth = exactRowWidth ?? input.style.width;\n const widthDefinite = measuredWidth !== undefined && measuredWidth !== 'auto';\n const heightDefinite = measuredHeight !== undefined && measuredHeight !== 'auto';\n if (widthDefinite && heightDefinite) {\n return { status: 'measured', size: {\n width: resolveMeasuredContainerLength(\n measuredWidth!,\n input.constraints.maxWidth,\n 'width',\n input.constraints,\n ),\n height: resolveMeasuredContainerLength(\n measuredHeight!,\n input.constraints.maxHeight,\n 'height',\n input.constraints,\n ),\n } };\n }\n const wrappedIntrinsic = (input.style.flexWrap ?? 'nowrap') !== 'nowrap';\n if (wrappedIntrinsic && !nativeLayout) return unsupportedIntrinsic('requires nowrap because wrapped intrinsic sizing is deferred');\n if (isPercentage(input.style.gap) || isPercentage(input.style.rowGap) || isPercentage(input.style.columnGap)) return unsupportedIntrinsic('does not support percentage gaps without an actual finite content allocation');\n const row = isRowDirection(input.style.flexDirection);\n const diagnosticBox = {\n x: 0,\n y: 0,\n width: Number.isFinite(input.constraints.maxWidth) ?\n input.constraints.maxWidth : 0,\n height: Number.isFinite(input.constraints.maxHeight) ?\n input.constraints.maxHeight : 0,\n };\n const options = normalizeFlexOptions(input.style, diagnosticBox);\n const stagedNonexact = measureStagedNonexactMain(input, children, options, diagnosticBox);\n if (stagedNonexact) return stagedNonexact;\n if (wrappedIntrinsic && !(nativeLayout && options.flexDirection === 'row' && options.flexWrap === 'wrap' && options.layoutDirection === 'ltr' && typeof input.style.width === 'number' && !heightDefinite)) {\n if (nativeLayout && row && widthDefinite && !heightDefinite) return measureAllocatedFlex(input, children, measuredWidth!);\n return unsupportedIntrinsic('wrapped intrinsic height requires a finite main allocation');\n }\n const wrapWidth = wrappedIntrinsic ? resolveMeasuredContainerLength(measuredWidth!, input.constraints.maxWidth, 'width', input.constraints) : 0;\n const mainGap = row ? options.columnGap : options.rowGap;\n // An exact width makes this dependency acyclic: main allocation precedes each\n // paired leaf's height query. Metadata inspection never evaluates components.\n const measuredRowWidth = nativeLayout && options.flexDirection === 'row' &&\n options.flexWrap === 'nowrap' && options.layoutDirection === 'ltr' && !heightDefinite &&\n typeof measuredWidth === 'number' ?\n resolveMeasuredContainerLength(measuredWidth, input.constraints.maxWidth, 'width', input.constraints) : undefined;\n let rowItems: IntrinsicRowItem[] | undefined;\n if (measuredRowWidth !== undefined) for (let index = 0; index < children.length; index++) {\n const candidate = children[index];\n // A layout description is inspectable only through its prepared root. Keep\n // the same receiver that the item pass will use, so description ownership\n // and cycle metadata stay on the source wrapper.\n const root = isLayoutComponent(candidate.type) ?\n prepareLayoutComponent(candidate, { receiverToken: getChildPrimitiveReceiverToken(\n GLOBAL_STATE.renderTransaction, GLOBAL_STATE.primitiveReceiverToken, index,\n ) }) : candidate;\n const definition = getPrimitiveDefinition(root.type);\n if (root.type !== Text && definition?.measureIntrinsic && definition.measure) { rowItems = []; break; }\n }\n let requiresSolvedCross = false;\n let lineMain = 0, lineCross = 0, lineItems = 0, wrappedHeight = 0;\n let intrinsicMain = 0;\n let intrinsicCross = 0;\n let count = 0;\n for (let sourceIndex = 0; sourceIndex < children.length; sourceIndex++) {\n const child = children[sourceIndex];\n const receiverToken = getChildPrimitiveReceiverToken(\n GLOBAL_STATE.renderTransaction,\n GLOBAL_STATE.primitiveReceiverToken,\n sourceIndex,\n );\n const prepared = prepareDirectChildStyle(child, receiverToken, diagnosticBox, true);\n let style = preparedStyleValue(prepared) as Readonly<\n BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>\n >;\n if (nativeLayout) {\n validateIntrinsicBound(style.minWidth, 'minWidth', child, diagnosticBox);\n validateIntrinsicBound(style.maxWidth, 'maxWidth', child, diagnosticBox);\n validateIntrinsicBound(style.minHeight, 'minHeight', child, diagnosticBox);\n validateIntrinsicBound(style.maxHeight, 'maxHeight', child, diagnosticBox);\n }\n if (hasPercentageBoxPadding(style, options.layoutDirection)) return unsupportedIntrinsic('does not support percentage padding without an actual finite Flex allocation');\n // Absolute children have no flow contribution. This first slice does not\n // define an intrinsic containing-block cascade, so fail before a child can\n // be measured into the owner size.\n if (style.position === 'absolute') {\n if (nativeLayout && wrappedIntrinsic && row && widthDefinite && !heightDefinite) return measureAllocatedFlex(input, children, measuredWidth!);\n return unsupportedIntrinsic('does not support absolute children during intrinsic Flex measurement');\n }\n if (nativeLayout && (style.paddingStart !== undefined || style.paddingEnd !== undefined || style.borderStartWidth !== undefined || style.borderEndWidth !== undefined)) style = resolveAllocatedInsets(style, { width: diagnosticBox.width, layoutDirection: options.layoutDirection, context: childContext(child, diagnosticBox) });\n const layoutChild = isLayoutComponent(child.type) ? prepareLayoutComponent(child, { receiverToken }) : child;\n const layoutReceiverToken = getPrimitiveReceiverToken(layoutChild) ?? receiverToken;\n const settledColumnChild = nativeLayout && !row && typeof input.style.width === 'number' && !heightDefinite &&\n (child.type === Text || layoutChild.type === Flow || layoutChild.type === Grid || layoutChild.type === Flex && isColumnDirection(style.flexDirection) && (style.flexWrap ?? 'nowrap') === 'nowrap');\n if (settledColumnChild && (isPercentage(style.width) || isPercentage(style.minWidth) || isPercentage(style.maxWidth))) {\n if (isPercentage(style.height) || isPercentage(style.flexBasis) || isPercentage(style.minHeight) || isPercentage(style.maxHeight)) return unsupportedIntrinsic('does not support percentage child main sizes or bounds');\n const reference = resolveMeasuredContainerLength(measuredWidth!, input.constraints.maxWidth, 'width', input.constraints);\n const context = childContext(child, diagnosticBox);\n // Resolve only against an explicit owner, before converting outer box inputs.\n // Keep numeric hot paths allocation-free and leave indefinite owners unsupported.\n style = { ...style,\n width: isPercentage(style.width) ? resolveScalarSizingLength(style.width!, reference, 'width', context) : style.width,\n minWidth: isPercentage(style.minWidth) ? resolveScalarSizingLength(style.minWidth!, reference, 'minWidth', context) : style.minWidth,\n maxWidth: isPercentage(style.maxWidth) ? resolveScalarSizingLength(style.maxWidth!, reference, 'maxWidth', context) : style.maxWidth,\n };\n }\n if (nativeLayout && automaticWidth && options.flexDirection === 'row' &&\n options.flexWrap === 'nowrap' && options.layoutDirection === 'ltr' &&\n (isPercentage(style.minWidth) || isPercentage(style.maxWidth))) {\n if (exactRowWidth === undefined) return unsupportedIntrinsic('requires an exact finite row width to resolve percentage main bounds');\n const context = childContext(child, diagnosticBox);\n style = { ...style,\n minWidth: isPercentage(style.minWidth) ? resolveScalarSizingLength(style.minWidth!, exactRowWidth, 'minWidth', context) : style.minWidth,\n maxWidth: isPercentage(style.maxWidth) ? resolveScalarSizingLength(style.maxWidth!, exactRowWidth, 'maxWidth', context) : style.maxWidth,\n };\n if (typeof style.minWidth === 'number' && typeof style.maxWidth === 'number' && style.minWidth > style.maxWidth) {\n throw childDiagnostic(child, 'minWidth', style.minWidth, diagnosticBox, 'minimum must not exceed maximum');\n }\n }\n if (nativeLayout && automaticHeight && options.flexDirection === 'column' &&\n options.flexWrap === 'nowrap' && options.layoutDirection === 'ltr' &&\n (isPercentage(style.minHeight) || isPercentage(style.maxHeight))) {\n if (exactColumnHeight === undefined) return unsupportedIntrinsic('requires an exact finite column height to resolve percentage main bounds');\n const context = childContext(child, diagnosticBox);\n style = { ...style,\n minHeight: isPercentage(style.minHeight) ? resolveScalarSizingLength(style.minHeight!, exactColumnHeight, 'minHeight', context) : style.minHeight,\n maxHeight: isPercentage(style.maxHeight) ? resolveScalarSizingLength(style.maxHeight!, exactColumnHeight, 'maxHeight', context) : style.maxHeight,\n };\n if (typeof style.minHeight === 'number' && typeof style.maxHeight === 'number' && style.minHeight > style.maxHeight) {\n throw childDiagnostic(child, 'minHeight', style.minHeight, diagnosticBox, 'minimum must not exceed maximum');\n }\n }\n if (style.boxSizing !== undefined) style = contentBoxStyle(style, { width: diagnosticBox.width, height: diagnosticBox.height, mainAxis: row ? 'width' : 'height', context: childContext(child, diagnosticBox) });\n rejectUnsupportedItemFields(child, style, diagnosticBox);\n if (style.aspectRatio !== undefined) return unsupportedIntrinsic('does not support aspectRatio during intrinsic measurement');\n const marginDirection = layoutChild.type === Flex ? style.layoutDirection ?? options.layoutDirection : options.layoutDirection;\n const logicalLeft = marginDirection === 'rtl' ? style.marginEnd : style.marginStart;\n const logicalRight = marginDirection === 'rtl' ? style.marginStart : style.marginEnd;\n const leftValue = logicalLeft !== undefined ? logicalLeft : style.marginLeft === undefined ? style.margin : style.marginLeft;\n const rightValue = logicalRight !== undefined ? logicalRight : style.marginRight === undefined ? style.margin : style.marginRight;\n const topValue = style.marginTop === undefined ? style.margin : style.marginTop;\n const bottomValue = style.marginBottom === undefined ? style.margin : style.marginBottom;\n const hasLogicalMargin = style.marginStart !== undefined || style.marginEnd !== undefined;\n if ((!hasLogicalMargin && isPercentage(style.margin)) || isPercentage(topValue) || isPercentage(rightValue) || isPercentage(bottomValue) || isPercentage(leftValue)) return unsupportedIntrinsic('does not support percentage margins without an actual finite Flex allocation');\n const autoTop = topValue === 'auto', autoRight = rightValue === 'auto';\n const autoBottom = bottomValue === 'auto', autoLeft = leftValue === 'auto';\n if (!nativeLayout && (autoTop || autoRight || autoBottom || autoLeft)) return unsupportedIntrinsic('automatic margins require the experimental layout engine');\n // Physical-only paths retain their existing shorthand validation.\n if (!hasLogicalMargin) numericMargin(nativeLayout && style.margin === 'auto' ? 0 : style.margin, 'margin', child, diagnosticBox);\n // Final allocation already represents automatic margins as zero until the\n // native placement pass divides free space. The intrinsic contribution uses\n // the same zero contribution; each measurement path retains its sizing guards.\n const marginTop = numericMargin(autoTop ? 0 : topValue, 'marginTop', child, diagnosticBox);\n const marginRight = numericMargin(autoRight ? 0 : rightValue, logicalRight !== undefined ? marginDirection === 'rtl' ? 'marginStart' : 'marginEnd' : 'marginRight', child, diagnosticBox);\n const marginBottom = numericMargin(autoBottom ? 0 : bottomValue, 'marginBottom', child, diagnosticBox);\n const marginLeft = numericMargin(autoLeft ? 0 : leftValue, logicalLeft !== undefined ? marginDirection === 'rtl' ? 'marginEnd' : 'marginStart' : 'marginLeft', child, diagnosticBox);\n const marginMain = row ? marginLeft + marginRight : marginTop + marginBottom;\n const marginCross = row ? marginTop + marginBottom : marginLeft + marginRight;\n const grow = nonnegativeFactor(\n style.flexGrow ?? 0,\n 'flexGrow',\n child,\n diagnosticBox,\n );\n if (grow !== 0) {\n if (nativeLayout && wrappedIntrinsic && row && widthDefinite && !heightDefinite) return measureAllocatedFlex(input, children, measuredWidth!);\n return unsupportedIntrinsic('does not support flexGrow during intrinsic measurement');\n }\n const shrink = nonnegativeFactor(\n style.flexShrink ?? 1,\n 'flexShrink',\n child,\n diagnosticBox,\n );\n const basis = style.flexBasis ?? 'auto';\n if (wrappedIntrinsic && (!hasEmptyRectangleMinimum(child, style, preparedStyleQuery(prepared)) || shrink !== 0 || basis !== 'auto')) return measureAllocatedFlex(input, children, measuredWidth!);\n const mainProperty = row ? 'width' : 'height';\n const crossProperty = row ? 'height' : 'width';\n const minimumProperty = row ? 'minWidth' : 'minHeight';\n if ((shrink > 0 || basis === 'auto') && style[minimumProperty] === undefined &&\n !hasEmptyRectangleMinimum(child, style, preparedStyleQuery(prepared))) {\n if (nativeLayout && row && widthDefinite && !heightDefinite && getPrimitiveDefinition(layoutChild.type)?.measureIntrinsic) return measureAllocatedFlex(input, children, measuredWidth!);\n throw childDiagnostic(\n child,\n minimumProperty,\n style[minimumProperty],\n diagnosticBox,\n 'an explicit main-axis minimum is required for shrink or auto basis',\n );\n }\n const mainValue = basis === 'auto' ? style[mainProperty] : basis;\n const crossValue = style[crossProperty];\n if (isPercentage(mainValue) || isPercentage(crossValue) ||\n hasPercentageBounds(style)) {\n return unsupportedIntrinsic('does not support percentage child sizes or bounds');\n }\n let baseMain: number;\n let baseCross: number;\n const provider = rowItems && layoutChild.type !== Text ? getPrimitiveDefinition(layoutChild.type) : undefined;\n const measureCross = !!rowItems && !!provider?.measureIntrinsic && !!provider.measure &&\n (crossValue === undefined || crossValue === 'auto');\n if (rowItems && preparedStyleQuery(prepared)) return unsupportedIntrinsic('does not support responsive child queries during solved row measurement');\n if (nativeLayout && layoutChild.type === Flex &&\n (style.flexDirection ?? 'row') === options.flexDirection &&\n options.flexWrap === 'nowrap' && (style.flexWrap ?? 'nowrap') === 'nowrap' &&\n options.layoutDirection === 'ltr' && (style.layoutDirection ?? 'ltr') === 'ltr' &&\n (mainValue === undefined || mainValue === 'auto') &&\n typeof crossValue === 'number' && Number.isFinite(crossValue) && crossValue >= 0 &&\n grow === 0 && shrink === 0) {\n // A declared same-axis owner can contribute its natural main size through\n // the shared pure context. Its finite cross size makes this descent acyclic.\n const measuredChild = clonePibblElement(layoutChild);\n setPreNormalizedStyle(measuredChild, style, layoutChild, layoutReceiverToken, preparedStyleQuery(prepared));\n const previousContribution = requestedIntrinsicContribution;\n requestedIntrinsicContribution = { receiver: layoutReceiverToken, axis: row ? 'row' : 'column' };\n let result: MeasureResult;\n try {\n result = input.measureElement(measuredChild, row ? {\n minWidth: 0, maxWidth: input.constraints.maxWidth, minHeight: crossValue, maxHeight: crossValue,\n } : {\n minWidth: crossValue, maxWidth: crossValue, minHeight: 0, maxHeight: input.constraints.maxHeight,\n });\n } finally {\n requestedIntrinsicContribution = previousContribution;\n }\n if (result.status !== 'measured') return result;\n baseMain = row ? result.size.width : result.size.height;\n baseCross = crossValue;\n } else if (nativeLayout && !row && widthDefinite && !heightDefinite &&\n (child.type === Text || layoutChild.type === Flow || layoutChild.type === Grid || layoutChild.type === Flex && isColumnDirection(style.flexDirection) && (style.flexWrap ?? 'nowrap') === 'nowrap') &&\n (mainValue === undefined || mainValue === 'auto' || crossValue === undefined || crossValue === 'auto')) {\n // Descend only through known built-in columns at settled content widths.\n // The shared measurement context detects descriptor cycles; there is no\n // speculative component execution, percentage feedback or fixed-point loop.\n const padding = normalizeBoxInsets(style, childContext(child, diagnosticBox));\n const automaticWidth = crossValue === undefined || crossValue === 'auto';\n if (automaticWidth && effectiveAlignment(normalizeItemAlignment(style.alignSelf, child, diagnosticBox), options.alignItems) !== 'stretch') {\n return unsupportedIntrinsic('requires stretch or a definite child width in an auto-height column');\n }\n const availableWidth = resolveMeasuredContainerLength(measuredWidth!, input.constraints.maxWidth, 'width', input.constraints);\n const minWidth = intrinsicOptionalNumber(style.minWidth, 0, 'minWidth');\n const maxWidth = intrinsicOptionalNumber(style.maxWidth, Number.POSITIVE_INFINITY, 'maxWidth');\n if (minWidth > maxWidth) throw childDiagnostic(child, 'minWidth', minWidth, diagnosticBox, 'minimum must not exceed maximum');\n const usedWidth = clamp(automaticWidth ? Math.max(0, availableWidth-padding.left-padding.right-marginCross) : intrinsicNumber(crossValue, 'width'), minWidth, maxWidth);\n const measuredChild = clonePibblElement(layoutChild);\n const measuredStyle = { ...style, width: usedWidth };\n setPreNormalizedStyle(measuredChild, measuredStyle, layoutChild, getPrimitiveReceiverToken(layoutChild) ?? receiverToken, preparedStyleQuery(prepared));\n const result = input.measureElement(measuredChild, { minWidth: 0, maxWidth: usedWidth, minHeight: 0, maxHeight: input.constraints.maxHeight });\n if (result.status !== 'measured') return result;\n baseMain = mainValue === undefined || mainValue === 'auto' ? result.size.height : intrinsicNumber(mainValue, 'flexBasis');\n baseCross = usedWidth;\n } else {\n if (mainValue === undefined || mainValue === 'auto') {\n return unsupportedIntrinsic('requires a definite child basis; measured auto basis is deferred');\n }\n if ((crossValue === undefined || crossValue === 'auto') && !measureCross) {\n return unsupportedIntrinsic('requires a definite child cross size');\n }\n baseMain = intrinsicNumber(mainValue, 'flexBasis');\n baseCross = measureCross ? 0 : intrinsicNumber(crossValue, crossProperty);\n }\n const minMain = intrinsicOptionalNumber(style[minimumProperty], 0, minimumProperty);\n const maxMainProperty = row ? 'maxWidth' : 'maxHeight';\n const maxMain = intrinsicOptionalNumber(\n style[maxMainProperty],\n Number.POSITIVE_INFINITY,\n maxMainProperty,\n );\n const minCrossProperty = row ? 'minHeight' : 'minWidth';\n const maxCrossProperty = row ? 'maxHeight' : 'maxWidth';\n const minCross = intrinsicOptionalNumber(style[minCrossProperty], 0, minCrossProperty);\n const maxCross = intrinsicOptionalNumber(\n style[maxCrossProperty],\n Number.POSITIVE_INFINITY,\n maxCrossProperty,\n );\n const padding = normalizeBoxInsets(style, childContext(child, diagnosticBox));\n const paddingMain = row ? padding.left + padding.right :\n padding.top + padding.bottom;\n const paddingCross = row ? padding.top + padding.bottom :\n padding.left + padding.right;\n if (wrappedIntrinsic) {\n const outerMain = clamp(baseMain, minMain, maxMain) + paddingMain + marginLeft + marginRight;\n const crossExtent = clamp(baseCross, minCross, maxCross) + paddingCross + marginTop + marginBottom;\n const nextMain = lineMain + (lineItems > 0 ? mainGap : 0) + outerMain;\n if (!Number.isFinite(outerMain) || !Number.isFinite(crossExtent)) throw childDiagnostic(child, 'intrinsicLine', nextMain, diagnosticBox, 'wrapped intrinsic outer extents and line widths must remain finite');\n const outerCross = Math.max(0, crossExtent);\n if (lineItems > 0 && nextMain > wrapWidth) {\n wrappedHeight += lineCross + options.rowGap;\n if (!Number.isFinite(wrappedHeight)) throw childDiagnostic(child, 'intrinsicLine', wrappedHeight, diagnosticBox, 'wrapped intrinsic accumulated height must remain finite');\n lineCross = 0; lineItems = 0;\n }\n lineMain = lineItems > 0 ? nextMain : outerMain;\n if (!Number.isFinite(lineMain)) throw childDiagnostic(child, 'intrinsicLine', lineMain, diagnosticBox, 'wrapped intrinsic accumulated line width must remain finite');\n lineCross = Math.max(lineCross, outerCross);\n lineItems++;\n }\n if (rowItems) {\n rowItems.push({ sourceIndex, child, measuredChild: layoutChild, style, receiverToken: layoutReceiverToken, measureCross, baseMain, minMain, maxMain,\n paddingMain, grow, shrink, marginMainBefore: marginLeft, marginMainAfter: marginRight,\n baseCross, minCross, maxCross, paddingCross, marginCross });\n if (measureCross) requiresSolvedCross = true;\n } else {\n intrinsicMain += clamp(baseMain, minMain, maxMain) + paddingMain + marginMain;\n intrinsicCross = Math.max(intrinsicCross,\n clamp(baseCross, minCross, maxCross) + paddingCross + marginCross);\n }\n count++;\n }\n if (rowItems) {\n const targets = requiresSolvedCross ? solveTransientFlexMain(rowItems, measuredRowWidth!, mainGap) : undefined;\n for (let index = 0; index < rowItems.length; index++) {\n const item = rowItems[index];\n const main = targets ? targets[index] : clamp(item.baseMain, item.minMain, item.maxMain);\n let cross = item.baseCross;\n if (item.measureCross) {\n const measuredChild = clonePibblElement(item.measuredChild);\n const measuredStyle = { ...item.style, width: main };\n // The root clone keeps its layout-description source metadata, while\n // the style handoff still names the authored wrapper and uses the\n // prepared leaf receiver for provider input ownership.\n setPreNormalizedStyle(measuredChild, measuredStyle, item.child, item.receiverToken);\n const result = measureConstrainedLayoutChild(measuredChild, {\n minWidth: main, maxWidth: main, minHeight: 0, maxHeight: Number.POSITIVE_INFINITY,\n }, item.sourceIndex);\n if (result.status !== 'measured') return result;\n cross = result.size.height;\n }\n intrinsicMain += main + item.paddingMain + item.marginMainBefore! + item.marginMainAfter!;\n intrinsicCross = Math.max(intrinsicCross,\n clamp(cross, item.minCross, item.maxCross) + item.paddingCross + item.marginCross);\n }\n }\n intrinsicMain = Math.max(0, intrinsicMain + Math.max(0, count - 1) * mainGap);\n return { status: 'measured', size: {\n width: widthDefinite ? resolveMeasuredContainerLength(\n measuredWidth!,\n input.constraints.maxWidth,\n 'width',\n input.constraints,\n ) : row ? intrinsicMain : intrinsicCross,\n height: heightDefinite ? resolveMeasuredContainerLength(\n measuredHeight!,\n input.constraints.maxHeight,\n 'height',\n input.constraints,\n ) : row ? wrappedIntrinsic ? wrappedHeight + lineCross : intrinsicCross : intrinsicMain,\n } };\n}\n\nfunction intrinsicMainLength(value: unknown, property: string, child: PibblElement<any>, box: Readonly<LayoutBox>): { value?: number; unit: 'none' | 'point' | 'percent' } | undefined {\n if (value === undefined) return { unit: 'none' };\n if (typeof value === 'number' && Number.isFinite(value) && value >= 0) return { value, unit: 'point' };\n if (isPercentage(value)) return { value: parsePercentage(value, property, childContext(child, box)), unit: 'percent' };\n return undefined;\n}\n\n/**\n * The native query retains Yoga's two main-axis phases. It returns final numeric\n * child bounds, which are staged only for the matching normal placement; raw\n * percentage styles are deliberately left untouched for forwarding.\n */\nfunction measureStagedNonexactMain(\n input: MeasureInput<FlexProps, FlexStyle>,\n children: readonly PibblElement<any>[],\n options: Readonly<ReturnType<typeof normalizeFlexOptions>>,\n diagnosticBox: Readonly<LayoutBox>,\n allocated?: Readonly<{ main: number; rootMin?: number; rootMax?: number }>,\n): MeasureResult | undefined {\n if (!nativeLayout || options.flexWrap !== 'nowrap' || options.layoutDirection !== 'ltr') return;\n if (options.flexDirection !== 'row' && options.flexDirection !== 'column') return;\n const row = options.flexDirection === 'row';\n const automaticMain = row ? input.style.width === undefined || input.style.width === 'auto' : input.style.height === undefined || input.style.height === 'auto';\n const cross = row ? input.style.height : input.style.width;\n const available = row ? input.constraints.maxWidth : input.constraints.maxHeight;\n const ownerReference = Number.isFinite(available) ? available : undefined;\n const rootMin = allocated ? allocated.rootMin : intrinsicOwnerBound(\n row ? input.style.minWidth : input.style.minHeight, ownerReference, row ? 'minWidth' : 'minHeight', input.constraints,\n );\n const rootMax = allocated ? allocated.rootMax : intrinsicOwnerBound(\n row ? input.style.maxWidth : input.style.maxHeight, ownerReference, row ? 'maxWidth' : 'maxHeight', input.constraints,\n );\n if (input.style.padding !== undefined || input.style.paddingStart !== undefined || input.style.paddingEnd !== undefined ||\n input.style.borderWidth !== undefined || input.style.borderStartWidth !== undefined || input.style.borderEndWidth !== undefined ||\n input.style.boxSizing !== undefined || input.style.aspectRatio !== undefined ||\n (row ? input.style.minHeight !== undefined && input.style.minHeight !== 0 || input.style.maxHeight !== undefined : input.style.minWidth !== undefined && input.style.minWidth !== 0 || input.style.maxWidth !== undefined)) return;\n if (!automaticMain || typeof cross !== 'number' || !Number.isFinite(cross) || cross < 0 ||\n (rootMin !== undefined && (typeof rootMin !== 'number' || !Number.isFinite(rootMin) || rootMin < 0)) ||\n (rootMax !== undefined && (typeof rootMax !== 'number' || !Number.isFinite(rootMax) || rootMax < 0)) ||\n typeof input.style.gap === 'number' && input.style.gap !== 0 ||\n input.style.rowGap !== undefined || input.style.columnGap !== undefined) return;\n if (typeof rootMin === 'number' && typeof rootMax === 'number' && rootMin > rootMax) {\n throw layoutDiagnostic({ component: 'Flex', property: row ? 'minWidth' : 'minHeight', value: rootMin, algorithm: 'measurement', constraints: input.constraints, reason: 'minimum must not exceed maximum' });\n }\n const externalOwner = allocated?.main ?? ownerReference;\n // An authored maximum retains its own initial envelope. Otherwise a finite\n // caller maximum is fit-content availability, still distinct from exact size.\n const initialAvailable = allocated?.main ?? (typeof rootMax === 'number' ? rootMax : externalOwner);\n const mode = allocated !== undefined ? 'exact' as const : initialAvailable === undefined ? 'max-content' as const : 'fit-content' as const;\n let hasPercentageBound = false;\n const items: { base: number; min: { value?: number; unit: 'none' | 'point' | 'percent' }; max: { value?: number; unit: 'none' | 'point' | 'percent' }; measured?: boolean; queryMaximum?: number }[] = [];\n const measuredLeaves: { readonly sourceIndex: number; readonly child: PibblElement<any>; readonly normalized: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>; readonly receiver: object; readonly query: PreparedQuery | undefined }[] = [];\n for (let sourceIndex = 0; sourceIndex < children.length; sourceIndex++) {\n const child = children[sourceIndex];\n const definition = getPrimitiveDefinition(child.type);\n const pairedMeasuredLeaf = child.type !== Rectangle && child.type !== Text && !isKnownLayoutType(child.type) &&\n !Object.hasOwn(child.props, 'children') && !!definition?.measureIntrinsic && !!definition.measure;\n if ((!pairedMeasuredLeaf && (child.type !== Rectangle || Object.hasOwn(child.props, 'children'))) ||\n !child.props.style || typeof child.props.style !== 'object' || isSignal(child.props.style)) return;\n const receiver = getChildPrimitiveReceiverToken(GLOBAL_STATE.renderTransaction, GLOBAL_STATE.primitiveReceiverToken, sourceIndex);\n const prepared = prepareDirectChildStyle(child, receiver, diagnosticBox, true);\n const style = preparedStyleValue(prepared) as Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>;\n validateIntrinsicBound(style.minWidth, 'minWidth', child, diagnosticBox);\n validateIntrinsicBound(style.maxWidth, 'maxWidth', child, diagnosticBox);\n validateIntrinsicBound(style.minHeight, 'minHeight', child, diagnosticBox);\n validateIntrinsicBound(style.maxHeight, 'maxHeight', child, diagnosticBox);\n const main = row ? style.width : style.height;\n const basis = style.flexBasis ?? 'auto';\n const childCross = row ? style.height : style.width;\n const min = row ? style.minWidth : style.minHeight;\n const max = row ? style.maxWidth : style.maxHeight;\n const automaticMeasuredMain = main === undefined || main === 'auto';\n if (preparedStyleQuery(prepared) || style.position !== undefined || style.aspectRatio !== undefined ||\n (pairedMeasuredLeaf && (row ? style.minHeight !== undefined && style.minHeight !== 0 || style.maxHeight !== undefined : style.minWidth !== undefined && style.minWidth !== 0 || style.maxWidth !== undefined)) ||\n typeof childCross !== 'number' || !Number.isFinite(childCross) || childCross < 0 ||\n (style.flexGrow ?? 0) !== 0 || (style.flexShrink ?? 1) !== 0 ||\n !zeroIntrinsicMargin(style.margin) || !zeroIntrinsicMargin(style.marginTop) || !zeroIntrinsicMargin(style.marginRight) ||\n !zeroIntrinsicMargin(style.marginBottom) || !zeroIntrinsicMargin(style.marginLeft) ||\n !zeroIntrinsicMargin(style.marginStart) || !zeroIntrinsicMargin(style.marginEnd) ||\n style.padding !== undefined || style.paddingStart !== undefined || style.paddingEnd !== undefined ||\n style.borderWidth !== undefined || style.borderStartWidth !== undefined || style.borderEndWidth !== undefined ||\n (pairedMeasuredLeaf ? !automaticMeasuredMain || basis !== 'auto' :\n typeof main !== 'number' || !Number.isFinite(main) || main < 0 ||\n typeof basis !== 'number' || !Number.isFinite(basis) || basis < 0 || main !== basis)) return;\n const intrinsicMin = intrinsicMainLength(min, row ? 'minWidth' : 'minHeight', child, diagnosticBox);\n const intrinsicMax = intrinsicMainLength(max, row ? 'maxWidth' : 'maxHeight', child, diagnosticBox);\n if (!intrinsicMin || !intrinsicMax) return;\n if (intrinsicMin.unit === 'percent' || intrinsicMax.unit === 'percent') hasPercentageBound = true;\n items.push({ base: pairedMeasuredLeaf ? 0 : basis as number, min: intrinsicMin, max: intrinsicMax, measured: pairedMeasuredLeaf || undefined });\n if (pairedMeasuredLeaf) measuredLeaves.push({ sourceIndex, child, normalized: style, receiver, query: preparedStyleQuery(prepared) });\n }\n if (!items.length || !hasPercentageBound) return;\n const intrinsicQuery = { externalOwner, initialAvailable, rootMin: rootMin as number | undefined,\n rootMax: rootMax as number | undefined, mode, gap: 0 };\n if (measuredLeaves.length) {\n const preparedQueries = prepareTransientIntrinsicMainQueries(items, intrinsicQuery);\n for (let index = 0; index < measuredLeaves.length; index++) {\n const leaf = measuredLeaves[index];\n const queryMaximum = preparedQueries.maximums[leaf.sourceIndex];\n const measurementChild = clonePibblElement(leaf.child);\n setPreNormalizedStyle(measurementChild, leaf.normalized, leaf.child, leaf.receiver, leaf.query);\n const leafCross = (row ? leaf.normalized.height : leaf.normalized.width) as number;\n const constraints = row ? { minWidth: 0, maxWidth: queryMaximum, minHeight: leafCross, maxHeight: leafCross } :\n { minWidth: leafCross, maxWidth: leafCross, minHeight: 0, maxHeight: queryMaximum };\n const result = measureConstrainedLayoutChild(measurementChild, constraints);\n if (result.status === 'unsupported') return result;\n const natural = row ? result.size.width : result.size.height;\n if (!Number.isFinite(natural) || natural < 0) throw new Error('Experimental staged intrinsic Flex provider returned an invalid main size.');\n items[leaf.sourceIndex] = { ...items[leaf.sourceIndex], base: natural, measured: true, queryMaximum };\n }\n }\n const receiver = GLOBAL_STATE.primitiveReceiverToken;\n const axis = row ? 'row' : 'column';\n // A same-axis known Flex is contributing to a parent's intrinsic line. Its\n // parent needs the adjusted native contribution, while standalone queries\n // deliberately continue to report the full resolved size.\n const contribution = allocated === undefined && requestedIntrinsicContribution !== undefined && requestedIntrinsicContribution.receiver === receiver &&\n requestedIntrinsicContribution.axis === axis;\n const normalOwner = contribution && requestedIntrinsicContribution?.normalOwner === true && !measuredLeaves.length &&\n externalOwner !== undefined && Number.isFinite(externalOwner) && initialAvailable !== undefined && Number.isFinite(initialAvailable);\n const resolved = normalOwner ? resolveTransientKnownOwnerMain(items, intrinsicQuery) : resolveTransientIntrinsicMain(items, intrinsicQuery);\n const stagedMain = allocated?.main ?? (contribution ? resolved.contributionMain : resolved.main);\n stagePreparedIntrinsicMain(receiver, {\n elements: children, axis, style: input.style, rootMin, rootMax, contentMain: stagedMain,\n normalOwner, autoMarginFreeMain: resolved.autoMarginFreeMain,\n revision: allocationInputRevision(),\n items: resolved.targets.map((target, sourceIndex) => ({\n sourceIndex, target, min: resolved.effectiveMins[sourceIndex], max: resolved.effectiveMaxes[sourceIndex],\n measured: items[sourceIndex].measured,\n })),\n });\n const reportedMain = contribution ? resolved.contributionMain : resolved.main;\n return { status: 'measured', size: row ? { width: reportedMain, height: cross } : { width: cross, height: reportedMain } };\n}\n\n/** Auto edges contribute zero; positive numeric edges need a separate phase profile. */\nfunction zeroIntrinsicMargin(value: FlexItemStyle['margin']): boolean {\n return value === undefined || value === 0 || value === 'auto';\n}\n\n/** Own bounds use the caller reference, never the eventual auto-owner size. */\nfunction intrinsicOwnerBound(\n value: BoxStyle['minWidth'], reference: number | undefined,\n property: string, constraints: Readonly<Constraints>,\n): number | undefined {\n if (value === undefined) return;\n if (typeof value === 'number') {\n if (Number.isFinite(value) && value >= 0) return value;\n throw layoutDiagnostic({ component: 'Flex', property, value, algorithm: 'measurement', constraints, reason: 'must be finite and nonnegative' });\n }\n const percentage = parsePercentage(value, property, { component: 'Flex', algorithm: 'measurement', constraints });\n if (percentage < 0) throw layoutDiagnostic({ component: 'Flex', property, value, algorithm: 'measurement', constraints, reason: 'must be nonnegative' });\n if (reference === undefined) return;\n const resolved = percentage / 100 * reference;\n if (!Number.isFinite(resolved)) throw layoutDiagnostic({ component: 'Flex', property, value, algorithm: 'measurement', constraints, reason: 'resolved percentage arithmetic must remain finite' });\n return resolved;\n}\n\nfunction resolveMeasuredContainerLength(\n value: Exclude<BoxStyle['width'], undefined>,\n reference: number,\n property: string,\n constraints: Readonly<Constraints>,\n): number {\n const resolved = resolveScalarSizingLength(value, reference, property, {\n component: 'Flex',\n algorithm: 'measurement',\n constraints,\n });\n if (resolved === undefined || resolved < 0) {\n throw layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'measurement',\n constraints,\n reason: 'requires a definite nonnegative container size',\n });\n }\n return resolved;\n}\n\nfunction intrinsicNumber(\n value: unknown,\n property: string,\n): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'measurement',\n reason: 'intrinsic measurement requires finite nonnegative numeric sizes',\n });\n }\n return value;\n}\n\nfunction validateIntrinsicBound(value: unknown, property: string, child: PibblElement<any>, container: Readonly<LayoutBox>): void {\n if (value === undefined) return;\n if (typeof value === 'number') {\n if (!Number.isFinite(value) || value < 0) throw childDiagnostic(child, property, value, container, 'must be finite and nonnegative');\n return;\n }\n const percentage = parsePercentage(value, property, childContext(child, container));\n if (percentage < 0) throw childDiagnostic(child, property, value, container, 'must be nonnegative');\n}\n\nfunction intrinsicOptionalNumber(\n value: unknown,\n fallback: number,\n property: string,\n): number {\n return value === undefined ? fallback : intrinsicNumber(value, property);\n}\n\nfunction isPercentage(value: unknown): boolean {\n return typeof value === 'string' && value.endsWith('%');\n}\n\nfunction hasPercentageBounds(style: Readonly<BoxStyle>): boolean {\n return isPercentage(style.minWidth) || isPercentage(style.maxWidth) ||\n isPercentage(style.minHeight) || isPercentage(style.maxHeight);\n}\n\nfunction unsupportedIntrinsic(reason: string): MeasureResult {\n return {\n status: 'unsupported',\n reason: `Flex intrinsic measurement ${reason}`,\n };\n}\n\nexport function layoutFlex(\n container: Readonly<LayoutBox>,\n children: PibblNodeInput,\n style: Readonly<FlexStyle>,\n measurement: FlexMeasurementInput,\n): LayoutBox[] {\n const prepared = materializeLayoutChildren(children, 'Flex');\n const region = nativeLayout ? new LayoutRegion() : undefined;\n try {\n return resolveFlexPlacements(\n container,\n prepared,\n style,\n measurement,\n region,\n ).map(placement => placement.box);\n } finally { region?.dispose(); }\n}\n\nfunction resolveFlexPlacements(\n container: Readonly<LayoutBox>,\n children: readonly PibblElement<any>[],\n style: Readonly<FlexStyle>,\n measurement: FlexMeasurementInput,\n region?: LayoutRegion,\n stagedIntrinsic?: PreparedIntrinsicMainStage,\n parentSlot?: PreparedLayoutSlot,\n deferStaticAbsolute?: Array<DeferredStaticAbsolutePlacement | undefined>,\n): FlexPlacement[] {\n if (region) recordWasmAllocationPass();\n assertFiniteBox(container);\n const options = normalizeFlexOptions(style, container);\n const row = isRowDirection(options.flexDirection);\n const authoredReverse = options.flexDirection === 'row-reverse' || options.flexDirection === 'column-reverse';\n const reverse = authoredReverse !== (row && options.layoutDirection === 'rtl');\n const authoredWrapReverse = options.flexWrap === 'wrap-reverse';\n const wrapReverse = authoredWrapReverse !== (!row && options.layoutDirection === 'rtl');\n const mainSize = row ? container.width : container.height;\n const crossSize = row ? container.height : container.width;\n const mainGap = row ? options.columnGap : options.rowGap;\n const crossGap = row ? options.rowGap : options.columnGap;\n const items: FlexItem[] = [];\n const placementsBySource: Array<FlexPlacement | undefined> = new Array(children.length);\n let hasAspectRatio = false;\n let hasAutoMainMargins = false;\n let absolutePaddingBox: Readonly<LayoutBox> | undefined;\n let absoluteMeasurementTokens: Set<object> | undefined;\n\n const occurrences = new Map<object, number>();\n for (let sourceIndex = 0; sourceIndex < children.length; sourceIndex++) {\n const child = children[sourceIndex];\n if (region) recordWasmAllocationItem();\n const receiverToken = getChildPrimitiveReceiverToken(\n GLOBAL_STATE.renderTransaction,\n GLOBAL_STATE.primitiveReceiverToken,\n sourceIndex,\n );\n const occurrence = occurrences.get(child.type) ?? 0;\n if (child.key === undefined) occurrences.set(child.type, occurrence + 1);\n const prepared = prepareDirectChildStyle(child, receiverToken, container, true);\n const declared = preparedStyleValue(prepared) as Readonly<\n BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>\n >;\n let normalized = declared;\n if (nativeLayout) normalized = resolveAllocatedInsets(normalized, { width: container.width, layoutDirection: options.layoutDirection, context: childContext(child, container) });\n if (normalized.boxSizing !== undefined) normalized = contentBoxStyle(normalized, { width: container.width, height: container.height, mainAxis: row ? 'width' : 'height', context: childContext(child, container) });\n const stagedItem = stagedIntrinsic?.items[sourceIndex];\n if (stagedItem && stagedItem.sourceIndex !== sourceIndex) throw new Error('Staged intrinsic Flex children are out of source order.');\n const stagedMeasured = stagedItem?.measured === true;\n const aspectRatio = normalized.aspectRatio;\n if (aspectRatio !== undefined && (typeof aspectRatio !== 'number' || !Number.isFinite(aspectRatio) || aspectRatio <= 0)) {\n throw childDiagnostic(child, 'aspectRatio', aspectRatio, container, 'must be a positive finite outer width/height ratio');\n }\n if (nativeLayout && aspectRatio !== undefined && normalized.position !== 'absolute' &&\n (normalized.flexBasis === undefined || normalized.flexBasis === 'auto')) {\n const main = normalized[row ? 'width' : 'height'], cross = normalized[row ? 'height' : 'width'];\n if ((main === undefined || main === 'auto') && typeof cross === 'number') {\n const insets = normalizeBoxInsets(normalized, childContext(child, container));\n const crossInsets = row ? insets.top + insets.bottom : insets.left + insets.right;\n const mainInsets = row ? insets.left + insets.right : insets.top + insets.bottom;\n const outer = row ? (cross + crossInsets) * aspectRatio : (cross + crossInsets) / aspectRatio;\n normalized = { ...normalized, [row ? 'width' : 'height']: Math.max(0, outer - mainInsets) };\n }\n }\n assertSupportedChildPosition('Flex', child, normalized, true);\n rejectUnsupportedItemFields(child, normalized, container);\n if (options[FLEX_BASELINE_GROUP] && normalized.position === 'absolute') {\n throw childDiagnostic(child, 'position', 'absolute', container, 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: absolute children are outside first-baseline composition');\n }\n if (normalized.position === 'absolute') {\n const definition = getPrimitiveDefinition(child.type);\n const hasPairedMeasurement = child.type !== Text && !!definition?.measureIntrinsic && !!definition.measure;\n const measurableText = child.type === Text &&\n (normalized.wrap === undefined || typeof normalized.wrap === 'boolean') &&\n (normalized.fit === undefined || normalized.fit === 'visible') &&\n (normalized.overflow === undefined || normalized.overflow === 'visible' || normalized.overflow === 'clip') && genericTextFont(normalized);\n const unwrappedText = measurableText && normalized.wrap !== true;\n const automaticWidth = normalized.width === undefined || normalized.width === 'auto';\n const automaticHeight = normalized.height === undefined || normalized.height === 'auto';\n const naturalBoth = unwrappedText && automaticWidth && automaticHeight && normalized.aspectRatio === undefined &&\n (absoluteLeftInset(normalized, options.layoutDirection) === undefined || absoluteRightInset(normalized, options.layoutDirection) === undefined) &&\n (normalized.top === undefined || normalized.bottom === undefined);\n const naturalWidth = naturalBoth || automaticWidth &&\n isAbsoluteSizeInput(normalized.height) &&\n normalized.aspectRatio === undefined && (absoluteLeftInset(normalized, options.layoutDirection) === undefined || absoluteRightInset(normalized, options.layoutDirection) === undefined) &&\n (hasPairedMeasurement || unwrappedText);\n const naturalHeight = naturalBoth || automaticHeight &&\n isAbsoluteSizeInput(normalized.width) &&\n normalized.aspectRatio === undefined && (normalized.top === undefined || normalized.bottom === undefined) &&\n (hasPairedMeasurement || measurableText);\n assertSupportedAbsoluteFlexPosition(child, normalized, container, options.layoutDirection, preparedStyleQuery(prepared), naturalWidth, naturalHeight);\n const measurementToken = naturalWidth || naturalHeight ? region?.absoluteMeasurementIdentity(child.type,\n child.key === undefined ? `occurrence:${occurrence}` : `key:${typeof child.key}:${child.key}`) : undefined;\n if (measurementToken) (absoluteMeasurementTokens ??= new Set()).add(measurementToken);\n const absoluteMeasurement = naturalWidth || naturalHeight ? measurement : undefined;\n if (deferStaticAbsolute) {\n deferStaticAbsolute[sourceIndex] = { sourceIndex, child, style: normalized, receiverToken,\n query: preparedStyleQuery(prepared), measurement: absoluteMeasurement, measurementToken };\n placementsBySource[sourceIndex] = deferredStaticPlacementSentinel();\n } else placementsBySource[sourceIndex] = resolveAbsoluteFlexPlacement(\n absolutePaddingBox ??= resolveFlexContainingBox(style, container), child, normalized, receiverToken,\n preparedStyleQuery(prepared), container, options, absoluteMeasurement, region, measurementToken,\n );\n continue;\n }\n if (aspectRatio !== undefined) hasAspectRatio = true;\n const layoutChild = isLayoutComponent(child.type) ? prepareLayoutComponent(child, { receiverToken }) : child;\n const pairedLayoutDefinition = getPrimitiveDefinition(layoutChild.type);\n const knownIntrinsicLayout = child.type === Flex || layoutChild.type === Flow || layoutChild.type === Grid || layoutChild.type === Flex &&\n isColumnDirection(normalized.flexDirection) && (normalized.flexWrap ?? 'nowrap') === 'nowrap';\n const layoutToken = region?.identity(child.type, child.key === undefined ? `occurrence:${occurrence}` : `key:${typeof child.key}:${child.key}`);\n let relativeX = 0;\n let relativeY = 0;\n const position = normalized.position;\n if (position !== undefined) {\n assertSupportedRelativeFlexPosition(child, normalized, options, container);\n const left = resolveFlexInset(normalized.left, 'left', child, container);\n const right = resolveFlexInset(normalized.right, 'right', child, container);\n const top = resolveFlexInset(normalized.top, 'top', child, container);\n const bottom = resolveFlexInset(normalized.bottom, 'bottom', child, container);\n if (position === 'relative') {\n if (options.layoutDirection === 'rtl') relativeX = right === undefined ? left ?? 0 : -right;\n else relativeX = left === undefined ? right === undefined ? 0 : -right : left;\n relativeY = top === undefined ? bottom === undefined ? 0 : -bottom : top;\n }\n }\n const allMargin = normalized.margin === 'auto' ? 'auto' : allocatedMargin(normalized.margin, 'margin', child, container);\n const marginDirection = layoutChild.type === Flex ? normalized.layoutDirection ?? options.layoutDirection : options.layoutDirection;\n const logicalLeft = marginDirection === 'rtl' ? normalized.marginEnd : normalized.marginStart;\n const logicalRight = marginDirection === 'rtl' ? normalized.marginStart : normalized.marginEnd;\n const marginLeftProperty = logicalLeft !== undefined ? marginDirection === 'rtl' ? 'marginEnd' : 'marginStart' : 'marginLeft';\n const marginRightProperty = logicalRight !== undefined ? marginDirection === 'rtl' ? 'marginStart' : 'marginEnd' : 'marginRight';\n const marginTopValue = normalized.marginTop === undefined ? allMargin : normalized.marginTop;\n const marginBottomValue = normalized.marginBottom === undefined ? allMargin : normalized.marginBottom;\n const marginRightValue = logicalRight !== undefined ? logicalRight : normalized.marginRight === undefined ? allMargin : normalized.marginRight;\n const marginLeftValue = logicalLeft !== undefined ? logicalLeft : normalized.marginLeft === undefined ? allMargin : normalized.marginLeft;\n const autoTop = marginTopValue === 'auto', autoRight = marginRightValue === 'auto';\n const autoBottom = marginBottomValue === 'auto', autoLeft = marginLeftValue === 'auto';\n const declaredCrossSize = row ? normalized.height : normalized.width;\n const hasAutoCrossMargin = row ? autoTop || autoBottom : autoLeft || autoRight;\n const measuredCrossContext = hasAutoCrossMargin && nativeLayout && row &&\n (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined;\n const columnNaturalWrappedTextCross = nativeLayout && !row &&\n options.flexWrap === 'nowrap' &&\n child.type === Text && (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n typeof declared.height === 'number' && typeof normalized.height === 'number' &&\n Number.isFinite(normalized.height) && normalized.height >= 0 &&\n (normalized.flexBasis === undefined || normalized.flexBasis === 'auto') &&\n (normalized.flexGrow ?? 0) === 0 && normalized.flexShrink === 0 && normalized.minHeight === 0 &&\n normalized.maxHeight === undefined && (normalized.minWidth === undefined || normalized.minWidth === 0) && normalized.maxWidth === undefined &&\n normalized.wrap === true &&\n (normalized.fit === undefined || normalized.fit === 'visible') &&\n (normalized.overflow === undefined || normalized.overflow === 'visible' || normalized.overflow === 'clip') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined && genericTextFont(normalized);\n const measuredColumnTextCross = hasAutoCrossMargin && nativeLayout && !row &&\n options.flexWrap === 'nowrap' &&\n child.type === Text && (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n (normalized.height === undefined || normalized.height === 'auto' ||\n typeof normalized.height === 'number' && Number.isFinite(normalized.height) && normalized.height >= 0) &&\n (normalized.flexBasis === undefined || normalized.flexBasis === 'auto' ||\n typeof normalized.flexBasis === 'number' && Number.isFinite(normalized.flexBasis) && normalized.flexBasis >= 0) &&\n (normalized.flexGrow ?? 0) === 0 && normalized.flexShrink === 0 && normalized.minHeight === 0 &&\n normalized.maxHeight === undefined && normalized.minWidth === undefined && normalized.maxWidth === undefined &&\n (normalized.wrap === undefined || normalized.wrap === false) &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined;\n const measuredColumnProviderCrossDefinition = hasAutoCrossMargin && nativeLayout && !row &&\n options.flexWrap === 'nowrap' &&\n (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n typeof declared.height === 'number' && typeof normalized.height === 'number' &&\n Number.isFinite(normalized.height) && normalized.height >= 0 &&\n (normalized.flexBasis === undefined || normalized.flexBasis === 'auto') &&\n (normalized.flexGrow ?? 0) === 0 && normalized.flexShrink === 0 && normalized.minHeight === 0 &&\n normalized.maxHeight === undefined && normalized.minWidth === undefined && normalized.maxWidth === undefined &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined && child.type !== Text ?\n getPrimitiveDefinition(child.type) : undefined;\n const measuredColumnProviderCross = !!measuredColumnProviderCrossDefinition?.measureIntrinsic &&\n !!measuredColumnProviderCrossDefinition.measure;\n const measuredColumnKnownCrossAuto = hasAutoCrossMargin && nativeLayout && !row &&\n options.flexWrap === 'nowrap' &&\n isKnownLayoutType(layoutChild.type) && (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n typeof declared.height === 'number' && typeof normalized.height === 'number' &&\n Number.isFinite(normalized.height) && normalized.height >= 0 &&\n (normalized.flexBasis === undefined || normalized.flexBasis === 'auto') &&\n (normalized.flexGrow ?? 0) === 0 && normalized.flexShrink === 0 && normalized.minHeight === 0 &&\n normalized.maxHeight === undefined && (normalized.minWidth === undefined || normalized.minWidth === 0) && normalized.maxWidth === undefined &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined;\n // In a finite column the main allocation is authoritative. For these\n // measured children, wait until the kernel settles height, then obtain the\n // natural width under that exact height before cross placement.\n const deferredColumnAutoCross = hasAutoCrossMargin && nativeLayout && !row &&\n options.flexWrap === 'nowrap' &&\n (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined && (\n child.type === Text &&\n (normalized.wrap === undefined || normalized.wrap === false) ||\n layoutChild.type !== Text && !!pairedLayoutDefinition?.measureIntrinsic && !!pairedLayoutDefinition.measure ||\n layoutChild.type === Flex || layoutChild.type === Flow || layoutChild.type === Grid\n );\n // Main sizing remains authoritative. The existing Text resolver uses\n // the shared settled-width pass before a row cross-auto margin is placed.\n const measuredTextCrossAuto = hasAutoCrossMargin && nativeLayout && row &&\n child.type === Text && (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined;\n const autoCrossDefinition = measuredCrossContext && !measuredTextCrossAuto ? pairedLayoutDefinition : undefined;\n const measuredPrimitiveCrossAuto = !!autoCrossDefinition?.measureIntrinsic && !!autoCrossDefinition.measure;\n const measuredKnownCrossAuto = measuredCrossContext && (layoutChild.type === Flex || layoutChild.type === Flow || layoutChild.type === Grid);\n // Remaining ordinary providers keep the same finite-availability query as\n // non-stretch sizing; an intrinsic callback is not a cross-size prerequisite.\n const ordinaryCrossAuto = hasAutoCrossMargin && nativeLayout &&\n (row || options.flexWrap === 'nowrap') &&\n (declaredCrossSize === undefined || declaredCrossSize === 'auto') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined && !!pairedLayoutDefinition?.measure;\n if (hasAutoCrossMargin && !measuredTextCrossAuto && !measuredColumnTextCross && !columnNaturalWrappedTextCross && !measuredColumnProviderCross && !measuredColumnKnownCrossAuto && !deferredColumnAutoCross && !measuredPrimitiveCrossAuto && !measuredKnownCrossAuto && !ordinaryCrossAuto &&\n aspectRatio === undefined && (declaredCrossSize === undefined || declaredCrossSize === 'auto')) {\n throw childDiagnostic(child, row ? autoTop ? 'marginTop' : 'marginBottom' : autoLeft ? marginLeftProperty : marginRightProperty, 'auto', container, 'auto cross-axis margins require a finite numeric child cross size or supported measurement');\n }\n const autoCrossBefore = row ? wrapReverse ? autoBottom : autoTop : wrapReverse ? autoRight : autoLeft;\n const autoCrossAfter = row ? wrapReverse ? autoTop : autoBottom : wrapReverse ? autoLeft : autoRight;\n const autoMainBefore = row ? reverse ? autoRight : autoLeft : reverse ? autoBottom : autoTop;\n const autoMainAfter = row ? reverse ? autoLeft : autoRight : reverse ? autoTop : autoBottom;\n if (autoMainBefore || autoMainAfter) hasAutoMainMargins = true;\n const marginTop = allocatedMargin(autoTop ? 0 : marginTopValue, 'marginTop', child, container);\n const marginRight = allocatedMargin(autoRight ? 0 : marginRightValue, marginRightProperty, child, container);\n const marginBottom = allocatedMargin(autoBottom ? 0 : marginBottomValue, 'marginBottom', child, container);\n const marginLeft = allocatedMargin(autoLeft ? 0 : marginLeftValue, marginLeftProperty, child, container);\n const marginMainBefore = row ? reverse ? marginRight : marginLeft : reverse ? marginBottom : marginTop;\n const marginMainAfter = row ? reverse ? marginLeft : marginRight : reverse ? marginTop : marginBottom;\n const marginCrossBefore = row ? wrapReverse ? marginBottom : marginTop : wrapReverse ? marginRight : marginLeft;\n const marginCrossAfter = row ? wrapReverse ? marginTop : marginBottom : wrapReverse ? marginLeft : marginRight;\n const grow = nonnegativeFactor(normalized.flexGrow ?? 0, 'flexGrow', child, container);\n const shrink = nonnegativeFactor(\n normalized.flexShrink ?? 1,\n 'flexShrink',\n child,\n container,\n );\n const basisValue = normalized.flexBasis ?? 'auto';\n const alignment = normalizeItemAlignment(normalized.alignSelf, child, container, authoredWrapReverse);\n const padding = normalizeBoxInsets(normalized, childContext(child, container));\n const paddingMain = row ? padding.left + padding.right : padding.top + padding.bottom;\n const paddingCross = row ? padding.top + padding.bottom : padding.left + padding.right;\n const minimumProperty = row ? 'minWidth' : 'minHeight';\n // Natural Text contributions are independent of row orientation and line\n // direction. Native allocation still owns grow/shrink and line formation.\n const intrinsicTextSizing = nativeLayout && row && child.type === Text &&\n (normalized.fit === undefined || normalized.fit === 'visible') &&\n (normalized.overflow === undefined || normalized.overflow === 'visible' || normalized.overflow === 'clip') &&\n !preparedStyleQuery(prepared) && aspectRatio === undefined &&\n (normalized.width === undefined || normalized.width === 'auto' || typeof normalized.width === 'number') &&\n (normalized.maxWidth === undefined || typeof normalized.maxWidth === 'number');\n const automaticTextBasis = intrinsicTextSizing && basisValue === 'auto' &&\n (normalized.width === undefined || normalized.width === 'auto') &&\n (normalized.minWidth === undefined || typeof normalized.minWidth === 'number');\n const automaticTextMinimum = intrinsicTextSizing && normalized[minimumProperty] === undefined && shrink > 0 &&\n (typeof basisValue === 'number' || basisValue === 'auto' &&\n (typeof normalized.width === 'number' || automaticTextBasis));\n // An empty authored rectangle has no intrinsic content contribution. Keep\n // opaque/child-bearing primitives conservative without evaluating children.\n const aspectMain = basisValue === 'auto' ? normalized[row ? 'width' : 'height'] : basisValue;\n const aspectCross = normalized[row ? 'height' : 'width'];\n // An empty shape has no content floor. Aspect sizing still derives cross\n // size from the solved main allocation; it does not transfer a cross floor.\n const automaticAspectRectangleMinimum = nativeLayout && aspectRatio !== undefined &&\n child.type === Rectangle && !Object.hasOwn(child.props, 'children') && !preparedStyleQuery(prepared) &&\n typeof aspectMain === 'number' && Number.isFinite(aspectMain) && aspectMain >= 0 &&\n (aspectCross === undefined || aspectCross === 'auto' ||\n typeof aspectCross === 'number' && Number.isFinite(aspectCross) && aspectCross >= 0);\n const automaticRectangleMinimum = automaticAspectRectangleMinimum ||\n hasEmptyRectangleMinimum(child, normalized, preparedStyleQuery(prepared), true);\n // A selected intrinsic main value reuses the existing direct paired-provider\n // transaction. The established numeric grow/shrink/bounds path remains the\n // authority after this contribution becomes a number.\n const intrinsicMainValue = basisValue === undefined || basisValue === 'auto'\n ? normalized[row ? 'width' : 'height']\n : basisValue;\n const intrinsicMainBounds = isIntrinsicSizingValue(normalized[row ? 'minWidth' : 'minHeight']) || isIntrinsicSizingValue(normalized[row ? 'maxWidth' : 'maxHeight']);\n const intrinsicMainRequested = isIntrinsicSizingValue(intrinsicMainValue);\n const directIntrinsicTextMain = (intrinsicMainRequested || intrinsicMainBounds) &&\n !stagedMeasured && nativeLayout && row &&\n child.type === Text && !preparedStyleQuery(prepared);\n const directIntrinsicMain = (intrinsicMainRequested || intrinsicMainBounds) &&\n !stagedMeasured && nativeLayout &&\n row && !preparedStyleQuery(prepared) &&\n child.type !== Text && !isLayoutComponent(child.type) &&\n !!pairedLayoutDefinition?.measureIntrinsic && !!pairedLayoutDefinition.measure;\n const customIntrinsic = child.type !== Text && (!isKnownLayoutType(layoutChild.type) || directIntrinsicMain) && !stagedMeasured && nativeLayout && row &&\n !preparedStyleQuery(prepared) && !!pairedLayoutDefinition?.measureIntrinsic &&\n (!isLayoutComponent(child.type) || aspectRatio === undefined && !!pairedLayoutDefinition.measure) &&\n (directIntrinsicMain || basisValue === 'auto' && (normalized.width === undefined || normalized.width === 'auto') || shrink > 0 && normalized.minWidth === undefined);\n let intrinsicMainRequest: NormalizedSizingLength | undefined;\n if (intrinsicMainRequested && (directIntrinsicMain || directIntrinsicTextMain)) {\n intrinsicMainRequest = normalizeSizingLength(intrinsicMainValue, {\n reference: mainSize, property: basisValue === undefined || basisValue === 'auto' ? 'width' : 'flexBasis',\n context: childContext(child, container), allowAuto: false, allowIntrinsic: true,\n });\n }\n let intrinsicTextMinimum: number | undefined;\n let intrinsicTextBasis: number | undefined;\n let intrinsicTextMaximum: number | undefined;\n if (directIntrinsicTextMain) {\n const intrinsic = measureTextIntrinsicWidths(child, normalized, receiverToken, measurement, region);\n const maximum = intrinsic.maximum;\n if (!Number.isFinite(maximum) || maximum < 0) {\n throw childDiagnostic(child, 'width', intrinsicMainValue, container, 'Text intrinsic run width must be finite and nonnegative');\n }\n // An unwrapped run has no soft break opportunities in Text's public policy.\n intrinsicTextMinimum = intrinsic.minimum;\n intrinsicTextMaximum = maximum;\n if (intrinsicMainRequest) {\n intrinsicTextBasis = resolveIntrinsicMainBasis(intrinsicMainRequest, intrinsicTextMinimum, maximum, child, container);\n } else if (basisValue === 'auto' && (normalized.width === undefined || normalized.width === 'auto')) {\n intrinsicTextBasis = maximum;\n }\n }\n let intrinsicSizes: Extract<import('../types.js').IntrinsicSizesResult, { status: 'measured' }> | undefined;\n if (customIntrinsic) {\n const measurementChild = clonePibblElement(child);\n setPreNormalizedStyle(measurementChild, normalized, child, receiverToken);\n const result = measureIntrinsicElement(measurementChild, { minWidth: 0, maxWidth: container.width, minHeight: 0, maxHeight: container.height }, measurement.service, region ? { cache: region, token: layoutToken ?? receiverToken, recordMeasurement: recordWasmMeasurement, key: JSON.stringify([allocationStructuralRevision(), measurementStyle(normalized), container.width, container.height]) } : undefined);\n if (result.status === 'unsupported') throw childDiagnostic(child, 'measureIntrinsic', 'unsupported', container, `intrinsic measurement is required but unsupported: ${result.reason}; supply a definite basis and explicit minWidth: 0 to avoid the query`);\n intrinsicSizes = result;\n }\n\n // Intrinsic-pair heights belong to their respective widths. A column floor\n // instead needs natural content height measured at its declared exact width.\n const columnExactWidth = !row && typeof normalized.width === 'number' ? normalized.width :\n !row && (normalized.width === undefined || normalized.width === 'auto' || normalized.width === 'stretch') &&\n !hasAutoCrossMargin && effectiveAlignment(alignment, options.alignItems) === 'stretch' ?\n clamp(Math.max(0, crossSize - paddingCross - marginCrossBefore - marginCrossAfter),\n resolveOptionalBound(normalized.minWidth, crossSize, 'minWidth', 0, child, container),\n resolveOptionalBound(normalized.maxWidth, crossSize, 'maxWidth', Number.POSITIVE_INFINITY, child, container)) : undefined;\n const columnMinimumDefinition = nativeLayout && !row &&\n (intrinsicMainRequested || intrinsicMainBounds || shrink > 0 && normalized.minHeight === undefined) &&\n (normalized.height === undefined || normalized.height === 'auto' || typeof normalized.height === 'number' || isIntrinsicSizingValue(normalized.height)) &&\n columnExactWidth !== undefined && Number.isFinite(columnExactWidth) && columnExactWidth >= 0 && aspectRatio === undefined &&\n !preparedStyleQuery(prepared) ? getPrimitiveDefinition(layoutChild.type) : undefined;\n let columnMinimumSize: { width: number; height: number } | undefined;\n if (columnMinimumDefinition?.measure && (columnMinimumDefinition.measureIntrinsic || child.type === Text || knownIntrinsicLayout)) {\n const measurementChild = clonePibblElement(child);\n const measurementStyle = { ...normalized, width: columnExactWidth };\n setPreNormalizedStyle(measurementChild, measurementStyle, child, receiverToken);\n const result = measureFlexChild(measurementChild, {\n minWidth: columnExactWidth!, maxWidth: columnExactWidth!,\n minHeight: 0, maxHeight: Number.POSITIVE_INFINITY,\n }, measurementStyle, layoutToken ?? receiverToken, measurement, region, undefined, true);\n if (result.status === 'unsupported') throw childDiagnostic(child, 'minHeight', 'auto', container,\n `exact-width automatic minimum measurement is required but unsupported: ${result.reason}`);\n columnMinimumSize = result.size;\n if (intrinsicMainRequested) intrinsicMainRequest = normalizeSizingLength(intrinsicMainValue, {\n reference: mainSize, property: 'height', context: childContext(child, container), allowAuto: false, allowIntrinsic: true,\n });\n }\n\n if (!stagedMeasured && (shrink > 0 || basisValue === 'auto') && normalized[minimumProperty] === undefined && !automaticTextMinimum && !automaticTextBasis && !automaticRectangleMinimum && !intrinsicSizes && intrinsicTextMinimum === undefined && !columnMinimumSize) {\n throw childDiagnostic(\n child,\n minimumProperty,\n normalized[minimumProperty],\n container,\n 'an explicit main-axis minimum is required for shrink or auto basis',\n );\n }\n\n const mainProperty = row ? 'width' : 'height';\n const crossProperty = row ? 'height' : 'width';\n const mainReference = mainSize;\n const crossReference = crossSize;\n let measured: { width: number; height: number } | undefined = columnMinimumSize;\n const specifiedMain = normalized[mainProperty];\n const specifiedCross = normalized[crossProperty];\n const needsMeasuredMain = !stagedMeasured && basisValue === 'auto' &&\n (specifiedMain === undefined || specifiedMain === 'auto');\n if (aspectRatio !== undefined && needsMeasuredMain && !intrinsicSizes && !automaticTextBasis) throw childDiagnostic(child, 'aspectRatio', aspectRatio, container, 'requires a definite main dimension or flexBasis; intrinsic aspect sizing is unsupported');\n const crossAuto = specifiedCross === undefined || specifiedCross === 'auto';\n const measuredColumnWrapText = nativeLayout && !row && options.flexWrap !== 'nowrap' &&\n needsMeasuredMain && child.type === Text && aspectRatio === undefined &&\n typeof declared.width === 'number' && typeof normalized.width === 'number' &&\n Number.isFinite(normalized.width) && normalized.width >= 0 && declared.minHeight === 0 &&\n grow === 0 && shrink === 0 && normalized.wrap === true &&\n (normalized.fit === undefined || normalized.fit === 'visible') &&\n (normalized.overflow === undefined || normalized.overflow === 'visible' || normalized.overflow === 'clip') &&\n (normalized.minWidth === undefined || normalized.minWidth === 0) &&\n normalized.maxWidth === undefined && normalized.maxHeight === undefined &&\n !preparedStyleQuery(prepared) && genericTextFont(normalized);\n const measuredColumnProviderDefinition = nativeLayout && !row && options.flexDirection === 'column' &&\n options.flexWrap === 'nowrap' && options.layoutDirection === 'ltr' && needsMeasuredMain &&\n aspectRatio === undefined && typeof declared.width === 'number' && typeof normalized.width === 'number' &&\n Number.isFinite(normalized.width) && normalized.width >= 0 && declared.minHeight === 0 &&\n grow === 0 && shrink === 0 && (normalized.minWidth === undefined || normalized.minWidth === 0) &&\n normalized.maxWidth === undefined && !preparedStyleQuery(prepared) ?\n getPrimitiveDefinition(child.type) : undefined;\n const measuredColumnProvider = child.type !== Text && !isKnownLayoutType(layoutChild.type) && !!measuredColumnProviderDefinition?.measureIntrinsic &&\n !!measuredColumnProviderDefinition.measure;\n const naturalColumnWrappedTextCross = columnNaturalWrappedTextCross &&\n (hasAutoCrossMargin || effectiveAlignment(alignment, options.alignItems) !== 'stretch');\n if (nativeLayout && !row && options.flexWrap !== 'nowrap' &&\n (needsMeasuredMain && !measuredColumnWrapText || aspectRatio === undefined && crossAuto && effectiveAlignment(alignment, options.alignItems) !== 'stretch')) {\n throw childDiagnostic(child, needsMeasuredMain ? mainProperty : crossProperty, 'auto', container,\n 'Experimental WASM column wrap requires a declared height or flexBasis and a declared width or stretched automatic width; intrinsic item sizes are unsupported.');\n }\n const needsMeasuredCross = aspectRatio === undefined && crossAuto && alignment !== 'stretch' &&\n options.alignItems !== 'stretch';\n // A finite column cross allocation determines a stretched built-in child's\n // width without measuring its intrinsic height. Resolve bounds/padding first.\n const deferredIntrinsicColumn = aspectRatio === undefined && nativeLayout && !row && knownIntrinsicLayout &&\n needsMeasuredMain && crossAuto && effectiveAlignment(alignment, options.alignItems) === 'stretch';\n if (intrinsicSizes) measured = intrinsicSizes.maxContent;\n if (!columnMinimumSize && !directIntrinsicTextMain && !intrinsicSizes && !deferredIntrinsicColumn && !naturalColumnWrappedTextCross && (!deferredColumnAutoCross || needsMeasuredMain) && (needsMeasuredMain || aspectRatio === undefined && (needsMeasuredCross || crossAuto))) {\n // A deferred auto-cross child may still need an initial main-size query.\n // That provisional query must not borrow the container width: the later\n // exact-height query is the only cross-size authority.\n const naturalColumnCross = measuredColumnTextCross || measuredColumnProviderCross || measuredColumnKnownCrossAuto || deferredColumnAutoCross;\n const exactColumnHeight = naturalColumnCross && typeof normalized.height === 'number' ? normalized.height : undefined;\n const constraints = {\n minWidth: naturalColumnCross ? 0 : measuredColumnWrapText || measuredColumnProvider ? normalized.width as number : 0,\n maxWidth: naturalColumnCross ? Number.POSITIVE_INFINITY : measuredColumnWrapText || measuredColumnProvider ? normalized.width as number : container.width,\n minHeight: exactColumnHeight ?? 0,\n maxHeight: exactColumnHeight ?? (measuredColumnWrapText || measuredColumnProvider ? Number.POSITIVE_INFINITY : container.height),\n };\n const measurementChild = clonePibblElement(child);\n setPreNormalizedStyle(\n measurementChild,\n normalized,\n child,\n receiverToken,\n preparedStyleQuery(prepared),\n );\n const result = measureFlexChild(\n measurementChild, constraints, normalized, layoutToken ?? receiverToken, measurement, region,\n preparedStyleQuery(prepared),\n (nativeLayout && row && options.flexWrap === 'nowrap') || measuredPrimitiveCrossAuto || measuredColumnProvider || measuredColumnProviderCross,\n needsMeasuredMain ? (row ? 'row' : 'column') : undefined, ordinaryCrossAuto || !!pairedLayoutDefinition?.measure && !pairedLayoutDefinition.measureIntrinsic && layoutChild.type !== Text && !isKnownLayoutType(layoutChild.type),\n );\n if (result.status === 'measured') {\n measured = result.size;\n } else if (measuredTextCrossAuto || measuredColumnTextCross || measuredKnownCrossAuto || measuredColumnProviderCross || measuredColumnKnownCrossAuto || deferredColumnAutoCross || ordinaryCrossAuto || needsMeasuredMain || (crossAuto && effectiveAlignment(\n alignment,\n options.alignItems,\n ) !== 'stretch')) {\n throw childDiagnostic(\n child,\n needsMeasuredMain ? mainProperty : crossProperty,\n 'auto',\n container,\n `measurement is required but unsupported: ${result.reason}`,\n );\n }\n }\n\n const intrinsicMinimum = row ? intrinsicSizes?.minContent.width ?? intrinsicTextMinimum : columnMinimumSize?.height;\n const intrinsicMaximum = row ? intrinsicSizes?.maxContent.width ?? intrinsicTextMaximum : columnMinimumSize?.height;\n let minMain = stagedItem ? stagedItem.min : isIntrinsicSizingValue(normalized[minimumProperty])\n ? resolveIntrinsicMainBound(normalized[minimumProperty]!, intrinsicMinimum, intrinsicMaximum, minimumProperty, mainReference, child, container)\n : resolveOptionalBound(\n normalized[minimumProperty],\n mainReference,\n minimumProperty,\n 0,\n child,\n container,\n );\n const maximumProperty = row ? 'maxWidth' : 'maxHeight';\n const maxMain = stagedItem ? stagedItem.max : isIntrinsicSizingValue(normalized[maximumProperty])\n ? resolveIntrinsicMainBound(normalized[maximumProperty]!, intrinsicMinimum, intrinsicMaximum, maximumProperty, mainReference, child, container)\n : resolveOptionalBound(\n normalized[maximumProperty],\n mainReference,\n maximumProperty,\n Number.POSITIVE_INFINITY,\n child,\n container,\n );\n if (intrinsicSizes && normalized.minWidth === undefined && shrink > 0) {\n minMain = Math.min(intrinsicSizes.minContent.width, maxMain,\n typeof specifiedMain === 'number' ? specifiedMain : Number.POSITIVE_INFINITY);\n }\n if (columnMinimumSize) {\n minMain = Math.min(columnMinimumSize.height, maxMain,\n typeof specifiedMain === 'number' ? specifiedMain : Number.POSITIVE_INFINITY);\n }\n if (intrinsicTextMinimum !== undefined && normalized.minWidth === undefined && shrink > 0) {\n minMain = Math.min(intrinsicTextMinimum, maxMain);\n }\n const intrinsicMainBasis = intrinsicTextBasis ?? (intrinsicMainRequest && intrinsicMinimum !== undefined && intrinsicMaximum !== undefined\n ? resolveIntrinsicMainBasis(intrinsicMainRequest, intrinsicMinimum, intrinsicMaximum, child, container)\n : undefined);\n if (automaticTextMinimum) {\n const contentMinimum = measureTextContentMinimum(child, normalized, receiverToken, measurement, region);\n minMain = Math.min(contentMinimum, maxMain,\n typeof specifiedMain === 'number' ? specifiedMain : Number.POSITIVE_INFINITY);\n }\n const minCrossProperty = row ? 'minHeight' : 'minWidth';\n const maxCrossProperty = row ? 'maxHeight' : 'maxWidth';\n const minCross = resolveOptionalBound(\n normalized[minCrossProperty],\n crossReference,\n minCrossProperty,\n 0,\n child,\n container,\n );\n const maxCross = resolveOptionalBound(\n normalized[maxCrossProperty],\n crossReference,\n maxCrossProperty,\n Number.POSITIVE_INFINITY,\n child,\n container,\n );\n if (naturalColumnWrappedTextCross) {\n const token = layoutToken ?? receiverToken;\n const naturalWidth = measureTextNaturalWidth(child, normalized, receiverToken, token, measurement, region);\n const chosenWidth = Math.min(naturalWidth, Math.max(0, crossSize - paddingCross - marginCrossBefore - marginCrossAfter));\n const measuredStyle = { ...normalized, width: chosenWidth };\n const measurementChild = clonePibblElement(child);\n setPreNormalizedStyle(measurementChild, measuredStyle, child, receiverToken, preparedStyleQuery(prepared));\n const result = measureFlexChild(measurementChild, {\n minWidth: chosenWidth, maxWidth: chosenWidth,\n minHeight: normalized.height as number, maxHeight: normalized.height as number,\n }, measuredStyle, token, measurement, region, preparedStyleQuery(prepared));\n if (result.status !== 'measured') {\n throw childDiagnostic(child, 'width', 'auto', container,\n `measurement is required but unsupported: ${result.reason}`);\n }\n measured = result.size;\n }\n if (minMain > maxMain) {\n throw childDiagnostic(\n child,\n minimumProperty,\n minMain,\n container,\n 'minimum must not exceed maximum',\n );\n }\n if (minCross > maxCross) {\n throw childDiagnostic(\n child,\n minCrossProperty,\n minCross,\n container,\n 'minimum must not exceed maximum',\n );\n }\n // Settle width-dependent height before using an automatic main basis.\n // The experimental built-in intrinsic column uses the same final-width rule.\n if (!row && options.flexWrap === 'nowrap' && (child.type === Text || nativeLayout && knownIntrinsicLayout) && needsMeasuredMain) {\n const preferredWidth = crossAuto ?\n effectiveAlignment(alignment, options.alignItems) === 'stretch' && !hasAutoCrossMargin ?\n Math.max(0, crossSize - paddingCross - marginCrossBefore - marginCrossAfter) : measured?.width ?? 0 :\n resolveItemLength(specifiedCross, crossReference, crossProperty, child, container);\n const usedWidth = clamp(preferredWidth, minCross, maxCross);\n if (child.type === Text || usedWidth !== measured?.width) {\n const measuredStyle = { ...normalized, width: usedWidth };\n const measurementChild = clonePibblElement(layoutChild);\n setPreNormalizedStyle(measurementChild, measuredStyle, layoutChild, getPrimitiveReceiverToken(layoutChild) ?? receiverToken, preparedStyleQuery(prepared));\n const result = measureFlexChild(measurementChild, {\n minWidth: 0, maxWidth: usedWidth,\n minHeight: 0, maxHeight: container.height,\n }, measuredStyle, layoutToken ?? receiverToken, measurement, region, preparedStyleQuery(prepared));\n if (result.status === 'measured') measured = result.size;\n else throw childDiagnostic(child, mainProperty, 'auto', container,\n `measurement is required but unsupported: ${result.reason}`);\n }\n }\n\n let naturalTextMain: number | undefined;\n if (automaticTextBasis) {\n naturalTextMain = measureTextNaturalWidth(child, normalized, receiverToken, layoutToken ?? receiverToken, measurement, region);\n }\n const stretchMain = (declared.flexBasis === undefined || declared.flexBasis === 'auto' ? declared[mainProperty] : declared.flexBasis) === 'stretch';\n const baseMain = stagedMeasured ? stagedItem!.target : stretchMain ? Math.max(0, mainReference - marginMainBefore - marginMainAfter - paddingMain) : intrinsicMainBasis ?? naturalTextMain ?? resolveBasis(\n basisValue,\n specifiedMain,\n measured?.[mainProperty],\n mainReference,\n mainProperty,\n child,\n container,\n );\n const preferredCross = declared[crossProperty] === 'stretch' ? Math.max(0, crossReference - marginCrossBefore - marginCrossAfter - paddingCross) : aspectRatio !== undefined ? 0 : crossAuto ?\n measured?.[crossProperty] ?? 0 :\n resolveItemLength(\n specifiedCross,\n crossReference,\n crossProperty,\n child,\n container,\n );\n items.push({\n child,\n normalized,\n baseMain,\n targetMain: baseMain,\n paddingMain,\n marginMainBefore, marginMainAfter, autoMainBefore, autoMainAfter, marginCrossBefore, marginCrossAfter, autoCrossBefore, autoCrossAfter,\n preferredCross: clamp(preferredCross, minCross, maxCross) + paddingCross,\n paddingCross,\n paddingCrossBefore: row ? padding.top : padding.left,\n minMain,\n maxMain,\n minCross,\n maxCross,\n grow,\n shrink,\n crossAuto: aspectRatio === undefined && crossAuto,\n aspectRatio,\n alignSelf: alignment,\n receiverToken,\n layoutToken,\n query: preparedStyleQuery(prepared),\n relativeX,\n relativeY,\n deferredColumnAutoCross,\n ordinaryColumnAutoCross: !row && ordinaryCrossAuto && !deferredColumnAutoCross && !naturalColumnWrappedTextCross,\n sourceIndex,\n layoutOccurrence: occurrence,\n });\n }\n\n const wrappedRegion = region && options.flexWrap !== 'nowrap';\n // Rust owns wrapped line boundaries and offsets; JS retains source-order items\n // only for host measurement and immediate rendering, never a second line solver.\n const lines = region ? items.length ? [{ items, crossSize: 0, crossOffset: 0 }] : [] :\n collectLines(items, mainSize, mainGap, options.flexWrap);\n if (lines.length === 0) region?.solve([], mainSize, mainGap, !!wrappedRegion);\n for (const line of lines) {\n if (region) region.solve(line.items, mainSize, mainGap, !!wrappedRegion);\n else resolveFlexibleLengths(line, mainSize, mainGap);\n if (hasAspectRatio) for (const item of line.items) {\n if (item.aspectRatio === undefined) continue;\n const outerMain = item.targetMain + item.paddingMain;\n const outerCross = row ? outerMain / item.aspectRatio : outerMain * item.aspectRatio;\n if (!Number.isFinite(outerCross)) throw childDiagnostic(item.child, 'aspectRatio', item.aspectRatio, container, 'derived cross size must be finite');\n item.preferredCross = clamp(Math.max(0, outerCross - item.paddingCross), item.minCross, item.maxCross) + item.paddingCross;\n }\n // Width-dependent content uses the settled content allocation.\n if (row) for (const item of line.items) {\n let measuredRoot = item.child;\n if (item.crossAuto && nativeLayout && (options.flexWrap === 'nowrap' && options.flexDirection === 'row' && options.layoutDirection === 'ltr' || item.autoCrossBefore || item.autoCrossAfter || options[FLEX_BASELINE_GROUP]) && !item.query && item.aspectRatio === undefined && isLayoutComponent(item.child.type)) {\n measuredRoot = prepareLayoutComponent(item.child, { receiverToken: item.receiverToken });\n }\n const definition = nativeLayout && (options.flexWrap === 'nowrap' || item.autoCrossBefore || item.autoCrossAfter || options[FLEX_BASELINE_GROUP]) && !item.query && item.aspectRatio === undefined ? getPrimitiveDefinition(measuredRoot.type) : undefined;\n const constrainedProvider = measuredRoot.type !== Text && !isKnownLayoutType(measuredRoot.type) && !!definition?.measureIntrinsic && !!definition.measure;\n const ordinaryProvider = !!definition?.measure && (item.autoCrossBefore || item.autoCrossAfter || options[FLEX_BASELINE_GROUP]);\n const requiredKnownCross = nativeLayout && (item.autoCrossBefore || item.autoCrossAfter) && (measuredRoot.type === Flex || measuredRoot.type === Flow || measuredRoot.type === Grid);\n if (!item.crossAuto || (item.child.type !== Text && !(nativeLayout && item.child.type === Flex) && !constrainedProvider && !ordinaryProvider && !requiredKnownCross)) continue;\n if (item.child.type === Flex && item.normalized.width === item.targetMain) continue;\n const measuredStyle = { ...item.normalized, width: item.targetMain };\n const child = clonePibblElement(item.child);\n setPreNormalizedStyle(child, measuredStyle, item.child, item.receiverToken, item.query);\n const result = measureFlexChild(child, {\n minWidth: constrainedProvider || ordinaryProvider ? item.targetMain : 0, maxWidth: item.targetMain,\n minHeight: 0, maxHeight: container.height,\n }, measuredStyle, item.layoutToken ?? item.receiverToken, measurement, region, item.query, constrainedProvider, undefined, ordinaryProvider);\n if (result.status === 'measured') {\n item.preferredCross = clamp(result.size.height, item.minCross, item.maxCross) + item.paddingCross;\n // Baseline grouping consumes this final measured box rather than stretching\n // an authored automatic cross size after the provider has been queried.\n if (options[FLEX_BASELINE_GROUP] && (item.alignSelf !== 'stretch' || item.autoCrossBefore || item.autoCrossAfter)) item.crossAuto = false;\n } else if (constrainedProvider || ordinaryProvider || requiredKnownCross || options[FLEX_BASELINE_GROUP] || nativeLayout && item.child.type === Text && (item.autoCrossBefore || item.autoCrossAfter)) throw childDiagnostic(item.child, 'height', 'auto', container, `final-width measurement is required but unsupported: ${result.reason}`);\n }\n }\n // Defer column natural cross measurement until the kernel has resolved each\n // item's final main allocation. The result is still measured through the\n // normal transaction/cache path and is required before any placement.\n if (!row) for (const item of items) {\n if ((!item.deferredColumnAutoCross && !item.ordinaryColumnAutoCross) || !item.crossAuto) continue;\n let measuredRoot = item.child;\n if (isLayoutComponent(item.child.type)) {\n measuredRoot = prepareLayoutComponent(item.child, { receiverToken: item.receiverToken });\n }\n const definition = getPrimitiveDefinition(measuredRoot.type);\n const constrainedProvider = measuredRoot.type !== Text && !!definition?.measureIntrinsic && !!definition.measure;\n const ordinaryWidth = Math.max(0, item.preferredCross - item.paddingCross);\n const measuredStyle = item.ordinaryColumnAutoCross ?\n { ...item.normalized, width: ordinaryWidth, height: item.targetMain } :\n { ...item.normalized, height: item.targetMain };\n const measurementChild = clonePibblElement(item.child);\n setPreNormalizedStyle(measurementChild, measuredStyle, item.child, item.receiverToken, item.query);\n const result = measureFlexChild(measurementChild, {\n minWidth: 0, maxWidth: item.ordinaryColumnAutoCross ? ordinaryWidth : Number.POSITIVE_INFINITY,\n minHeight: item.targetMain, maxHeight: item.targetMain,\n }, measuredStyle, item.layoutToken ?? item.receiverToken, measurement, region, item.query, constrainedProvider, undefined, item.ordinaryColumnAutoCross);\n if (result.status === 'unsupported') {\n throw childDiagnostic(item.child, 'width', 'auto', container,\n `final-height measurement is required but unsupported: ${result.reason}`);\n }\n item.preferredCross = clamp(result.size.width, item.minCross, item.maxCross) + item.paddingCross;\n }\n if (options[FLEX_BASELINE_GROUP]) {\n assertSupportedBaselineFlex(options, items, container, region !== undefined);\n for (const item of items) {\n // Automatic cross margins replace alignment, so this leaf neither supplies\n // nor consumes a shared baseline. Native placement resolves its free space.\n if (item.alignSelf !== 'auto' || item.autoCrossBefore || item.autoCrossAfter) { item.firstBaseline = 0; continue; }\n const structural = prepareKnownStructuralBaseline(item, container, measurement, parentSlot, options[FLEX_LAST_BASELINE]);\n if (structural !== undefined) {\n item.structuralBaselineSlot = structural.slot;\n item.firstBaseline = item.paddingCrossBefore + structural.offset;\n continue;\n }\n const allocation = { x: 0, y: 0, width: item.targetMain, height: Math.max(0, item.preferredCross - item.paddingCross) };\n const baselineRoot = item.baselineRoot ?? item.child;\n const definition = getPrimitiveDefinition(baselineRoot.type);\n if (!definition?.measureBaselines) {\n item.firstBaseline = item.paddingCrossBefore + allocation.height;\n continue;\n }\n const measurementChild = clonePibblElement(baselineRoot);\n const measuredStyle: SystemStyle & { width: number; height: number } = { ...item.normalized, width: allocation.width, height: allocation.height };\n setPreNormalizedStyle(measurementChild, measuredStyle, baselineRoot, getPrimitiveReceiverToken(baselineRoot) ?? item.receiverToken, item.query);\n if (item.query) setPreparedBaselineOwner(measurementChild, container);\n // Application-owned fonts can change outside retained layout revisions.\n // Query them on each admitted render; only generic Text results are retained.\n const cacheOptions: BaselineMeasurementOptions | undefined = region && !item.query && (baselineRoot.type !== Text || genericTextFont(item.normalized)) ? {\n cache: region,\n token: item.layoutToken ?? item.receiverToken,\n key: `${allocationStructuralRevision()}:${allocation.width}:${allocation.height}:${JSON.stringify(measurementStyle(item.normalized))}`,\n recordMeasurement: recordWasmMeasurement,\n } : undefined;\n if (cacheOptions && item.baselineRoot) cacheOptions.source = item.child;\n const result = measureBaselineElement(measurementChild, allocation, measurement.service, cacheOptions);\n if (result.status === 'unsupported') {\n throw childDiagnostic(item.child, 'measureBaselines', 'unsupported', container, `first-baseline alignment requires a baseline result: ${result.reason}`);\n }\n item.firstBaseline = item.paddingCrossBefore + (options[FLEX_LAST_BASELINE] ? result.last : result.first);\n }\n }\n if (region) {\n // Per-item wrapped line cross offsets are produced by the kernel below.\n for (const line of lines) { line.crossSize = crossSize; line.crossOffset = 0; }\n } else {\n resolveLineCrossSizes(lines, crossSize, crossGap, options.alignContent, options.flexWrap === 'wrap');\n }\n\n const crossPlacements = region?.placeCross(items, crossSize, options.alignItems, {\n reverse: wrapReverse,\n wrap: wrappedRegion ? { gap: crossGap, alignContent: options.alignContent } : undefined,\n baseline: options[FLEX_BASELINE_GROUP],\n lastBaseline: options[FLEX_LAST_BASELINE],\n });\n const mainPlacements = region?.placeMain(mainSize, mainGap, options.justifyContent, reverse, hasAutoMainMargins ? items : undefined, stagedIntrinsic?.autoMarginFreeMain);\n let mainIndex = 0;\n let crossIndex = 0;\n for (const line of lines) {\n const occupied = mainPlacements ? 0 : line.items.reduce(\n (total, item) => total + item.targetMain + item.paddingMain,\n Math.max(0, line.items.length - 1) * mainGap,\n );\n const distribution = mainPlacements ? { start: 0, between: 0 } : distributeAlignment(\n options.justifyContent,\n mainSize - occupied,\n line.items.length,\n );\n let mainCursor = distribution.start;\n for (const item of line.items) {\n if (mainPlacements) mainCursor = mainPlacements[mainIndex++];\n let outerCross: number;\n let crossOffset: number;\n if (crossPlacements) {\n const placement = crossPlacements[crossIndex++];\n outerCross = placement.outerCross;\n crossOffset = placement.offset;\n } else {\n const alignment = effectiveAlignment(item.alignSelf, options.alignItems);\n outerCross = item.preferredCross;\n if (alignment === 'stretch' && item.crossAuto) {\n outerCross = clamp(Math.max(0, line.crossSize - item.paddingCross), item.minCross, item.maxCross) + item.paddingCross;\n }\n crossOffset = alignmentOffset(alignment, line.crossSize, outerCross);\n }\n const outerMain = item.targetMain + item.paddingMain;\n const x = row ?\n container.x + mainCursor + item.relativeX :\n container.x + line.crossOffset + crossOffset + item.relativeX;\n const layoutY = row ?\n container.y + line.crossOffset + crossOffset :\n container.y + mainCursor;\n const y = layoutY + item.relativeY;\n const box = {\n x: finiteRelativePlacement(x, 'left', item.child, container),\n y: finiteRelativePlacement(y, 'top', item.child, container),\n width: row ? outerMain : outerCross,\n height: row ? outerCross : outerMain,\n };\n const usedStyle = {\n ...item.normalized,\n width: row ? item.targetMain : Math.max(0, outerCross - item.paddingCross),\n height: row ? Math.max(0, outerCross - item.paddingCross) : item.targetMain,\n };\n const element = childWithUsedSize(\n item.child,\n usedStyle,\n usedStyle.width,\n usedStyle.height,\n item.receiverToken,\n item.query,\n );\n attachPreparedLayoutSlot(element, item.structuralBaselineSlot);\n placementsBySource[item.sourceIndex] = {\n usedWidth: usedStyle.width,\n usedHeight: usedStyle.height,\n layoutY: finiteRelativePlacement(layoutY, 'top', item.child, container),\n box,\n element,\n };\n mainCursor += outerMain + mainGap + distribution.between;\n }\n }\n for (let sourceIndex = 0; sourceIndex < placementsBySource.length; sourceIndex++) {\n if (!placementsBySource[sourceIndex]) throw new Error('Flex placement did not resolve one direct child.');\n }\n region?.pruneAbsoluteMeasurements(absoluteMeasurementTokens);\n return placementsBySource as FlexPlacement[];\n}\n\nfunction resolveFlexContainingBox(style: Readonly<FlexStyle> | Readonly<ResolvedFlexStyle>, content: Readonly<LayoutBox>): Readonly<LayoutBox> {\n const resolved = style as Readonly<Partial<ResolvedFlexStyle>>;\n const inherited = resolved[FLEX_INHERITED_CONTAINING_BOX];\n if (inherited) return inherited;\n const specified = resolved[FLEX_ABSOLUTE_BOX_STYLE] ?? style as Readonly<FlexStyle>;\n if (specified.position === 'static') {\n return getLogicalContainingBox();\n }\n return resolveFlexAbsolutePaddingBox(specified, content);\n}\n\nfunction resolveFlexAbsolutePaddingBox(\n style: Readonly<FlexStyle>,\n content: Readonly<LayoutBox>,\n): LayoutBox {\n const paddingOnly = normalizeBoxInsets({\n ...style,\n borderWidth: undefined,\n borderStartWidth: undefined,\n borderEndWidth: undefined,\n }, {\n component: 'Flex', algorithm: 'flex absolute', constraints: constraintsFor(content),\n });\n return Object.freeze({\n x: content.x - paddingOnly.left,\n y: content.y - paddingOnly.top,\n width: content.width + paddingOnly.left + paddingOnly.right,\n height: content.height + paddingOnly.top + paddingOnly.bottom,\n });\n}\n\nexport function resolveAbsoluteFlexPlacement(\n paddingBox: Readonly<LayoutBox>,\n child: PibblElement<any>,\n style: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>,\n receiverToken: object,\n query: PreparedQuery | undefined,\n content: Readonly<LayoutBox>,\n options: Readonly<Pick<ResolvedFlexStyle, 'flexDirection' | 'flexWrap' | 'justifyContent' | 'alignItems' | 'layoutDirection'>>,\n measurement?: FlexMeasurementInput,\n region?: LayoutRegion,\n measurementToken?: object,\n): FlexPlacement {\n const left = resolveFlexInset(absoluteLeftInset(style, options.layoutDirection), 'left', child, paddingBox);\n const right = resolveFlexInset(absoluteRightInset(style, options.layoutDirection), 'right', child, paddingBox);\n const top = resolveFlexInset(style.top, 'top', child, paddingBox);\n const bottom = resolveFlexInset(style.bottom, 'bottom', child, paddingBox);\n const specifiedWidth = resolveAbsoluteSize(style.width, 'width', paddingBox.width, child, paddingBox);\n const specifiedHeight = resolveAbsoluteSize(style.height, 'height', paddingBox.height, child, paddingBox);\n const specifiedMinWidth = resolveAbsoluteSize(style.minWidth, 'minWidth', paddingBox.width, child, paddingBox);\n const specifiedMaxWidth = resolveAbsoluteSize(style.maxWidth, 'maxWidth', paddingBox.width, child, paddingBox);\n const specifiedMinHeight = resolveAbsoluteSize(style.minHeight, 'minHeight', paddingBox.height, child, paddingBox);\n const specifiedMaxHeight = resolveAbsoluteSize(style.maxHeight, 'maxHeight', paddingBox.height, child, paddingBox);\n const sizingStyle = specifiedWidth === style.width && specifiedHeight === style.height &&\n specifiedMinWidth === style.minWidth && specifiedMaxWidth === style.maxWidth &&\n specifiedMinHeight === style.minHeight && specifiedMaxHeight === style.maxHeight ? style : {\n ...style, width: specifiedWidth, height: specifiedHeight,\n minWidth: specifiedMinWidth, maxWidth: specifiedMaxWidth,\n minHeight: specifiedMinHeight, maxHeight: specifiedMaxHeight,\n };\n const automaticWidth = specifiedWidth === undefined || specifiedWidth === 'auto';\n const automaticHeight = specifiedHeight === undefined || specifiedHeight === 'auto';\n let measuredWidth: number | undefined;\n let measuredHeight: number | undefined;\n if (measurement) {\n const measurementAxis = automaticWidth && automaticHeight ? 'both' : automaticWidth ? 'width' : 'height';\n const measuredChild = clonePibblElement(child);\n // Text's measure callback uses an omitted natural axis. Keep authored\n // automatic dimensions on the original descriptor for final settlement.\n const measuredStyle = child.type === Text ? measurementAxis === 'both' ?\n { ...sizingStyle, width: undefined, height: undefined } : measurementAxis === 'width' ?\n { ...sizingStyle, width: undefined } : { ...sizingStyle, height: undefined } : sizingStyle;\n setPreNormalizedStyle(measuredChild, measuredStyle, child, receiverToken, query);\n const fixedAxis = measurementAxis === 'both' ? 0 : measurementAxis === 'width' ? specifiedHeight as number : specifiedWidth as number;\n const result = measureConstrainedIntrinsicElement(measuredChild, measurementAxis === 'both' ? {\n minWidth: 0, maxWidth: Number.POSITIVE_INFINITY, minHeight: 0, maxHeight: Number.POSITIVE_INFINITY,\n } : measurementAxis === 'width' ? {\n minWidth: 0, maxWidth: Number.POSITIVE_INFINITY, minHeight: fixedAxis, maxHeight: fixedAxis,\n } : {\n minWidth: fixedAxis, maxWidth: fixedAxis, minHeight: 0, maxHeight: Number.POSITIVE_INFINITY,\n }, measurement.service, region && measurementToken ? {\n cache: region, token: measurementToken,\n key: measurementAxis === 'both' ? `absolute-size:both:${allocationStructuralRevision()}` :\n `absolute-size:${measurementAxis}:${allocationStructuralRevision()}:${fixedAxis}`,\n recordMeasurement: recordWasmMeasurement,\n } : undefined);\n if (result.status !== 'measured') {\n throw childDiagnostic(child, measurementAxis, 'auto', paddingBox, `absolute natural ${measurementAxis} requires supported pure measurement: ${result.reason}`);\n }\n if (measurementAxis !== 'height') measuredWidth = result.size.width;\n if (measurementAxis !== 'width') measuredHeight = result.size.height;\n }\n const settledStyle = automaticWidth || automaticHeight ? {\n ...sizingStyle,\n width: automaticWidth ? measuredWidth ?? resolveAbsoluteAutoSize(left, right, paddingBox.width, 'width', child, paddingBox, sizingStyle.aspectRatio === undefined ? undefined : (specifiedHeight as number) * sizingStyle.aspectRatio) : specifiedWidth,\n height: automaticHeight ? measuredHeight ?? resolveAbsoluteAutoSize(top, bottom, paddingBox.height, 'height', child, paddingBox, sizingStyle.aspectRatio === undefined ? undefined : (specifiedWidth as number) / sizingStyle.aspectRatio) : specifiedHeight,\n } : sizingStyle;\n if (automaticWidth || automaticHeight) markDerivedAbsoluteAxes(settledStyle, automaticWidth, automaticHeight);\n const resolved = resolveDirectChildBox(paddingBox, child, 'absolute', settledStyle, undefined, receiverToken);\n const width = resolved.borderBox.width;\n const height = resolved.borderBox.height;\n const row = isRowDirection(options.flexDirection);\n const mainReversed = (options.flexDirection === 'row-reverse' || options.flexDirection === 'column-reverse') !==\n (row && options.layoutDirection === 'rtl');\n const crossReversed = (options.flexWrap === 'wrap-reverse') !== (!row && options.layoutDirection === 'rtl');\n const x = left !== undefined || right !== undefined ?\n options.layoutDirection === 'rtl'\n ? right === undefined ? paddingBox.x + left! : paddingBox.x + paddingBox.width - right - width\n : left === undefined ? paddingBox.x + paddingBox.width - right! - width : paddingBox.x + left :\n row ? resolveAbsoluteMainAlignment(content, width, options.justifyContent, mainReversed, true) :\n resolveAbsoluteCrossAlignment(content, width, options.alignItems, crossReversed, false);\n const y = top !== undefined || bottom !== undefined ?\n top === undefined ? paddingBox.y + paddingBox.height - bottom! - height : paddingBox.y + top :\n row ? resolveAbsoluteCrossAlignment(content, height, options.alignItems, crossReversed, true) :\n resolveAbsoluteMainAlignment(content, height, options.justifyContent, mainReversed, false);\n const usedWidth = resolved.contentBox.width;\n const usedHeight = resolved.contentBox.height;\n return {\n box: { x: finiteRelativePlacement(x, 'left', child, paddingBox), y: finiteRelativePlacement(y, 'top', child, paddingBox), width, height },\n usedWidth,\n usedHeight,\n layoutY: finiteRelativePlacement(y, 'top', child, paddingBox),\n element: childWithUsedSize(child, settledStyle, usedWidth, usedHeight, receiverToken, query),\n };\n}\n\nfunction resolveAbsoluteAutoSize(\n start: number | undefined,\n end: number | undefined,\n available: number,\n property: 'width' | 'height',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n aspectSize?: number,\n): number {\n if ((start === undefined || end === undefined) && aspectSize === undefined) {\n throw childDiagnostic(child, property, 'auto', container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: automatic absolute size requires opposing physical insets or one definite aspect-ratio axis');\n }\n // Opposing insets win; otherwise use the declared opposite axis before bounds.\n const size = start !== undefined && end !== undefined ? available - start - end : aspectSize!;\n if (!Number.isFinite(size)) {\n throw childDiagnostic(child, property, size, container, 'derived absolute size must remain finite');\n }\n return Math.max(0, size);\n}\n\nfunction resolveAbsoluteMainAlignment(\n content: Readonly<LayoutBox>,\n size: number,\n justifyContent: MainAlignment,\n reversed: boolean,\n horizontal: boolean,\n): number {\n let alignment: CrossAlignment = justifyContent === 'flex-end' ? 'flex-end' :\n justifyContent === 'flex-start' || justifyContent === 'space-between' ? 'flex-start' : 'center';\n if (reversed) {\n if (alignment === 'flex-start') alignment = 'flex-end';\n else if (alignment === 'flex-end') alignment = 'flex-start';\n }\n return horizontal ? content.x + alignmentOffset(alignment, content.width, size) :\n content.y + alignmentOffset(alignment, content.height, size);\n}\n\nfunction resolveAbsoluteCrossAlignment(\n content: Readonly<LayoutBox>,\n size: number,\n alignItems: CrossAlignment,\n reversed: boolean,\n vertical: boolean,\n): number {\n let alignment: CrossAlignment = alignItems === 'stretch' ? 'flex-start' : alignItems;\n if (reversed) {\n if (alignment === 'flex-start') alignment = 'flex-end';\n else if (alignment === 'flex-end') alignment = 'flex-start';\n }\n return vertical ? content.y + alignmentOffset(alignment, content.height, size) :\n content.x + alignmentOffset(alignment, content.width, size);\n}\n\nfunction genericTextFont(style: Readonly<Record<string, unknown>>): boolean {\n return isGenericCanvasFont(String(style.font ?? '13px sans-serif'));\n}\nfunction measurementStyle(style: Readonly<Record<string, unknown>>) {\n const { fill: _fill, stroke: _stroke, opacity: _opacity, cursor: _cursor, filter: _filter, ...metrics } = style;\n // Rest construction owns this fresh snapshot; normalize geometry-equivalent axes.\n const owned = metrics as Record<string, unknown>;\n if (owned.flexDirection === 'row-reverse') owned.flexDirection = 'row';\n else if (owned.flexDirection === 'column-reverse') owned.flexDirection = 'column';\n return owned;\n}\n\n// Resolve every receiver even on cache hits so normal traversal adopts current\n// subscriptions. Retain only scalar snapshots, never descriptors or provisions.\nfunction intrinsicTextSnapshot(child: PibblElement<any>, style: Readonly<BoxStyle & Record<string, unknown>>, constraints: Constraints): unknown[] | undefined {\n if (child.type !== Flex || !isColumnDirection(style.flexDirection) || (style.flexWrap ?? 'nowrap') !== 'nowrap' ||\n typeof style.width !== 'number' || (style.height !== undefined && style.height !== 'auto')) return;\n return withSignalWriteForbidden('Signal writes are forbidden during Pibbl measurement', () => withIsolatedRenderState(() => {\n const previous = GLOBAL_STATE.primitiveReceiverToken;\n const visiting = new Set<PibblElement<any>>();\n function visit(column: PibblElement<any>, columnStyle: Readonly<Record<string, unknown>>, parent: object | undefined, width: number): unknown[] | undefined {\n if (visiting.has(column)) return;\n visiting.add(column);\n GLOBAL_STATE.primitiveReceiverToken = parent;\n try {\n const snapshot: unknown[] = [];\n for (const [index, leaf] of prepareLayoutChildren(column.props.children, 'Flex').entries()) {\n const receiver = getChildPrimitiveReceiverToken(GLOBAL_STATE.renderTransaction, parent, index);\n const prepared = prepareDirectChildStyle(leaf, receiver, { x: 0, y: 0, width, height: constraints.maxHeight });\n const leafStyle = preparedStyleValue(prepared) as Readonly<BoxStyle & Record<string, unknown>>;\n if (preparedStyleQuery(prepared) || hasPercentageBounds(leafStyle) || isPercentage(leafStyle.width) || isPercentage(leafStyle.height)) return;\n let content: unknown;\n if (leaf.type === Text) {\n if (!genericTextFont(leafStyle)) return;\n content = prepareLayoutTextContent(leaf.props, { receiverToken: receiver });\n } else if (leaf.type === Flex && isColumnDirection(leafStyle.flexDirection) && (leafStyle.flexWrap ?? 'nowrap') === 'nowrap' && (leafStyle.height === undefined || leafStyle.height === 'auto')) {\n const padding = normalizeBoxInsets(leafStyle, childContext(leaf, { x: 0, y: 0, width, height: constraints.maxHeight }));\n const available = typeof leafStyle.width === 'number' ? leafStyle.width : Math.max(0, width-padding.left-padding.right);\n const usedWidth = clamp(available, typeof leafStyle.minWidth === 'number' ? leafStyle.minWidth : 0, typeof leafStyle.maxWidth === 'number' ? leafStyle.maxWidth : Infinity);\n content = visit(leaf, leafStyle, receiver, usedWidth);\n if (content === undefined) return;\n } else {\n // Opaque components participate only by already-declared finite sizes.\n if (typeof leafStyle.width !== 'number' || typeof leafStyle.height !== 'number' || !Number.isFinite(leafStyle.width) || !Number.isFinite(leafStyle.height)) return;\n content = null;\n }\n snapshot.push([leaf.key, content, measurementStyle(leafStyle)]);\n GLOBAL_STATE.primitiveReceiverToken = parent;\n }\n return [measurementStyle(columnStyle), snapshot];\n } finally { visiting.delete(column); GLOBAL_STATE.primitiveReceiverToken = parent; }\n }\n try { return visit(child, style, getPrimitiveReceiverToken(child), style.width as number); }\n finally { GLOBAL_STATE.primitiveReceiverToken = previous; }\n }));\n}\n\ninterface PreparedRowMeasurement {\n readonly snapshot: readonly unknown[];\n readonly receivers: readonly object[];\n}\n\n// This snapshot is intentionally stricter than the ordinary primitive snapshot:\n// a layout description can otherwise hide mutable leaf props behind its own stable\n// descriptor. It records every direct leaf's identity and resolved full style, so\n// cache reuse never bypasses a provider-visible paint/style or program input.\nfunction preparedRowMeasurement(\n child: PibblElement<any>,\n style: Readonly<BoxStyle & Record<string, unknown>>,\n): PreparedRowMeasurement | undefined {\n try { return withSignalWriteForbidden('Signal writes are forbidden during Pibbl measurement', () =>\n withStyleMeasurement('recursive', () => withIsolatedRenderState(() => {\n const previous = GLOBAL_STATE.primitiveReceiverToken;\n try {\n const root = prepareLayoutComponent(child);\n if (root.type !== Flex) return;\n const rootReceiver = getPrimitiveReceiverToken(root);\n if (!rootReceiver) return;\n GLOBAL_STATE.primitiveReceiverToken = rootReceiver;\n const rootStyle = style as Readonly<FlexStyle & Record<string, unknown>>;\n if ((rootStyle.flexDirection ?? 'row') !== 'row' ||\n (rootStyle.flexWrap ?? 'nowrap') !== 'nowrap' ||\n (rootStyle.layoutDirection ?? getLayoutDirection()) !== 'ltr' ||\n typeof rootStyle.width !== 'number' || !Number.isFinite(rootStyle.width) || rootStyle.width < 0 ||\n rootStyle.height !== undefined && rootStyle.height !== 'auto') return;\n const snapshot: unknown[] = ['prepared-row', root.type, root.key];\n if (!appendPreparedProgramSnapshot(snapshot, getPrimitiveProgramProps(child))) return;\n if (!appendPreparedProgramSnapshot(snapshot, getPrimitiveProgramProps(root), true)) return;\n if (!appendPreparedStyleSnapshot(snapshot, rootStyle)) return;\n const children = prepareLayoutChildren(root.props.children, 'Flex');\n snapshot.push(children.length);\n const receivers: object[] = [];\n for (let index = 0; index < children.length; index++) {\n const leaf = children[index];\n const directReceiver = getChildPrimitiveReceiverToken(GLOBAL_STATE.renderTransaction, rootReceiver, index);\n const directPrepared = prepareDirectChildStyle(leaf, directReceiver, undefined, true);\n if (preparedStyleQuery(directPrepared)) return;\n const directStyle = preparedStyleValue(directPrepared) as Readonly<\n BoxStyle & FlexItemStyle & LayoutItemStyle & Record<string, unknown>\n >;\n let measuredLeaf = leaf;\n let receiver = directReceiver;\n let wrapped = false;\n if (isLayoutComponent(leaf.type)) {\n // One transparent known description is enough for the 164 receipt:\n // snapshot both layers and replay the paired root's current receiver.\n // A second description would need a recursive receipt path.\n measuredLeaf = prepareLayoutComponent(leaf, { receiverToken: directReceiver });\n if (isLayoutComponent(measuredLeaf.type)) return;\n const preparedReceiver = getPrimitiveReceiverToken(measuredLeaf);\n if (!preparedReceiver) return;\n receiver = preparedReceiver;\n wrapped = true;\n }\n const paired = getPrimitiveDefinition(measuredLeaf.type);\n const emptyRectangle = !wrapped && measuredLeaf.type === Rectangle &&\n !Object.hasOwn(measuredLeaf.props, 'children');\n if (!emptyRectangle && !(paired?.measureIntrinsic && paired.measure)) return;\n if (!appendPreparedProgramSnapshot(snapshot, getPrimitiveProgramProps(leaf)) ||\n !appendPreparedStyleSnapshot(snapshot, directStyle) ||\n wrapped && !appendPreparedProgramSnapshot(snapshot, getPrimitiveProgramProps(measuredLeaf))) return;\n snapshot.push(index, leaf.type, leaf.key, wrapped, measuredLeaf.type, measuredLeaf.key);\n receivers.push(receiver);\n }\n return { snapshot, receivers };\n } finally {\n GLOBAL_STATE.primitiveReceiverToken = previous;\n }\n })),\n ); } catch (error) {\n if (error instanceof UnsupportedResponsiveMeasurement) return undefined;\n throw error;\n }\n}\n\nfunction appendPreparedProgramSnapshot(\n snapshot: unknown[],\n props: Readonly<Record<PropertyKey, unknown>>,\n omitChildren = false,\n): boolean {\n const keys = Reflect.ownKeys(props);\n let count = 0;\n for (let index = 0; index < keys.length; index++) if (!omitChildren || keys[index] !== 'children') count++;\n snapshot.push(count);\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n if (omitChildren && key === 'children') continue;\n const value = props[key];\n if (typeof value === 'function' || value !== null && typeof value === 'object' && !isSignal(value)) return false;\n snapshot.push(key, value);\n }\n return true;\n}\n\nfunction appendPreparedStyleSnapshot(snapshot: unknown[], style: Readonly<Record<PropertyKey, unknown>>): boolean {\n const keys = Reflect.ownKeys(style);\n snapshot.push(keys.length);\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n const value = style[key];\n if (typeof value === 'function' || value !== null && typeof value === 'object') return false;\n snapshot.push(key, value);\n }\n return true;\n}\n\nfunction currentFlexMeasurementInput(): FlexMeasurementInput {\n const context = GLOBAL_STATE.renderContext;\n if (!context) throw new Error('A mounted Flex query requires its current Canvas context.');\n const service = canvasMeasurementService(context);\n return { service, measureElement: (element, constraints) => measureElement(element, constraints, service) };\n}\nfunction bindFlexMeasurementInput(input: FlexMeasurementInput): () => FlexMeasurementInput {\n return isCurrentCanvasMeasurementService(input.service) ? currentFlexMeasurementInput : () => input;\n}\n\nfunction measureTextIntrinsicWidths(child: PibblElement<any>, style: Readonly<SystemStyle>, receiver: object, measurement: FlexMeasurementInput, region?: LayoutRegion): { minimum: number; maximum: number } {\n const resolveMeasurement = bindFlexMeasurementInput(measurement);\n const element = clonePibblElement(child);\n setPreNormalizedStyle(element, style, child, receiver);\n return allocationMeasurement(element, current => {\n const measurement = resolveMeasurement();\n const normalized = peekPreNormalizedStyle(current)!.style as Readonly<TextStyle>;\n const receiverToken = getPrimitiveReceiverToken(current);\n const font = normalized.font ?? '13px sans-serif';\n const content = prepareLayoutTextContent(current.props, { receiverToken });\n if (region) recordWasmMeasurement();\n const maximum = normalized.wrap === true ? measureLayoutTextNaturalRun(content, { font, service: measurement.service }) : measurement.service.measureText(content, font).width;\n const minimum = normalized.wrap === true ? measureLayoutTextMinimumWidth(current.props, { font, service: measurement.service, receiverToken }) : maximum;\n return { minimum, maximum };\n });\n}\nfunction measureTextContentMinimum(child: PibblElement<any>, style: Readonly<SystemStyle>, receiver: object, measurement: FlexMeasurementInput, region?: LayoutRegion): number {\n const resolveMeasurement = bindFlexMeasurementInput(measurement);\n const element = clonePibblElement(child);\n setPreNormalizedStyle(element, style, child, receiver);\n return allocationMeasurement(element, current => {\n const measurement = resolveMeasurement();\n const normalized = peekPreNormalizedStyle(current)!.style as Readonly<TextStyle>;\n const receiverToken = getPrimitiveReceiverToken(current);\n const font = normalized.font ?? '13px sans-serif';\n if (region) recordWasmMeasurement();\n return normalized.wrap === true ? measureLayoutTextMinimumWidth(current.props, { font, service: measurement.service, receiverToken }) :\n measurement.service.measureText(prepareLayoutTextContent(current.props, { receiverToken }), font).width;\n });\n}\nfunction measureTextNaturalWidth(child: PibblElement<any>, style: Readonly<SystemStyle>, receiver: object, token: object, measurement: FlexMeasurementInput, region?: LayoutRegion): number {\n const resolveMeasurement = bindFlexMeasurementInput(measurement);\n const element = clonePibblElement(child);\n setPreNormalizedStyle(element, style, child, receiver);\n return allocationMeasurement(element, current => {\n const measurement = resolveMeasurement();\n const normalized = peekPreNormalizedStyle(current)!.style as Readonly<TextStyle>;\n const receiverToken = getPrimitiveReceiverToken(current);\n const font = normalized.font ?? '13px sans-serif';\n const content = prepareLayoutTextContent(current.props, { receiverToken });\n let width = genericTextFont(normalized) ? region?.readTextMaximum(token, content, font) : undefined;\n if (width === undefined) {\n if (region) recordWasmMeasurement();\n width = normalized.wrap === true ? measureLayoutTextNaturalRun(content, { font, service: measurement.service }) : measurement.service.measureText(content, font).width;\n if (genericTextFont(normalized)) region?.writeTextMaximum(token, content, font, width);\n }\n return width;\n });\n}\n\nfunction prepareLayoutTextContent(props: Parameters<typeof readLayoutTextContent>[0], options: Parameters<typeof readLayoutTextContent>[1]): string {\n declineUnrecordedAllocationMeasurement();\n return readLayoutTextContent(props, options);\n}\n\nfunction measureFlexChild(\n child: PibblElement<any>, constraints: Constraints,\n style: Readonly<BoxStyle & Record<string, unknown>>, token: object,\n measurement: FlexMeasurementInput, region?: LayoutRegion, query?: PreparedQuery, constrainedProvider = false,\n parentMainAxis?: 'row' | 'column', ordinaryProvider = false,\n): MeasureResult {\n const resolveMeasurement = bindFlexMeasurementInput(measurement);\n return allocationMeasurement(child, current => measureFlexChildUncached(current, constraints,\n (peekPreNormalizedStyle(current)?.style ?? style) as Readonly<BoxStyle & Record<string, unknown>>,\n token, resolveMeasurement(), region, query, constrainedProvider, parentMainAxis, ordinaryProvider));\n}\n\nfunction measureFlexChildUncached(\n child: PibblElement<any>, constraints: Constraints,\n style: Readonly<BoxStyle & Record<string, unknown>>, token: object,\n measurement: FlexMeasurementInput, region?: LayoutRegion, query?: PreparedQuery, constrainedProvider = false,\n parentMainAxis?: 'row' | 'column', ordinaryProvider = false,\n): MeasureResult {\n const measuredRoot = !query && isLayoutComponent(child.type) && (constrainedProvider || ordinaryProvider || parentMainAxis !== undefined) ?\n prepareLayoutComponent(child) : child;\n // `style` is the direct-placement normalized style, including the described\n // Flex root's forwarded values. Do not reread authored component props here:\n // signals or callbacks there would describe a different phase.\n const rootAxis = style.flexDirection === 'column' || style.flexDirection === 'column-reverse' ? 'column' : 'row';\n const contributionReceiver = parentMainAxis !== undefined && measuredRoot.type === Flex && rootAxis === parentMainAxis ?\n getPrimitiveReceiverToken(measuredRoot) : undefined;\n // The prepared-row cache is a normal final-size result. A same-axis\n // contribution has a distinct native result contract and must bypass it.\n if (contributionReceiver) {\n const previousContribution = requestedIntrinsicContribution;\n requestedIntrinsicContribution = { receiver: contributionReceiver, axis: parentMainAxis!, normalOwner: true };\n try {\n if (region) recordWasmMeasurement();\n return measurement.measureElement(child, constraints);\n } finally {\n requestedIntrinsicContribution = previousContribution;\n }\n }\n // A direct paired primitive keeps the original descriptor as the receiver\n // boundary. A described row uses the same parent-region entry, but only after a\n // conservative structural snapshot has established fresh direct-child receiver\n // paths for receipt replay on a later transaction.\n if (region && !query && isLayoutComponent(child.type)) {\n const prepared = preparedRowMeasurement(child, style);\n if (prepared) {\n return measurePreparedLayoutElement(child, constraints, measurement.service, {\n cache: region,\n token,\n key: JSON.stringify(['prepared-row', allocationStructuralRevision(), measurementStyle(style), constraints]),\n recordMeasurement: recordWasmMeasurement,\n }, prepared.snapshot, prepared.receivers);\n }\n }\n const definition = (constrainedProvider || ordinaryProvider) && !query ? getPrimitiveDefinition(measuredRoot.type) : undefined;\n if (measuredRoot.type !== Text && !isKnownLayoutType(measuredRoot.type) && definition?.measure && (definition.measureIntrinsic || ordinaryProvider)) return measureConstrainedIntrinsicElement(child, constraints, measurement.service, region ? { cache: region, token, key: JSON.stringify([allocationStructuralRevision(), measurementStyle(style), constraints]), recordMeasurement: recordWasmMeasurement } : undefined);\n const content = region && child.type === Text ? prepareLayoutTextContent(\n child.props, { receiverToken: getPrimitiveReceiverToken(child) },\n ) : undefined;\n const intrinsic = region && !query ? intrinsicTextSnapshot(child, style, constraints) : undefined;\n const cacheable = !query && (content !== undefined && genericTextFont(style) || intrinsic !== undefined);\n const key = cacheable ? JSON.stringify([content, intrinsic, measurementStyle(style), constraints]) : undefined;\n const cached = key ? region!.readMeasurement(token, key) : undefined;\n if (cached) return { status: 'measured', size: cached };\n if (region) recordWasmMeasurement();\n const result = measurement.measureElement(child, constraints);\n if (key && result.status === 'measured') region!.writeMeasurement(token, key, result.size);\n return result;\n}\n\nfunction collectLines(\n items: readonly FlexItem[],\n mainSize: number,\n gap: number,\n wrap: FlexWrap,\n): FlexLine[] {\n const lines: FlexLine[] = [];\n let current: FlexItem[] = [];\n let occupied = 0;\n for (const item of items) {\n const hypothetical = clamp(item.baseMain, item.minMain, item.maxMain) +\n item.paddingMain;\n const next = current.length === 0 ? hypothetical : occupied + gap + hypothetical;\n if (wrap === 'wrap' && current.length > 0 && next > mainSize) {\n lines.push({ items: current, crossSize: 0, crossOffset: 0 });\n current = [];\n occupied = 0;\n }\n occupied = current.length === 0 ? hypothetical : occupied + gap + hypothetical;\n current.push(item);\n }\n if (current.length > 0) {\n lines.push({ items: current, crossSize: 0, crossOffset: 0 });\n }\n return lines;\n}\n\nfunction resolveFlexibleLengths(\n line: FlexLine,\n mainSize: number,\n gap: number,\n): void {\n const gapSpace = Math.max(0, line.items.length - 1) * gap;\n const hypotheticalOuter = line.items.reduce(\n (total, item) => total +\n clamp(item.baseMain, item.minMain, item.maxMain) + item.paddingMain,\n 0,\n );\n const growing = hypotheticalOuter + gapSpace < mainSize;\n let initialOuter = gapSpace;\n const frozen = new Set<FlexItem>();\n for (const item of line.items) {\n item.targetMain = item.baseMain;\n const hypothetical = clamp(item.baseMain, item.minMain, item.maxMain);\n if (\n (growing ? item.grow : item.shrink) === 0 ||\n (growing && item.baseMain > hypothetical) ||\n (!growing && item.baseMain < hypothetical)\n ) {\n item.targetMain = hypothetical;\n frozen.add(item);\n }\n initialOuter += item.targetMain + item.paddingMain;\n }\n const initialFree = mainSize - initialOuter;\n if (!Number.isFinite(initialFree)) throw new Error('Flex numeric overflow during allocation');\n\n while (frozen.size < line.items.length) {\n const fixed = line.items.reduce(\n (total, item) => total +\n (frozen.has(item) ? item.targetMain : item.baseMain) +\n item.paddingMain,\n gapSpace,\n );\n let free = mainSize - fixed;\n const unfrozen = line.items.filter(item => !frozen.has(item));\n const rawFactor = growing ?\n unfrozen.reduce((total, item) => total + item.grow, 0) :\n unfrozen.reduce((total, item) => total + item.shrink, 0);\n const maxFactor = unfrozen.reduce((max, item) => Math.max(max, growing ? item.grow : item.shrink), 0);\n const maxBasis = growing ? 1 : unfrozen.reduce((max, item) => Math.max(max, item.baseMain), 0);\n const weight = (item: FlexItem) => maxFactor === 0 || maxBasis === 0 ? 0 :\n ((growing ? item.grow : item.shrink) / maxFactor) *\n (growing ? 1 : item.baseMain / maxBasis);\n const scaledFactor = unfrozen.reduce((total, item) => total + weight(item), 0);\n if (scaledFactor === 0) {\n for (const item of unfrozen) {\n item.targetMain = clamp(item.baseMain, item.minMain, item.maxMain);\n frozen.add(item);\n }\n break;\n }\n if (rawFactor < 1) {\n const partialFree = initialFree * rawFactor;\n if (Math.abs(partialFree) < Math.abs(free)) free = partialFree;\n }\n const violations: { item: FlexItem; amount: number }[] = [];\n for (const item of unfrozen) {\n const share = weight(item) / scaledFactor;\n const candidate = item.baseMain + free * share;\n if (!Number.isFinite(candidate)) throw new Error('Flex numeric overflow during allocation');\n const clamped = clamp(candidate, item.minMain, item.maxMain);\n item.targetMain = clamped;\n if (clamped !== candidate) {\n violations.push({ item, amount: clamped - candidate });\n }\n }\n if (violations.length === 0) break;\n const totalViolation = violations.reduce(\n (total, violation) => total + violation.amount,\n 0,\n );\n for (const violation of violations) {\n if (\n totalViolation === 0 ||\n (totalViolation > 0 && violation.amount > 0) ||\n (totalViolation < 0 && violation.amount < 0)\n ) {\n frozen.add(violation.item);\n }\n }\n }\n}\n\nfunction resolveLineCrossSizes(\n lines: FlexLine[],\n crossSize: number,\n gap: number,\n alignment: ResolvedFlexStyle['alignContent'],\n multiLine: boolean,\n): void {\n if (lines.length === 0) return;\n for (const line of lines) {\n line.crossSize = Math.max(0, ...line.items.map(item => item.preferredCross));\n }\n if (lines.length === 1 && !multiLine) {\n lines[0].crossSize = crossSize;\n lines[0].crossOffset = 0;\n return;\n }\n const occupied = lines.reduce(\n (total, line) => total + line.crossSize,\n Math.max(0, lines.length - 1) * gap,\n );\n const free = crossSize - occupied;\n if (alignment === 'stretch' && free > 0) {\n const addition = free / lines.length;\n for (const line of lines) line.crossSize += addition;\n }\n const distribution = alignment === 'stretch' ?\n { start: 0, between: 0 } :\n distributeAlignment(alignment, free, lines.length);\n let cursor = distribution.start;\n for (const line of lines) {\n line.crossOffset = cursor;\n cursor += line.crossSize + gap + distribution.between;\n }\n}\n\nfunction distributeAlignment(\n alignment: MainAlignment | CrossAlignment,\n free: number,\n count: number,\n): { start: number; between: number } {\n if (count === 0 || alignment === 'flex-start' || alignment === 'stretch') {\n return { start: 0, between: 0 };\n }\n if (free < 0) {\n if (alignment === 'flex-end') return { start: free, between: 0 };\n if (alignment === 'center') {\n return { start: free / 2, between: 0 };\n }\n return { start: 0, between: 0 };\n }\n if (alignment === 'flex-end') return { start: free, between: 0 };\n if (alignment === 'center') return { start: free / 2, between: 0 };\n if (alignment === 'space-between') {\n return count === 1 ? { start: 0, between: 0 } :\n { start: 0, between: free / (count - 1) };\n }\n if (alignment === 'space-around') {\n const between = free / count;\n return { start: between / 2, between };\n }\n if (alignment === 'space-evenly') {\n const between = free / (count + 1);\n return { start: between, between };\n }\n return { start: 0, between: 0 };\n}\n\nfunction prepareKnownStructuralBaseline(\n item: FlexItem,\n container: Readonly<LayoutBox>,\n measurement: FlexMeasurementInput,\n parentSlot?: PreparedLayoutSlot,\n lastSource = false,\n): PreparedKnownBaseline | undefined {\n const root = item.baselineRoot ?? item.child;\n if (root.type !== Flex && root.type !== Flow && root.type !== Grid) return;\n const resolveMeasurement = bindFlexMeasurementInput(measurement);\n const { targetMain, preferredCross, paddingCross, layoutOccurrence } = item;\n const child = clonePibblElement(item.child);\n setPreNormalizedStyle(child, item.normalized, item.child, item.receiverToken, item.query);\n const offset = allocationMeasurement(child, current => {\n const normalized = peekPreNormalizedStyle(current)!.style;\n const receiverToken = getPrimitiveReceiverToken(current);\n if (!receiverToken) throw new Error('A structural baseline query requires its current receiver.');\n const baselineRoot = isLayoutComponent(current.type) ? prepareLayoutComponent(current, { receiverToken }) : current;\n return prepareKnownStructuralBaselineUncached({ child: current, normalized, receiverToken, baselineRoot,\n targetMain, preferredCross, paddingCross, layoutOccurrence }, container, resolveMeasurement(), parentSlot, lastSource).offset;\n });\n const slot = currentPreparedReceiverSlot(item.receiverToken);\n if (!slot) throw new Error('A structural baseline demand must stage its current receiver allocation.');\n return { slot, offset };\n}\n\nfunction prepareKnownStructuralBaselineUncached(\n item: Pick<FlexItem, 'child' | 'normalized' | 'receiverToken' | 'baselineRoot' | 'targetMain' | 'preferredCross' | 'paddingCross' | 'layoutOccurrence'>,\n container: Readonly<LayoutBox>, measurement: FlexMeasurementInput, parentSlot: PreparedLayoutSlot | undefined, lastSource: boolean,\n): PreparedKnownBaseline {\n const alignment = lastSource ? 'last-baseline' : 'first-baseline';\n const root = item.baselineRoot ?? item.child;\n const style = item.normalized as Readonly<FlexStyle>;\n const staticOwner = root.type === Flex && style.position === 'static';\n const content = { x: 0, y: 0, width: item.targetMain, height: Math.max(0, item.preferredCross - item.paddingCross) };\n const direction = style.layoutDirection ?? getLayoutDirection();\n const currentSlot = currentPreparedReceiverSlot(item.receiverToken);\n const currentPlan = currentSlot && peekPreparedLayoutPlan(currentSlot, content, direction);\n // A failed equality comparison may already have prepared this exact demand.\n // The ensuing allocator consumes that current plan instead of staging it twice.\n const slot = currentPlan ? currentSlot : preflightKnownLayout(item.child, item.normalized, content, item.receiverToken, item.layoutOccurrence, parentSlot, 'row',\n staticOwner ? { deferStaticContainingDescendants: true } : undefined);\n if (!slot) throw childDiagnostic(item.child, 'alignItems', alignment, container,\n 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: the selected known layout root did not prepare its allocation');\n const plan = root.type === Flex ?\n peekPreparedFlexPlan(slot, content, direction) :\n peekPreparedLayoutPlan(slot, content, direction);\n if (!plan) throw childDiagnostic(item.child, 'alignItems', alignment, container,\n 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: the selected known layout root has no current settled allocation');\n return { slot, offset: readPreparedKnownBaseline(plan, root.type === Flex ? 'flex' : root.type === Flow ? 'flow' : 'grid', measurement, direction,\n root.type === Flex && (style.flexWrap ?? 'nowrap') !== 'nowrap', lastSource) };\n}\n\n/** Reads current prepared source-order placements without a second layout pass. */\nfunction readPreparedKnownBaseline(\n plan: PreparedLayoutPlan,\n kind: 'flex' | 'flow' | 'grid',\n measurement: FlexMeasurementInput,\n direction: 'ltr' | 'rtl',\n wrapped: boolean,\n lastSource: boolean,\n): number {\n const alignment = lastSource ? 'last-baseline' : 'first-baseline';\n const content = plan.content;\n // Native Flow and Grid retain declared record order. Flex's current native\n // first/final-line proof establishes membership without inferring pixel lines.\n const flexPlan = kind === 'flex' ? plan as PreparedFlexLayoutPlan : undefined;\n const lineCount = wrapped ? lastSource ? flexPlan!.region.lastWrapLineCount() : flexPlan!.region.firstWrapLineCount() : undefined;\n const pending = flexPlan ? deferredStaticState(flexPlan) : undefined;\n const step = lastSource ? -1 : 1;\n for (let index = lastSource ? plan.children.length - 1 : 0; index >= 0 && index < plan.children.length; index += step) {\n if (pending?.slots[index]) continue;\n const source = plan.children[index];\n const placement = plan.placements[index];\n const prepared = peekPreNormalizedStyle(placement.element);\n if (!prepared) throw new Error('Known Flex baseline selection requires settled child inputs.');\n const selectedStyle = prepared.style as Readonly<FlexStyle>;\n if (selectedStyle.position === 'absolute') continue;\n // Skipping absolute/deferred slots preserves in-flow source order. The\n // selected endpoint is native record zero or the final native record, and\n // therefore belongs to the validated corresponding endpoint line.\n if (lineCount === 0) throw new Error('Structural baseline source has no native endpoint-line membership.');\n const receiver = getPrimitiveReceiverToken(placement.element);\n const root = isLayoutComponent(source.type) ? prepareLayoutComponent(source, { receiverToken: receiver }) : placement.element;\n const usedWidth = 'usedWidth' in placement ? placement.usedWidth : undefined;\n const usedHeight = 'usedHeight' in placement ? placement.usedHeight : undefined;\n if (typeof usedWidth !== 'number' || !Number.isFinite(usedWidth) || usedWidth < 0 ||\n typeof usedHeight !== 'number' || !Number.isFinite(usedHeight) || usedHeight < 0) {\n throw new Error('Prepared known baseline placement is missing settled content geometry.');\n }\n const allocation = { x: 0, y: 0, width: usedWidth, height: usedHeight };\n const insets = normalizeBoxInsets(selectedStyle, childContext(source, content));\n let offset = allocation.height;\n if (root.type === Flex || root.type === Flow || root.type === Grid) {\n const slot = getElementMetadata(placement.element)?.preparedLayoutSlot as PreparedLayoutSlot | undefined;\n const childDirection = selectedStyle.layoutDirection ?? direction;\n const nested = root.type === Flex ?\n slot && peekPreparedFlexPlan(slot, allocation, childDirection) :\n slot && peekPreparedLayoutPlan(slot, allocation, childDirection);\n if (!nested) throw childDiagnostic(source, 'alignItems', alignment, content,\n 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: selected known layout root requires its current prepared allocation');\n offset = readPreparedKnownBaseline(nested, root.type === Flex ? 'flex' : root.type === Flow ? 'flow' : 'grid', measurement, childDirection,\n root.type === Flex && (selectedStyle.flexWrap ?? 'nowrap') !== 'nowrap', lastSource);\n } else {\n const definition = getPrimitiveDefinition(root.type);\n if (!definition || isKnownLayoutType(root.type)) throw childDiagnostic(source, 'alignItems', alignment, content,\n 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: selected structural source must resolve to a primitive or prepared known layout root');\n if (definition.measureBaselines) {\n const measurementChild = clonePibblElement(root);\n setPreNormalizedStyle(measurementChild, selectedStyle, root, getPrimitiveReceiverToken(root) ?? receiver, prepared.query);\n if (prepared.query) setPreparedBaselineOwner(measurementChild, content);\n // Read under the actual current root receiver; retain no aggregate result.\n const result = measureBaselineElement(measurementChild, allocation, measurement.service);\n if (result.status === 'unsupported') throw childDiagnostic(source, 'measureBaselines', 'unsupported', content,\n `${alignment} alignment requires a baseline result: ${result.reason}`);\n offset = lastSource ? result.last : result.first;\n }\n }\n const layoutY = kind === 'flex' ? (placement as FlexPlacement).layoutY : placement.box.y;\n if (!Number.isFinite(layoutY)) throw new Error('Prepared known baseline placement has no finite physical y origin.');\n return layoutY + insets.top + offset;\n }\n if (lineCount !== undefined && lineCount !== 0) throw new Error('Empty structural baseline source disagrees with native endpoint-line membership.');\n return content.height;\n}\n\nfunction assertSupportedBaselineFlex(\n options: Readonly<ReturnType<typeof normalizeFlexOptions>>,\n items: readonly FlexItem[],\n container: Readonly<LayoutBox>,\n mounted: boolean,\n): void {\n const alignment = options[FLEX_LAST_BASELINE] ? 'last-baseline' : 'first-baseline';\n if (!mounted || !nativeLayout || !isRowDirection(options.flexDirection)) {\n throw optionDiagnostic('alignItems', alignment, container, 'requires mounted experimental horizontal Flex');\n }\n for (const item of items) {\n const style = item.normalized;\n const baselineRoot = isLayoutComponent(item.child.type) ?\n prepareLayoutComponent(item.child, { receiverToken: item.receiverToken }) : item.child;\n if (baselineRoot !== item.child) item.baselineRoot = baselineRoot;\n if (baselineRoot.type === Flex || baselineRoot.type === Flow || baselineRoot.type === Grid) {\n if (item.crossAuto || !Number.isFinite(item.targetMain) || item.targetMain < 0 || !Number.isFinite(item.preferredCross) || item.preferredCross < item.paddingCross) {\n throw childDiagnostic(item.child, 'alignItems', alignment, container,\n 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: a structural baseline requires settled finite known-layout geometry');\n }\n continue;\n }\n const textLeaf = baselineRoot.type === Text;\n const textStyle = style as Readonly<TextStyle>;\n const fontSize = textLeaf ? /(?:^| )(\\d+(?:\\.\\d+)?)px(?:\\s*\\/\\s*(?:normal|\\d+(?:\\.\\d+)?(?:px|%)?))?\\s+\\S/.exec(String(textStyle.font ?? '13px sans-serif')) : null;\n const supportedTextLeaf = !textLeaf || (\n fontSize !== null && Number.isFinite(Number(fontSize[1])) && Number(fontSize[1]) > 0 &&\n typeof (textStyle.lineHeight ?? 13) === 'number' &&\n Number.isFinite(textStyle.lineHeight ?? 13) &&\n (textStyle.lineHeight ?? 13) >= 0 &&\n (textStyle.wrap === undefined || typeof textStyle.wrap === 'boolean')\n );\n const sharesBaseline = item.alignSelf === 'auto' && !item.autoCrossBefore && !item.autoCrossAfter;\n if (!getPrimitiveDefinition(baselineRoot.type) || isKnownLayoutType(baselineRoot.type) || isLayoutComponent(baselineRoot.type) || (!supportedTextLeaf && sharesBaseline) ||\n (style.position !== undefined && style.position !== 'static' && style.position !== 'relative') || (item.crossAuto && item.alignSelf !== 'stretch') ||\n !Number.isFinite(item.targetMain) || item.targetMain < 0 || !Number.isFinite(item.preferredCross) || item.preferredCross < item.paddingCross) {\n throw childDiagnostic(item.child, 'alignItems', alignment, container, 'PIBBL_LAYOUT_UNSUPPORTED_BASELINE: requires primitive roots with settled finite content boxes and no absolute position');\n }\n }\n}\n\nfunction isRowDirection(direction: unknown): boolean {\n return direction === undefined || direction === 'row' || direction === 'row-reverse';\n}\nfunction isColumnDirection(direction: unknown): boolean {\n return direction === 'column' || direction === 'column-reverse';\n}\n\nfunction normalizeFlexOptions(\n style: Readonly<FlexStyle>,\n container: Readonly<LayoutBox>,\n) {\n const layoutDirection = style.layoutDirection ?? getLayoutDirection();\n if (layoutDirection !== 'ltr' && !(nativeLayout && layoutDirection === 'rtl')) {\n throw optionDiagnostic('layoutDirection', layoutDirection, container);\n }\n const flexDirection = style.flexDirection ?? 'row';\n if (flexDirection !== 'row' && flexDirection !== 'column' &&\n !(nativeLayout && (flexDirection === 'row-reverse' || flexDirection === 'column-reverse'))) {\n throw optionDiagnostic('flexDirection', flexDirection, container, 'uses an unsupported flex direction in this build');\n }\n const flexWrap = style.flexWrap ?? 'nowrap';\n if (flexWrap !== 'nowrap' && flexWrap !== 'wrap' && !(nativeLayout && flexWrap === 'wrap-reverse')) {\n throw optionDiagnostic('flexWrap', flexWrap, container, 'uses an unsupported flex wrap in this build');\n }\n const justifyContent = supported(\n normalizeLogicalAlignment(style.justifyContent ?? 'flex-start', flexDirection === 'row-reverse' || flexDirection === 'column-reverse'),\n ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n 'justifyContent',\n container,\n );\n const requestedAlignItems = normalizeLogicalAlignment((style as Readonly<Partial<ResolvedFlexStyle>>)[FLEX_LAST_BASELINE] ? 'last-baseline' : (style as Readonly<Partial<ResolvedFlexStyle>>)[FLEX_BASELINE_GROUP] ? 'first-baseline' : style.alignItems ?? 'stretch', flexWrap === 'wrap-reverse');\n const alignItems = supported(\n requestedAlignItems,\n nativeLayout ? ['stretch', 'flex-start', 'flex-end', 'center', 'first-baseline', 'last-baseline'] : ['stretch', 'flex-start', 'flex-end', 'center'],\n 'alignItems',\n container,\n );\n const alignContent = supported(\n normalizeLogicalAlignment(style.alignContent ?? 'stretch', flexWrap === 'wrap-reverse'),\n ['stretch', 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n 'alignContent',\n container,\n );\n const gap = style.gap ?? 0;\n const columnGap = nonnegativeGap(gap, 'gap', container, container.width);\n const rowGap = typeof gap === 'number' ? columnGap : nonnegativeGap(gap, 'gap', container, container.height);\n return {\n layoutDirection,\n flexDirection: flexDirection as FlexDirection,\n flexWrap: flexWrap as FlexWrap,\n justifyContent: justifyContent as MainAlignment,\n // Yoga resolves baseline alignment on column axes to logical flex-start\n // before placement. It neither measures nor forms a vertical baseline group.\n alignItems: alignItems === 'first-baseline' ? 'flex-start' : alignItems === 'last-baseline' ? (isRowDirection(flexDirection) ? 'flex-start' : 'flex-end') : alignItems as CrossAlignment,\n [FLEX_BASELINE_GROUP]: (alignItems === 'first-baseline' || alignItems === 'last-baseline') && isRowDirection(flexDirection),\n [FLEX_LAST_BASELINE]: alignItems === 'last-baseline' && isRowDirection(flexDirection),\n alignContent: alignContent as CrossAlignment | MainAlignment,\n rowGap: style.rowGap === undefined ? rowGap : nonnegativeGap(style.rowGap, 'rowGap', container, container.height),\n columnGap: style.columnGap === undefined ? columnGap : nonnegativeGap(style.columnGap, 'columnGap', container, container.width),\n };\n}\n\nfunction supported(\n value: string,\n accepted: readonly string[],\n property: string,\n container: Readonly<LayoutBox>,\n): string {\n if (!accepted.includes(value)) throw optionDiagnostic(property, value, container);\n return value;\n}\n\nfunction nonnegativeGap(\n value: unknown,\n property: string,\n container: Readonly<LayoutBox>,\n reference: number,\n): number {\n const resolved = nativeLayout && isPercentage(value)\n ? resolveScalarSizingLength(value as Percentage, reference, property, { component: 'Flex', algorithm: 'flex', constraints: constraintsFor(container) })\n : value;\n if (typeof resolved !== 'number' || !Number.isFinite(resolved) || resolved < 0) {\n throw optionDiagnostic(property, value, container);\n }\n return resolved;\n}\n\nfunction nonnegativeFactor(\n value: number,\n property: string,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (!Number.isFinite(value) || value < 0) {\n throw childDiagnostic(\n child,\n property,\n value,\n container,\n 'must be finite and nonnegative',\n );\n }\n return value;\n}\n\nfunction resolveIntrinsicMainBound(\n value: NonNullable<BoxStyle['minWidth']>,\n minimum: number | undefined,\n maximum: number | undefined,\n property: 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight',\n reference: number,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (minimum === undefined || maximum === undefined) {\n throw childDiagnostic(child, property, value, container, 'requires a direct finite horizontal Flex intrinsic-sizing owner');\n }\n const request = normalizeSizingLength(value, {\n reference, property, context: childContext(child, container), allowAuto: false, allowIntrinsic: true,\n });\n return resolveIntrinsicMainBasis(request!, minimum, maximum, child, container);\n}\n\nfunction resolveIntrinsicMainBasis(\n request: NormalizedSizingLength,\n minimum: number,\n maximum: number,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (request.kind === 'min-content') return minimum;\n if (request.kind === 'max-content') return maximum;\n if (request.kind === 'fit-content') return Math.min(maximum, Math.max(minimum, request.limit));\n throw childDiagnostic(child, 'flexBasis', request, container, 'requires min-content, max-content or fit-content');\n}\n\nfunction resolveBasis(\n basis: FlexItemStyle['flexBasis'],\n specifiedMain: BoxStyle['width'],\n measuredMain: number | undefined,\n reference: number,\n property: 'width' | 'height',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n const value = basis === 'auto' || basis === undefined ? specifiedMain : basis;\n if (value === undefined || value === 'auto') {\n if (measuredMain === undefined) {\n throw childDiagnostic(\n child,\n property,\n value ?? 'auto',\n container,\n 'auto flex basis requires supported pure measurement',\n );\n }\n return measuredMain;\n }\n return resolveItemLength(value, reference, 'flexBasis', child, container);\n}\n\nfunction resolveItemLength(\n value: Exclude<BoxStyle['width'], undefined>,\n reference: number,\n property: string,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n const resolved = resolveScalarSizingLength(value, reference, property, childContext(child, container));\n if (resolved === undefined || resolved < 0) {\n throw childDiagnostic(\n child,\n property,\n value,\n container,\n 'must resolve to a finite nonnegative length',\n );\n }\n return resolved;\n}\n\nfunction resolveOptionalBound(\n value: BoxStyle['minWidth'],\n reference: number,\n property: string,\n fallback: number,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (value === undefined) return fallback;\n return resolveItemLength(value, reference, property, child, container);\n}\n\nfunction normalizeLogicalAlignment(value: string, reversed: boolean): string {\n if (value === 'start') return reversed ? 'flex-end' : 'flex-start';\n if (value === 'end') return reversed ? 'flex-start' : 'flex-end';\n return value;\n}\n\nfunction normalizeItemAlignment(\n value: LayoutItemStyle['alignSelf'],\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n reverseCross = false,\n): CrossAlignment | 'auto' {\n if (value === undefined || value === 'auto') return 'auto';\n if (value === 'start') return reverseCross ? 'flex-end' : 'flex-start';\n if (value === 'end') return reverseCross ? 'flex-start' : 'flex-end';\n if (value === 'stretch' || value === 'flex-start' ||\n value === 'flex-end' || value === 'center') return value;\n throw childDiagnostic(\n child,\n 'alignSelf',\n value,\n container,\n 'uses an unsupported flex item alignment',\n );\n}\n\nfunction effectiveAlignment(\n value: CrossAlignment | 'auto',\n fallback: CrossAlignment,\n): CrossAlignment {\n return value === 'auto' ? fallback : value;\n}\n\nfunction alignmentOffset(\n alignment: CrossAlignment,\n lineSize: number,\n itemSize: number,\n): number {\n if (alignment === 'center') return (lineSize - itemSize) / 2;\n if (alignment === 'flex-end') return lineSize - itemSize;\n return 0;\n}\n\n\nfunction finiteRelativePlacement(\n value: number,\n property: 'left' | 'top',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number {\n if (!Number.isFinite(value)) {\n throw childDiagnostic(child, property, value, container, 'resolved relative placement arithmetic must remain finite');\n }\n return value;\n}\n\nfunction assertSupportedAbsoluteFlexPosition(\n child: PibblElement<any>,\n style: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>,\n container: Readonly<LayoutBox>,\n direction: 'ltr' | 'rtl',\n query: PreparedQuery | undefined,\n naturalWidth = false,\n naturalHeight = false,\n): void {\n if (isKnownLayoutType(child.type) || isLayoutComponent(child.type)) {\n throw childDiagnostic(child, 'position', style.position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute layout children and nested containing blocks are not supported in this slice');\n }\n if (!nativeLayout) {\n throw childDiagnostic(child, 'position', style.position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute requires experimental Flex');\n }\n const automaticWidth = style.width === undefined || style.width === 'auto';\n const automaticHeight = style.height === undefined || style.height === 'auto';\n if ((!automaticWidth && !isAbsoluteSizeInput(style.width)) ||\n (!automaticHeight && !isAbsoluteSizeInput(style.height))) {\n throw childDiagnostic(child, 'position', style.position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute currently requires finite nonnegative numeric or percentage dimensions, or admitted automatic dimensions');\n }\n if (style.aspectRatio !== undefined && automaticWidth === automaticHeight) {\n throw childDiagnostic(child, 'aspectRatio', style.aspectRatio, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute aspectRatio currently requires exactly one automatic axis and one finite numeric or percentage axis');\n }\n if (style.aspectRatio === undefined && ((!naturalWidth && automaticWidth && (absoluteLeftInset(style, direction) === undefined || absoluteRightInset(style, direction) === undefined)) ||\n (!naturalHeight && automaticHeight && (style.top === undefined || style.bottom === undefined)))) {\n throw childDiagnostic(child, 'position', style.position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: automatic absolute size requires opposing insets on its axis');\n }\n if (style.alignSelf !== undefined) {\n throw childDiagnostic(child, 'alignSelf', style.alignSelf, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute currently uses parent alignItems only');\n }\n validateAbsoluteBound(style.minWidth, 'minWidth', child, container);\n validateAbsoluteBound(style.maxWidth, 'maxWidth', child, container);\n validateAbsoluteBound(style.minHeight, 'minHeight', child, container);\n validateAbsoluteBound(style.maxHeight, 'maxHeight', child, container);\n if (query || style.flexBasis !== undefined && style.flexBasis !== 'auto' ||\n (style.flexGrow !== undefined && style.flexGrow !== 0) || (style.flexShrink !== undefined && style.flexShrink !== 0) ||\n style.boxSizing !== undefined || style.padding !== undefined || style.paddingStart !== undefined || style.paddingEnd !== undefined ||\n style.borderWidth !== undefined || style.borderStartWidth !== undefined || style.borderEndWidth !== undefined || hasFlexMargin(style)) {\n throw childDiagnostic(child, 'position', style.position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute excludes nonzero flex factors, margins, and child box decoration in this slice');\n }\n}\n\nfunction validateAbsoluteBound(\n value: unknown,\n property: 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): void {\n if (value === undefined) return;\n if (!isAbsoluteSizeInput(value)) {\n throw childDiagnostic(child, property, value, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: absolute size bounds currently require nonnegative finite numbers or percentages');\n }\n}\n\nfunction isAbsoluteSizeInput(value: unknown): boolean {\n return typeof value === 'number' && Number.isFinite(value) && value >= 0 || isPercentage(value);\n}\n\nfunction resolveAbsoluteSize(\n value: unknown,\n property: 'width' | 'height' | 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight',\n reference: number,\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number | 'auto' | undefined {\n if (!isPercentage(value)) return value as number | 'auto' | undefined;\n const resolved = resolveScalarSizingLength(value as Percentage, reference, property, childContext(child, container))!;\n if (resolved < 0) throw childDiagnostic(child, property, value, container, 'absolute sizes must resolve to nonnegative finite numbers');\n return resolved;\n}\n\n// Read effective edges without rewriting authored inputs used by exact forwarding.\nfunction absoluteLeftInset(style: Readonly<LayoutItemStyle>, direction: 'ltr' | 'rtl') {\n const logical = direction === 'rtl' ? style.insetEnd : style.insetStart;\n return logical === undefined ? style.left : logical;\n}\n\nfunction absoluteRightInset(style: Readonly<LayoutItemStyle>, direction: 'ltr' | 'rtl') {\n const logical = direction === 'rtl' ? style.insetStart : style.insetEnd;\n return logical === undefined ? style.right : logical;\n}\n\nfunction resolveFlexInset(\n value: unknown,\n property: 'left' | 'right' | 'top' | 'bottom',\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n): number | undefined {\n if (value === undefined) return;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (isPercentage(value)) {\n return resolveScalarSizingLength(value as Percentage, property === 'left' || property === 'right' ? container.width : container.height,\n property, childContext(child, container));\n }\n throw childDiagnostic(child, property, value, container, 'currently requires a finite numeric inset or a signed decimal percentage');\n}\n\nfunction assertSupportedRelativeFlexPosition(\n child: PibblElement<any>,\n style: Readonly<BoxStyle & FlexItemStyle & LayoutItemStyle>,\n _options: Readonly<Pick<ResolvedFlexStyle, 'flexDirection' | 'flexWrap' | 'layoutDirection'>>,\n container: Readonly<LayoutBox>,\n): void {\n const position = style.position;\n if (!nativeLayout || (position !== 'static' && position !== 'relative')) {\n throw childDiagnostic(child, 'position', position, container, 'PIBBL_LAYOUT_UNSUPPORTED_POSITION: uses an unsupported Flex placement mode');\n }\n}\n\nfunction rejectUnsupportedItemFields(\n child: PibblElement<any>,\n style: Readonly<Record<string, unknown>>,\n container: Readonly<LayoutBox>,\n): void {\n if (!nativeLayout && hasFlexMargin(style)) throw childDiagnostic(child, 'margin', style.margin, container, 'margins require the experimental Flex engine');\n for (let propertyIndex = 0; propertyIndex < unsupportedProperties.length; propertyIndex++) {\n const property = unsupportedProperties[propertyIndex];\n if (style[property] !== undefined) {\n throw childDiagnostic(\n child,\n property,\n style[property],\n container,\n 'uses an unsupported flex item feature',\n );\n }\n }\n}\n\nfunction hasFlexMargin(style: Readonly<Record<string, unknown>>): boolean {\n return style.margin !== undefined || style.marginTop !== undefined || style.marginRight !== undefined ||\n style.marginBottom !== undefined || style.marginLeft !== undefined ||\n style.marginStart !== undefined || style.marginEnd !== undefined;\n}\nfunction allocatedMargin(value: unknown, property: string, child: PibblElement<any>, container: Readonly<LayoutBox>): number {\n if (nativeLayout && isPercentage(value)) {\n return resolveScalarSizingLength(value as Percentage, container.width, property, childContext(child, container))!;\n }\n return numericMargin(value, property, child, container);\n}\nfunction numericMargin(value: unknown, property: string, child: PibblElement<any>, container: Readonly<LayoutBox>): number {\n if (value === undefined) return 0;\n if (typeof value !== 'number' || !Number.isFinite(value)) throw childDiagnostic(child, property, value, container, 'margin must be a finite number in logical Canvas units');\n return value;\n}\n\nfunction hasEmptyRectangleMinimum(\n child: PibblElement<any>,\n style: Readonly<Record<string, unknown>>,\n query: PreparedQuery | undefined,\n percentageSizes = false,\n): boolean {\n return nativeLayout && child.type === Rectangle &&\n !Object.hasOwn(child.props, 'children') && !query &&\n (typeof style.width === 'number' && Number.isFinite(style.width) && style.width >= 0 || percentageSizes && isPercentage(style.width)) &&\n (typeof style.height === 'number' && Number.isFinite(style.height) && style.height >= 0 || percentageSizes && isPercentage(style.height));\n}\n\nfunction clamp(value: number, minimum: number, maximum: number): number {\n return Math.min(maximum, Math.max(minimum, value));\n}\n\nfunction assertFiniteBox(container: Readonly<LayoutBox>): void {\n for (const [property, value] of Object.entries(container)) {\n if (!Number.isFinite(value) ||\n ((property === 'width' || property === 'height') && value < 0)) {\n throw optionDiagnostic(property, value, container);\n }\n }\n}\n\nfunction optionDiagnostic(\n property: string,\n value: unknown,\n container: Readonly<LayoutBox>,\n reason = 'uses an unsupported flex value',\n) {\n return layoutDiagnostic({\n component: 'Flex',\n property,\n value,\n algorithm: 'flex',\n constraints: constraintsFor(container),\n reason,\n });\n}\n\nfunction childDiagnostic(\n child: PibblElement<any>,\n property: string,\n value: unknown,\n container: Readonly<LayoutBox>,\n reason: string,\n) {\n return layoutDiagnostic({\n component: child.type.name || 'Anonymous',\n property,\n value,\n algorithm: 'flex',\n constraints: constraintsFor(container),\n reason,\n });\n}\n\nfunction childContext(\n child: PibblElement<any>,\n container: Readonly<LayoutBox>,\n) {\n return {\n component: child.type.name || 'Anonymous',\n algorithm: 'flex',\n constraints: constraintsFor(container),\n };\n}\n\nfunction constraintsFor(container: Readonly<LayoutBox>): Constraints {\n return {\n minWidth: 0,\n maxWidth: container.width,\n minHeight: 0,\n maxHeight: container.height,\n };\n}\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC,wCAAwC;AACjF,SAAS,0BAA0B,uBAAuB,uBAAuB,8CAA8C;AAC/H,SAAS,uBAAuB;AAChC,SAAS,0BAA0B,mCAAmC,2BAA2B;AACjG,SAAS,YAAY;AACrB,SAAS,YAAY;AAErB,SAAS,6BAA6B,mBAAmB,8BAA8B,yBAAyB,uBAAuB,wBAAwB,sBAAsB,yBAAyB,sBAAsB,0BAA0B,4BAA4B,2BAA2B,iCAAkE;AACvX,SAAS,mBAAmB,8BAA8B;AAC1D,SAAS,yBAAyB,oCAAoC;AACtE,SAAS,qBAAqB,0BAA0B;AAExD,SAAS,cAAc,cAAc,qBAAqB,wBAAwB,sCAAsC,+BAA+B,gCAA2D,uBAAuB,0BAA0B,0BAA0B,oCAAoC;AACjU,SAAS,iBAAiB;AAC1B,SAAS,MAAM,4BAA4B,uBAAuB,+BAA+B,mCAAmC;AAEpI,MAAM,wBAAwB,CAAC,OAAO;AAEtC,SAAS,4BAA4B,kCAAkC,sBAAsB,oBAAoB,0BAA8C;AAC/J,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,gCAAgC,2BAA2B,wBAAwB,0BAA0B,oBAAoB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B,aAAa,MAAM,MAAM;AAC3I;AAEA,SAAS,MAAM,OAAe,SAAiB,SAAyB;AACtE,SAAO,KAAK,IAAI,SAAS,KAAK,IAAI,SAAS,KAAK,CAAC;AACnD;AAEA,SAAS,gBAAgB,WAAsC;AAC7D,aAAW,CAAC,UAAU,KAAK,KAAK,OAAO,QAAQ,SAAS,GAAG;AACzD,QAAI,CAAC,OAAO,SAAS,KAAK,MACtB,aAAa,WAAW,aAAa,aAAa,QAAQ,GAAI;AAChE,YAAM,iBAAiB,UAAU,OAAO,SAAS;AAAA,IACnD;AAAA,EACF;AACF;AAEA,SAAS,iBACP,UACA,OACA,WACA,SAAS,kCACT;AACA,SAAO,iBAAiB;AAAA,IACtB,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,IACrC;AAAA,EACF,CAAC;AACH;AAEA,SAAS,gBACP,OACA,UACA,OACA,WACA,QACA;AACA,SAAO,iBAAiB;AAAA,IACtB,WAAW,MAAM,KAAK,QAAQ;AAAA,IAC9B;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,IACrC;AAAA,EACF,CAAC;AACH;AAEA,SAAS,aACP,OACA,WACA;AACA,SAAO;AAAA,IACL,WAAW,MAAM,KAAK,QAAQ;AAAA,IAC9B,WAAW;AAAA,IACX,aAAa,eAAe,SAAS;AAAA,EACvC;AACF;AAEA,SAAS,eAAe,WAA6C;AACnE,SAAO;AAAA,IACL,UAAU;AAAA,IACV,UAAU,UAAU;AAAA,IACpB,WAAW;AAAA,IACX,WAAW,UAAU;AAAA,EACvB;AACF;",
6
+ "names": ["ctx", "diagnosticBox", "padding", "automaticWidth", "receiver", "measurementStyle", "measurement"]
7
7
  }