@despia-native/kernel 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (661) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +1414 -0
  3. package/README.md +17 -2
  4. package/dist/.dsx-build-stamp.json +7 -0
  5. package/dist/api-cohort.d.ts +27 -0
  6. package/dist/api-cohort.d.ts.map +1 -0
  7. package/dist/api-cohort.js +94 -0
  8. package/dist/api-cohort.js.map +1 -0
  9. package/dist/api.d.ts +454 -0
  10. package/dist/api.d.ts.map +1 -0
  11. package/dist/api.js +2442 -0
  12. package/dist/api.js.map +1 -0
  13. package/dist/app-consts.d.ts +10 -0
  14. package/dist/app-consts.d.ts.map +1 -0
  15. package/dist/app-consts.js +39 -0
  16. package/dist/app-consts.js.map +1 -0
  17. package/dist/app-update.d.ts +12 -0
  18. package/dist/app-update.d.ts.map +1 -0
  19. package/dist/app-update.js +32 -0
  20. package/dist/app-update.js.map +1 -0
  21. package/dist/aria.d.ts +152 -0
  22. package/dist/aria.d.ts.map +1 -0
  23. package/dist/aria.js +524 -0
  24. package/dist/aria.js.map +1 -0
  25. package/dist/audio-core.d.ts +260 -0
  26. package/dist/audio-core.d.ts.map +1 -0
  27. package/dist/audio-core.js +1440 -0
  28. package/dist/audio-core.js.map +1 -0
  29. package/dist/audio-edit.d.ts +100 -0
  30. package/dist/audio-edit.d.ts.map +1 -0
  31. package/dist/audio-edit.js +489 -0
  32. package/dist/audio-edit.js.map +1 -0
  33. package/dist/audio-mix.d.ts +84 -0
  34. package/dist/audio-mix.d.ts.map +1 -0
  35. package/dist/audio-mix.js +393 -0
  36. package/dist/audio-mix.js.map +1 -0
  37. package/dist/auth-proof.d.ts +145 -0
  38. package/dist/auth-proof.d.ts.map +1 -0
  39. package/dist/auth-proof.js +644 -0
  40. package/dist/auth-proof.js.map +1 -0
  41. package/dist/availability-explain.d.ts +3 -0
  42. package/dist/availability-explain.d.ts.map +1 -0
  43. package/dist/availability-explain.js +322 -0
  44. package/dist/availability-explain.js.map +1 -0
  45. package/dist/availability.d.ts +246 -0
  46. package/dist/availability.d.ts.map +1 -0
  47. package/dist/availability.js +615 -0
  48. package/dist/availability.js.map +1 -0
  49. package/dist/background.d.ts +116 -0
  50. package/dist/background.d.ts.map +1 -0
  51. package/dist/background.js +235 -0
  52. package/dist/background.js.map +1 -0
  53. package/dist/boot-tables-flag.d.ts +2 -0
  54. package/dist/boot-tables-flag.d.ts.map +1 -0
  55. package/dist/boot-tables-flag.js +16 -0
  56. package/dist/boot-tables-flag.js.map +1 -0
  57. package/dist/boot-tables.d.ts +40 -0
  58. package/dist/boot-tables.d.ts.map +1 -0
  59. package/dist/boot-tables.js +102 -0
  60. package/dist/boot-tables.js.map +1 -0
  61. package/dist/border-edges.d.ts +5 -0
  62. package/dist/border-edges.d.ts.map +1 -0
  63. package/dist/border-edges.js +47 -0
  64. package/dist/border-edges.js.map +1 -0
  65. package/dist/bus.d.ts +1203 -0
  66. package/dist/bus.d.ts.map +1 -0
  67. package/dist/bus.js +2647 -0
  68. package/dist/bus.js.map +1 -0
  69. package/dist/calendar-core.d.ts +143 -0
  70. package/dist/calendar-core.d.ts.map +1 -0
  71. package/dist/calendar-core.js +372 -0
  72. package/dist/calendar-core.js.map +1 -0
  73. package/dist/call-value.d.ts +16 -0
  74. package/dist/call-value.d.ts.map +1 -0
  75. package/dist/call-value.js +54 -0
  76. package/dist/call-value.js.map +1 -0
  77. package/dist/camera-core.d.ts +222 -0
  78. package/dist/camera-core.d.ts.map +1 -0
  79. package/dist/camera-core.js +980 -0
  80. package/dist/camera-core.js.map +1 -0
  81. package/dist/canvas-core.d.ts +404 -0
  82. package/dist/canvas-core.d.ts.map +1 -0
  83. package/dist/canvas-core.js +2186 -0
  84. package/dist/canvas-core.js.map +1 -0
  85. package/dist/capture-core.d.ts +74 -0
  86. package/dist/capture-core.d.ts.map +1 -0
  87. package/dist/capture-core.js +158 -0
  88. package/dist/capture-core.js.map +1 -0
  89. package/dist/compile/codegen.d.ts +146 -0
  90. package/dist/compile/codegen.d.ts.map +1 -0
  91. package/dist/compile/codegen.js +1949 -0
  92. package/dist/compile/codegen.js.map +1 -0
  93. package/dist/compile/jstier.d.ts +44 -0
  94. package/dist/compile/jstier.d.ts.map +1 -0
  95. package/dist/compile/jstier.js +181 -0
  96. package/dist/compile/jstier.js.map +1 -0
  97. package/dist/compile/tier-door.d.ts +41 -0
  98. package/dist/compile/tier-door.d.ts.map +1 -0
  99. package/dist/compile/tier-door.js +167 -0
  100. package/dist/compile/tier-door.js.map +1 -0
  101. package/dist/compile/tier-realm.d.ts +49 -0
  102. package/dist/compile/tier-realm.d.ts.map +1 -0
  103. package/dist/compile/tier-realm.js +368 -0
  104. package/dist/compile/tier-realm.js.map +1 -0
  105. package/dist/compile/tier.d.ts +23 -0
  106. package/dist/compile/tier.d.ts.map +1 -0
  107. package/dist/compile/tier.js +157 -0
  108. package/dist/compile/tier.js.map +1 -0
  109. package/dist/compose-core.d.ts +86 -0
  110. package/dist/compose-core.d.ts.map +1 -0
  111. package/dist/compose-core.js +112 -0
  112. package/dist/compose-core.js.map +1 -0
  113. package/dist/config-validate.d.ts +31 -0
  114. package/dist/config-validate.d.ts.map +1 -0
  115. package/dist/config-validate.js +147 -0
  116. package/dist/config-validate.js.map +1 -0
  117. package/dist/config-values.d.ts +106 -0
  118. package/dist/config-values.d.ts.map +1 -0
  119. package/dist/config-values.js +340 -0
  120. package/dist/config-values.js.map +1 -0
  121. package/dist/contacts-core.d.ts +127 -0
  122. package/dist/contacts-core.d.ts.map +1 -0
  123. package/dist/contacts-core.js +211 -0
  124. package/dist/contacts-core.js.map +1 -0
  125. package/dist/content-transition.d.ts +58 -0
  126. package/dist/content-transition.d.ts.map +1 -0
  127. package/dist/content-transition.js +94 -0
  128. package/dist/content-transition.js.map +1 -0
  129. package/dist/controls-core.d.ts +227 -0
  130. package/dist/controls-core.d.ts.map +1 -0
  131. package/dist/controls-core.js +652 -0
  132. package/dist/controls-core.js.map +1 -0
  133. package/dist/cookies.d.ts +78 -0
  134. package/dist/cookies.d.ts.map +1 -0
  135. package/dist/cookies.js +265 -0
  136. package/dist/cookies.js.map +1 -0
  137. package/dist/corner-shape-core.d.ts +69 -0
  138. package/dist/corner-shape-core.d.ts.map +1 -0
  139. package/dist/corner-shape-core.js +261 -0
  140. package/dist/corner-shape-core.js.map +1 -0
  141. package/dist/crypto-core.d.ts +57 -0
  142. package/dist/crypto-core.d.ts.map +1 -0
  143. package/dist/crypto-core.js +128 -0
  144. package/dist/crypto-core.js.map +1 -0
  145. package/dist/dataviz.d.ts +436 -0
  146. package/dist/dataviz.d.ts.map +1 -0
  147. package/dist/dataviz.js +956 -0
  148. package/dist/dataviz.js.map +1 -0
  149. package/dist/debug.d.ts +293 -0
  150. package/dist/debug.d.ts.map +1 -0
  151. package/dist/debug.js +767 -0
  152. package/dist/debug.js.map +1 -0
  153. package/dist/device-ownership.d.ts +50 -0
  154. package/dist/device-ownership.d.ts.map +1 -0
  155. package/dist/device-ownership.js +105 -0
  156. package/dist/device-ownership.js.map +1 -0
  157. package/dist/effects.d.ts +86 -0
  158. package/dist/effects.d.ts.map +1 -0
  159. package/dist/effects.js +98 -0
  160. package/dist/effects.js.map +1 -0
  161. package/dist/element.d.ts +108 -0
  162. package/dist/element.d.ts.map +1 -0
  163. package/dist/element.js +63 -0
  164. package/dist/element.js.map +1 -0
  165. package/dist/file-watch.d.ts +16 -0
  166. package/dist/file-watch.d.ts.map +1 -0
  167. package/dist/file-watch.js +49 -0
  168. package/dist/file-watch.js.map +1 -0
  169. package/dist/filepaths.d.ts +72 -0
  170. package/dist/filepaths.d.ts.map +1 -0
  171. package/dist/filepaths.js +271 -0
  172. package/dist/filepaths.js.map +1 -0
  173. package/dist/film.d.ts +264 -0
  174. package/dist/film.d.ts.map +1 -0
  175. package/dist/film.js +313 -0
  176. package/dist/film.js.map +1 -0
  177. package/dist/fonts.d.ts +66 -0
  178. package/dist/fonts.d.ts.map +1 -0
  179. package/dist/fonts.js +135 -0
  180. package/dist/fonts.js.map +1 -0
  181. package/dist/forms.d.ts +191 -0
  182. package/dist/forms.d.ts.map +1 -0
  183. package/dist/forms.js +663 -0
  184. package/dist/forms.js.map +1 -0
  185. package/dist/geo.d.ts +289 -0
  186. package/dist/geo.d.ts.map +1 -0
  187. package/dist/geo.js +460 -0
  188. package/dist/geo.js.map +1 -0
  189. package/dist/handler-announce.d.ts +46 -0
  190. package/dist/handler-announce.d.ts.map +1 -0
  191. package/dist/handler-announce.js +96 -0
  192. package/dist/handler-announce.js.map +1 -0
  193. package/dist/handoff.d.ts +71 -0
  194. package/dist/handoff.d.ts.map +1 -0
  195. package/dist/handoff.js +250 -0
  196. package/dist/handoff.js.map +1 -0
  197. package/dist/identity-durability.d.ts +76 -0
  198. package/dist/identity-durability.d.ts.map +1 -0
  199. package/dist/identity-durability.js +150 -0
  200. package/dist/identity-durability.js.map +1 -0
  201. package/dist/image-core.d.ts +240 -0
  202. package/dist/image-core.d.ts.map +1 -0
  203. package/dist/image-core.js +618 -0
  204. package/dist/image-core.js.map +1 -0
  205. package/dist/image-schemes.d.ts +10 -0
  206. package/dist/image-schemes.d.ts.map +1 -0
  207. package/dist/image-schemes.js +28 -0
  208. package/dist/image-schemes.js.map +1 -0
  209. package/dist/index.d.ts +143 -0
  210. package/dist/index.d.ts.map +1 -0
  211. package/dist/index.js +299 -0
  212. package/dist/index.js.map +1 -0
  213. package/dist/ink-core.d.ts +53 -0
  214. package/dist/ink-core.d.ts.map +1 -0
  215. package/dist/ink-core.js +119 -0
  216. package/dist/ink-core.js.map +1 -0
  217. package/dist/input.d.ts +148 -0
  218. package/dist/input.d.ts.map +1 -0
  219. package/dist/input.js +358 -0
  220. package/dist/input.js.map +1 -0
  221. package/dist/integrity.d.ts +63 -0
  222. package/dist/integrity.d.ts.map +1 -0
  223. package/dist/integrity.js +150 -0
  224. package/dist/integrity.js.map +1 -0
  225. package/dist/intents.d.ts +95 -0
  226. package/dist/intents.d.ts.map +1 -0
  227. package/dist/intents.js +282 -0
  228. package/dist/intents.js.map +1 -0
  229. package/dist/interpolate-core.d.ts +37 -0
  230. package/dist/interpolate-core.d.ts.map +1 -0
  231. package/dist/interpolate-core.js +443 -0
  232. package/dist/interpolate-core.js.map +1 -0
  233. package/dist/jse/color.d.ts +12 -0
  234. package/dist/jse/color.d.ts.map +1 -0
  235. package/dist/jse/color.js +196 -0
  236. package/dist/jse/color.js.map +1 -0
  237. package/dist/jse/core.d.ts +54 -0
  238. package/dist/jse/core.d.ts.map +1 -0
  239. package/dist/jse/core.js +1519 -0
  240. package/dist/jse/core.js.map +1 -0
  241. package/dist/jse/dispatch.d.ts +28 -0
  242. package/dist/jse/dispatch.d.ts.map +1 -0
  243. package/dist/jse/dispatch.js +116 -0
  244. package/dist/jse/dispatch.js.map +1 -0
  245. package/dist/jse/highlight-grammar.d.ts +15 -0
  246. package/dist/jse/highlight-grammar.d.ts.map +1 -0
  247. package/dist/jse/highlight-grammar.js +161 -0
  248. package/dist/jse/highlight-grammar.js.map +1 -0
  249. package/dist/jse/highlight-grammars.generated.d.ts +2 -0
  250. package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
  251. package/dist/jse/highlight-grammars.generated.js +4 -0
  252. package/dist/jse/highlight-grammars.generated.js.map +1 -0
  253. package/dist/jse/highlight.d.ts +37 -0
  254. package/dist/jse/highlight.d.ts.map +1 -0
  255. package/dist/jse/highlight.js +323 -0
  256. package/dist/jse/highlight.js.map +1 -0
  257. package/dist/jse/jse.d.ts +674 -0
  258. package/dist/jse/jse.d.ts.map +1 -0
  259. package/dist/jse/jse.js +5841 -0
  260. package/dist/jse/jse.js.map +1 -0
  261. package/dist/jse/pathmatch.d.ts +10 -0
  262. package/dist/jse/pathmatch.d.ts.map +1 -0
  263. package/dist/jse/pathmatch.js +73 -0
  264. package/dist/jse/pathmatch.js.map +1 -0
  265. package/dist/jse/regex.d.ts +33 -0
  266. package/dist/jse/regex.d.ts.map +1 -0
  267. package/dist/jse/regex.js +375 -0
  268. package/dist/jse/regex.js.map +1 -0
  269. package/dist/jse/stdlib.d.ts +8 -0
  270. package/dist/jse/stdlib.d.ts.map +1 -0
  271. package/dist/jse/stdlib.js +765 -0
  272. package/dist/jse/stdlib.js.map +1 -0
  273. package/dist/jse/tokens.d.ts +102 -0
  274. package/dist/jse/tokens.d.ts.map +1 -0
  275. package/dist/jse/tokens.js +982 -0
  276. package/dist/jse/tokens.js.map +1 -0
  277. package/dist/jse/values.d.ts +206 -0
  278. package/dist/jse/values.d.ts.map +1 -0
  279. package/dist/jse/values.js +846 -0
  280. package/dist/jse/values.js.map +1 -0
  281. package/dist/keyboard.d.ts +196 -0
  282. package/dist/keyboard.d.ts.map +1 -0
  283. package/dist/keyboard.js +186 -0
  284. package/dist/keyboard.js.map +1 -0
  285. package/dist/label-choices.d.ts +3 -0
  286. package/dist/label-choices.d.ts.map +1 -0
  287. package/dist/label-choices.js +168 -0
  288. package/dist/label-choices.js.map +1 -0
  289. package/dist/language.d.ts +33 -0
  290. package/dist/language.d.ts.map +1 -0
  291. package/dist/language.js +50 -0
  292. package/dist/language.js.map +1 -0
  293. package/dist/length-units.d.ts +30 -0
  294. package/dist/length-units.d.ts.map +1 -0
  295. package/dist/length-units.js +83 -0
  296. package/dist/length-units.js.map +1 -0
  297. package/dist/lightsensor.d.ts +48 -0
  298. package/dist/lightsensor.d.ts.map +1 -0
  299. package/dist/lightsensor.js +97 -0
  300. package/dist/lightsensor.js.map +1 -0
  301. package/dist/link-refresh.d.ts +27 -0
  302. package/dist/link-refresh.d.ts.map +1 -0
  303. package/dist/link-refresh.js +166 -0
  304. package/dist/link-refresh.js.map +1 -0
  305. package/dist/link.d.ts +57 -0
  306. package/dist/link.d.ts.map +1 -0
  307. package/dist/link.js +333 -0
  308. package/dist/link.js.map +1 -0
  309. package/dist/linkpreview.d.ts +114 -0
  310. package/dist/linkpreview.d.ts.map +1 -0
  311. package/dist/linkpreview.js +439 -0
  312. package/dist/linkpreview.js.map +1 -0
  313. package/dist/list-presence.d.ts +32 -0
  314. package/dist/list-presence.d.ts.map +1 -0
  315. package/dist/list-presence.js +48 -0
  316. package/dist/list-presence.js.map +1 -0
  317. package/dist/live-stream.d.ts +27 -0
  318. package/dist/live-stream.d.ts.map +1 -0
  319. package/dist/live-stream.js +274 -0
  320. package/dist/live-stream.js.map +1 -0
  321. package/dist/livelogs.d.ts +134 -0
  322. package/dist/livelogs.d.ts.map +1 -0
  323. package/dist/livelogs.js +409 -0
  324. package/dist/livelogs.js.map +1 -0
  325. package/dist/logs.d.ts +80 -0
  326. package/dist/logs.d.ts.map +1 -0
  327. package/dist/logs.js +206 -0
  328. package/dist/logs.js.map +1 -0
  329. package/dist/mcp/apps.d.ts +82 -0
  330. package/dist/mcp/apps.d.ts.map +1 -0
  331. package/dist/mcp/apps.js +219 -0
  332. package/dist/mcp/apps.js.map +1 -0
  333. package/dist/mcp/entities.d.ts +25 -0
  334. package/dist/mcp/entities.d.ts.map +1 -0
  335. package/dist/mcp/entities.js +71 -0
  336. package/dist/mcp/entities.js.map +1 -0
  337. package/dist/mcp/result.d.ts +73 -0
  338. package/dist/mcp/result.d.ts.map +1 -0
  339. package/dist/mcp/result.js +119 -0
  340. package/dist/mcp/result.js.map +1 -0
  341. package/dist/mcp/webmcp.d.ts +162 -0
  342. package/dist/mcp/webmcp.d.ts.map +1 -0
  343. package/dist/mcp/webmcp.js +214 -0
  344. package/dist/mcp/webmcp.js.map +1 -0
  345. package/dist/mcp.d.ts +5 -0
  346. package/dist/mcp.d.ts.map +1 -0
  347. package/dist/mcp.js +14 -0
  348. package/dist/mcp.js.map +1 -0
  349. package/dist/media-core.d.ts +191 -0
  350. package/dist/media-core.d.ts.map +1 -0
  351. package/dist/media-core.js +446 -0
  352. package/dist/media-core.js.map +1 -0
  353. package/dist/media-timeline-core.d.ts +94 -0
  354. package/dist/media-timeline-core.d.ts.map +1 -0
  355. package/dist/media-timeline-core.js +620 -0
  356. package/dist/media-timeline-core.js.map +1 -0
  357. package/dist/message.d.ts +42 -0
  358. package/dist/message.d.ts.map +1 -0
  359. package/dist/message.js +582 -0
  360. package/dist/message.js.map +1 -0
  361. package/dist/missing-element.d.ts +29 -0
  362. package/dist/missing-element.d.ts.map +1 -0
  363. package/dist/missing-element.js +76 -0
  364. package/dist/missing-element.js.map +1 -0
  365. package/dist/motion-core.d.ts +160 -0
  366. package/dist/motion-core.d.ts.map +1 -0
  367. package/dist/motion-core.js +752 -0
  368. package/dist/motion-core.js.map +1 -0
  369. package/dist/motion-pose.d.ts +65 -0
  370. package/dist/motion-pose.d.ts.map +1 -0
  371. package/dist/motion-pose.js +143 -0
  372. package/dist/motion-pose.js.map +1 -0
  373. package/dist/motion.d.ts +132 -0
  374. package/dist/motion.d.ts.map +1 -0
  375. package/dist/motion.js +260 -0
  376. package/dist/motion.js.map +1 -0
  377. package/dist/mount-core.d.ts +203 -0
  378. package/dist/mount-core.d.ts.map +1 -0
  379. package/dist/mount-core.js +437 -0
  380. package/dist/mount-core.js.map +1 -0
  381. package/dist/net-core.d.ts +110 -0
  382. package/dist/net-core.d.ts.map +1 -0
  383. package/dist/net-core.js +225 -0
  384. package/dist/net-core.js.map +1 -0
  385. package/dist/notify.d.ts +399 -0
  386. package/dist/notify.d.ts.map +1 -0
  387. package/dist/notify.js +964 -0
  388. package/dist/notify.js.map +1 -0
  389. package/dist/orientation-binding.d.ts +39 -0
  390. package/dist/orientation-binding.d.ts.map +1 -0
  391. package/dist/orientation-binding.js +64 -0
  392. package/dist/orientation-binding.js.map +1 -0
  393. package/dist/orientation.d.ts +55 -0
  394. package/dist/orientation.d.ts.map +1 -0
  395. package/dist/orientation.js +89 -0
  396. package/dist/orientation.js.map +1 -0
  397. package/dist/ota.d.ts +52 -0
  398. package/dist/ota.d.ts.map +1 -0
  399. package/dist/ota.js +122 -0
  400. package/dist/ota.js.map +1 -0
  401. package/dist/passkeys.d.ts +91 -0
  402. package/dist/passkeys.d.ts.map +1 -0
  403. package/dist/passkeys.js +307 -0
  404. package/dist/passkeys.js.map +1 -0
  405. package/dist/payment.d.ts +85 -0
  406. package/dist/payment.d.ts.map +1 -0
  407. package/dist/payment.js +270 -0
  408. package/dist/payment.js.map +1 -0
  409. package/dist/pending-presenter.d.ts +31 -0
  410. package/dist/pending-presenter.d.ts.map +1 -0
  411. package/dist/pending-presenter.js +119 -0
  412. package/dist/pending-presenter.js.map +1 -0
  413. package/dist/permission-core.d.ts +59 -0
  414. package/dist/permission-core.d.ts.map +1 -0
  415. package/dist/permission-core.js +102 -0
  416. package/dist/permission-core.js.map +1 -0
  417. package/dist/persist.d.ts +169 -0
  418. package/dist/persist.d.ts.map +1 -0
  419. package/dist/persist.js +361 -0
  420. package/dist/persist.js.map +1 -0
  421. package/dist/phase-plan.d.ts +114 -0
  422. package/dist/phase-plan.d.ts.map +1 -0
  423. package/dist/phase-plan.js +837 -0
  424. package/dist/phase-plan.js.map +1 -0
  425. package/dist/playback-core.d.ts +64 -0
  426. package/dist/playback-core.d.ts.map +1 -0
  427. package/dist/playback-core.js +176 -0
  428. package/dist/playback-core.js.map +1 -0
  429. package/dist/player-sources.d.ts +12 -0
  430. package/dist/player-sources.d.ts.map +1 -0
  431. package/dist/player-sources.js +44 -0
  432. package/dist/player-sources.js.map +1 -0
  433. package/dist/proxy-denylist.d.ts +11 -0
  434. package/dist/proxy-denylist.d.ts.map +1 -0
  435. package/dist/proxy-denylist.js +44 -0
  436. package/dist/proxy-denylist.js.map +1 -0
  437. package/dist/public-config.d.ts +20 -0
  438. package/dist/public-config.d.ts.map +1 -0
  439. package/dist/public-config.js +109 -0
  440. package/dist/public-config.js.map +1 -0
  441. package/dist/qoe-core.d.ts +72 -0
  442. package/dist/qoe-core.d.ts.map +1 -0
  443. package/dist/qoe-core.js +113 -0
  444. package/dist/qoe-core.js.map +1 -0
  445. package/dist/reactive-request.d.ts +80 -0
  446. package/dist/reactive-request.d.ts.map +1 -0
  447. package/dist/reactive-request.js +192 -0
  448. package/dist/reactive-request.js.map +1 -0
  449. package/dist/read-cache.d.ts +129 -0
  450. package/dist/read-cache.d.ts.map +1 -0
  451. package/dist/read-cache.js +566 -0
  452. package/dist/read-cache.js.map +1 -0
  453. package/dist/recorder-core.d.ts +57 -0
  454. package/dist/recorder-core.d.ts.map +1 -0
  455. package/dist/recorder-core.js +136 -0
  456. package/dist/recorder-core.js.map +1 -0
  457. package/dist/ref.d.ts +41 -0
  458. package/dist/ref.d.ts.map +1 -0
  459. package/dist/ref.js +98 -0
  460. package/dist/ref.js.map +1 -0
  461. package/dist/refusal.d.ts +82 -0
  462. package/dist/refusal.d.ts.map +1 -0
  463. package/dist/refusal.js +218 -0
  464. package/dist/refusal.js.map +1 -0
  465. package/dist/region-insets.d.ts +61 -0
  466. package/dist/region-insets.d.ts.map +1 -0
  467. package/dist/region-insets.js +67 -0
  468. package/dist/region-insets.js.map +1 -0
  469. package/dist/rive-core.d.ts +323 -0
  470. package/dist/rive-core.d.ts.map +1 -0
  471. package/dist/rive-core.js +677 -0
  472. package/dist/rive-core.js.map +1 -0
  473. package/dist/runner.d.ts +595 -0
  474. package/dist/runner.d.ts.map +1 -0
  475. package/dist/runner.js +4094 -0
  476. package/dist/runner.js.map +1 -0
  477. package/dist/scene/a11y.d.ts +11 -0
  478. package/dist/scene/a11y.d.ts.map +1 -0
  479. package/dist/scene/a11y.js +67 -0
  480. package/dist/scene/a11y.js.map +1 -0
  481. package/dist/scene/anim.d.ts +149 -0
  482. package/dist/scene/anim.d.ts.map +1 -0
  483. package/dist/scene/anim.js +396 -0
  484. package/dist/scene/anim.js.map +1 -0
  485. package/dist/scene/bind.d.ts +33 -0
  486. package/dist/scene/bind.d.ts.map +1 -0
  487. package/dist/scene/bind.js +66 -0
  488. package/dist/scene/bind.js.map +1 -0
  489. package/dist/scene/collide.d.ts +56 -0
  490. package/dist/scene/collide.d.ts.map +1 -0
  491. package/dist/scene/collide.js +146 -0
  492. package/dist/scene/collide.js.map +1 -0
  493. package/dist/scene/frame.d.ts +22 -0
  494. package/dist/scene/frame.d.ts.map +1 -0
  495. package/dist/scene/frame.js +57 -0
  496. package/dist/scene/frame.js.map +1 -0
  497. package/dist/scene/gltf.d.ts +79 -0
  498. package/dist/scene/gltf.d.ts.map +1 -0
  499. package/dist/scene/gltf.js +409 -0
  500. package/dist/scene/gltf.js.map +1 -0
  501. package/dist/scene/ir.d.ts +293 -0
  502. package/dist/scene/ir.d.ts.map +1 -0
  503. package/dist/scene/ir.js +692 -0
  504. package/dist/scene/ir.js.map +1 -0
  505. package/dist/scene/math.d.ts +50 -0
  506. package/dist/scene/math.d.ts.map +1 -0
  507. package/dist/scene/math.js +180 -0
  508. package/dist/scene/math.js.map +1 -0
  509. package/dist/scene/orbit.d.ts +19 -0
  510. package/dist/scene/orbit.d.ts.map +1 -0
  511. package/dist/scene/orbit.js +60 -0
  512. package/dist/scene/orbit.js.map +1 -0
  513. package/dist/scene/physics.d.ts +228 -0
  514. package/dist/scene/physics.d.ts.map +1 -0
  515. package/dist/scene/physics.js +1500 -0
  516. package/dist/scene/physics.js.map +1 -0
  517. package/dist/scene/registry.d.ts +85 -0
  518. package/dist/scene/registry.d.ts.map +1 -0
  519. package/dist/scene/registry.js +75 -0
  520. package/dist/scene/registry.js.map +1 -0
  521. package/dist/scene/skin.d.ts +82 -0
  522. package/dist/scene/skin.d.ts.map +1 -0
  523. package/dist/scene/skin.js +351 -0
  524. package/dist/scene/skin.js.map +1 -0
  525. package/dist/scene/sprite.d.ts +36 -0
  526. package/dist/scene/sprite.d.ts.map +1 -0
  527. package/dist/scene/sprite.js +107 -0
  528. package/dist/scene/sprite.js.map +1 -0
  529. package/dist/scene/viewer.d.ts +96 -0
  530. package/dist/scene/viewer.d.ts.map +1 -0
  531. package/dist/scene/viewer.js +235 -0
  532. package/dist/scene/viewer.js.map +1 -0
  533. package/dist/scoped-slots.d.ts +9 -0
  534. package/dist/scoped-slots.d.ts.map +1 -0
  535. package/dist/scoped-slots.js +42 -0
  536. package/dist/scoped-slots.js.map +1 -0
  537. package/dist/screen.d.ts +109 -0
  538. package/dist/screen.d.ts.map +1 -0
  539. package/dist/screen.js +309 -0
  540. package/dist/screen.js.map +1 -0
  541. package/dist/scroll.d.ts +525 -0
  542. package/dist/scroll.d.ts.map +1 -0
  543. package/dist/scroll.js +1226 -0
  544. package/dist/scroll.js.map +1 -0
  545. package/dist/settings-plane.d.ts +58 -0
  546. package/dist/settings-plane.d.ts.map +1 -0
  547. package/dist/settings-plane.js +86 -0
  548. package/dist/settings-plane.js.map +1 -0
  549. package/dist/share-inbox.d.ts +56 -0
  550. package/dist/share-inbox.d.ts.map +1 -0
  551. package/dist/share-inbox.js +114 -0
  552. package/dist/share-inbox.js.map +1 -0
  553. package/dist/shared-transition.d.ts +152 -0
  554. package/dist/shared-transition.d.ts.map +1 -0
  555. package/dist/shared-transition.js +257 -0
  556. package/dist/shared-transition.js.map +1 -0
  557. package/dist/sheet-content-padding.d.ts +24 -0
  558. package/dist/sheet-content-padding.d.ts.map +1 -0
  559. package/dist/sheet-content-padding.js +32 -0
  560. package/dist/sheet-content-padding.js.map +1 -0
  561. package/dist/shot-devices.d.ts +36 -0
  562. package/dist/shot-devices.d.ts.map +1 -0
  563. package/dist/shot-devices.js +90 -0
  564. package/dist/shot-devices.js.map +1 -0
  565. package/dist/shot-guards.d.ts +100 -0
  566. package/dist/shot-guards.d.ts.map +1 -0
  567. package/dist/shot-guards.js +260 -0
  568. package/dist/shot-guards.js.map +1 -0
  569. package/dist/shot-scope.d.ts +140 -0
  570. package/dist/shot-scope.d.ts.map +1 -0
  571. package/dist/shot-scope.js +302 -0
  572. package/dist/shot-scope.js.map +1 -0
  573. package/dist/slot-partition.d.ts +9 -0
  574. package/dist/slot-partition.d.ts.map +1 -0
  575. package/dist/slot-partition.js +38 -0
  576. package/dist/slot-partition.js.map +1 -0
  577. package/dist/snackbar.d.ts +165 -0
  578. package/dist/snackbar.d.ts.map +1 -0
  579. package/dist/snackbar.js +220 -0
  580. package/dist/snackbar.js.map +1 -0
  581. package/dist/socket.d.ts +96 -0
  582. package/dist/socket.d.ts.map +1 -0
  583. package/dist/socket.js +370 -0
  584. package/dist/socket.js.map +1 -0
  585. package/dist/spotlight.d.ts +77 -0
  586. package/dist/spotlight.d.ts.map +1 -0
  587. package/dist/spotlight.js +174 -0
  588. package/dist/spotlight.js.map +1 -0
  589. package/dist/state-primitive.d.ts +37 -0
  590. package/dist/state-primitive.d.ts.map +1 -0
  591. package/dist/state-primitive.js +91 -0
  592. package/dist/state-primitive.js.map +1 -0
  593. package/dist/store-query.d.ts +25 -0
  594. package/dist/store-query.d.ts.map +1 -0
  595. package/dist/store-query.js +88 -0
  596. package/dist/store-query.js.map +1 -0
  597. package/dist/store-value.d.ts +48 -0
  598. package/dist/store-value.d.ts.map +1 -0
  599. package/dist/store-value.js +264 -0
  600. package/dist/store-value.js.map +1 -0
  601. package/dist/store-versioning.d.ts +70 -0
  602. package/dist/store-versioning.d.ts.map +1 -0
  603. package/dist/store-versioning.js +188 -0
  604. package/dist/store-versioning.js.map +1 -0
  605. package/dist/store.d.ts +282 -0
  606. package/dist/store.d.ts.map +1 -0
  607. package/dist/store.js +1144 -0
  608. package/dist/store.js.map +1 -0
  609. package/dist/strings.d.ts +141 -0
  610. package/dist/strings.d.ts.map +1 -0
  611. package/dist/strings.js +581 -0
  612. package/dist/strings.js.map +1 -0
  613. package/dist/telemetry.d.ts +95 -0
  614. package/dist/telemetry.d.ts.map +1 -0
  615. package/dist/telemetry.js +255 -0
  616. package/dist/telemetry.js.map +1 -0
  617. package/dist/transform-core.d.ts +228 -0
  618. package/dist/transform-core.d.ts.map +1 -0
  619. package/dist/transform-core.js +921 -0
  620. package/dist/transform-core.js.map +1 -0
  621. package/dist/transition-core.d.ts +58 -0
  622. package/dist/transition-core.d.ts.map +1 -0
  623. package/dist/transition-core.js +352 -0
  624. package/dist/transition-core.js.map +1 -0
  625. package/dist/trim-trailing.d.ts +3 -0
  626. package/dist/trim-trailing.d.ts.map +1 -0
  627. package/dist/trim-trailing.js +14 -0
  628. package/dist/trim-trailing.js.map +1 -0
  629. package/dist/upload.d.ts +51 -0
  630. package/dist/upload.d.ts.map +1 -0
  631. package/dist/upload.js +68 -0
  632. package/dist/upload.js.map +1 -0
  633. package/dist/vendor-face.d.ts +44 -0
  634. package/dist/vendor-face.d.ts.map +1 -0
  635. package/dist/vendor-face.js +80 -0
  636. package/dist/vendor-face.js.map +1 -0
  637. package/dist/vendor-session.d.ts +166 -0
  638. package/dist/vendor-session.d.ts.map +1 -0
  639. package/dist/vendor-session.js +423 -0
  640. package/dist/vendor-session.js.map +1 -0
  641. package/dist/vendor-surface.d.ts +290 -0
  642. package/dist/vendor-surface.d.ts.map +1 -0
  643. package/dist/vendor-surface.js +439 -0
  644. package/dist/vendor-surface.js.map +1 -0
  645. package/dist/version-rules.generated.d.ts +17 -0
  646. package/dist/version-rules.generated.d.ts.map +1 -0
  647. package/dist/version-rules.generated.js +99 -0
  648. package/dist/version-rules.generated.js.map +1 -0
  649. package/dist/view-transition-core.d.ts +99 -0
  650. package/dist/view-transition-core.d.ts.map +1 -0
  651. package/dist/view-transition-core.js +127 -0
  652. package/dist/view-transition-core.js.map +1 -0
  653. package/dist/view-transition-door.d.ts +26 -0
  654. package/dist/view-transition-door.d.ts.map +1 -0
  655. package/dist/view-transition-door.js +88 -0
  656. package/dist/view-transition-door.js.map +1 -0
  657. package/dist/window-identity.d.ts +3 -0
  658. package/dist/window-identity.d.ts.map +1 -0
  659. package/dist/window-identity.js +27 -0
  660. package/dist/window-identity.js.map +1 -0
  661. package/package.json +139 -4
