use-scroll-animate 10.2.0 → 10.4.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 (403) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +67 -0
  4. package/bin/motionary-mcp.mjs +265 -0
  5. package/dist/chunks/anim-image-DDdb9q3X.js +166 -0
  6. package/dist/chunks/anim-image-DDdb9q3X.js.map +1 -0
  7. package/dist/chunks/anim-image-blQgPFFS.cjs +174 -0
  8. package/dist/chunks/anim-image-blQgPFFS.cjs.map +1 -0
  9. package/dist/chunks/audio-BpU-A1m1.cjs.map +1 -1
  10. package/dist/chunks/{audio-D95jwlOh.js → audio-CWt1xdZB.js} +3 -3
  11. package/dist/chunks/{audio-D95jwlOh.js.map → audio-CWt1xdZB.js.map} +1 -1
  12. package/dist/chunks/{base-BnRyfuyM.js → base-BTev8qxg.js} +2 -2
  13. package/dist/chunks/{base-BnRyfuyM.js.map → base-BTev8qxg.js.map} +1 -1
  14. package/dist/chunks/base-DBheNxJu.cjs.map +1 -1
  15. package/dist/chunks/bind-B_CTL6Qn.js.map +1 -1
  16. package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -1
  17. package/dist/chunks/builtins-CKKZNR95.cjs.map +1 -1
  18. package/dist/chunks/{builtins-CqIq1zBv.js → builtins-CPmS6aDB.js} +3 -3
  19. package/dist/chunks/{builtins-CqIq1zBv.js.map → builtins-CPmS6aDB.js.map} +1 -1
  20. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -1
  21. package/dist/chunks/{core-DsGoL9EY.js → core-BviA7nFa.js} +2 -2
  22. package/dist/chunks/{core-DsGoL9EY.js.map → core-BviA7nFa.js.map} +1 -1
  23. package/dist/chunks/core-D74Fz-dL.cjs.map +1 -1
  24. package/dist/chunks/core-D7cVumUu.js.map +1 -1
  25. package/dist/chunks/{core-XA2yhn1b.js → core-KiM7MXjL.js} +2 -2
  26. package/dist/chunks/{core-XA2yhn1b.js.map → core-KiM7MXjL.js.map} +1 -1
  27. package/dist/chunks/core-MQlXZKUG.cjs.map +1 -1
  28. package/dist/chunks/ease-HwYZnZat.cjs +94 -0
  29. package/dist/chunks/ease-HwYZnZat.cjs.map +1 -0
  30. package/dist/chunks/ease-XN8_0sXu.js +89 -0
  31. package/dist/chunks/ease-XN8_0sXu.js.map +1 -0
  32. package/dist/chunks/fx-B_pbhpDp.cjs.map +1 -1
  33. package/dist/chunks/{fx-CtnrFEg9.js → fx-CgWKqVsn.js} +2 -2
  34. package/dist/chunks/{fx-CtnrFEg9.js.map → fx-CgWKqVsn.js.map} +1 -1
  35. package/dist/chunks/generative-2LhxG5BJ.js.map +1 -1
  36. package/dist/chunks/generative-BHIj-NU0.cjs.map +1 -1
  37. package/dist/chunks/{gpu-CDcXiNA8.js → gpu-BWfgYWMY.js} +2 -2
  38. package/dist/chunks/{gpu-CDcXiNA8.js.map → gpu-BWfgYWMY.js.map} +1 -1
  39. package/dist/chunks/gpu-cUixt7kT.cjs.map +1 -1
  40. package/dist/chunks/index-tags-B-JBecYg.js.map +1 -1
  41. package/dist/chunks/index-tags-hLIF2Clq.cjs.map +1 -1
  42. package/dist/chunks/{keyframes-W-474DMc.js → keyframes-B5PWe5bU.js} +3 -2
  43. package/dist/chunks/keyframes-B5PWe5bU.js.map +1 -0
  44. package/dist/chunks/{keyframes-ZheOkpt0.cjs → keyframes-tC3I7anQ.cjs} +4 -3
  45. package/dist/chunks/keyframes-tC3I7anQ.cjs.map +1 -0
  46. package/dist/chunks/{manifest-D58HXVY-.js → manifest-BHx5yPN6.js} +2 -2
  47. package/dist/chunks/{manifest-D58HXVY-.js.map → manifest-BHx5yPN6.js.map} +1 -1
  48. package/dist/chunks/manifest-PaF9B8Vt.cjs.map +1 -1
  49. package/dist/chunks/{player-48Zy_NBG.js → player-BfHMNtiM.js} +4 -4
  50. package/dist/chunks/{player-48Zy_NBG.js.map → player-BfHMNtiM.js.map} +1 -1
  51. package/dist/chunks/player-C4y4jXSv.cjs.map +1 -1
  52. package/dist/chunks/presets-BYBVJVeP.js.map +1 -1
  53. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -1
  54. package/dist/chunks/{registry-gFJRpPES.js → registry-BKzyg1JV.js} +2 -2
  55. package/dist/chunks/{registry-gFJRpPES.js.map → registry-BKzyg1JV.js.map} +1 -1
  56. package/dist/chunks/{registry-BIEjKngP.js → registry-CT-TT_bx.js} +3 -3
  57. package/dist/chunks/{registry-BIEjKngP.js.map → registry-CT-TT_bx.js.map} +1 -1
  58. package/dist/chunks/{registry-eJgpFAzI.cjs → registry-tzwKkldE.cjs} +2 -2
  59. package/dist/chunks/{registry-eJgpFAzI.cjs.map → registry-tzwKkldE.cjs.map} +1 -1
  60. package/dist/chunks/registry-xQZnSqqV.cjs.map +1 -1
  61. package/dist/chunks/shared-CkKHWrtJ.js.map +1 -1
  62. package/dist/chunks/shared-jkgRH-Hx.cjs.map +1 -1
  63. package/dist/chunks/{spring-CZDNyqWp.js → spring-BHuP55DR.js} +2 -2
  64. package/dist/chunks/{spring-CZDNyqWp.js.map → spring-BHuP55DR.js.map} +1 -1
  65. package/dist/chunks/spring-BlTQD2AV.cjs.map +1 -1
  66. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -1
  67. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -1
  68. package/dist/chunks/{ticker-CM_56oVy.js → ticker-C8lSGml9.js} +2 -2
  69. package/dist/chunks/{ticker-CM_56oVy.js.map → ticker-C8lSGml9.js.map} +1 -1
  70. package/dist/chunks/{ticker-D4o6enH0.cjs → ticker-Un0bvTWR.cjs} +2 -2
  71. package/dist/chunks/{ticker-D4o6enH0.cjs.map → ticker-Un0bvTWR.cjs.map} +1 -1
  72. package/dist/chunks/{tween-CqX1JBuj.js → tween-BcejKpsx.js} +15 -91
  73. package/dist/chunks/tween-BcejKpsx.js.map +1 -0
  74. package/dist/chunks/{tween-CBuWYpI-.cjs → tween-CwLLC3Ko.cjs} +15 -95
  75. package/dist/chunks/tween-CwLLC3Ko.cjs.map +1 -0
  76. package/dist/chunks/variants-CrDDJoYK.cjs.map +1 -1
  77. package/dist/chunks/{variants-GU3yIL4F.js → variants-CsRGUIyA.js} +2 -2
  78. package/dist/chunks/{variants-GU3yIL4F.js.map → variants-CsRGUIyA.js.map} +1 -1
  79. package/dist/components/a11y.cjs.map +1 -1
  80. package/dist/components/a11y.js +2 -2
  81. package/dist/components/a11y.js.map +1 -1
  82. package/dist/components/angular.cjs.map +1 -1
  83. package/dist/components/angular.js +8 -8
  84. package/dist/components/angular.js.map +1 -1
  85. package/dist/components/background.cjs.map +1 -1
  86. package/dist/components/background.js +2 -2
  87. package/dist/components/background.js.map +1 -1
  88. package/dist/components/bridge.cjs.map +1 -1
  89. package/dist/components/bridge.js +1 -1
  90. package/dist/components/bridge.js.map +1 -1
  91. package/dist/components/cards.cjs.map +1 -1
  92. package/dist/components/cards.js +2 -2
  93. package/dist/components/cards.js.map +1 -1
  94. package/dist/components/click.cjs.map +1 -1
  95. package/dist/components/click.js +3 -3
  96. package/dist/components/click.js.map +1 -1
  97. package/dist/components/core.cjs.map +1 -1
  98. package/dist/components/core.js.map +1 -1
  99. package/dist/components/depth.cjs.map +1 -1
  100. package/dist/components/depth.js +3 -3
  101. package/dist/components/depth.js.map +1 -1
  102. package/dist/components/design.cjs.map +1 -1
  103. package/dist/components/design.js +3 -3
  104. package/dist/components/design.js.map +1 -1
  105. package/dist/components/dsl.cjs.map +1 -1
  106. package/dist/components/dsl.js +2 -2
  107. package/dist/components/dsl.js.map +1 -1
  108. package/dist/components/effects.cjs.map +1 -1
  109. package/dist/components/effects.js +9 -9
  110. package/dist/components/effects.js.map +1 -1
  111. package/dist/components/engine.cjs.map +1 -1
  112. package/dist/components/engine.js +2 -2
  113. package/dist/components/engine.js.map +1 -1
  114. package/dist/components/feedback.cjs.map +1 -1
  115. package/dist/components/feedback.js +1 -1
  116. package/dist/components/feedback.js.map +1 -1
  117. package/dist/components/fx-3d.cjs.map +1 -1
  118. package/dist/components/fx-3d.js +2 -2
  119. package/dist/components/fx-3d.js.map +1 -1
  120. package/dist/components/fx-ai.cjs.map +1 -1
  121. package/dist/components/fx-ai.js +2 -2
  122. package/dist/components/fx-ai.js.map +1 -1
  123. package/dist/components/fx-chart.cjs.map +1 -1
  124. package/dist/components/fx-chart.js +2 -2
  125. package/dist/components/fx-chart.js.map +1 -1
  126. package/dist/components/fx-cinema.cjs.map +1 -1
  127. package/dist/components/fx-cinema.js +2 -2
  128. package/dist/components/fx-cinema.js.map +1 -1
  129. package/dist/components/fx-cyber.cjs.map +1 -1
  130. package/dist/components/fx-cyber.js +2 -2
  131. package/dist/components/fx-cyber.js.map +1 -1
  132. package/dist/components/fx-festival.cjs.map +1 -1
  133. package/dist/components/fx-festival.js +2 -2
  134. package/dist/components/fx-festival.js.map +1 -1
  135. package/dist/components/fx-focus.cjs.map +1 -1
  136. package/dist/components/fx-focus.js +2 -2
  137. package/dist/components/fx-focus.js.map +1 -1
  138. package/dist/components/fx-form.cjs.map +1 -1
  139. package/dist/components/fx-form.js +2 -2
  140. package/dist/components/fx-form.js.map +1 -1
  141. package/dist/components/fx-game.cjs.map +1 -1
  142. package/dist/components/fx-game.js +2 -2
  143. package/dist/components/fx-game.js.map +1 -1
  144. package/dist/components/fx-genart.cjs.map +1 -1
  145. package/dist/components/fx-genart.js +2 -2
  146. package/dist/components/fx-genart.js.map +1 -1
  147. package/dist/components/fx-geo.cjs.map +1 -1
  148. package/dist/components/fx-geo.js +2 -2
  149. package/dist/components/fx-geo.js.map +1 -1
  150. package/dist/components/fx-gesture.cjs.map +1 -1
  151. package/dist/components/fx-gesture.js +2 -2
  152. package/dist/components/fx-gesture.js.map +1 -1
  153. package/dist/components/fx-gpu.js +3 -3
  154. package/dist/components/fx-light.cjs.map +1 -1
  155. package/dist/components/fx-light.js +2 -2
  156. package/dist/components/fx-light.js.map +1 -1
  157. package/dist/components/fx-lottie.cjs.map +1 -1
  158. package/dist/components/fx-lottie.js +2 -2
  159. package/dist/components/fx-lottie.js.map +1 -1
  160. package/dist/components/fx-morph.cjs.map +1 -1
  161. package/dist/components/fx-morph.js +2 -2
  162. package/dist/components/fx-morph.js.map +1 -1
  163. package/dist/components/fx-music.cjs.map +1 -1
  164. package/dist/components/fx-music.js +3 -3
  165. package/dist/components/fx-music.js.map +1 -1
  166. package/dist/components/fx-organic.cjs.map +1 -1
  167. package/dist/components/fx-organic.js +2 -2
  168. package/dist/components/fx-organic.js.map +1 -1
  169. package/dist/components/fx-paper.cjs.map +1 -1
  170. package/dist/components/fx-paper.js +2 -2
  171. package/dist/components/fx-paper.js.map +1 -1
  172. package/dist/components/fx-perf.cjs.map +1 -1
  173. package/dist/components/fx-perf.js +2 -2
  174. package/dist/components/fx-perf.js.map +1 -1
  175. package/dist/components/fx-physics.cjs.map +1 -1
  176. package/dist/components/fx-physics.js +2 -2
  177. package/dist/components/fx-physics.js.map +1 -1
  178. package/dist/components/fx-retro.cjs.map +1 -1
  179. package/dist/components/fx-retro.js +2 -2
  180. package/dist/components/fx-retro.js.map +1 -1
  181. package/dist/components/fx-safe.cjs.map +1 -1
  182. package/dist/components/fx-safe.js +2 -2
  183. package/dist/components/fx-safe.js.map +1 -1
  184. package/dist/components/fx-shop.cjs.map +1 -1
  185. package/dist/components/fx-shop.js +2 -2
  186. package/dist/components/fx-shop.js.map +1 -1
  187. package/dist/components/fx-social.cjs.map +1 -1
  188. package/dist/components/fx-social.js +2 -2
  189. package/dist/components/fx-social.js.map +1 -1
  190. package/dist/components/fx-spatial.cjs.map +1 -1
  191. package/dist/components/fx-spatial.js +2 -2
  192. package/dist/components/fx-spatial.js.map +1 -1
  193. package/dist/components/fx-surface.cjs.map +1 -1
  194. package/dist/components/fx-surface.js +2 -2
  195. package/dist/components/fx-surface.js.map +1 -1
  196. package/dist/components/fx-text.cjs.map +1 -1
  197. package/dist/components/fx-text.js +2 -2
  198. package/dist/components/fx-text.js.map +1 -1
  199. package/dist/components/fx-transitions.cjs.map +1 -1
  200. package/dist/components/fx-transitions.js +3 -3
  201. package/dist/components/fx-transitions.js.map +1 -1
  202. package/dist/components/fx-video.cjs.map +1 -1
  203. package/dist/components/fx-video.js +2 -2
  204. package/dist/components/fx-video.js.map +1 -1
  205. package/dist/components/fx-weather.cjs.map +1 -1
  206. package/dist/components/fx-weather.js +2 -2
  207. package/dist/components/fx-weather.js.map +1 -1
  208. package/dist/components/fx.cjs.map +1 -1
  209. package/dist/components/fx.js +6 -6
  210. package/dist/components/fx.js.map +1 -1
  211. package/dist/components/fx2.cjs.map +1 -1
  212. package/dist/components/fx2.js +6 -6
  213. package/dist/components/fx2.js.map +1 -1
  214. package/dist/components/gesture.cjs.map +1 -1
  215. package/dist/components/gesture.js +4 -4
  216. package/dist/components/gesture.js.map +1 -1
  217. package/dist/components/interaction.cjs.map +1 -1
  218. package/dist/components/interaction.js +1 -1
  219. package/dist/components/interaction.js.map +1 -1
  220. package/dist/components/layout.cjs.map +1 -1
  221. package/dist/components/layout.js +1 -1
  222. package/dist/components/layout.js.map +1 -1
  223. package/dist/components/lazy.cjs.map +1 -1
  224. package/dist/components/lazy.js.map +1 -1
  225. package/dist/components/lite.cjs.map +1 -1
  226. package/dist/components/lite.js.map +1 -1
  227. package/dist/components/marketplace.cjs.map +1 -1
  228. package/dist/components/marketplace.js +4 -4
  229. package/dist/components/marketplace.js.map +1 -1
  230. package/dist/components/native.cjs.map +1 -1
  231. package/dist/components/native.js +3 -3
  232. package/dist/components/native.js.map +1 -1
  233. package/dist/components/packs.cjs.map +1 -1
  234. package/dist/components/packs.js +1 -1
  235. package/dist/components/packs.js.map +1 -1
  236. package/dist/components/page.cjs.map +1 -1
  237. package/dist/components/page.js +3 -3
  238. package/dist/components/page.js.map +1 -1
  239. package/dist/components/perf.cjs.map +1 -1
  240. package/dist/components/perf.js +2 -2
  241. package/dist/components/perf.js.map +1 -1
  242. package/dist/components/physics.cjs.map +1 -1
  243. package/dist/components/physics.js +3 -3
  244. package/dist/components/physics.js.map +1 -1
  245. package/dist/components/plugins.cjs.map +1 -1
  246. package/dist/components/plugins.js +4 -4
  247. package/dist/components/plugins.js.map +1 -1
  248. package/dist/components/react.cjs.map +1 -1
  249. package/dist/components/react.js.map +1 -1
  250. package/dist/components/reveal.cjs.map +1 -1
  251. package/dist/components/reveal.js +1 -1
  252. package/dist/components/reveal.js.map +1 -1
  253. package/dist/components/solid.cjs.map +1 -1
  254. package/dist/components/solid.js +8 -8
  255. package/dist/components/solid.js.map +1 -1
  256. package/dist/components/svelte.cjs.map +1 -1
  257. package/dist/components/svelte.js +8 -8
  258. package/dist/components/svelte.js.map +1 -1
  259. package/dist/components/svg.cjs.map +1 -1
  260. package/dist/components/svg.js +1 -1
  261. package/dist/components/svg.js.map +1 -1
  262. package/dist/components/text.cjs.map +1 -1
  263. package/dist/components/text.js +2 -2
  264. package/dist/components/text.js.map +1 -1
  265. package/dist/components/timeline.cjs.map +1 -1
  266. package/dist/components/timeline.js +3 -3
  267. package/dist/components/timeline.js.map +1 -1
  268. package/dist/components/tokens.cjs.map +1 -1
  269. package/dist/components/tokens.js.map +1 -1
  270. package/dist/components/transitions.cjs.map +1 -1
  271. package/dist/components/transitions.js +1 -1
  272. package/dist/components/transitions.js.map +1 -1
  273. package/dist/components/ui.cjs.map +1 -1
  274. package/dist/components/ui.js +4 -4
  275. package/dist/components/ui.js.map +1 -1
  276. package/dist/components/vue.cjs.map +1 -1
  277. package/dist/components/vue.js +8 -8
  278. package/dist/components/vue.js.map +1 -1
  279. package/dist/components/webgl.cjs.map +1 -1
  280. package/dist/components/webgl.js +1 -1
  281. package/dist/components/webgl.js.map +1 -1
  282. package/dist/components/widgets.cjs +766 -212
  283. package/dist/components/widgets.cjs.map +1 -1
  284. package/dist/components/widgets.d.cts +207 -2
  285. package/dist/components/widgets.d.ts +207 -2
  286. package/dist/components/widgets.js +770 -221
  287. package/dist/components/widgets.js.map +1 -1
  288. package/dist/components.cjs.map +1 -1
  289. package/dist/components.js +10 -10
  290. package/dist/components.js.map +1 -1
  291. package/dist/element.cjs.map +1 -1
  292. package/dist/element.js.map +1 -1
  293. package/dist/index.cjs.map +1 -1
  294. package/dist/index.js +2 -2
  295. package/dist/index.js.map +1 -1
  296. package/dist/llms-full.txt +250 -1
  297. package/dist/llms.txt +13 -2
  298. package/dist/manifest.json +646 -1
  299. package/dist/presets/extended.cjs.map +1 -1
  300. package/dist/presets/extended.js.map +1 -1
  301. package/dist/react.cjs.map +1 -1
  302. package/dist/react.js.map +1 -1
  303. package/dist/runtime/format-apng.cjs +131 -0
  304. package/dist/runtime/format-apng.cjs.map +1 -0
  305. package/dist/runtime/format-apng.d.cts +250 -0
  306. package/dist/runtime/format-apng.d.ts +250 -0
  307. package/dist/runtime/format-apng.iife.js +2 -0
  308. package/dist/runtime/format-apng.iife.js.map +1 -0
  309. package/dist/runtime/format-apng.js +123 -0
  310. package/dist/runtime/format-apng.js.map +1 -0
  311. package/dist/runtime/format-css.cjs +5 -4
  312. package/dist/runtime/format-css.cjs.map +1 -1
  313. package/dist/runtime/format-css.js +5 -4
  314. package/dist/runtime/format-css.js.map +1 -1
  315. package/dist/runtime/format-gif.cjs +206 -0
  316. package/dist/runtime/format-gif.cjs.map +1 -0
  317. package/dist/runtime/format-gif.d.cts +223 -0
  318. package/dist/runtime/format-gif.d.ts +223 -0
  319. package/dist/runtime/format-gif.iife.js +2 -0
  320. package/dist/runtime/format-gif.iife.js.map +1 -0
  321. package/dist/runtime/format-gif.js +199 -0
  322. package/dist/runtime/format-gif.js.map +1 -0
  323. package/dist/runtime/format-motion.cjs +9 -8
  324. package/dist/runtime/format-motion.cjs.map +1 -1
  325. package/dist/runtime/format-motion.js +5 -4
  326. package/dist/runtime/format-motion.js.map +1 -1
  327. package/dist/runtime/format-sprite.cjs +226 -0
  328. package/dist/runtime/format-sprite.cjs.map +1 -0
  329. package/dist/runtime/format-sprite.d.cts +224 -0
  330. package/dist/runtime/format-sprite.d.ts +224 -0
  331. package/dist/runtime/format-sprite.iife.js +2 -0
  332. package/dist/runtime/format-sprite.iife.js.map +1 -0
  333. package/dist/runtime/format-sprite.js +216 -0
  334. package/dist/runtime/format-sprite.js.map +1 -0
  335. package/dist/runtime/format-svg.cjs +5 -4
  336. package/dist/runtime/format-svg.cjs.map +1 -1
  337. package/dist/runtime/format-svg.iife.js.map +1 -1
  338. package/dist/runtime/format-svg.js +4 -3
  339. package/dist/runtime/format-svg.js.map +1 -1
  340. package/dist/runtime/format-webp.cjs +123 -0
  341. package/dist/runtime/format-webp.cjs.map +1 -0
  342. package/dist/runtime/format-webp.d.cts +245 -0
  343. package/dist/runtime/format-webp.d.ts +245 -0
  344. package/dist/runtime/format-webp.iife.js +2 -0
  345. package/dist/runtime/format-webp.iife.js.map +1 -0
  346. package/dist/runtime/format-webp.js +115 -0
  347. package/dist/runtime/format-webp.js.map +1 -0
  348. package/dist/runtime/scroll.cjs +2 -2
  349. package/dist/runtime/scroll.cjs.map +1 -1
  350. package/dist/runtime/scroll.js +2 -2
  351. package/dist/runtime/scroll.js.map +1 -1
  352. package/dist/runtime/smooth.cjs +284 -0
  353. package/dist/runtime/smooth.cjs.map +1 -0
  354. package/dist/runtime/smooth.d.cts +137 -0
  355. package/dist/runtime/smooth.d.ts +137 -0
  356. package/dist/runtime/smooth.iife.js +2 -0
  357. package/dist/runtime/smooth.iife.js.map +1 -0
  358. package/dist/runtime/smooth.js +279 -0
  359. package/dist/runtime/smooth.js.map +1 -0
  360. package/dist/runtime/text.cjs +147 -0
  361. package/dist/runtime/text.cjs.map +1 -0
  362. package/dist/runtime/text.d.cts +65 -0
  363. package/dist/runtime/text.d.ts +65 -0
  364. package/dist/runtime/text.iife.js +2 -0
  365. package/dist/runtime/text.iife.js.map +1 -0
  366. package/dist/runtime/text.js +143 -0
  367. package/dist/runtime/text.js.map +1 -0
  368. package/dist/runtime.cjs +9 -8
  369. package/dist/runtime.cjs.map +1 -1
  370. package/dist/runtime.d.cts +9 -2
  371. package/dist/runtime.d.ts +9 -2
  372. package/dist/runtime.iife.js +1 -1
  373. package/dist/runtime.iife.js.map +1 -1
  374. package/dist/runtime.js +6 -5
  375. package/dist/runtime.js.map +1 -1
  376. package/dist/solid.cjs.map +1 -1
  377. package/dist/solid.js.map +1 -1
  378. package/dist/svelte.cjs.map +1 -1
  379. package/dist/svelte.js.map +1 -1
  380. package/dist/vue.cjs.map +1 -1
  381. package/dist/vue.js.map +1 -1
  382. package/dist/widgets.umd.js +1 -1
  383. package/dist/widgets.umd.js.map +1 -1
  384. package/docs/ROADMAP.md +2 -2
  385. package/docs/components/README.md +12 -7
  386. package/docs/components/usa-parallax-layers.md +38 -0
  387. package/docs/components/usa-route-transition.md +38 -0
  388. package/docs/components/usa-scroll-ring.md +32 -0
  389. package/docs/components/usa-smooth-scroll.md +60 -0
  390. package/docs/components/usa-text-splitter.md +60 -0
  391. package/docs/components.md +94 -0
  392. package/docs/mcp.md +50 -0
  393. package/docs/runtime/format-apng.md +59 -0
  394. package/docs/runtime/format-gif.md +60 -0
  395. package/docs/runtime/format-sprite.md +60 -0
  396. package/docs/runtime/format-webp.md +58 -0
  397. package/docs/runtime/smooth.md +60 -0
  398. package/docs/runtime/text.md +59 -0
  399. package/package.json +64 -2
  400. package/dist/chunks/keyframes-W-474DMc.js.map +0 -1
  401. package/dist/chunks/keyframes-ZheOkpt0.cjs.map +0 -1
  402. package/dist/chunks/tween-CBuWYpI-.cjs.map +0 -1
  403. package/dist/chunks/tween-CqX1JBuj.js.map +0 -1