@@ -0,0 +1,921 @@
1
+ //
2
+ // transform-core.ts - the CSS transform algebra, pure and corpus-pinned (the TypeScript twin
3
+ // of OpenSource/Engine/Swift/TransformCore.swift and :core TransformCore.kt).
4
+ // OpenSource/Conformance/motion/transform.json pins all three.
5
+ //
6
+ // The browser composes its own transforms, so the web renderer never calls this file to
7
+ // paint. It exists because the corpus has to run somewhere on every pull request, and
8
+ // because the arithmetic the two native lanes hand their platforms needs one reference the
9
+ // browser can be diffed against.
10
+ //
11
+ // A `transform` is a list of functions composed into ONE 4x4 matrix (CSS Transforms 1 and 2:
12
+ // identity, translate by the origin, every function left to right, translate back).
13
+ //
14
+ // Layout of a matrix: sixteen numbers in the `matrix3d()` argument order, column major with
15
+ // column vectors (x' = m0 x + m4 y + m8 z + m12).
16
+ //
17
+ export const TRANSFORM_IDENTITY = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
18
+ /** The trailing run of unit letters (`px`, `deg`, `%`), walked from the end: the unanchored
19
+ * `/[a-zA-Z%]+$/` rescanned every earlier letter run to the end, quadratic in the argument. */
20
+ function trailingUnit(text) {
21
+ let start = text.length;
22
+ while (start > 0 && /[a-zA-Z%]/.test(text[start - 1]))
23
+ start -= 1;
24
+ return text.slice(start);
25
+ }
26
+ const NUMBER = /^[-+]?(\d+(?:\.\d*)?|\.\d+)([eE][-+]?\d+)?$/;
27
+ /** The function list of a `transform` value: null when malformed, empty for `none`. */
28
+ export function parseTransformList(source) {
29
+ const out = [];
30
+ let name = "";
31
+ let body = "";
32
+ let inBody = false;
33
+ // Close the function whose arguments have accumulated in `body`. False when an argument is
34
+ // not a CSS number with an optional unit, which drops the whole declaration.
35
+ const close = () => {
36
+ const args = [];
37
+ for (const raw of body.split(",")) {
38
+ const text = raw.trim();
39
+ if (text === "")
40
+ return false;
41
+ const unit = trailingUnit(text);
42
+ const numberText = unit === "" ? text : text.slice(0, text.length - unit.length);
43
+ if (!NUMBER.test(numberText))
44
+ return false;
45
+ const n = Number(numberText);
46
+ if (!Number.isFinite(n))
47
+ return false;
48
+ args.push({ n, unit });
49
+ }
50
+ const fnName = name.trim();
51
+ if (fnName === "")
52
+ return false;
53
+ out.push({ name: fnName, args });
54
+ name = "";
55
+ body = "";
56
+ return true;
57
+ };
58
+ for (const ch of source) {
59
+ if (ch === "(") {
60
+ if (inBody)
61
+ return null;
62
+ inBody = true;
63
+ body = "";
64
+ continue;
65
+ }
66
+ if (ch === ")") {
67
+ if (!inBody || !close())
68
+ return null;
69
+ inBody = false;
70
+ continue;
71
+ }
72
+ if (inBody)
73
+ body += ch;
74
+ else
75
+ name += ch;
76
+ }
77
+ // CSS closes an unclosed function at the end of input (Syntax 3, consuming a component
78
+ // value), so a function whose closing paren never arrives is still that function.
79
+ if (inBody)
80
+ return close() ? out : null;
81
+ const rest = name.trim();
82
+ if (out.length === 0)
83
+ return rest.toLowerCase() === "none" ? [] : null;
84
+ return rest === "" ? out : null;
85
+ }
86
+ /**
87
+ * THE LEGACY PAINT ATTRIBUTES as a function list, in the order CSS composes its individual
88
+ * transform properties (Transforms 2 section 3: `translate`, then `rotate`, then `scale`). Those
89
+ * three properties are exactly what `offsetX`/`offsetY`, `rotation` and `scale`/`scaleX`/`scaleY`
90
+ * are, so an author who writes the attribute and an author who writes the stylesheet get one
91
+ * matrix. `offset` is the legacy alias of `offsetY`.
92
+ */
93
+ function foldLegacyTransform(attributes) {
94
+ const number = (key) => {
95
+ const text = attributes[key]?.trim();
96
+ if (text === undefined || text === "")
97
+ return null;
98
+ const value = Number(text);
99
+ return Number.isFinite(value) ? value : null;
100
+ };
101
+ const fns = [];
102
+ const x = number("offsetX") ?? 0;
103
+ const y = number("offsetY") ?? number("offset") ?? 0;
104
+ if (x !== 0 || y !== 0) {
105
+ fns.push({ name: "translate", args: [{ n: x, unit: "px" }, { n: y, unit: "px" }] });
106
+ }
107
+ const rotation = number("rotation");
108
+ if (rotation !== null && rotation !== 0) {
109
+ fns.push({ name: "rotate", args: [{ n: rotation, unit: "deg" }] });
110
+ }
111
+ // The uniform scale keeps CSS's ONE-argument spelling; `scale(s)` and `scale(s, s)` are the
112
+ // same matrix, and one argument is how the web has always written this attribute.
113
+ const scale = number("scale");
114
+ if (scale !== null && scale !== 1) {
115
+ fns.push({ name: "scale", args: [{ n: scale, unit: "" }] });
116
+ }
117
+ const sx = number("scaleX");
118
+ const sy = number("scaleY");
119
+ if ((sx !== null || sy !== null) && ((sx ?? 1) !== 1 || (sy ?? 1) !== 1)) {
120
+ fns.push({ name: "scale", args: [{ n: sx ?? 1, unit: "" }, { n: sy ?? 1, unit: "" }] });
121
+ }
122
+ return fns.length === 0 ? null : fns;
123
+ }
124
+ /**
125
+ * THE TRANSFORM AN ELEMENT DECLARES, as a function list the paint layer can compose.
126
+ *
127
+ * `transform` wins outright when it is there: a stylesheet's own declaration, or the frame a
128
+ * running keyframe sampled, REPLACES the base value, which is what CSS says an animation does to
129
+ * the property it animates. Otherwise the legacy paint attributes fold into the same list.
130
+ */
131
+ export function transformListFromAttributes(attributes) {
132
+ const declared = attributes["transform"];
133
+ if (declared !== undefined)
134
+ return parseTransformList(declared);
135
+ return foldLegacyTransform(attributes);
136
+ }
137
+ /**
138
+ * The same fold as ONE CSS DECLARATION VALUE, for a renderer that hands the string to a parser it
139
+ * already has. The web is that renderer: a browser composes its own transforms, so a declared
140
+ * `transform` rides through verbatim and only the legacy attributes need folding. Keeping this
141
+ * path free of the parser is what keeps the transform algebra out of an embed's bytes, where the
142
+ * G10 widget law leaves no room for a second one.
143
+ */
144
+ export function transformDeclarationFromAttributes(attributes) {
145
+ const declared = attributes["transform"]?.trim();
146
+ if (declared !== undefined)
147
+ return declared === "" ? null : declared;
148
+ const fns = foldLegacyTransform(attributes);
149
+ return fns === null ? null : normalizeTransform(fns);
150
+ }
151
+ /** The canonical spelling of a function list; an empty list spells `none`. */
152
+ export function normalizeTransform(fns) {
153
+ if (fns.length === 0)
154
+ return "none";
155
+ return fns
156
+ .map((fn) => `${fn.name}(${fn.args.map((a) => formatTransformNumber(a.n) + a.unit).join(", ")})`)
157
+ .join(" ");
158
+ }
159
+ /** The matrix of a function list about the box's top left corner, or null for an unknown function. */
160
+ export function transformMatrix(fns, width, height) {
161
+ let m = [...TRANSFORM_IDENTITY];
162
+ for (const fn of fns) {
163
+ const f = functionMatrix(fn, width, height);
164
+ if (f === null)
165
+ return null;
166
+ m = multiplyTransform(m, f);
167
+ }
168
+ return m;
169
+ }
170
+ /** The matrix about an origin inside the box: `translate(origin) * functions * translate(-origin)`. */
171
+ export function transformMatrixAbout(fns, width, height, originX, originY) {
172
+ const inner = transformMatrix(fns, width, height);
173
+ if (inner === null)
174
+ return null;
175
+ if (originX === 0 && originY === 0)
176
+ return inner;
177
+ return multiplyTransform(multiplyTransform(translation(originX, originY, 0), inner), translation(-originX, -originY, 0));
178
+ }
179
+ /**
180
+ * The `transform-origin` of a box in points: the DSX words (logical, flipped under RTL), the CSS
181
+ * words (physical), one or two lengths or percentages; anything else is the centre, which is
182
+ * CSS's initial value.
183
+ */
184
+ export function transformOrigin(value, width, height, rtl) {
185
+ const centre = [width / 2, height / 2];
186
+ const raw = value?.trim() ?? "";
187
+ if (raw === "")
188
+ return centre;
189
+ const start = rtl ? width : 0;
190
+ const end = rtl ? 0 : width;
191
+ switch (raw) {
192
+ case "center": return centre;
193
+ case "leading": return [start, height / 2];
194
+ case "trailing": return [end, height / 2];
195
+ case "topLeading": return [start, 0];
196
+ case "topTrailing": return [end, 0];
197
+ case "bottomLeading": return [start, height];
198
+ case "bottomTrailing": return [end, height];
199
+ default: break;
200
+ }
201
+ const words = raw.toLowerCase().split(" ").filter((w) => w !== "");
202
+ if (words.length === 0 || words.length > 3)
203
+ return centre;
204
+ if (words.length === 1) {
205
+ switch (words[0]) {
206
+ case "left": return [0, height / 2];
207
+ case "right": return [width, height / 2];
208
+ case "top": return [width / 2, 0];
209
+ case "bottom": return [width / 2, height];
210
+ default: {
211
+ const v = axisValue(words[0], width);
212
+ return v === null ? centre : [v, height / 2];
213
+ }
214
+ }
215
+ }
216
+ const horizontal = new Set(["left", "right"]);
217
+ const vertical = new Set(["top", "bottom"]);
218
+ let first = words[0];
219
+ let second = words[1];
220
+ if (vertical.has(first) && (horizontal.has(second) || second === "center")) {
221
+ const swap = first;
222
+ first = second;
223
+ second = swap;
224
+ }
225
+ let x;
226
+ let y;
227
+ switch (first) {
228
+ case "left":
229
+ x = 0;
230
+ break;
231
+ case "right":
232
+ x = width;
233
+ break;
234
+ case "center":
235
+ x = width / 2;
236
+ break;
237
+ default: x = axisValue(first, width);
238
+ }
239
+ switch (second) {
240
+ case "top":
241
+ y = 0;
242
+ break;
243
+ case "bottom":
244
+ y = height;
245
+ break;
246
+ case "center":
247
+ y = height / 2;
248
+ break;
249
+ default: y = axisValue(second, height);
250
+ }
251
+ if (x === null || y === null)
252
+ return centre;
253
+ return [x, y];
254
+ }
255
+ function axisValue(word, along) {
256
+ if (word.endsWith("%")) {
257
+ const n = Number(word.slice(0, -1));
258
+ return Number.isFinite(n) && word.length > 1 ? (n / 100) * along : null;
259
+ }
260
+ if (word.endsWith("px")) {
261
+ const n = Number(word.slice(0, -2));
262
+ return Number.isFinite(n) && word.length > 2 ? n : null;
263
+ }
264
+ if (word === "")
265
+ return null;
266
+ const n = Number(word);
267
+ return Number.isFinite(n) ? n : null;
268
+ }
269
+ /** True when the matrix moves nothing out of the plane: no z terms, no perspective. */
270
+ export function isAffineTransform(m) {
271
+ if (m.length !== 16)
272
+ return false;
273
+ for (const i of [2, 3, 6, 7, 8, 9, 11, 14])
274
+ if (Math.abs(m[i]) > 1e-9)
275
+ return false;
276
+ return Math.abs(m[10] - 1) < 1e-9 && Math.abs(m[15] - 1) < 1e-9;
277
+ }
278
+ /**
279
+ * The nine numbers of a flat element's projection: a plane's points have no z, so the third row
280
+ * and column fall away and the perspective terms stay. x' = p0 x + p3 y + p6,
281
+ * y' = p1 x + p4 y + p7, w' = p2 x + p5 y + p8.
282
+ */
283
+ export function projectTransform(m) {
284
+ if (m.length !== 16)
285
+ return [1, 0, 0, 0, 1, 0, 0, 0, 1];
286
+ return [m[0], m[1], m[3], m[4], m[5], m[7], m[12], m[13], m[15]];
287
+ }
288
+ /** The plane decomposition of an affine matrix, or null when it leaves the plane or collapses an axis. */
289
+ export function decomposeTransform(m) {
290
+ if (!isAffineTransform(m))
291
+ return null;
292
+ const a = m[0];
293
+ const b = m[1];
294
+ const c = m[4];
295
+ const d = m[5];
296
+ const sx = Math.sqrt(a * a + b * b);
297
+ if (sx <= 1e-12)
298
+ return null;
299
+ const rotation = Math.atan2(b, a);
300
+ const cosR = Math.cos(rotation);
301
+ const sinR = Math.sin(rotation);
302
+ const shear = c * cosR + d * sinR;
303
+ const sy = -c * sinR + d * cosR;
304
+ if (Math.abs(sy) <= 1e-12)
305
+ return null;
306
+ const skew = (Math.atan(shear / sy) * 180) / Math.PI;
307
+ return {
308
+ translateX: m[12],
309
+ translateY: m[13],
310
+ scaleX: sx,
311
+ scaleY: sy,
312
+ rotation: (rotation * 180) / Math.PI,
313
+ skewX: skew,
314
+ };
315
+ }
316
+ /**
317
+ * The bounds of a box after a transform, relative to the box's own top left corner: the
318
+ * browser's `getBoundingClientRect` of a transformed element. A corner behind the viewer keeps
319
+ * its unprojected place rather than exploding.
320
+ */
321
+ export function transformBounds(m, width, height) {
322
+ if (m.length !== 16)
323
+ return [0, 0, width, height];
324
+ let minX = Infinity;
325
+ let minY = Infinity;
326
+ let maxX = -Infinity;
327
+ let maxY = -Infinity;
328
+ for (const [x, y] of [[0, 0], [width, 0], [0, height], [width, height]]) {
329
+ let px = m[0] * x + m[4] * y + m[12];
330
+ let py = m[1] * x + m[5] * y + m[13];
331
+ const pw = m[3] * x + m[7] * y + m[15];
332
+ if (pw > 1e-9) {
333
+ px /= pw;
334
+ py /= pw;
335
+ }
336
+ if (px < minX)
337
+ minX = px;
338
+ if (px > maxX)
339
+ maxX = px;
340
+ if (py < minY)
341
+ minY = py;
342
+ if (py > maxY)
343
+ maxY = py;
344
+ }
345
+ return [minX, minY, maxX - minX, maxY - minY];
346
+ }
347
+ /** True when the element shows its back: the z axis points away from the viewer. */
348
+ export function transformShowsBackface(m) {
349
+ return m.length === 16 && m[10] < 0;
350
+ }
351
+ /* THE 3D RENDERING CONTEXT (CSS Transforms 2 sections 4, 5, 6 and 7).
352
+ Swift twin: TransformCore.swift, same section. Kotlin twin: TransformCore.kt. */
353
+ /**
354
+ * The depth of the `perspective` PROPERTY, in pixels, or null for `none`.
355
+ *
356
+ * This is not the `perspective()` transform FUNCTION: the function sits in the element's own
357
+ * matrix, while the property builds a matrix that applies to the element's CHILDREN, about
358
+ * `perspective-origin`. Measured in Chromium 149.0.7827.55, Firefox 151.0 and
359
+ * WebKit 26.5: `none` and any negative length compute to `none`, `0` computes to `0px`, and a
360
+ * relative length is already absolute by the time it reaches this file.
361
+ *
362
+ * Zero is DELIBERATELY not a depth here. The three browsers do not agree on what a zero or
363
+ * sub-pixel depth draws (Chromium and WebKit clamp to one pixel and collapse the box to a speck,
364
+ * Firefox projects it to hundreds of thousands of pixels), so there is no standard answer for the
365
+ * native lanes to copy and this function answers null rather than inventing one.
366
+ * https://www.w3.org/TR/css-transforms-2/#perspective-property
367
+ */
368
+ export function perspectiveDepth(value) {
369
+ const raw = (value ?? "").trim().toLowerCase();
370
+ if (raw === "" || raw === "none")
371
+ return null;
372
+ const hasUnit = raw.endsWith("px");
373
+ const numberText = hasUnit ? raw.slice(0, -2) : raw;
374
+ if (!NUMBER.test(numberText))
375
+ return null;
376
+ const n = Number(numberText);
377
+ if (!Number.isFinite(n))
378
+ return null;
379
+ // A length needs its unit unless it is zero, and a zero or negative depth is not one.
380
+ if (!hasUnit && n !== 0)
381
+ return null;
382
+ return n > 0 ? n : null;
383
+ }
384
+ /**
385
+ * THE DEPTH AS THE PARENT STAMP CARRIES IT, which is not CSS text. The bridge resolves the
386
+ * `perspective` property to points once, on the element that declares it (CssBridge
387
+ * `a["perspective"]`), and the container placement loops stamp that number on every child
388
+ * (`-dsx-parent-perspective`), so what reaches a child's paint ladder is a bare count of points
389
+ * and `perspectiveDepth` above rightly refuses it: a bare number is not a CSS length. Zero and
390
+ * anything negative are still not a depth, for the reason `perspectiveDepth` gives.
391
+ * https://www.w3.org/TR/css-transforms-2/#perspective-property
392
+ */
393
+ export function perspectivePoints(stamped) {
394
+ const raw = (stamped ?? "").trim();
395
+ if (raw === "")
396
+ return null;
397
+ const n = Number(raw);
398
+ if (!Number.isFinite(n) || n <= 0)
399
+ return null;
400
+ return n;
401
+ }
402
+ /**
403
+ * The `perspective-origin` of a box in pixels. The grammar is `transform-origin`'s two
404
+ * dimensional half and the initial value is the centre, so the origin parser above IS this
405
+ * parser; the name exists so a reader of the paint layer sees which property is being asked for.
406
+ * Measured in all three browsers: `left top` computes `0px 0px`, `25% 75%` on a 200x80 box
407
+ * computes `50px 60px`, and a single `10px` computes `10px 40px`.
408
+ * https://www.w3.org/TR/css-transforms-2/#perspective-origin-property
409
+ */
410
+ export function perspectiveOrigin(value, width, height) {
411
+ return transformOrigin(value, width, height, false);
412
+ }
413
+ /**
414
+ * THE MATRIX A PARENT'S `perspective` APPLIES TO A CHILD: the perspective matrix conjugated by
415
+ * the perspective origin, `translate(origin) * perspective(depth) * translate(-origin)`.
416
+ *
417
+ * The origin is given in the CHILD's own coordinates, which is the parent's perspective origin
418
+ * minus where the child sits inside the parent, because that is the frame the child's own matrix
419
+ * is already written in. Compose it on the LEFT of the child's matrix: a `perspective: 200px`
420
+ * parent over a child that translates 50 pixels toward the viewer scales the child by
421
+ * 200 / (200 - 50), which is what all three browsers drew (a 200x80 box became 266.667x106.667,
422
+ * exactly, in Chromium 149, Firefox 151 and WebKit 26.5).
423
+ * https://www.w3.org/TR/css-transforms-2/#perspective-matrix
424
+ */
425
+ export function perspectiveMatrix(depth, originX, originY) {
426
+ if (!(depth > 0) || !Number.isFinite(depth))
427
+ return [...TRANSFORM_IDENTITY];
428
+ const p = [...TRANSFORM_IDENTITY];
429
+ p[11] = -1 / depth;
430
+ if (originX === 0 && originY === 0)
431
+ return p;
432
+ return multiplyTransform(multiplyTransform(translation(originX, originY, 0), p), translation(-originX, -originY, 0));
433
+ }
434
+ /**
435
+ * `transform-style`, as the two words CSS has. Anything else is the initial value: a stylesheet
436
+ * that misspells the word gets a flattening context, not a dropped element.
437
+ * https://www.w3.org/TR/css-transforms-2/#transform-style-property
438
+ */
439
+ export function transformStyleWord(value) {
440
+ return (value ?? "").trim().toLowerCase() === "preserve-3d" ? "preserve-3d" : "flat";
441
+ }
442
+ /* The CSS grouping property set is recorded ONCE, in
443
+ OpenSource/Conformance/motion/transform.json under `groupingSet`, from Chromium
444
+ 149.0.7827.55, Firefox 151.0 and WebKit 26.5 by
445
+ OpenSource/Engine/TypeScript/packages/dom/oracle/spec-oracle-grouping.ts. This table, its Kotlin and Swift twins
446
+ and the corpus `flattening` cases are all written from that one list.
447
+ GROUPING SET GENERATED BY the build tooling generator, DO NOT EDIT. */
448
+ export const GROUPING_PROPERTY_RULES = [
449
+ { property: "overflow", kind: "otherThan", values: ["visible"] },
450
+ { property: "overflow-x", kind: "otherThan", values: ["visible"] },
451
+ { property: "overflow-y", kind: "otherThan", values: ["visible"] },
452
+ { property: "opacity", kind: "belowOne", values: [] },
453
+ { property: "filter", kind: "otherThan", values: ["none"] },
454
+ { property: "backdrop-filter", kind: "otherThan", values: ["none"] },
455
+ { property: "clip-path", kind: "otherThan", values: ["none"] },
456
+ { property: "mask-image", kind: "otherThan", values: ["none"] },
457
+ { property: "mask", kind: "otherThan", values: ["none"] },
458
+ { property: "mask-border", kind: "otherThan", values: ["none"] },
459
+ { property: "mask-border-source", kind: "otherThan", values: ["none"] },
460
+ { property: "mix-blend-mode", kind: "otherThan", values: ["normal"] },
461
+ { property: "isolation", kind: "oneOf", values: ["isolate"] },
462
+ { property: "clip", kind: "otherThan", values: ["auto"] },
463
+ { property: "contain", kind: "tokenAny", values: ["paint", "layout", "strict", "content"] },
464
+ { property: "will-change", kind: "namesGroupingProperty", values: [] },
465
+ ];
466
+ /* END GROUPING SET */
467
+ /**
468
+ * True when a `transform-style: preserve-3d` element is forced to flatten anyway because it
469
+ * carries a grouping property (css-transforms-2 section 7.1). The MEMBERS are the generated
470
+ * table above; this is only the reading of the five rule kinds, so a member is added to the
471
+ * corpus and never to three languages.
472
+ * https://www.w3.org/TR/css-transforms-2/#grouping-property-values
473
+ */
474
+ export function flattensDespitePreserve3d(decls) {
475
+ const word = (key) => (decls[key] ?? "").trim().toLowerCase();
476
+ for (const rule of GROUPING_PROPERTY_RULES) {
477
+ const value = word(rule.property);
478
+ if (value === "")
479
+ continue;
480
+ switch (rule.kind) {
481
+ case "otherThan":
482
+ if (!rule.values.includes(value))
483
+ return true;
484
+ break;
485
+ case "oneOf":
486
+ if (rule.values.includes(value))
487
+ return true;
488
+ break;
489
+ case "belowOne": {
490
+ const n = Number(value);
491
+ if (Number.isFinite(n) && n < 1)
492
+ return true;
493
+ break;
494
+ }
495
+ case "tokenAny":
496
+ if (value.split(/\s+/).some(token => rule.values.includes(token)))
497
+ return true;
498
+ break;
499
+ case "namesGroupingProperty":
500
+ if (value.split(",").map(part => part.trim()).some(name => GROUPING_PROPERTY_RULES.some(other => other.property === name && other.kind !== "namesGroupingProperty")))
501
+ return true;
502
+ break;
503
+ default:
504
+ throw new Error(`unknown grouping rule kind ${JSON.stringify(rule.kind)}`);
505
+ }
506
+ }
507
+ return false;
508
+ }
509
+ /**
510
+ * THE USED VALUE of `transform-style`: the word the author declared, forced to `flat` when the
511
+ * element also carries one of the grouping property values. An element whose used value is
512
+ * `preserve-3d` EXTENDS the 3D rendering context it participates in rather than establishing a
513
+ * flat plane of its own, so this one answer decides whether a descendant's z survives. Read from
514
+ * the RESOLVED STYLE and never from a table of tags.
515
+ * https://www.w3.org/TR/css-transforms-2/#transform-style-property
516
+ */
517
+ export function usedTransformStyle(value, decls) {
518
+ return transformStyleWord(value) === "preserve-3d" && !flattensDespitePreserve3d(decls)
519
+ ? "preserve-3d"
520
+ : "flat";
521
+ }
522
+ /**
523
+ * THE FLATTENING MATRIX of CSS Transforms 2 section 4.1: the identity with its third column
524
+ * removed. A `flat` element renders its descendants into a plane and then places that plane, so a
525
+ * descendant's own z must reach neither the projection nor the depth, while the element's OWN z,
526
+ * which lives in the translation column, still travels through the viewing distance its context
527
+ * opened. Composing this on the right of the element's matrix is exactly that: a descendant point
528
+ * (x, y, z) arrives as (x, y, 0) and the element's own translation is untouched.
529
+ * https://www.w3.org/TR/css-transforms-2/#3d-rendering-contexts
530
+ */
531
+ export function flatteningMatrix() {
532
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
533
+ }
534
+ /** The same matrix with everything a descendant's z could say to it removed. */
535
+ export function flattenTransform(m) {
536
+ return multiplyTransform(m, flatteningMatrix());
537
+ }
538
+ /**
539
+ * ONE STEP OF THE 3D RENDERING CONTEXT, from the accumulated matrix of the parent to the
540
+ * accumulated matrix of the child, both written in the context root's coordinates: where the child
541
+ * sits inside the parent, then the child's own matrix. A parent whose used transform-style is
542
+ * `flat` flattens first, which is what stops the child's z at that boundary; a parent that
543
+ * preserves 3D passes the space through untouched, which is what makes a grandchild's z compose
544
+ * with its grandparent's.
545
+ * https://www.w3.org/TR/css-transforms-2/#accumulated-3d-transformation-matrix-computation
546
+ */
547
+ export function accumulateTransform(parent, offsetX, offsetY, own, parentPreserves3d) {
548
+ const base = parentPreserves3d ? parent.slice() : flattenTransform(parent);
549
+ const placed = multiplyTransform(base, translation(offsetX, offsetY, 0));
550
+ return own === null ? placed : multiplyTransform(placed, own);
551
+ }
552
+ /**
553
+ * THE DEPTH an accumulated matrix puts an element at: the z its own origin lands on, which is the
554
+ * translation column's third number. CSS Transforms 2 section 4.1 sorts the elements of one 3D
555
+ * rendering context by their position in that space rather than by document order, and this is the
556
+ * number that position is read from.
557
+ */
558
+ export function transformDepth(m) {
559
+ return m.length === 16 ? m[14] : 0;
560
+ }
561
+ /**
562
+ * THE PAINT ORDER of one 3D rendering context: the indices of its participants back to front, a
563
+ * STABLE sort so two elements at the same depth keep the order the document gave them, which is
564
+ * what CSS falls back to when the depths tie.
565
+ */
566
+ export function depthOrder(depths) {
567
+ return depths
568
+ .map((depth, index) => ({ depth, index }))
569
+ .sort((a, b) => (a.depth === b.depth ? a.index - b.index : a.depth - b.depth))
570
+ .map(row => row.index);
571
+ }
572
+ /**
573
+ * THE 4x4 WHOSE PROJECTION IS THIS HOMOGRAPHY: `projectTransform`'s inverse for a plane. A toolkit
574
+ * whose canvas matrix is 3x3 takes its transforms as homographies, so a matrix computed in 3D has
575
+ * to travel back out through this one.
576
+ */
577
+ export function unprojectTransform(p) {
578
+ if (p.length !== 9)
579
+ return TRANSFORM_IDENTITY.slice();
580
+ return [
581
+ p[0], p[1], 0, p[2],
582
+ p[3], p[4], 0, p[5],
583
+ 0, 0, 1, 0,
584
+ p[6], p[7], 0, p[8],
585
+ ];
586
+ }
587
+ /** A plane translation as a homography, ordered like `projectTransform`. */
588
+ export function translationProjection(x, y) {
589
+ return [1, 0, 0, 0, 1, 0, x, y, 1];
590
+ }
591
+ /** The product of two homographies, ordered like `projectTransform`. */
592
+ export function multiplyProjection(a, b) {
593
+ if (a.length !== 9 || b.length !== 9)
594
+ return [1, 0, 0, 0, 1, 0, 0, 0, 1];
595
+ const out = new Array(9).fill(0);
596
+ for (let col = 0; col < 3; col++) {
597
+ for (let row = 0; row < 3; row++) {
598
+ let sum = 0;
599
+ for (let k = 0; k < 3; k++)
600
+ sum += a[k * 3 + row] * b[col * 3 + k];
601
+ out[col * 3 + row] = sum;
602
+ }
603
+ }
604
+ return out;
605
+ }
606
+ /**
607
+ * THE HOMOGRAPHY THAT UNDOES ANOTHER, or null when it collapses the plane.
608
+ *
609
+ * A toolkit composes a descendant's transform with every transform its ancestors applied, and a 3D
610
+ * rendering context needs the descendant to land where the SHARED space puts it rather than where
611
+ * that composition would. So each participant applies the RESIDUAL: the inverse of what its
612
+ * ancestors already applied, then the projection its own accumulated matrix asks for. That is the
613
+ * whole trick that lets Compose and SwiftUI, whose canvas and projection effect are both 3x3, hold
614
+ * a real 3D rendering context they have no primitive for.
615
+ */
616
+ export function invertProjection(p) {
617
+ if (p.length !== 9)
618
+ return null;
619
+ const a = p[0], b = p[1], c = p[2];
620
+ const d = p[3], e = p[4], f = p[5];
621
+ const g = p[6], h = p[7], i = p[8];
622
+ const det = a * (e * i - h * f) - d * (b * i - h * c) + g * (b * f - e * c);
623
+ if (Math.abs(det) < 1e-12)
624
+ return null;
625
+ return [
626
+ (e * i - h * f) / det, (h * c - b * i) / det, (b * f - e * c) / det,
627
+ (g * f - d * i) / det, (a * i - g * c) / det, (d * c - a * f) / det,
628
+ (d * h - g * e) / det, (g * b - a * h) / det, (a * e - d * b) / det,
629
+ ];
630
+ }
631
+ /**
632
+ * `backface-visibility`, as the two words CSS has.
633
+ * https://www.w3.org/TR/css-transforms-2/#backface-visibility-property
634
+ */
635
+ export function backfaceVisibilityWord(value) {
636
+ return (value ?? "").trim().toLowerCase() === "hidden" ? "hidden" : "visible";
637
+ }
638
+ /**
639
+ * True when this element must not be painted at all: its back is turned and it asked to be
640
+ * hidden when it is. Measured in all three browsers: a `rotateY(180deg)` box with
641
+ * `backface-visibility: hidden` is not the element under its own centre point.
642
+ */
643
+ export function hidesBackface(m, visibility) {
644
+ return backfaceVisibilityWord(visibility) === "hidden" && transformShowsBackface(m);
645
+ }
646
+ /**
647
+ * `will-change`, normalised the way the browsers serialize it: the keyword `auto`, or the comma
648
+ * separated list of idents in the author's order, one space after each comma. It is a RENDERING
649
+ * HINT and nothing else, so no renderer may draw differently for it; the native lanes carry it as
650
+ * a no-op with a platform parity row saying so.
651
+ * https://www.w3.org/TR/css-will-change-1/#will-change
652
+ */
653
+ export function willChangeList(value) {
654
+ const raw = (value ?? "").trim();
655
+ if (raw === "")
656
+ return "auto";
657
+ const parts = raw.split(",").map(part => part.trim()).filter(part => part !== "");
658
+ if (parts.length === 0)
659
+ return "auto";
660
+ if (parts.some(part => part.toLowerCase() === "auto"))
661
+ return "auto";
662
+ return parts.join(", ");
663
+ }
664
+ /** The column major product of two matrices. */
665
+ export function multiplyTransform(a, b) {
666
+ const out = new Array(16).fill(0);
667
+ for (let col = 0; col < 4; col++) {
668
+ for (let row = 0; row < 4; row++) {
669
+ let sum = 0;
670
+ for (let k = 0; k < 4; k++)
671
+ sum += a[k * 4 + row] * b[col * 4 + k];
672
+ out[col * 4 + row] = sum;
673
+ }
674
+ }
675
+ return out;
676
+ }
677
+ /** Four decimals, trailing zeros trimmed, negative zero normalised (MotionCore's rule). */
678
+ export function formatTransformNumber(value) {
679
+ if (!Number.isFinite(value))
680
+ return "0";
681
+ const rounded = (Math.round(Math.abs(value) * 10000) / 10000) * Math.sign(value || 1);
682
+ if (rounded === 0)
683
+ return "0";
684
+ let text = rounded.toFixed(4);
685
+ text = text.replace(/0+$/, "").replace(/\.$/, "");
686
+ return text === "-0" ? "0" : text;
687
+ }
688
+ function functionMatrix(fn, width, height) {
689
+ const name = fn.name.toLowerCase();
690
+ const args = fn.args;
691
+ const len = (i, along) => (i < args.length ? px(args[i], along) : 0);
692
+ const num = (i) => i < args.length && args[i].unit === "" ? args[i].n : null;
693
+ const angle = (i) => (i < args.length ? rad(args[i]) : null);
694
+ switch (name) {
695
+ case "translate": {
696
+ if (args.length < 1 || args.length > 2)
697
+ return null;
698
+ const x = len(0, width);
699
+ const y = len(1, height);
700
+ return x === null || y === null ? null : translation(x, y, 0);
701
+ }
702
+ case "translatex": {
703
+ if (args.length !== 1)
704
+ return null;
705
+ const x = len(0, width);
706
+ return x === null ? null : translation(x, 0, 0);
707
+ }
708
+ case "translatey": {
709
+ if (args.length !== 1)
710
+ return null;
711
+ const y = len(0, height);
712
+ return y === null ? null : translation(0, y, 0);
713
+ }
714
+ case "translatez": {
715
+ if (args.length !== 1 || args[0].unit === "%")
716
+ return null;
717
+ const z = len(0, 0);
718
+ return z === null ? null : translation(0, 0, z);
719
+ }
720
+ case "translate3d": {
721
+ if (args.length !== 3 || args[2].unit === "%")
722
+ return null;
723
+ const x = len(0, width);
724
+ const y = len(1, height);
725
+ const z = len(2, 0);
726
+ return x === null || y === null || z === null ? null : translation(x, y, z);
727
+ }
728
+ case "scale": {
729
+ if (args.length < 1 || args.length > 2)
730
+ return null;
731
+ const x = num(0);
732
+ if (x === null)
733
+ return null;
734
+ const y = args.length === 2 ? num(1) : x;
735
+ return y === null ? null : scaling(x, y, 1);
736
+ }
737
+ case "scalex": {
738
+ if (args.length !== 1)
739
+ return null;
740
+ const x = num(0);
741
+ return x === null ? null : scaling(x, 1, 1);
742
+ }
743
+ case "scaley": {
744
+ if (args.length !== 1)
745
+ return null;
746
+ const y = num(0);
747
+ return y === null ? null : scaling(1, y, 1);
748
+ }
749
+ case "scalez": {
750
+ if (args.length !== 1)
751
+ return null;
752
+ const z = num(0);
753
+ return z === null ? null : scaling(1, 1, z);
754
+ }
755
+ case "scale3d": {
756
+ if (args.length !== 3)
757
+ return null;
758
+ const x = num(0);
759
+ const y = num(1);
760
+ const z = num(2);
761
+ return x === null || y === null || z === null ? null : scaling(x, y, z);
762
+ }
763
+ case "rotate":
764
+ case "rotatez": {
765
+ if (args.length !== 1)
766
+ return null;
767
+ const a = angle(0);
768
+ return a === null ? null : rotation(0, 0, 1, a);
769
+ }
770
+ case "rotatex": {
771
+ if (args.length !== 1)
772
+ return null;
773
+ const a = angle(0);
774
+ return a === null ? null : rotation(1, 0, 0, a);
775
+ }
776
+ case "rotatey": {
777
+ if (args.length !== 1)
778
+ return null;
779
+ const a = angle(0);
780
+ return a === null ? null : rotation(0, 1, 0, a);
781
+ }
782
+ case "rotate3d": {
783
+ if (args.length !== 4)
784
+ return null;
785
+ const x = num(0);
786
+ const y = num(1);
787
+ const z = num(2);
788
+ const a = angle(3);
789
+ return x === null || y === null || z === null || a === null ? null : rotation(x, y, z, a);
790
+ }
791
+ case "skew": {
792
+ if (args.length < 1 || args.length > 2)
793
+ return null;
794
+ const ax = angle(0);
795
+ if (ax === null)
796
+ return null;
797
+ const ay = args.length === 2 ? angle(1) : 0;
798
+ if (ay === null)
799
+ return null;
800
+ const m = [...TRANSFORM_IDENTITY];
801
+ m[4] = Math.tan(ax);
802
+ m[1] = Math.tan(ay);
803
+ return m;
804
+ }
805
+ case "skewx": {
806
+ if (args.length !== 1)
807
+ return null;
808
+ const ax = angle(0);
809
+ if (ax === null)
810
+ return null;
811
+ const m = [...TRANSFORM_IDENTITY];
812
+ m[4] = Math.tan(ax);
813
+ return m;
814
+ }
815
+ case "skewy": {
816
+ if (args.length !== 1)
817
+ return null;
818
+ const ay = angle(0);
819
+ if (ay === null)
820
+ return null;
821
+ const m = [...TRANSFORM_IDENTITY];
822
+ m[1] = Math.tan(ay);
823
+ return m;
824
+ }
825
+ case "matrix": {
826
+ if (args.length !== 6)
827
+ return null;
828
+ const v = [];
829
+ for (let i = 0; i < 6; i++) {
830
+ const n = num(i);
831
+ if (n === null)
832
+ return null;
833
+ v.push(n);
834
+ }
835
+ return [v[0], v[1], 0, 0, v[2], v[3], 0, 0, 0, 0, 1, 0, v[4], v[5], 0, 1];
836
+ }
837
+ case "matrix3d": {
838
+ if (args.length !== 16)
839
+ return null;
840
+ const v = [];
841
+ for (let i = 0; i < 16; i++) {
842
+ const n = num(i);
843
+ if (n === null)
844
+ return null;
845
+ v.push(n);
846
+ }
847
+ return v;
848
+ }
849
+ case "perspective": {
850
+ if (args.length !== 1)
851
+ return null;
852
+ if (args[0].unit === "" && args[0].n === 0)
853
+ return [...TRANSFORM_IDENTITY];
854
+ if (args[0].unit !== "px" || args[0].n <= 0)
855
+ return null;
856
+ const m = [...TRANSFORM_IDENTITY];
857
+ m[11] = -1 / args[0].n;
858
+ return m;
859
+ }
860
+ default:
861
+ return null;
862
+ }
863
+ }
864
+ function translation(x, y, z) {
865
+ const m = [...TRANSFORM_IDENTITY];
866
+ m[12] = x;
867
+ m[13] = y;
868
+ m[14] = z;
869
+ return m;
870
+ }
871
+ function scaling(x, y, z) {
872
+ const m = [...TRANSFORM_IDENTITY];
873
+ m[0] = x;
874
+ m[5] = y;
875
+ m[10] = z;
876
+ return m;
877
+ }
878
+ /** `rotate3d(x, y, z, angle)` as CSS Transforms 2 writes it, with the axis normalised. */
879
+ function rotation(x, y, z, angle) {
880
+ const length = Math.sqrt(x * x + y * y + z * z);
881
+ if (length <= 1e-12)
882
+ return [...TRANSFORM_IDENTITY];
883
+ const nx = x / length;
884
+ const ny = y / length;
885
+ const nz = z / length;
886
+ const sc = Math.sin(angle / 2) * Math.cos(angle / 2);
887
+ const sq = Math.sin(angle / 2) * Math.sin(angle / 2);
888
+ const m = [...TRANSFORM_IDENTITY];
889
+ m[0] = 1 - 2 * (ny * ny + nz * nz) * sq;
890
+ m[1] = 2 * (nx * ny * sq + nz * sc);
891
+ m[2] = 2 * (nx * nz * sq - ny * sc);
892
+ m[4] = 2 * (nx * ny * sq - nz * sc);
893
+ m[5] = 1 - 2 * (nx * nx + nz * nz) * sq;
894
+ m[6] = 2 * (ny * nz * sq + nx * sc);
895
+ m[8] = 2 * (nx * nz * sq + ny * sc);
896
+ m[9] = 2 * (ny * nz * sq - nx * sc);
897
+ m[10] = 1 - 2 * (nx * nx + ny * ny) * sq;
898
+ // A quarter turn is exactly zero where CSS says zero: three languages compare these.
899
+ return m.map((v) => (Math.abs(v) < 1e-12 ? 0 : v));
900
+ }
901
+ /** A translation length in points against the axis it moves along. */
902
+ function px(arg, along) {
903
+ switch (arg.unit) {
904
+ case "px": return arg.n;
905
+ case "%": return (arg.n / 100) * along;
906
+ case "": return arg.n === 0 ? 0 : null;
907
+ default: return null;
908
+ }
909
+ }
910
+ /** An angle in radians, in the units CSS writes them. */
911
+ function rad(arg) {
912
+ switch (arg.unit) {
913
+ case "deg": return (arg.n * Math.PI) / 180;
914
+ case "rad": return arg.n;
915
+ case "turn": return arg.n * 2 * Math.PI;
916
+ case "grad": return (arg.n * Math.PI) / 200;
917
+ case "": return arg.n === 0 ? 0 : null;
918
+ default: return null;
919
+ }
920
+ }
921
+ //# sourceMappingURL=transform-core.js.map