@@ -0,0 +1,223 @@
1
+ /** A runtime module: `{ id, version, api }`, registered with `use()`. */
2
+ interface RuntimeModule<A = unknown> {
3
+ /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
4
+ id: string;
5
+ version: string;
6
+ /** Other modules this one needs (registered first by `use()` callers). */
7
+ requires?: string[];
8
+ /** The module's public API (what `requireModule(id)` returns). */
9
+ api: A;
10
+ /** Optional one-time setup, called on first registration. */
11
+ setup?(registry: RuntimeRegistry): void;
12
+ }
13
+ interface RuntimeRegistry {
14
+ version: string;
15
+ modules: Map<string, RuntimeModule>;
16
+ /** Shared per-page state slots (the ticker lives here). */
17
+ slots: Record<string, unknown>;
18
+ }
19
+
20
+ /** Easing functions (t ∈ [0, 1] → progress). Original implementations of the standard Penner-style curves. */
21
+ type Ease = (t: number) => number;
22
+
23
+ type Target = object | Element;
24
+ type Props = Record<string, number | string>;
25
+ interface PlayOptions {
26
+ /** Delay before the first iteration, ms. */
27
+ delay?: number;
28
+ /** Extra iterations (-1 = forever). */
29
+ repeat?: number;
30
+ /** Alternate direction on every other iteration. */
31
+ yoyo?: boolean;
32
+ /** Start paused (`play()` to start). */
33
+ paused?: boolean;
34
+ onUpdate?: (progress: number) => void;
35
+ onComplete?: () => void;
36
+ }
37
+ interface TweenOptions extends PlayOptions {
38
+ to?: Props;
39
+ from?: Props;
40
+ /** ms (default 600). */
41
+ duration?: number;
42
+ ease?: string | Ease;
43
+ /** Delay added per target index (ms) when several targets are given. */
44
+ stagger?: number;
45
+ }
46
+ /** Common playback: delay, repeat, yoyo, direction, ticker attachment, promise. */
47
+ declare abstract class Playable {
48
+ delay: number;
49
+ repeat: number;
50
+ yoyo: boolean;
51
+ /** Playback rate multiplier. */
52
+ timeScale: number;
53
+ onUpdate?: (progress: number) => void;
54
+ onComplete?: () => void;
55
+ protected _t: number;
56
+ private _dir;
57
+ private _off;
58
+ private _done;
59
+ private _resolve;
60
+ /** Resolves on completion (forward end, or start when reversed). */
61
+ finished: Promise<void>;
62
+ /** Set when owned by a timeline (then the ticker never drives it). */
63
+ parent: Timeline | null;
64
+ constructor(o: PlayOptions);
65
+ /** One iteration, ms. */
66
+ abstract get duration(): number;
67
+ /** Render at `ms` into one iteration. */
68
+ protected abstract renderLocal(ms: number, iterationEnded: boolean): void;
69
+ get totalDuration(): number;
70
+ get time(): number;
71
+ get progress(): number;
72
+ set progress(p: number);
73
+ get isActive(): boolean;
74
+ get reversed(): boolean;
75
+ /** Jump to `ms` (total time, including the delay) and render. */
76
+ seek(ms: number): this;
77
+ play(): this;
78
+ pause(): this;
79
+ /** Play backwards from the current time. */
80
+ reverse(): this;
81
+ restart(): this;
82
+ /** Stop and detach for good. */
83
+ kill(): void;
84
+ /** Promise-like: `await tween(...)`. */
85
+ then<R>(ok?: (v: void) => R, err?: (e: unknown) => R): Promise<R>;
86
+ private attach;
87
+ private advance;
88
+ protected complete(): void;
89
+ }
90
+ /** Position: ms number, '<' (start of previous), '>' (end of previous, default), '+=200' / '-=200' (relative to the end), 'label', 'label+=100', '<+=100'. */
91
+ type Position = number | string;
92
+ interface TimelineOptions extends PlayOptions {
93
+ /** Defaults merged into every `.to()`. */
94
+ defaults?: Omit<TweenOptions, 'to' | 'from'>;
95
+ }
96
+ /** A sequence of tweens, nested timelines and callbacks. */
97
+ declare class Timeline extends Playable {
98
+ private children;
99
+ private labels;
100
+ private prevStart;
101
+ private prevEnd;
102
+ private defaults;
103
+ private lastLocal;
104
+ constructor(o?: TimelineOptions);
105
+ get duration(): number;
106
+ private resolve;
107
+ /** Add a tween, timeline or callback at a position. */
108
+ add(item: Playable | (() => void), position?: Position): this;
109
+ /** `tween(target, vars)` placed at `position` (stagger across several targets). */
110
+ to(target: Target | Target[] | ArrayLike<Target>, vars: TweenOptions, position?: Position): this;
111
+ call(fn: () => void, position?: Position): this;
112
+ label(name: string, position?: Position): this;
113
+ /** Time of a label, ms. */
114
+ labelTime(name: string): number | undefined;
115
+ remove(item: Playable): void;
116
+ /** Children in start order (callbacks excluded). */
117
+ getChildren(): Playable[];
118
+ protected renderLocal(ms: number): void;
119
+ }
120
+
121
+ /**
122
+ * Shared internals of the animated-image loaders (`format-gif`, `format-apng`,
123
+ * `format-webp`, 10.4): the decoded-animation shape, frame compositing in
124
+ * plain RGBA arrays (no DOM — works in workers and on the server), the
125
+ * browser image decoder used for APNG / WebP frames, and the canvas player
126
+ * (a runtime `Playable`, so it can be paused, reversed, scrubbed and driven
127
+ * by a scroll scene). Bundled into each loader; not a public module.
128
+ */
129
+
130
+ /** An RGBA bitmap (the shape of `ImageData`, without needing the DOM). */
131
+ interface Rgba {
132
+ width: number;
133
+ height: number;
134
+ data: Uint8ClampedArray;
135
+ }
136
+ /** One frame of an animation, already composited to the full canvas size. */
137
+ interface AnimFrame {
138
+ /** Display time, ms. */
139
+ delay: number;
140
+ image: Rgba;
141
+ }
142
+ interface AnimatedImage {
143
+ format: 'gif' | 'apng' | 'webp';
144
+ width: number;
145
+ height: number;
146
+ /** Number of plays: 0 = forever, 1 = once, … */
147
+ plays: number;
148
+ frames: AnimFrame[];
149
+ }
150
+ /** A frame region before compositing (APNG fcTL / WebP ANMF / GIF descriptor). */
151
+ interface FramePart {
152
+ x: number;
153
+ y: number;
154
+ image: Rgba;
155
+ delay: number;
156
+ /** 'over' alpha-blends onto the canvas, 'source' replaces the region. */
157
+ blend: 'over' | 'source';
158
+ /** What happens to the region after the frame is shown. */
159
+ dispose: 'none' | 'background' | 'previous';
160
+ }
161
+ /** Composite frame parts onto a `width × height` canvas (pure; RGBA in, RGBA out). */
162
+ declare function composeFrames(width: number, height: number, parts: FramePart[], background?: [number, number, number, number]): AnimFrame[];
163
+ interface AnimPlayerOptions {
164
+ /** Extra repeats; default from the file (`plays`: 0 → forever). */
165
+ repeat?: number;
166
+ yoyo?: boolean;
167
+ paused?: boolean;
168
+ /** Playback speed (default 1). */
169
+ speed?: number;
170
+ }
171
+ type AnimPlayer = Playable & {
172
+ readonly frame: number;
173
+ readonly frameCount: number;
174
+ };
175
+ /** Play a decoded animation on a canvas as a runtime timeline (seek / reverse / `progress` scrub). */
176
+ declare function animatedImagePlayer(canvas: HTMLCanvasElement | OffscreenCanvas, anim: AnimatedImage, o?: AnimPlayerOptions): AnimPlayer;
177
+
178
+ /**
179
+ * `motionary/runtime/format-gif` (10.4) — a complete GIF decoder written for
180
+ * Motionary (own LZW implementation, no dependencies, no DOM): GIF87a / GIF89a,
181
+ * global and local palettes, transparency, interlaced frames, disposal
182
+ * methods 0–3, per-frame delays and the NETSCAPE2.0 loop count. Frames are
183
+ * composited to full-size RGBA, so they can be drawn, scrubbed or reversed
184
+ * with `animatedImagePlayer()` (a runtime timeline).
185
+ *
186
+ * ```ts
187
+ * import { use } from 'motionary/runtime';
188
+ * import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';
189
+ * use(formatGif);
190
+ * const gif = await loadGif('/loader.gif');
191
+ * const player = animatedImagePlayer(canvas, gif); // player.pause(); player.progress = 0.5
192
+ * ```
193
+ */
194
+
195
+ /** LZW-decode GIF image data into palette indices (exported for tests / tools). */
196
+ declare function lzwDecode(minCodeSize: number, data: Uint8Array, pixelCount: number): Uint8Array;
197
+ interface GifInfo {
198
+ version: '87a' | '89a';
199
+ width: number;
200
+ height: number;
201
+ /** NETSCAPE2.0 loop count (0 = forever), or null when the file has none (plays once). */
202
+ loopCount: number | null;
203
+ frameCount: number;
204
+ }
205
+ /** Decode a GIF (bytes) into composited RGBA frames. Pure: no DOM, works in workers / Node. */
206
+ declare function decodeGif(input: Uint8Array | ArrayBuffer): AnimatedImage & {
207
+ info: GifInfo;
208
+ };
209
+ /** Fetch (URL) or read (ArrayBuffer / Blob / bytes) and decode a GIF. */
210
+ declare function loadGif(src: string | ArrayBuffer | ArrayBufferView | Blob): Promise<AnimatedImage & {
211
+ info: GifInfo;
212
+ }>;
213
+ interface FormatGifApi {
214
+ decodeGif: typeof decodeGif;
215
+ loadGif: typeof loadGif;
216
+ lzwDecode: typeof lzwDecode;
217
+ animatedImagePlayer: typeof animatedImagePlayer;
218
+ }
219
+ /** The module object for `use(formatGif)`. */
220
+ declare const formatGif: RuntimeModule<FormatGifApi>;
221
+
222
+ export { animatedImagePlayer, composeFrames, decodeGif, formatGif, loadGif, lzwDecode };
223
+ export type { AnimFrame, AnimPlayer, AnimPlayerOptions, AnimatedImage, FormatGifApi, GifInfo, Rgba };
@@ -0,0 +1,223 @@
1
+ /** A runtime module: `{ id, version, api }`, registered with `use()`. */
2
+ interface RuntimeModule<A = unknown> {
3
+ /** Module id: 'core', 'format-css', 'scroll', … (import path `motionary/runtime/<id>`). */
4
+ id: string;
5
+ version: string;
6
+ /** Other modules this one needs (registered first by `use()` callers). */
7
+ requires?: string[];
8
+ /** The module's public API (what `requireModule(id)` returns). */
9
+ api: A;
10
+ /** Optional one-time setup, called on first registration. */
11
+ setup?(registry: RuntimeRegistry): void;
12
+ }
13
+ interface RuntimeRegistry {
14
+ version: string;
15
+ modules: Map<string, RuntimeModule>;
16
+ /** Shared per-page state slots (the ticker lives here). */
17
+ slots: Record<string, unknown>;
18
+ }
19
+
20
+ /** Easing functions (t ∈ [0, 1] → progress). Original implementations of the standard Penner-style curves. */
21
+ type Ease = (t: number) => number;
22
+
23
+ type Target = object | Element;
24
+ type Props = Record<string, number | string>;
25
+ interface PlayOptions {
26
+ /** Delay before the first iteration, ms. */
27
+ delay?: number;
28
+ /** Extra iterations (-1 = forever). */
29
+ repeat?: number;
30
+ /** Alternate direction on every other iteration. */
31
+ yoyo?: boolean;
32
+ /** Start paused (`play()` to start). */
33
+ paused?: boolean;
34
+ onUpdate?: (progress: number) => void;
35
+ onComplete?: () => void;
36
+ }
37
+ interface TweenOptions extends PlayOptions {
38
+ to?: Props;
39
+ from?: Props;
40
+ /** ms (default 600). */
41
+ duration?: number;
42
+ ease?: string | Ease;
43
+ /** Delay added per target index (ms) when several targets are given. */
44
+ stagger?: number;
45
+ }
46
+ /** Common playback: delay, repeat, yoyo, direction, ticker attachment, promise. */
47
+ declare abstract class Playable {
48
+ delay: number;
49
+ repeat: number;
50
+ yoyo: boolean;
51
+ /** Playback rate multiplier. */
52
+ timeScale: number;
53
+ onUpdate?: (progress: number) => void;
54
+ onComplete?: () => void;
55
+ protected _t: number;
56
+ private _dir;
57
+ private _off;
58
+ private _done;
59
+ private _resolve;
60
+ /** Resolves on completion (forward end, or start when reversed). */
61
+ finished: Promise<void>;
62
+ /** Set when owned by a timeline (then the ticker never drives it). */
63
+ parent: Timeline | null;
64
+ constructor(o: PlayOptions);
65
+ /** One iteration, ms. */
66
+ abstract get duration(): number;
67
+ /** Render at `ms` into one iteration. */
68
+ protected abstract renderLocal(ms: number, iterationEnded: boolean): void;
69
+ get totalDuration(): number;
70
+ get time(): number;
71
+ get progress(): number;
72
+ set progress(p: number);
73
+ get isActive(): boolean;
74
+ get reversed(): boolean;
75
+ /** Jump to `ms` (total time, including the delay) and render. */
76
+ seek(ms: number): this;
77
+ play(): this;
78
+ pause(): this;
79
+ /** Play backwards from the current time. */
80
+ reverse(): this;
81
+ restart(): this;
82
+ /** Stop and detach for good. */
83
+ kill(): void;
84
+ /** Promise-like: `await tween(...)`. */
85
+ then<R>(ok?: (v: void) => R, err?: (e: unknown) => R): Promise<R>;
86
+ private attach;
87
+ private advance;
88
+ protected complete(): void;
89
+ }
90
+ /** Position: ms number, '<' (start of previous), '>' (end of previous, default), '+=200' / '-=200' (relative to the end), 'label', 'label+=100', '<+=100'. */
91
+ type Position = number | string;
92
+ interface TimelineOptions extends PlayOptions {
93
+ /** Defaults merged into every `.to()`. */
94
+ defaults?: Omit<TweenOptions, 'to' | 'from'>;
95
+ }
96
+ /** A sequence of tweens, nested timelines and callbacks. */
97
+ declare class Timeline extends Playable {
98
+ private children;
99
+ private labels;
100
+ private prevStart;
101
+ private prevEnd;
102
+ private defaults;
103
+ private lastLocal;
104
+ constructor(o?: TimelineOptions);
105
+ get duration(): number;
106
+ private resolve;
107
+ /** Add a tween, timeline or callback at a position. */
108
+ add(item: Playable | (() => void), position?: Position): this;
109
+ /** `tween(target, vars)` placed at `position` (stagger across several targets). */
110
+ to(target: Target | Target[] | ArrayLike<Target>, vars: TweenOptions, position?: Position): this;
111
+ call(fn: () => void, position?: Position): this;
112
+ label(name: string, position?: Position): this;
113
+ /** Time of a label, ms. */
114
+ labelTime(name: string): number | undefined;
115
+ remove(item: Playable): void;
116
+ /** Children in start order (callbacks excluded). */
117
+ getChildren(): Playable[];
118
+ protected renderLocal(ms: number): void;
119
+ }
120
+
121
+ /**
122
+ * Shared internals of the animated-image loaders (`format-gif`, `format-apng`,
123
+ * `format-webp`, 10.4): the decoded-animation shape, frame compositing in
124
+ * plain RGBA arrays (no DOM — works in workers and on the server), the
125
+ * browser image decoder used for APNG / WebP frames, and the canvas player
126
+ * (a runtime `Playable`, so it can be paused, reversed, scrubbed and driven
127
+ * by a scroll scene). Bundled into each loader; not a public module.
128
+ */
129
+
130
+ /** An RGBA bitmap (the shape of `ImageData`, without needing the DOM). */
131
+ interface Rgba {
132
+ width: number;
133
+ height: number;
134
+ data: Uint8ClampedArray;
135
+ }
136
+ /** One frame of an animation, already composited to the full canvas size. */
137
+ interface AnimFrame {
138
+ /** Display time, ms. */
139
+ delay: number;
140
+ image: Rgba;
141
+ }
142
+ interface AnimatedImage {
143
+ format: 'gif' | 'apng' | 'webp';
144
+ width: number;
145
+ height: number;
146
+ /** Number of plays: 0 = forever, 1 = once, … */
147
+ plays: number;
148
+ frames: AnimFrame[];
149
+ }
150
+ /** A frame region before compositing (APNG fcTL / WebP ANMF / GIF descriptor). */
151
+ interface FramePart {
152
+ x: number;
153
+ y: number;
154
+ image: Rgba;
155
+ delay: number;
156
+ /** 'over' alpha-blends onto the canvas, 'source' replaces the region. */
157
+ blend: 'over' | 'source';
158
+ /** What happens to the region after the frame is shown. */
159
+ dispose: 'none' | 'background' | 'previous';
160
+ }
161
+ /** Composite frame parts onto a `width × height` canvas (pure; RGBA in, RGBA out). */
162
+ declare function composeFrames(width: number, height: number, parts: FramePart[], background?: [number, number, number, number]): AnimFrame[];
163
+ interface AnimPlayerOptions {
164
+ /** Extra repeats; default from the file (`plays`: 0 → forever). */
165
+ repeat?: number;
166
+ yoyo?: boolean;
167
+ paused?: boolean;
168
+ /** Playback speed (default 1). */
169
+ speed?: number;
170
+ }
171
+ type AnimPlayer = Playable & {
172
+ readonly frame: number;
173
+ readonly frameCount: number;
174
+ };
175
+ /** Play a decoded animation on a canvas as a runtime timeline (seek / reverse / `progress` scrub). */
176
+ declare function animatedImagePlayer(canvas: HTMLCanvasElement | OffscreenCanvas, anim: AnimatedImage, o?: AnimPlayerOptions): AnimPlayer;
177
+
178
+ /**
179
+ * `motionary/runtime/format-gif` (10.4) — a complete GIF decoder written for
180
+ * Motionary (own LZW implementation, no dependencies, no DOM): GIF87a / GIF89a,
181
+ * global and local palettes, transparency, interlaced frames, disposal
182
+ * methods 0–3, per-frame delays and the NETSCAPE2.0 loop count. Frames are
183
+ * composited to full-size RGBA, so they can be drawn, scrubbed or reversed
184
+ * with `animatedImagePlayer()` (a runtime timeline).
185
+ *
186
+ * ```ts
187
+ * import { use } from 'motionary/runtime';
188
+ * import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';
189
+ * use(formatGif);
190
+ * const gif = await loadGif('/loader.gif');
191
+ * const player = animatedImagePlayer(canvas, gif); // player.pause(); player.progress = 0.5
192
+ * ```
193
+ */
194
+
195
+ /** LZW-decode GIF image data into palette indices (exported for tests / tools). */
196
+ declare function lzwDecode(minCodeSize: number, data: Uint8Array, pixelCount: number): Uint8Array;
197
+ interface GifInfo {
198
+ version: '87a' | '89a';
199
+ width: number;
200
+ height: number;
201
+ /** NETSCAPE2.0 loop count (0 = forever), or null when the file has none (plays once). */
202
+ loopCount: number | null;
203
+ frameCount: number;
204
+ }
205
+ /** Decode a GIF (bytes) into composited RGBA frames. Pure: no DOM, works in workers / Node. */
206
+ declare function decodeGif(input: Uint8Array | ArrayBuffer): AnimatedImage & {
207
+ info: GifInfo;
208
+ };
209
+ /** Fetch (URL) or read (ArrayBuffer / Blob / bytes) and decode a GIF. */
210
+ declare function loadGif(src: string | ArrayBuffer | ArrayBufferView | Blob): Promise<AnimatedImage & {
211
+ info: GifInfo;
212
+ }>;
213
+ interface FormatGifApi {
214
+ decodeGif: typeof decodeGif;
215
+ loadGif: typeof loadGif;
216
+ lzwDecode: typeof lzwDecode;
217
+ animatedImagePlayer: typeof animatedImagePlayer;
218
+ }
219
+ /** The module object for `use(formatGif)`. */
220
+ declare const formatGif: RuntimeModule<FormatGifApi>;
221
+
222
+ export { animatedImagePlayer, composeFrames, decodeGif, formatGif, loadGif, lzwDecode };
223
+ export type { AnimFrame, AnimPlayer, AnimPlayerOptions, AnimatedImage, FormatGifApi, GifInfo, Rgba };
@@ -0,0 +1,2 @@
1
+ !function(t,e,n){"use strict";const r=t=>t<=10?100:t;function i(t,e,n,r){const i=new Uint8ClampedArray(t*e*4),a=[];for(const o of n){const n="previous"===o.dispose?i.slice():null,{width:s,height:f,data:h}=o.image;for(let n=0;n<f;n++){const r=o.y+n;if(!(r<0||r>=e))for(let e=0;e<s;e++){const a=o.x+e;if(a<0||a>=t)continue;const f=4*(n*s+e),c=4*(r*t+a),l=h[f+3];if("source"===o.blend||255===l)i[c]=h[f],i[c+1]=h[f+1],i[c+2]=h[f+2],i[c+3]=l;else if(l){const t=i[c+3]/255,e=l/255,n=e+t*(1-e);for(let r=0;r<3;r++)i[c+r]=(h[f+r]*e+i[c+r]*t*(1-e))/n;i[c+3]=255*n}}}if(a.push({delay:o.delay,image:{width:t,height:e,data:i.slice()}}),"background"===o.dispose)for(let n=Math.max(0,o.y);n<Math.min(e,o.y+f);n++)for(let e=Math.max(0,o.x);e<Math.min(t,o.x+s);e++)i.set(r||[0,0,0,0],4*(n*t+e));else n&&i.set(n)}return a}class a extends n.Playable{constructor(t,e,n){super({repeat:n.repeat??(0===e.plays?-1:Math.max(0,e.plays-1)),yoyo:n.yoyo}),this.canvas=t,this.anim=e,this.times=[0],this.cur=-1,this.timeScale=n.speed||1;for(const t of e.frames)this.times.push(this.times[this.times.length-1]+t.delay);t.width!==e.width&&(t.width=e.width),t.height!==e.height&&(t.height=e.height),this.ctx=t.getContext("2d"),this.datas=e.frames.map(()=>null),this.show(0),n.paused||this.play()}get duration(){return this.times[this.times.length-1]}get frame(){return this.cur}get frameCount(){return this.anim.frames.length}renderLocal(t){const e=Math.min(t,this.duration-.001);let n=0,r=this.anim.frames.length-1;for(;n<r;){const t=n+r+1>>1;this.times[t]<=e?n=t:r=t-1}this.show(n)}show(t){if(t===this.cur||!this.ctx)return;this.cur=t;const e=this.anim.frames[t];if(!e)return;let n=this.datas[t];n||"function"!=typeof ImageData||(n=this.datas[t]=new ImageData(new Uint8ClampedArray(e.image.data),e.image.width,e.image.height)),n&&this.ctx.putImageData(n,0,0)}}function o(t,e,n={}){if(!e.frames.length)throw new Error("[motionary] animatedImagePlayer: the animation has no frames");return new a(t,e,n)}function s(t,e,n){const r=new Uint8Array(n),i=1<<t,a=i+1,o=new Uint16Array(4096),s=new Uint8Array(4096),f=new Uint8Array(4097);let h=t+1,c=(1<<h)-1,l=a+1,u=-1,m=0,y=0,d=0,g=0,w=0;for(let t=0;t<i;t++)s[t]=t;for(;g<n;){for(;y<h;){if(w>=e.length)return r;d|=e[w++]<<y,y+=8}const p=d&c;if(d>>>=h,y-=h,p===i){h=t+1,c=(1<<h)-1,l=a+1,u=-1;continue}if(p===a)break;if(-1===u){r[g++]=s[p],u=m=p;continue}let b=p,A=0;for(p>=l&&(f[A++]=m,b=u);b>=i;)f[A++]=s[b],b=o[b];for(m=s[b],f[A++]=m;A&&g<n;)r[g++]=f[--A];l<4096&&(o[l]=u,s[l]=m,l++,l>c&&h<12&&(h++,c=(1<<h)-1)),u=p}return r}const f=["none","none","background","previous"];function h(t){const e=(n=t)instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength);var n;const a=String.fromCharCode(...e.subarray(0,6));if("GIF87a"!==a&&"GIF89a"!==a)throw new Error("[motionary] format-gif: not a GIF file");const o=e[6]|e[7]<<8,h=e[8]|e[9]<<8,c=e[10];let l=13,u=null;if(128&c){const t=3<<1+(7&c);u=e.subarray(l,l+t),l+=t}const m=[];let y=null,d=0,g=-1,w=0;const p=()=>{const t=[];let n=0;for(;l<e.length;){const r=e[l++];if(!r)break;t.push(e.subarray(l,l+r)),n+=r,l+=r}const r=new Uint8Array(n);let i=0;for(const e of t)r.set(e,i),i+=e.length;return r};for(;l<e.length;){const t=e[l++];if(59===t)break;if(33===t){const t=e[l++];if(249===t){const t=p();w=t[0]>>2&7,d=10*(t[1]|t[2]<<8),g=1&t[0]?t[3]:-1}else if(255===t){const t=String.fromCharCode(...e.subarray(l+1,l+12)),n=p();("NETSCAPE2.0"===t||"ANIMEXTS1.0"===t)&&n.length>=14&&1===n[11]&&(y=n[12]|n[13]<<8)}else p();continue}if(44!==t)break;const n=e[l]|e[l+1]<<8,i=e[l+2]|e[l+3]<<8,a=e[l+4]|e[l+5]<<8,o=e[l+6]|e[l+7]<<8,h=e[l+8];l+=9;let c=u;if(128&h){const t=3<<1+(7&h);c=e.subarray(l,l+t),l+=t}const b=s(e[l++],p(),a*o),A=new Uint32Array(o);if(64&h){let t=0;for(const[e,n]of[[0,8],[4,8],[2,4],[1,2]])for(let r=e;r<o;r+=n)A[t++]=r}else for(let t=0;t<o;t++)A[t]=t;const U=new Uint8ClampedArray(a*o*4);for(let t=0;t<o;t++){const e=A[t];for(let n=0;n<a;n++){const r=b[t*a+n],i=4*(e*a+n);r===g||!c||3*r+2>=c.length||(U[i]=c[3*r],U[i+1]=c[3*r+1],U[i+2]=c[3*r+2],U[i+3]=255)}}m.push({x:n,y:i,image:{width:a,height:o,data:U},delay:r(d),blend:"over",dispose:f[w]||"none"}),d=0,g=-1,w=0}const b=i(o,h,m);return{format:"gif",width:o,height:h,plays:null===y?1:0===y?0:y+1,frames:b,info:{version:a.slice(3),width:o,height:h,loopCount:y,frameCount:b.length}}}async function c(t){return h(await async function(t){if("string"==typeof t){const e=await fetch(t);if(!e.ok)throw new Error(`[motionary] could not load ${t} (${e.status})`);return new Uint8Array(await e.arrayBuffer())}return t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(await t.arrayBuffer())}(t))}const l={id:"format-gif",version:e.RUNTIME_VERSION,requires:["core"],api:{decodeGif:h,loadGif:c,lzwDecode:s,animatedImagePlayer:o}};e.register(l),t.animatedImagePlayer=o,t.composeFrames=i,t.decodeGif=h,t.formatGif=l,t.loadGif=c,t.lzwDecode=s}(this.MotionaryRuntime=this.MotionaryRuntime||{},MotionaryRuntime,MotionaryRuntime);
2
+ //# sourceMappingURL=format-gif.iife.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-gif.iife.js","sources":["../../src/runtime/anim-image.ts","../../src/runtime/format-gif.ts","../../src/runtime/iife/format-gif.ts"],"sourcesContent":["/**\n * Shared internals of the animated-image loaders (`format-gif`, `format-apng`,\n * `format-webp`, 10.4): the decoded-animation shape, frame compositing in\n * plain RGBA arrays (no DOM — works in workers and on the server), the\n * browser image decoder used for APNG / WebP frames, and the canvas player\n * (a runtime `Playable`, so it can be paused, reversed, scrubbed and driven\n * by a scroll scene). Bundled into each loader; not a public module.\n */\nimport { Playable } from './tween';\n\n/** An RGBA bitmap (the shape of `ImageData`, without needing the DOM). */\nexport interface Rgba {\n width: number;\n height: number;\n data: Uint8ClampedArray;\n}\n\n/** One frame of an animation, already composited to the full canvas size. */\nexport interface AnimFrame {\n /** Display time, ms. */\n delay: number;\n image: Rgba;\n}\n\nexport interface AnimatedImage {\n format: 'gif' | 'apng' | 'webp';\n width: number;\n height: number;\n /** Number of plays: 0 = forever, 1 = once, … */\n plays: number;\n frames: AnimFrame[];\n}\n\n/** A frame region before compositing (APNG fcTL / WebP ANMF / GIF descriptor). */\nexport interface FramePart {\n x: number;\n y: number;\n image: Rgba;\n delay: number;\n /** 'over' alpha-blends onto the canvas, 'source' replaces the region. */\n blend: 'over' | 'source';\n /** What happens to the region after the frame is shown. */\n dispose: 'none' | 'background' | 'previous';\n}\n\n/** Browsers clamp tiny delays (0–10 ms) to 100 ms; we do the same. */\nexport const fixDelay = (ms: number): number => (ms <= 10 ? 100 : ms);\n\n/** Composite frame parts onto a `width × height` canvas (pure; RGBA in, RGBA out). */\nexport function composeFrames(width: number, height: number, parts: FramePart[], background?: [number, number, number, number]): AnimFrame[] {\n const canvas = new Uint8ClampedArray(width * height * 4);\n const out: AnimFrame[] = [];\n for (const p of parts) {\n const before = p.dispose === 'previous' ? canvas.slice() : null;\n const { width: w, height: h, data } = p.image;\n for (let y = 0; y < h; y++) {\n const cy = p.y + y;\n if (cy < 0 || cy >= height) continue;\n for (let x = 0; x < w; x++) {\n const cx = p.x + x;\n if (cx < 0 || cx >= width) continue;\n const s = (y * w + x) * 4, d = (cy * width + cx) * 4;\n const a = data[s + 3];\n if (p.blend === 'source' || a === 255) {\n canvas[d] = data[s]; canvas[d + 1] = data[s + 1]; canvas[d + 2] = data[s + 2]; canvas[d + 3] = a;\n } else if (a) {\n // straight-alpha \"over\"\n const da = canvas[d + 3] / 255, sa = a / 255, oa = sa + da * (1 - sa);\n for (let c = 0; c < 3; c++) canvas[d + c] = (data[s + c] * sa + canvas[d + c] * da * (1 - sa)) / oa;\n canvas[d + 3] = oa * 255;\n }\n }\n }\n out.push({ delay: p.delay, image: { width, height, data: canvas.slice() } });\n if (p.dispose === 'background') {\n for (let y = Math.max(0, p.y); y < Math.min(height, p.y + h); y++)\n for (let x = Math.max(0, p.x); x < Math.min(width, p.x + w); x++) canvas.set(background || [0, 0, 0, 0], (y * width + x) * 4);\n } else if (before) canvas.set(before);\n }\n return out;\n}\n\n/** Image decoder for one frame file (PNG / WebP bytes) → RGBA. Replaceable (workers, tests, servers). */\nexport type FrameDecoder = (bytes: Uint8Array, mime: string) => Promise<Rgba>;\n\n/** Default decoder: the browser's own (`createImageBitmap` + a 2D canvas; OffscreenCanvas in workers). */\nexport const browserDecode: FrameDecoder = async (bytes, mime) => {\n const g = globalThis as any;\n if (typeof g.createImageBitmap !== 'function') throw new Error('[motionary] no image decoder here (createImageBitmap is missing) — pass { decode } to the loader');\n const bmp = await g.createImageBitmap(new Blob([bytes as BlobPart], { type: mime }));\n const w = bmp.width, h = bmp.height; // read before close(): a closed ImageBitmap reports 0 × 0\n const c = typeof g.OffscreenCanvas === 'function' ? new g.OffscreenCanvas(w, h) : Object.assign(document.createElement('canvas'), { width: w, height: h });\n const ctx = c.getContext('2d', { willReadFrequently: true });\n ctx.drawImage(bmp, 0, 0);\n bmp.close?.();\n const id = ctx.getImageData(0, 0, w, h);\n return { width: id.width, height: id.height, data: id.data };\n};\n\n/** Read a `src` (URL, ArrayBuffer, typed array or Blob) into bytes. */\nexport async function bytesOf(src: string | ArrayBuffer | ArrayBufferView | Blob): Promise<Uint8Array> {\n if (typeof src === 'string') {\n const r = await fetch(src);\n if (!r.ok) throw new Error(`[motionary] could not load ${src} (${r.status})`);\n return new Uint8Array(await r.arrayBuffer());\n }\n if (src instanceof ArrayBuffer) return new Uint8Array(src);\n if (ArrayBuffer.isView(src)) return new Uint8Array(src.buffer, src.byteOffset, src.byteLength);\n return new Uint8Array(await (src as Blob).arrayBuffer());\n}\n\nexport interface AnimPlayerOptions {\n /** Extra repeats; default from the file (`plays`: 0 → forever). */\n repeat?: number;\n yoyo?: boolean;\n paused?: boolean;\n /** Playback speed (default 1). */\n speed?: number;\n}\n\nexport type AnimPlayer = Playable & { readonly frame: number; readonly frameCount: number };\n\nclass AnimImagePlayer extends Playable {\n private times: number[] = [0];\n private cur = -1;\n private ctx: CanvasRenderingContext2D | null;\n private datas: (ImageData | null)[];\n constructor(private canvas: HTMLCanvasElement | OffscreenCanvas, private anim: AnimatedImage, o: AnimPlayerOptions) {\n super({ repeat: o.repeat ?? (anim.plays === 0 ? -1 : Math.max(0, anim.plays - 1)), yoyo: o.yoyo });\n this.timeScale = o.speed || 1;\n for (const f of anim.frames) this.times.push(this.times[this.times.length - 1] + f.delay);\n if (canvas.width !== anim.width) canvas.width = anim.width;\n if (canvas.height !== anim.height) canvas.height = anim.height;\n this.ctx = canvas.getContext('2d') as CanvasRenderingContext2D | null;\n this.datas = anim.frames.map(() => null);\n this.show(0);\n if (!o.paused) this.play();\n }\n get duration(): number {\n return this.times[this.times.length - 1];\n }\n get frame(): number {\n return this.cur;\n }\n get frameCount(): number {\n return this.anim.frames.length;\n }\n protected renderLocal(ms: number): void {\n const t = Math.min(ms, this.duration - 0.001);\n let lo = 0, hi = this.anim.frames.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (this.times[mid] <= t) lo = mid;\n else hi = mid - 1;\n }\n this.show(lo);\n }\n private show(i: number): void {\n if (i === this.cur || !this.ctx) return;\n this.cur = i;\n const f = this.anim.frames[i];\n if (!f) return;\n let d = this.datas[i];\n if (!d && typeof ImageData === 'function') d = this.datas[i] = new ImageData(new Uint8ClampedArray(f.image.data), f.image.width, f.image.height);\n if (d) this.ctx.putImageData(d, 0, 0);\n }\n}\n\n/** Play a decoded animation on a canvas as a runtime timeline (seek / reverse / `progress` scrub). */\nexport function animatedImagePlayer(canvas: HTMLCanvasElement | OffscreenCanvas, anim: AnimatedImage, o: AnimPlayerOptions = {}): AnimPlayer {\n if (!anim.frames.length) throw new Error('[motionary] animatedImagePlayer: the animation has no frames');\n return new AnimImagePlayer(canvas, anim, o);\n}\n\n/** A plain Uint8Array view (Node Buffers' `slice()` shares memory — normalise them away). */\nexport const u8 = (x: Uint8Array | ArrayBuffer): Uint8Array => (x instanceof ArrayBuffer ? new Uint8Array(x) : new Uint8Array(x.buffer, x.byteOffset, x.byteLength));\n\n/** CRC-32 (PNG chunks). */\nlet CRC: Uint32Array | null = null;\nexport function crc32(bytes: Uint8Array, start = 0, end = bytes.length): number {\n if (!CRC) {\n CRC = new Uint32Array(256);\n for (let n = 0; n < 256; n++) {\n let c = n;\n for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n CRC[n] = c >>> 0;\n }\n }\n let c = 0xffffffff;\n for (let i = start; i < end; i++) c = CRC[(c ^ bytes[i]) & 0xff] ^ (c >>> 8);\n return (c ^ 0xffffffff) >>> 0;\n}\n","/**\n * `motionary/runtime/format-gif` (10.4) — a complete GIF decoder written for\n * Motionary (own LZW implementation, no dependencies, no DOM): GIF87a / GIF89a,\n * global and local palettes, transparency, interlaced frames, disposal\n * methods 0–3, per-frame delays and the NETSCAPE2.0 loop count. Frames are\n * composited to full-size RGBA, so they can be drawn, scrubbed or reversed\n * with `animatedImagePlayer()` (a runtime timeline).\n *\n * ```ts\n * import { use } from 'motionary/runtime';\n * import { formatGif, loadGif, animatedImagePlayer } from 'motionary/runtime/format-gif';\n * use(formatGif);\n * const gif = await loadGif('/loader.gif');\n * const player = animatedImagePlayer(canvas, gif); // player.pause(); player.progress = 0.5\n * ```\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { composeFrames, fixDelay, bytesOf, animatedImagePlayer, u8, type AnimatedImage, type FramePart } from './anim-image';\n\nexport type { AnimatedImage, AnimFrame, Rgba, AnimPlayer, AnimPlayerOptions } from './anim-image';\nexport { animatedImagePlayer, composeFrames } from './anim-image';\n\n/** LZW-decode GIF image data into palette indices (exported for tests / tools). */\nexport function lzwDecode(minCodeSize: number, data: Uint8Array, pixelCount: number): Uint8Array {\n const out = new Uint8Array(pixelCount);\n const clear = 1 << minCodeSize, eoi = clear + 1;\n const prefix = new Uint16Array(4096), suffix = new Uint8Array(4096), stack = new Uint8Array(4097);\n let size = minCodeSize + 1, mask = (1 << size) - 1, next = eoi + 1;\n let old = -1, first = 0, bits = 0, acc = 0, op = 0, pos = 0;\n for (let i = 0; i < clear; i++) suffix[i] = i;\n while (op < pixelCount) {\n while (bits < size) {\n if (pos >= data.length) return out; // truncated data: keep what we have\n acc |= data[pos++] << bits;\n bits += 8;\n }\n const code = acc & mask;\n acc >>>= size;\n bits -= size;\n if (code === clear) {\n size = minCodeSize + 1; mask = (1 << size) - 1; next = eoi + 1; old = -1;\n continue;\n }\n if (code === eoi) break;\n if (old === -1) {\n out[op++] = suffix[code];\n old = first = code;\n continue;\n }\n let c = code, sp = 0;\n if (code >= next) {\n stack[sp++] = first;\n c = old;\n }\n while (c >= clear) {\n stack[sp++] = suffix[c];\n c = prefix[c];\n }\n first = suffix[c];\n stack[sp++] = first;\n while (sp && op < pixelCount) out[op++] = stack[--sp];\n if (next < 4096) {\n prefix[next] = old;\n suffix[next] = first;\n next++;\n if (next > mask && size < 12) {\n size++;\n mask = (1 << size) - 1;\n }\n }\n old = code;\n }\n return out;\n}\n\nexport interface GifInfo {\n version: '87a' | '89a';\n width: number;\n height: number;\n /** NETSCAPE2.0 loop count (0 = forever), or null when the file has none (plays once). */\n loopCount: number | null;\n frameCount: number;\n}\n\nconst DISPOSE: FramePart['dispose'][] = ['none', 'none', 'background', 'previous'];\n\n/** Decode a GIF (bytes) into composited RGBA frames. Pure: no DOM, works in workers / Node. */\nexport function decodeGif(input: Uint8Array | ArrayBuffer): AnimatedImage & { info: GifInfo } {\n const b = u8(input);\n const sig = String.fromCharCode(...b.subarray(0, 6));\n if (sig !== 'GIF87a' && sig !== 'GIF89a') throw new Error('[motionary] format-gif: not a GIF file');\n const width = b[6] | (b[7] << 8), height = b[8] | (b[9] << 8), flags = b[10];\n let p = 13, gct: Uint8Array | null = null;\n if (flags & 0x80) {\n const n = 3 << ((flags & 7) + 1);\n gct = b.subarray(p, p + n);\n p += n;\n }\n const parts: FramePart[] = [];\n let loopCount: number | null = null, delay = 0, transparent = -1, disposal = 0;\n const blocks = (): Uint8Array => {\n const chunks: Uint8Array[] = [];\n let len = 0;\n while (p < b.length) {\n const n = b[p++];\n if (!n) break;\n chunks.push(b.subarray(p, p + n));\n len += n;\n p += n;\n }\n const outB = new Uint8Array(len);\n let o = 0;\n for (const c of chunks) {\n outB.set(c, o);\n o += c.length;\n }\n return outB;\n };\n while (p < b.length) {\n const t = b[p++];\n if (t === 0x3b) break; // trailer\n if (t === 0x21) {\n const label = b[p++];\n if (label === 0xf9) {\n const d = blocks();\n disposal = (d[0] >> 2) & 7;\n delay = (d[1] | (d[2] << 8)) * 10;\n transparent = d[0] & 1 ? d[3] : -1;\n } else if (label === 0xff) {\n const id = String.fromCharCode(...b.subarray(p + 1, p + 12));\n const d = blocks();\n if ((id === 'NETSCAPE2.0' || id === 'ANIMEXTS1.0') && d.length >= 14 && d[11] === 1) loopCount = d[12] | (d[13] << 8);\n } else blocks();\n continue;\n }\n if (t !== 0x2c) break; // unknown block: stop (corrupt tail)\n const x = b[p] | (b[p + 1] << 8), y = b[p + 2] | (b[p + 3] << 8), w = b[p + 4] | (b[p + 5] << 8), h = b[p + 6] | (b[p + 7] << 8), f = b[p + 8];\n p += 9;\n let pal = gct;\n if (f & 0x80) {\n const n = 3 << ((f & 7) + 1);\n pal = b.subarray(p, p + n);\n p += n;\n }\n const minCode = b[p++];\n const idx = lzwDecode(minCode, blocks(), w * h);\n const rows = new Uint32Array(h);\n if (f & 0x40) {\n // interlaced: rows come in 4 passes (every 8th from 0, every 8th from 4, every 4th from 2, every 2nd from 1)\n let r = 0;\n for (const [start, step] of [[0, 8], [4, 8], [2, 4], [1, 2]]) for (let yy = start; yy < h; yy += step) rows[r++] = yy;\n } else for (let yy = 0; yy < h; yy++) rows[yy] = yy;\n const data = new Uint8ClampedArray(w * h * 4);\n for (let r = 0; r < h; r++) {\n const dy = rows[r];\n for (let xx = 0; xx < w; xx++) {\n const ci = idx[r * w + xx], o = (dy * w + xx) * 4;\n if (ci === transparent || !pal || ci * 3 + 2 >= pal.length) continue;\n data[o] = pal[ci * 3]; data[o + 1] = pal[ci * 3 + 1]; data[o + 2] = pal[ci * 3 + 2]; data[o + 3] = 255;\n }\n }\n parts.push({ x, y, image: { width: w, height: h, data }, delay: fixDelay(delay), blend: 'over', dispose: DISPOSE[disposal] || 'none' });\n delay = 0; transparent = -1; disposal = 0;\n }\n // like browsers, \"restore to background\" clears to transparent\n const frames = composeFrames(width, height, parts);\n return {\n format: 'gif',\n width,\n height,\n plays: loopCount === null ? 1 : loopCount === 0 ? 0 : loopCount + 1,\n frames,\n info: { version: sig.slice(3) as '87a' | '89a', width, height, loopCount, frameCount: frames.length },\n };\n}\n\n/** Fetch (URL) or read (ArrayBuffer / Blob / bytes) and decode a GIF. */\nexport async function loadGif(src: string | ArrayBuffer | ArrayBufferView | Blob): Promise<AnimatedImage & { info: GifInfo }> {\n return decodeGif(await bytesOf(src));\n}\n\nexport interface FormatGifApi {\n decodeGif: typeof decodeGif;\n loadGif: typeof loadGif;\n lzwDecode: typeof lzwDecode;\n animatedImagePlayer: typeof animatedImagePlayer;\n}\n\n/** The module object for `use(formatGif)`. */\nexport const formatGif: RuntimeModule<FormatGifApi> = { id: 'format-gif', version: RUNTIME_VERSION, requires: ['core'], api: { decodeGif, loadGif, lzwDecode, animatedImagePlayer } };\n","// CDN build: load runtime.iife.js first, then this file → registers motionary/runtime/format-gif and adds its API to window.MotionaryRuntime.\nimport { register } from '../registry';\nimport { formatGif } from '../format-gif';\nexport * from '../format-gif';\nregister(formatGif);\n"],"names":["fixDelay","ms","composeFrames","width","height","parts","background","canvas","Uint8ClampedArray","out","p","before","dispose","slice","w","h","data","image","y","cy","x","cx","s","d","a","blend","da","sa","oa","c","push","delay","Math","max","min","set","AnimImagePlayer","Playable","constructor","anim","o","super","repeat","plays","yoyo","this","times","cur","timeScale","speed","f","frames","length","ctx","getContext","datas","map","show","paused","play","duration","frame","frameCount","renderLocal","t","lo","hi","mid","i","ImageData","putImageData","animatedImagePlayer","Error","lzwDecode","minCodeSize","pixelCount","Uint8Array","clear","eoi","prefix","Uint16Array","suffix","stack","size","mask","next","old","first","bits","acc","op","pos","code","sp","DISPOSE","decodeGif","input","b","ArrayBuffer","buffer","byteOffset","byteLength","sig","String","fromCharCode","subarray","flags","gct","n","loopCount","transparent","disposal","blocks","chunks","len","outB","label","id","pal","idx","rows","Uint32Array","r","start","step","yy","dy","xx","ci","format","info","version","async","loadGif","src","fetch","ok","status","arrayBuffer","isView","bytesOf","formatGif","RUNTIME_VERSION","requires","api","register"],"mappings":"8BA8CO,MAAMA,EAAYC,GAAwBA,GAAM,GAAK,IAAMA,EAG5D,SAAUC,EAAcC,EAAeC,EAAgBC,EAAoBC,GAC/E,MAAMC,EAAS,IAAIC,kBAAkBL,EAAQC,EAAS,GAChD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