@motionscript/core 0.1.0-alpha.8 → 0.1.0-alpha.9

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 (791) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +201 -201
  3. package/NOTICE +49 -49
  4. package/README.md +91 -91
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.js.map +1 -1
  7. package/dist/assets/errors.js.map +1 -1
  8. package/dist/assets/index.js.map +1 -1
  9. package/dist/assets/manager.js.map +1 -1
  10. package/dist/assets/manifest.js.map +1 -1
  11. package/dist/assets/record.js.map +1 -1
  12. package/dist/assets/scope.js.map +1 -1
  13. package/dist/attributes/audio/effects/chain.js.map +1 -1
  14. package/dist/attributes/audio/effects/implementations/echo.js.map +1 -1
  15. package/dist/attributes/audio/effects/implementations/gain.js.map +1 -1
  16. package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -1
  17. package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -1
  18. package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -1
  19. package/dist/attributes/audio/effects/index.js.map +1 -1
  20. package/dist/attributes/audio/effects/registry.js.map +1 -1
  21. package/dist/attributes/audio/effects/union.js.map +1 -1
  22. package/dist/attributes/audio/ramp.js.map +1 -1
  23. package/dist/attributes/audio/request.js.map +1 -1
  24. package/dist/attributes/audio/schedule.js.map +1 -1
  25. package/dist/attributes/audio/sound.js.map +1 -1
  26. package/dist/attributes/audio/transition.js.map +1 -1
  27. package/dist/attributes/index.js.map +1 -1
  28. package/dist/attributes/layout/alignment.js.map +1 -1
  29. package/dist/attributes/layout/index.js.map +1 -1
  30. package/dist/attributes/layout/insets.js.map +1 -1
  31. package/dist/attributes/layout/matrix2d.js.map +1 -1
  32. package/dist/attributes/layout/size.js.map +1 -1
  33. package/dist/attributes/layout/space3d.js.map +1 -1
  34. package/dist/attributes/layout/transform3d.js.map +1 -1
  35. package/dist/attributes/layout/vector2.js.map +1 -1
  36. package/dist/attributes/layout/world-transform.js.map +1 -1
  37. package/dist/attributes/mask/boolean.js.map +1 -1
  38. package/dist/attributes/mask/mask.js.map +1 -1
  39. package/dist/attributes/properties/decorator.js.map +1 -1
  40. package/dist/attributes/properties/inputs.js.map +1 -1
  41. package/dist/attributes/properties/typed.js.map +1 -1
  42. package/dist/attributes/render3d/orbit.js.map +1 -1
  43. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  44. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  45. package/dist/attributes/shape/corners/corners.js.map +1 -1
  46. package/dist/attributes/shape/corners/index.js.map +1 -1
  47. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  48. package/dist/attributes/shape/effects/chain.js.map +1 -1
  49. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  50. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  51. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  52. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  53. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  54. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  55. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  56. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  57. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  58. package/dist/attributes/shape/effects/implementations/curves.d.ts +2 -2
  59. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  60. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  61. package/dist/attributes/shape/effects/implementations/dither.d.ts +2 -2
  62. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  63. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  64. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  65. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  66. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  67. package/dist/attributes/shape/effects/implementations/glow.d.ts +4 -4
  68. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  69. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  70. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  71. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  72. package/dist/attributes/shape/effects/implementations/invert.d.ts +2 -2
  73. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  74. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  75. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  76. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  77. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  78. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  79. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  80. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  81. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  82. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  83. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  84. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  85. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  86. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  87. package/dist/attributes/shape/effects/implementations/shader.d.ts +2 -2
  88. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  89. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  90. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  91. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  92. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  93. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  94. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  95. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  96. package/dist/attributes/shape/effects/index.js.map +1 -1
  97. package/dist/attributes/shape/effects/registry.js.map +1 -1
  98. package/dist/attributes/shape/effects/spec.js.map +1 -1
  99. package/dist/attributes/shape/effects/union.js.map +1 -1
  100. package/dist/attributes/shape/fill/blend.js.map +1 -1
  101. package/dist/attributes/shape/fill/chain.js.map +1 -1
  102. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  103. package/dist/attributes/shape/fill/color/constants.js.map +1 -1
  104. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  105. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  106. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  107. package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
  108. package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
  109. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  110. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  111. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  112. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  113. package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
  114. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  115. package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
  116. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  117. package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
  118. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  119. package/dist/attributes/shape/fill/index.js.map +1 -1
  120. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  121. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  122. package/dist/attributes/shape/fill/registry.js.map +1 -1
  123. package/dist/attributes/shape/fill/union.js.map +1 -1
  124. package/dist/attributes/shape/filters/chain.js.map +1 -1
  125. package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
  126. package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
  127. package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
  128. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  129. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  130. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  131. package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
  132. package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
  133. package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
  134. package/dist/attributes/shape/filters/index.js.map +1 -1
  135. package/dist/attributes/shape/filters/registry.js.map +1 -1
  136. package/dist/attributes/shape/filters/union.js.map +1 -1
  137. package/dist/attributes/shape/path/anchors.js.map +1 -1
  138. package/dist/attributes/shape/path/bezier.js.map +1 -1
  139. package/dist/attributes/shape/path/index.js.map +1 -1
  140. package/dist/attributes/shape/path/measure.js.map +1 -1
  141. package/dist/attributes/shape/path/morph.js.map +1 -1
  142. package/dist/attributes/shape/path/ops.js.map +1 -1
  143. package/dist/attributes/shape/path/types.js.map +1 -1
  144. package/dist/attributes/shape/path/walk.js.map +1 -1
  145. package/dist/attributes/shape/shaders/index.js.map +1 -1
  146. package/dist/attributes/shape/shaders/language.js.map +1 -1
  147. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  148. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  149. package/dist/attributes/shape/shadow/index.js.map +1 -1
  150. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  151. package/dist/attributes/shape/stroke/index.js.map +1 -1
  152. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  153. package/dist/attributes/shared/operators.js.map +1 -1
  154. package/dist/attributes/text/index.js.map +1 -1
  155. package/dist/attributes/text/ops.js.map +1 -1
  156. package/dist/attributes/text/types.js.map +1 -1
  157. package/dist/browser/chunks/{chunk-LKUYVFU3.js → chunk-4BDLFEOC.js} +1 -1
  158. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +7 -0
  159. package/dist/browser/chunks/{chunk-GKM6UZJR.js → chunk-7DB6BI27.js} +2 -2
  160. package/dist/browser/chunks/chunk-7DB6BI27.js.map +7 -0
  161. package/dist/browser/chunks/{chunk-AOT33LMS.js → chunk-IX53IFBD.js} +2 -2
  162. package/dist/browser/chunks/chunk-IX53IFBD.js.map +7 -0
  163. package/dist/browser/chunks/{chunk-ZRPZPWZU.js → chunk-Q55UPA3E.js} +1 -1
  164. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +7 -0
  165. package/dist/browser/component.js +1 -1
  166. package/dist/browser/experimental.js +1 -1
  167. package/dist/browser/experimental.js.map +1 -1
  168. package/dist/browser/index.js +1 -1
  169. package/dist/browser/index.js.map +1 -1
  170. package/dist/browser/sdk.js +1 -1
  171. package/dist/component.js.map +1 -1
  172. package/dist/components/builtins/audio/audio.js.map +1 -1
  173. package/dist/components/builtins/geometry/composite.js.map +1 -1
  174. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  175. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  176. package/dist/components/builtins/layout/layout.js.map +1 -1
  177. package/dist/components/builtins/media/media.js.map +1 -1
  178. package/dist/components/builtins/providers/providers.js.map +1 -1
  179. package/dist/components/builtins/text/number-format.js.map +1 -1
  180. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  181. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  182. package/dist/components/builtins/text/text-layout.js.map +1 -1
  183. package/dist/components/builtins/text/text.d.ts +9 -9
  184. package/dist/components/builtins/text/text.js.map +1 -1
  185. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  186. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  187. package/dist/components/builtins/three/three.js.map +1 -1
  188. package/dist/components/factory/api.js.map +1 -1
  189. package/dist/components/factory/clip-of.js.map +1 -1
  190. package/dist/components/factory/commands-for.js.map +1 -1
  191. package/dist/components/factory/component-audio.js.map +1 -1
  192. package/dist/components/factory/component2d.js.map +1 -1
  193. package/dist/components/factory/component3d.js.map +1 -1
  194. package/dist/components/factory/factory.js.map +1 -1
  195. package/dist/components/factory/timeline.js.map +1 -1
  196. package/dist/components/factory/type-def.js.map +1 -1
  197. package/dist/components/factory/types.js.map +1 -1
  198. package/dist/components/factory/views.js.map +1 -1
  199. package/dist/components/modules/aim.js.map +1 -1
  200. package/dist/components/modules/corners.js.map +1 -1
  201. package/dist/components/modules/flow.js.map +1 -1
  202. package/dist/components/modules/material.js.map +1 -1
  203. package/dist/components/modules/paint.js.map +1 -1
  204. package/dist/components/modules/shapes.js.map +1 -1
  205. package/dist/components/modules/text-layout.js.map +1 -1
  206. package/dist/components/modules/text-style.d.ts +1 -1
  207. package/dist/components/modules/text-style.js.map +1 -1
  208. package/dist/components/modules/three-entries.js.map +1 -1
  209. package/dist/components/modules/view3d.js.map +1 -1
  210. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  211. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  212. package/dist/components/trees/2d/node-motion.js.map +1 -1
  213. package/dist/components/trees/2d/node-render.js.map +1 -1
  214. package/dist/components/trees/2d/node-space.js.map +1 -1
  215. package/dist/components/trees/2d/node-transform.js.map +1 -1
  216. package/dist/components/trees/2d/node2d.js.map +1 -1
  217. package/dist/components/trees/audio/index.js.map +1 -1
  218. package/dist/components/trees/audio/node-audio.js.map +1 -1
  219. package/dist/components/trees/index.js.map +1 -1
  220. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  221. package/dist/components/trees/node/node-reactive.js.map +1 -1
  222. package/dist/components/trees/node/node-time.js.map +1 -1
  223. package/dist/components/trees/node/node-walk.js.map +1 -1
  224. package/dist/components/trees/node/node.js.map +1 -1
  225. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  226. package/dist/components/trees/three/node3d.js.map +1 -1
  227. package/dist/document/audio.js.map +1 -1
  228. package/dist/document/builtins.js.map +1 -1
  229. package/dist/document/command-traits.js.map +1 -1
  230. package/dist/document/deny-globals.js.map +1 -1
  231. package/dist/document/diff.js.map +1 -1
  232. package/dist/document/doc-index.js.map +1 -1
  233. package/dist/document/expression/compile.js.map +1 -1
  234. package/dist/document/expression/index.js.map +1 -1
  235. package/dist/document/expression/ops.js.map +1 -1
  236. package/dist/document/expression/parse.js.map +1 -1
  237. package/dist/document/expression/refs.js.map +1 -1
  238. package/dist/document/expression/types.js.map +1 -1
  239. package/dist/document/expression/walk.js.map +1 -1
  240. package/dist/document/index.js.map +1 -1
  241. package/dist/document/migrate.js.map +1 -1
  242. package/dist/document/missing-node.js.map +1 -1
  243. package/dist/document/node-decorator.js.map +1 -1
  244. package/dist/document/node-descriptor.js.map +1 -1
  245. package/dist/document/placement.js.map +1 -1
  246. package/dist/document/project.js.map +1 -1
  247. package/dist/document/prop-evolution.js.map +1 -1
  248. package/dist/document/registry.js.map +1 -1
  249. package/dist/document/settled-index.js.map +1 -1
  250. package/dist/document/timeline-patch.js.map +1 -1
  251. package/dist/document/timeline.js.map +1 -1
  252. package/dist/document/types.js.map +1 -1
  253. package/dist/document/validate.js.map +1 -1
  254. package/dist/document/vocabulary.js.map +1 -1
  255. package/dist/experimental.d.ts.map +1 -1
  256. package/dist/experimental.js.map +1 -1
  257. package/dist/index.js.map +1 -1
  258. package/dist/layout/bounds.js.map +1 -1
  259. package/dist/layout/constraints.js.map +1 -1
  260. package/dist/layout/flex.js.map +1 -1
  261. package/dist/layout/freeform.js.map +1 -1
  262. package/dist/layout/grid.js.map +1 -1
  263. package/dist/layout/index.js.map +1 -1
  264. package/dist/layout/item.js.map +1 -1
  265. package/dist/layout/ops.js.map +1 -1
  266. package/dist/layout/types.js.map +1 -1
  267. package/dist/platform/audio-sink.js.map +1 -1
  268. package/dist/platform/exporter.js.map +1 -1
  269. package/dist/platform/index.js.map +1 -1
  270. package/dist/platform/stepped-clock.js.map +1 -1
  271. package/dist/platform/storage-adapter.js.map +1 -1
  272. package/dist/platform/ticker.js.map +1 -1
  273. package/dist/project/config.js.map +1 -1
  274. package/dist/project/index.js.map +1 -1
  275. package/dist/project/tree.js.map +1 -1
  276. package/dist/props/host.js.map +1 -1
  277. package/dist/props/index.js.map +1 -1
  278. package/dist/props/observer.js.map +1 -1
  279. package/dist/props/slot.js.map +1 -1
  280. package/dist/renamed-scene-names.js.map +1 -1
  281. package/dist/render/canvas-render-context2d.js.map +1 -1
  282. package/dist/render/clip-contains.js.map +1 -1
  283. package/dist/render/clip.js.map +1 -1
  284. package/dist/render/descriptors/ellipse.js.map +1 -1
  285. package/dist/render/descriptors/line.js.map +1 -1
  286. package/dist/render/descriptors/path-builder.js.map +1 -1
  287. package/dist/render/descriptors/path.js.map +1 -1
  288. package/dist/render/descriptors/polygon.js.map +1 -1
  289. package/dist/render/descriptors/polygram.js.map +1 -1
  290. package/dist/render/descriptors/rect.js.map +1 -1
  291. package/dist/render/descriptors/richtext.js.map +1 -1
  292. package/dist/render/descriptors/shape.js.map +1 -1
  293. package/dist/render/descriptors/text.js.map +1 -1
  294. package/dist/render/descriptors/transform.js.map +1 -1
  295. package/dist/render/graphics2d.js.map +1 -1
  296. package/dist/render/index.js.map +1 -1
  297. package/dist/render/measure-context.js.map +1 -1
  298. package/dist/render/null-render-context.js.map +1 -1
  299. package/dist/render/render-context2d.js.map +1 -1
  300. package/dist/render/render-issue.js.map +1 -1
  301. package/dist/render/surface.js.map +1 -1
  302. package/dist/render/text-defaults.js.map +1 -1
  303. package/dist/render/text-layout.js.map +1 -1
  304. package/dist/render3d/bounds3d.js.map +1 -1
  305. package/dist/render3d/builders.js.map +1 -1
  306. package/dist/render3d/camera.js.map +1 -1
  307. package/dist/render3d/fill3d.js.map +1 -1
  308. package/dist/render3d/geometry.js.map +1 -1
  309. package/dist/render3d/graphics3d.js.map +1 -1
  310. package/dist/render3d/index.js.map +1 -1
  311. package/dist/render3d/inert.js.map +1 -1
  312. package/dist/render3d/light.js.map +1 -1
  313. package/dist/render3d/material.js.map +1 -1
  314. package/dist/render3d/matrix4.js.map +1 -1
  315. package/dist/render3d/render-context3d.js.map +1 -1
  316. package/dist/render3d/resources.js.map +1 -1
  317. package/dist/render3d/rounded-box.js.map +1 -1
  318. package/dist/render3d/scene-settings.js.map +1 -1
  319. package/dist/render3d/scene3d.js.map +1 -1
  320. package/dist/render3d/segments.js.map +1 -1
  321. package/dist/render3d/texture.js.map +1 -1
  322. package/dist/render3d/tracking.js.map +1 -1
  323. package/dist/render3d/transform.js.map +1 -1
  324. package/dist/render3d/vector3.js.map +1 -1
  325. package/dist/render3d/walk.js.map +1 -1
  326. package/dist/runtime/asset-refine.js.map +1 -1
  327. package/dist/runtime/asset-timeline.js.map +1 -1
  328. package/dist/runtime/asset-update.js.map +1 -1
  329. package/dist/runtime/audio-index.js.map +1 -1
  330. package/dist/runtime/builtin-context.js.map +1 -1
  331. package/dist/runtime/clip-instance.js.map +1 -1
  332. package/dist/runtime/clip-store.js.map +1 -1
  333. package/dist/runtime/engine.js.map +1 -1
  334. package/dist/runtime/frame-time.js.map +1 -1
  335. package/dist/runtime/index.js.map +1 -1
  336. package/dist/runtime/node-picking.js.map +1 -1
  337. package/dist/runtime/node-picking3d.js.map +1 -1
  338. package/dist/runtime/placement.js.map +1 -1
  339. package/dist/runtime/playback-controller.js.map +1 -1
  340. package/dist/runtime/playback.js.map +1 -1
  341. package/dist/runtime/precompisition.js.map +1 -1
  342. package/dist/runtime/project-assets.js.map +1 -1
  343. package/dist/runtime/session.js.map +1 -1
  344. package/dist/runtime/settle.js.map +1 -1
  345. package/dist/runtime/state-evaluator.js.map +1 -1
  346. package/dist/runtime/text-geometry.js.map +1 -1
  347. package/dist/sdk/index.js.map +1 -1
  348. package/dist/tween/command-decorator.js.map +1 -1
  349. package/dist/tween/command.js.map +1 -1
  350. package/dist/tween/ease/constants.js.map +1 -1
  351. package/dist/tween/ease/curve.js.map +1 -1
  352. package/dist/tween/ease/describe.js.map +1 -1
  353. package/dist/tween/ease/spec.js.map +1 -1
  354. package/dist/tween/ease/type.js.map +1 -1
  355. package/dist/tween/index.js.map +1 -1
  356. package/dist/tween/inert.js.map +1 -1
  357. package/dist/tween/lerp.js.map +1 -1
  358. package/dist/tween/loop.js.map +1 -1
  359. package/dist/tween/prepare.js.map +1 -1
  360. package/dist/tween/stepper.js.map +1 -1
  361. package/dist/tween/to-command.js.map +1 -1
  362. package/dist/util/clamp.js.map +1 -1
  363. package/dist/util/context.js.map +1 -1
  364. package/dist/util/csv.js.map +1 -1
  365. package/dist/util/generateList.js.map +1 -1
  366. package/dist/util/index.js.map +1 -1
  367. package/dist/util/metrics.js.map +1 -1
  368. package/dist/util/random.js.map +1 -1
  369. package/dist/util/reference.js.map +1 -1
  370. package/dist/util/scheduler.js.map +1 -1
  371. package/package.json +1 -1
  372. package/dist/attributes/audio/filters/chain.d.ts +0 -113
  373. package/dist/attributes/audio/filters/chain.d.ts.map +0 -1
  374. package/dist/attributes/audio/filters/chain.js +0 -104
  375. package/dist/attributes/audio/filters/chain.js.map +0 -1
  376. package/dist/attributes/audio/filters/curve.d.ts +0 -152
  377. package/dist/attributes/audio/filters/curve.d.ts.map +0 -1
  378. package/dist/attributes/audio/filters/curve.js +0 -250
  379. package/dist/attributes/audio/filters/curve.js.map +0 -1
  380. package/dist/attributes/audio/filters/implementations/echo.d.ts +0 -14
  381. package/dist/attributes/audio/filters/implementations/echo.d.ts.map +0 -1
  382. package/dist/attributes/audio/filters/implementations/echo.js +0 -11
  383. package/dist/attributes/audio/filters/implementations/echo.js.map +0 -1
  384. package/dist/attributes/audio/filters/implementations/gain.d.ts +0 -10
  385. package/dist/attributes/audio/filters/implementations/gain.d.ts.map +0 -1
  386. package/dist/attributes/audio/filters/implementations/gain.js +0 -6
  387. package/dist/attributes/audio/filters/implementations/gain.js.map +0 -1
  388. package/dist/attributes/audio/filters/implementations/highpass.d.ts +0 -12
  389. package/dist/attributes/audio/filters/implementations/highpass.d.ts.map +0 -1
  390. package/dist/attributes/audio/filters/implementations/highpass.js +0 -10
  391. package/dist/attributes/audio/filters/implementations/highpass.js.map +0 -1
  392. package/dist/attributes/audio/filters/implementations/lowpass.d.ts +0 -12
  393. package/dist/attributes/audio/filters/implementations/lowpass.d.ts.map +0 -1
  394. package/dist/attributes/audio/filters/implementations/lowpass.js +0 -10
  395. package/dist/attributes/audio/filters/implementations/lowpass.js.map +0 -1
  396. package/dist/attributes/audio/filters/implementations/speed.d.ts +0 -18
  397. package/dist/attributes/audio/filters/implementations/speed.d.ts.map +0 -1
  398. package/dist/attributes/audio/filters/implementations/speed.js +0 -6
  399. package/dist/attributes/audio/filters/implementations/speed.js.map +0 -1
  400. package/dist/attributes/audio/filters/implementations/tremolo.d.ts +0 -12
  401. package/dist/attributes/audio/filters/implementations/tremolo.d.ts.map +0 -1
  402. package/dist/attributes/audio/filters/implementations/tremolo.js +0 -10
  403. package/dist/attributes/audio/filters/implementations/tremolo.js.map +0 -1
  404. package/dist/attributes/audio/filters/index.d.ts +0 -22
  405. package/dist/attributes/audio/filters/index.d.ts.map +0 -1
  406. package/dist/attributes/audio/filters/index.js +0 -8
  407. package/dist/attributes/audio/filters/index.js.map +0 -1
  408. package/dist/attributes/audio/filters/registry.d.ts +0 -36
  409. package/dist/attributes/audio/filters/registry.d.ts.map +0 -1
  410. package/dist/attributes/audio/filters/registry.js +0 -82
  411. package/dist/attributes/audio/filters/registry.js.map +0 -1
  412. package/dist/attributes/audio/filters/union.d.ts +0 -18
  413. package/dist/attributes/audio/filters/union.d.ts.map +0 -1
  414. package/dist/attributes/audio/filters/union.js +0 -28
  415. package/dist/attributes/audio/filters/union.js.map +0 -1
  416. package/dist/attributes/shape/sksl-uniforms.d.ts +0 -146
  417. package/dist/attributes/shape/sksl-uniforms.d.ts.map +0 -1
  418. package/dist/attributes/shape/sksl-uniforms.js +0 -0
  419. package/dist/attributes/shape/sksl-uniforms.js.map +0 -1
  420. package/dist/browser/chunks/chunk-AOT33LMS.js.map +0 -7
  421. package/dist/browser/chunks/chunk-GKM6UZJR.js.map +0 -7
  422. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +0 -7
  423. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +0 -7
  424. package/dist/component/api.d.ts +0 -508
  425. package/dist/component/api.d.ts.map +0 -1
  426. package/dist/component/api.js +0 -4
  427. package/dist/component/api.js.map +0 -1
  428. package/dist/component/builtins/audio.d.ts +0 -26
  429. package/dist/component/builtins/audio.d.ts.map +0 -1
  430. package/dist/component/builtins/audio.js +0 -41
  431. package/dist/component/builtins/audio.js.map +0 -1
  432. package/dist/component/builtins/canvas3d.d.ts +0 -98
  433. package/dist/component/builtins/canvas3d.d.ts.map +0 -1
  434. package/dist/component/builtins/canvas3d.js +0 -21
  435. package/dist/component/builtins/canvas3d.js.map +0 -1
  436. package/dist/component/builtins/composite.d.ts +0 -56
  437. package/dist/component/builtins/composite.d.ts.map +0 -1
  438. package/dist/component/builtins/composite.js +0 -25
  439. package/dist/component/builtins/composite.js.map +0 -1
  440. package/dist/component/builtins/geometry.d.ts +0 -505
  441. package/dist/component/builtins/geometry.d.ts.map +0 -1
  442. package/dist/component/builtins/geometry.js +0 -107
  443. package/dist/component/builtins/geometry.js.map +0 -1
  444. package/dist/component/builtins/layout.d.ts +0 -88
  445. package/dist/component/builtins/layout.d.ts.map +0 -1
  446. package/dist/component/builtins/layout.js +0 -84
  447. package/dist/component/builtins/layout.js.map +0 -1
  448. package/dist/component/builtins/media.d.ts +0 -95
  449. package/dist/component/builtins/media.d.ts.map +0 -1
  450. package/dist/component/builtins/media.js +0 -149
  451. package/dist/component/builtins/media.js.map +0 -1
  452. package/dist/component/builtins/providers.d.ts +0 -23
  453. package/dist/component/builtins/providers.d.ts.map +0 -1
  454. package/dist/component/builtins/providers.js +0 -30
  455. package/dist/component/builtins/providers.js.map +0 -1
  456. package/dist/component/builtins/text.d.ts +0 -193
  457. package/dist/component/builtins/text.d.ts.map +0 -1
  458. package/dist/component/builtins/text.js +0 -113
  459. package/dist/component/builtins/text.js.map +0 -1
  460. package/dist/component/builtins/three.d.ts +0 -1085
  461. package/dist/component/builtins/three.d.ts.map +0 -1
  462. package/dist/component/builtins/three.js +0 -265
  463. package/dist/component/builtins/three.js.map +0 -1
  464. package/dist/component/clip-of.d.ts +0 -5
  465. package/dist/component/clip-of.d.ts.map +0 -1
  466. package/dist/component/clip-of.js +0 -33
  467. package/dist/component/clip-of.js.map +0 -1
  468. package/dist/component/commands-for.d.ts +0 -19
  469. package/dist/component/commands-for.d.ts.map +0 -1
  470. package/dist/component/commands-for.js +0 -5
  471. package/dist/component/commands-for.js.map +0 -1
  472. package/dist/component/component-audio.d.ts +0 -9
  473. package/dist/component/component-audio.d.ts.map +0 -1
  474. package/dist/component/component-audio.js +0 -18
  475. package/dist/component/component-audio.js.map +0 -1
  476. package/dist/component/component2d.d.ts +0 -9
  477. package/dist/component/component2d.d.ts.map +0 -1
  478. package/dist/component/component2d.js +0 -239
  479. package/dist/component/component2d.js.map +0 -1
  480. package/dist/component/component3d.d.ts +0 -9
  481. package/dist/component/component3d.d.ts.map +0 -1
  482. package/dist/component/component3d.js +0 -99
  483. package/dist/component/component3d.js.map +0 -1
  484. package/dist/component/factory.d.ts +0 -63
  485. package/dist/component/factory.d.ts.map +0 -1
  486. package/dist/component/factory.js +0 -313
  487. package/dist/component/factory.js.map +0 -1
  488. package/dist/component/modules/aim.d.ts +0 -30
  489. package/dist/component/modules/aim.d.ts.map +0 -1
  490. package/dist/component/modules/aim.js +0 -39
  491. package/dist/component/modules/aim.js.map +0 -1
  492. package/dist/component/modules/corners.d.ts +0 -13
  493. package/dist/component/modules/corners.d.ts.map +0 -1
  494. package/dist/component/modules/corners.js +0 -12
  495. package/dist/component/modules/corners.js.map +0 -1
  496. package/dist/component/modules/flow.d.ts +0 -26
  497. package/dist/component/modules/flow.d.ts.map +0 -1
  498. package/dist/component/modules/flow.js +0 -55
  499. package/dist/component/modules/flow.js.map +0 -1
  500. package/dist/component/modules/material.d.ts +0 -40
  501. package/dist/component/modules/material.d.ts.map +0 -1
  502. package/dist/component/modules/material.js +0 -75
  503. package/dist/component/modules/material.js.map +0 -1
  504. package/dist/component/modules/paint.d.ts +0 -71
  505. package/dist/component/modules/paint.d.ts.map +0 -1
  506. package/dist/component/modules/paint.js +0 -106
  507. package/dist/component/modules/paint.js.map +0 -1
  508. package/dist/component/modules/shapes.d.ts +0 -31
  509. package/dist/component/modules/shapes.d.ts.map +0 -1
  510. package/dist/component/modules/shapes.js +0 -43
  511. package/dist/component/modules/shapes.js.map +0 -1
  512. package/dist/component/modules/text-layout.d.ts +0 -26
  513. package/dist/component/modules/text-layout.d.ts.map +0 -1
  514. package/dist/component/modules/text-layout.js +0 -57
  515. package/dist/component/modules/text-layout.js.map +0 -1
  516. package/dist/component/modules/text-style.d.ts +0 -48
  517. package/dist/component/modules/text-style.d.ts.map +0 -1
  518. package/dist/component/modules/text-style.js +0 -63
  519. package/dist/component/modules/text-style.js.map +0 -1
  520. package/dist/component/modules/three-entries.d.ts +0 -23
  521. package/dist/component/modules/three-entries.d.ts.map +0 -1
  522. package/dist/component/modules/three-entries.js +0 -41
  523. package/dist/component/modules/three-entries.js.map +0 -1
  524. package/dist/component/modules/view3d.d.ts +0 -55
  525. package/dist/component/modules/view3d.d.ts.map +0 -1
  526. package/dist/component/modules/view3d.js +0 -160
  527. package/dist/component/modules/view3d.js.map +0 -1
  528. package/dist/component/timeline.d.ts +0 -22
  529. package/dist/component/timeline.d.ts.map +0 -1
  530. package/dist/component/timeline.js +0 -128
  531. package/dist/component/timeline.js.map +0 -1
  532. package/dist/component/type-def.d.ts +0 -26
  533. package/dist/component/type-def.d.ts.map +0 -1
  534. package/dist/component/type-def.js +0 -16
  535. package/dist/component/type-def.js.map +0 -1
  536. package/dist/component/types.d.ts +0 -91
  537. package/dist/component/types.d.ts.map +0 -1
  538. package/dist/component/types.js +0 -88
  539. package/dist/component/types.js.map +0 -1
  540. package/dist/component/views.d.ts +0 -121
  541. package/dist/component/views.d.ts.map +0 -1
  542. package/dist/component/views.js +0 -413
  543. package/dist/component/views.js.map +0 -1
  544. package/dist/document/withdraw.d.ts +0 -28
  545. package/dist/document/withdraw.d.ts.map +0 -1
  546. package/dist/document/withdraw.js +0 -61
  547. package/dist/document/withdraw.js.map +0 -1
  548. package/dist/jsx/jsx-dev-runtime.d.ts +0 -3
  549. package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
  550. package/dist/jsx/jsx-dev-runtime.js +0 -3
  551. package/dist/jsx/jsx-dev-runtime.js.map +0 -1
  552. package/dist/jsx/jsx-runtime.d.ts +0 -27
  553. package/dist/jsx/jsx-runtime.d.ts.map +0 -1
  554. package/dist/jsx/jsx-runtime.js +0 -26
  555. package/dist/jsx/jsx-runtime.js.map +0 -1
  556. package/dist/nodes/2d/node-lifecycle.d.ts +0 -46
  557. package/dist/nodes/2d/node-lifecycle.d.ts.map +0 -1
  558. package/dist/nodes/2d/node-lifecycle.js +0 -264
  559. package/dist/nodes/2d/node-lifecycle.js.map +0 -1
  560. package/dist/nodes/2d/node-motion.d.ts +0 -56
  561. package/dist/nodes/2d/node-motion.d.ts.map +0 -1
  562. package/dist/nodes/2d/node-motion.js +0 -86
  563. package/dist/nodes/2d/node-motion.js.map +0 -1
  564. package/dist/nodes/2d/node-render.d.ts +0 -44
  565. package/dist/nodes/2d/node-render.d.ts.map +0 -1
  566. package/dist/nodes/2d/node-render.js +0 -80
  567. package/dist/nodes/2d/node-render.js.map +0 -1
  568. package/dist/nodes/2d/node-space.d.ts +0 -63
  569. package/dist/nodes/2d/node-space.d.ts.map +0 -1
  570. package/dist/nodes/2d/node-space.js +0 -131
  571. package/dist/nodes/2d/node-space.js.map +0 -1
  572. package/dist/nodes/2d/node-transform.d.ts +0 -55
  573. package/dist/nodes/2d/node-transform.d.ts.map +0 -1
  574. package/dist/nodes/2d/node-transform.js +0 -73
  575. package/dist/nodes/2d/node-transform.js.map +0 -1
  576. package/dist/nodes/2d/node2d.d.ts +0 -1111
  577. package/dist/nodes/2d/node2d.d.ts.map +0 -1
  578. package/dist/nodes/2d/node2d.js +0 -1665
  579. package/dist/nodes/2d/node2d.js.map +0 -1
  580. package/dist/nodes/2d/paint-node.d.ts +0 -142
  581. package/dist/nodes/2d/paint-node.d.ts.map +0 -1
  582. package/dist/nodes/2d/paint-node.js +0 -232
  583. package/dist/nodes/2d/paint-node.js.map +0 -1
  584. package/dist/nodes/audio/audio-bus.d.ts +0 -28
  585. package/dist/nodes/audio/audio-bus.d.ts.map +0 -1
  586. package/dist/nodes/audio/audio-bus.js +0 -33
  587. package/dist/nodes/audio/audio-bus.js.map +0 -1
  588. package/dist/nodes/audio/index.d.ts +0 -4
  589. package/dist/nodes/audio/index.d.ts.map +0 -1
  590. package/dist/nodes/audio/index.js +0 -2
  591. package/dist/nodes/audio/index.js.map +0 -1
  592. package/dist/nodes/audio/node-audio.d.ts +0 -107
  593. package/dist/nodes/audio/node-audio.d.ts.map +0 -1
  594. package/dist/nodes/audio/node-audio.js +0 -179
  595. package/dist/nodes/audio/node-audio.js.map +0 -1
  596. package/dist/nodes/audio/sound-node.d.ts +0 -41
  597. package/dist/nodes/audio/sound-node.d.ts.map +0 -1
  598. package/dist/nodes/audio/sound-node.js +0 -71
  599. package/dist/nodes/audio/sound-node.js.map +0 -1
  600. package/dist/nodes/geometry/boolean-node.d.ts +0 -28
  601. package/dist/nodes/geometry/boolean-node.d.ts.map +0 -1
  602. package/dist/nodes/geometry/boolean-node.js +0 -81
  603. package/dist/nodes/geometry/boolean-node.js.map +0 -1
  604. package/dist/nodes/geometry/bounds-shape-node.d.ts +0 -149
  605. package/dist/nodes/geometry/bounds-shape-node.d.ts.map +0 -1
  606. package/dist/nodes/geometry/bounds-shape-node.js +0 -181
  607. package/dist/nodes/geometry/bounds-shape-node.js.map +0 -1
  608. package/dist/nodes/geometry/box-path-node.d.ts +0 -89
  609. package/dist/nodes/geometry/box-path-node.d.ts.map +0 -1
  610. package/dist/nodes/geometry/box-path-node.js +0 -116
  611. package/dist/nodes/geometry/box-path-node.js.map +0 -1
  612. package/dist/nodes/geometry/ellipse-node.d.ts +0 -18
  613. package/dist/nodes/geometry/ellipse-node.d.ts.map +0 -1
  614. package/dist/nodes/geometry/ellipse-node.js +0 -45
  615. package/dist/nodes/geometry/ellipse-node.js.map +0 -1
  616. package/dist/nodes/geometry/group-bounds.d.ts +0 -56
  617. package/dist/nodes/geometry/group-bounds.d.ts.map +0 -1
  618. package/dist/nodes/geometry/group-bounds.js +0 -87
  619. package/dist/nodes/geometry/group-bounds.js.map +0 -1
  620. package/dist/nodes/geometry/mask-node.d.ts +0 -33
  621. package/dist/nodes/geometry/mask-node.d.ts.map +0 -1
  622. package/dist/nodes/geometry/mask-node.js +0 -66
  623. package/dist/nodes/geometry/mask-node.js.map +0 -1
  624. package/dist/nodes/geometry/path-node.d.ts +0 -26
  625. package/dist/nodes/geometry/path-node.d.ts.map +0 -1
  626. package/dist/nodes/geometry/path-node.js +0 -58
  627. package/dist/nodes/geometry/path-node.js.map +0 -1
  628. package/dist/nodes/geometry/polygon-node.d.ts +0 -26
  629. package/dist/nodes/geometry/polygon-node.d.ts.map +0 -1
  630. package/dist/nodes/geometry/polygon-node.js +0 -47
  631. package/dist/nodes/geometry/polygon-node.js.map +0 -1
  632. package/dist/nodes/geometry/polygram-node.d.ts +0 -33
  633. package/dist/nodes/geometry/polygram-node.d.ts.map +0 -1
  634. package/dist/nodes/geometry/polygram-node.js +0 -52
  635. package/dist/nodes/geometry/polygram-node.js.map +0 -1
  636. package/dist/nodes/geometry/rect-node.d.ts +0 -38
  637. package/dist/nodes/geometry/rect-node.d.ts.map +0 -1
  638. package/dist/nodes/geometry/rect-node.js +0 -56
  639. package/dist/nodes/geometry/rect-node.js.map +0 -1
  640. package/dist/nodes/geometry/shape-node.d.ts +0 -71
  641. package/dist/nodes/geometry/shape-node.d.ts.map +0 -1
  642. package/dist/nodes/geometry/shape-node.js +0 -140
  643. package/dist/nodes/geometry/shape-node.js.map +0 -1
  644. package/dist/nodes/geometry/shape-outline.d.ts +0 -93
  645. package/dist/nodes/geometry/shape-outline.d.ts.map +0 -1
  646. package/dist/nodes/geometry/shape-outline.js +0 -470
  647. package/dist/nodes/geometry/shape-outline.js.map +0 -1
  648. package/dist/nodes/index.d.ts +0 -53
  649. package/dist/nodes/index.d.ts.map +0 -1
  650. package/dist/nodes/index.js +0 -35
  651. package/dist/nodes/index.js.map +0 -1
  652. package/dist/nodes/layout/camera-node.d.ts +0 -80
  653. package/dist/nodes/layout/camera-node.d.ts.map +0 -1
  654. package/dist/nodes/layout/camera-node.js +0 -153
  655. package/dist/nodes/layout/camera-node.js.map +0 -1
  656. package/dist/nodes/layout/orbit-camera-node.d.ts +0 -80
  657. package/dist/nodes/layout/orbit-camera-node.d.ts.map +0 -1
  658. package/dist/nodes/layout/orbit-camera-node.js +0 -118
  659. package/dist/nodes/layout/orbit-camera-node.js.map +0 -1
  660. package/dist/nodes/layout/rotated-box.d.ts +0 -20
  661. package/dist/nodes/layout/rotated-box.d.ts.map +0 -1
  662. package/dist/nodes/layout/rotated-box.js +0 -76
  663. package/dist/nodes/layout/rotated-box.js.map +0 -1
  664. package/dist/nodes/media/video-node.d.ts +0 -229
  665. package/dist/nodes/media/video-node.d.ts.map +0 -1
  666. package/dist/nodes/media/video-node.js +0 -350
  667. package/dist/nodes/media/video-node.js.map +0 -1
  668. package/dist/nodes/node/declare-paints.d.ts +0 -19
  669. package/dist/nodes/node/declare-paints.d.ts.map +0 -1
  670. package/dist/nodes/node/declare-paints.js +0 -27
  671. package/dist/nodes/node/declare-paints.js.map +0 -1
  672. package/dist/nodes/node/node-editor-state.d.ts +0 -53
  673. package/dist/nodes/node/node-editor-state.d.ts.map +0 -1
  674. package/dist/nodes/node/node-editor-state.js +0 -23
  675. package/dist/nodes/node/node-editor-state.js.map +0 -1
  676. package/dist/nodes/node/node-reactive.d.ts +0 -89
  677. package/dist/nodes/node/node-reactive.d.ts.map +0 -1
  678. package/dist/nodes/node/node-reactive.js +0 -135
  679. package/dist/nodes/node/node-reactive.js.map +0 -1
  680. package/dist/nodes/node/node-time.d.ts +0 -39
  681. package/dist/nodes/node/node-time.d.ts.map +0 -1
  682. package/dist/nodes/node/node-time.js +0 -14
  683. package/dist/nodes/node/node-time.js.map +0 -1
  684. package/dist/nodes/node/node-walk.d.ts +0 -46
  685. package/dist/nodes/node/node-walk.d.ts.map +0 -1
  686. package/dist/nodes/node/node-walk.js +0 -74
  687. package/dist/nodes/node/node-walk.js.map +0 -1
  688. package/dist/nodes/node/node.d.ts +0 -445
  689. package/dist/nodes/node/node.d.ts.map +0 -1
  690. package/dist/nodes/node/node.js +0 -745
  691. package/dist/nodes/node/node.js.map +0 -1
  692. package/dist/nodes/node/text-defaults.d.ts +0 -32
  693. package/dist/nodes/node/text-defaults.d.ts.map +0 -1
  694. package/dist/nodes/node/text-defaults.js +0 -37
  695. package/dist/nodes/node/text-defaults.js.map +0 -1
  696. package/dist/nodes/root/canvas2d-node.d.ts +0 -163
  697. package/dist/nodes/root/canvas2d-node.d.ts.map +0 -1
  698. package/dist/nodes/root/canvas2d-node.js +0 -264
  699. package/dist/nodes/root/canvas2d-node.js.map +0 -1
  700. package/dist/nodes/root/provider-node.d.ts +0 -47
  701. package/dist/nodes/root/provider-node.d.ts.map +0 -1
  702. package/dist/nodes/root/provider-node.js +0 -63
  703. package/dist/nodes/root/provider-node.js.map +0 -1
  704. package/dist/nodes/root/theme-provider-node.d.ts +0 -29
  705. package/dist/nodes/root/theme-provider-node.d.ts.map +0 -1
  706. package/dist/nodes/root/theme-provider-node.js +0 -43
  707. package/dist/nodes/root/theme-provider-node.js.map +0 -1
  708. package/dist/nodes/text/default-text-style-node.d.ts +0 -103
  709. package/dist/nodes/text/default-text-style-node.d.ts.map +0 -1
  710. package/dist/nodes/text/default-text-style-node.js +0 -146
  711. package/dist/nodes/text/default-text-style-node.js.map +0 -1
  712. package/dist/nodes/text/number-format.d.ts +0 -66
  713. package/dist/nodes/text/number-format.d.ts.map +0 -1
  714. package/dist/nodes/text/number-format.js +0 -227
  715. package/dist/nodes/text/number-format.js.map +0 -1
  716. package/dist/nodes/text/number-node.d.ts +0 -94
  717. package/dist/nodes/text/number-node.d.ts.map +0 -1
  718. package/dist/nodes/text/number-node.js +0 -86
  719. package/dist/nodes/text/number-node.js.map +0 -1
  720. package/dist/nodes/text/number-pattern.d.ts +0 -51
  721. package/dist/nodes/text/number-pattern.d.ts.map +0 -1
  722. package/dist/nodes/text/number-pattern.js +0 -77
  723. package/dist/nodes/text/number-pattern.js.map +0 -1
  724. package/dist/nodes/text/richtext-node.d.ts +0 -68
  725. package/dist/nodes/text/richtext-node.d.ts.map +0 -1
  726. package/dist/nodes/text/richtext-node.js +0 -78
  727. package/dist/nodes/text/richtext-node.js.map +0 -1
  728. package/dist/nodes/text/text-base.d.ts +0 -118
  729. package/dist/nodes/text/text-base.d.ts.map +0 -1
  730. package/dist/nodes/text/text-base.js +0 -153
  731. package/dist/nodes/text/text-base.js.map +0 -1
  732. package/dist/nodes/text/text-layout.d.ts +0 -87
  733. package/dist/nodes/text/text-layout.d.ts.map +0 -1
  734. package/dist/nodes/text/text-layout.js +0 -368
  735. package/dist/nodes/text/text-layout.js.map +0 -1
  736. package/dist/nodes/text/text-node.d.ts +0 -84
  737. package/dist/nodes/text/text-node.d.ts.map +0 -1
  738. package/dist/nodes/text/text-node.js +0 -188
  739. package/dist/nodes/text/text-node.js.map +0 -1
  740. package/dist/nodes/text/text-selection.d.ts +0 -125
  741. package/dist/nodes/text/text-selection.d.ts.map +0 -1
  742. package/dist/nodes/text/text-selection.js +0 -209
  743. package/dist/nodes/text/text-selection.js.map +0 -1
  744. package/dist/nodes/three/camera-nodes.d.ts +0 -109
  745. package/dist/nodes/three/camera-nodes.d.ts.map +0 -1
  746. package/dist/nodes/three/camera-nodes.js +0 -112
  747. package/dist/nodes/three/camera-nodes.js.map +0 -1
  748. package/dist/nodes/three/canvas3d-node.d.ts +0 -295
  749. package/dist/nodes/three/canvas3d-node.d.ts.map +0 -1
  750. package/dist/nodes/three/canvas3d-node.js +0 -486
  751. package/dist/nodes/three/canvas3d-node.js.map +0 -1
  752. package/dist/nodes/three/drawable-nodes.d.ts +0 -173
  753. package/dist/nodes/three/drawable-nodes.d.ts.map +0 -1
  754. package/dist/nodes/three/drawable-nodes.js +0 -284
  755. package/dist/nodes/three/drawable-nodes.js.map +0 -1
  756. package/dist/nodes/three/environment-nodes.d.ts +0 -106
  757. package/dist/nodes/three/environment-nodes.d.ts.map +0 -1
  758. package/dist/nodes/three/environment-nodes.js +0 -134
  759. package/dist/nodes/three/environment-nodes.js.map +0 -1
  760. package/dist/nodes/three/geometry-nodes.d.ts +0 -197
  761. package/dist/nodes/three/geometry-nodes.d.ts.map +0 -1
  762. package/dist/nodes/three/geometry-nodes.js +0 -322
  763. package/dist/nodes/three/geometry-nodes.js.map +0 -1
  764. package/dist/nodes/three/grid-geometry3d.d.ts +0 -62
  765. package/dist/nodes/three/grid-geometry3d.d.ts.map +0 -1
  766. package/dist/nodes/three/grid-geometry3d.js +0 -114
  767. package/dist/nodes/three/grid-geometry3d.js.map +0 -1
  768. package/dist/nodes/three/group3d.d.ts +0 -23
  769. package/dist/nodes/three/group3d.d.ts.map +0 -1
  770. package/dist/nodes/three/group3d.js +0 -21
  771. package/dist/nodes/three/group3d.js.map +0 -1
  772. package/dist/nodes/three/light-nodes.d.ts +0 -120
  773. package/dist/nodes/three/light-nodes.d.ts.map +0 -1
  774. package/dist/nodes/three/light-nodes.js +0 -173
  775. package/dist/nodes/three/light-nodes.js.map +0 -1
  776. package/dist/nodes/three/mesh3d.d.ts +0 -117
  777. package/dist/nodes/three/mesh3d.d.ts.map +0 -1
  778. package/dist/nodes/three/mesh3d.js +0 -147
  779. package/dist/nodes/three/mesh3d.js.map +0 -1
  780. package/dist/nodes/three/node3d.d.ts +0 -230
  781. package/dist/nodes/three/node3d.d.ts.map +0 -1
  782. package/dist/nodes/three/node3d.js +0 -337
  783. package/dist/nodes/three/node3d.js.map +0 -1
  784. package/dist/render/descriptors/latex.d.ts +0 -6
  785. package/dist/render/descriptors/latex.d.ts.map +0 -1
  786. package/dist/render/descriptors/latex.js +0 -2
  787. package/dist/render/descriptors/latex.js.map +0 -1
  788. package/dist/tween/seekable.d.ts +0 -81
  789. package/dist/tween/seekable.d.ts.map +0 -1
  790. package/dist/tween/seekable.js +0 -137
  791. package/dist/tween/seekable.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{$b as Qs,$c as lo,Ac as lr,Ae as Or,Bc as jt,Be as No,Cb as ir,Ce as lt,Dc as fr,De as Ro,Eb as ar,Ec as ke,Ee as qt,F as Vs,Fb as he,Fc as Vt,Fd as I,Fe as zo,Gb as B,Gc as oo,Gd as vr,Ge as Lo,Ha as zt,Hb as ce,Hd as Xt,He as Bo,Ia as Ys,Ib as cr,Ic as Z,Id as _o,Jc as hr,Jd as wo,Je as ft,Kb as dr,Ke as P,La as tr,Le as w,Ma as ve,Md as xo,Me as Ht,Nd as E,Ne as me,Ob as it,Od as k,Oe as Jt,Pb as ur,Pd as Se,Pe as jo,Qb as Js,Qc as pr,Qd as Be,Qe as ge,Re as Vo,Sc as mr,Sd as j,Se as Zt,Tc as io,Td as K,Te as Ko,Uc as ao,Ud as R,Ue as Uo,Vc as co,Wa as rr,Wc as gr,Wd as vo,We as Go,X as Qn,Xc as Kt,Xd as F,Xe as Yo,Ya as rt,Yb as at,Yc as uo,Yd as $,Ye as Xo,Zb as Zs,Zc as Ut,Zd as Q,Ze as Wo,_b as ne,_c as yr,_d as T,ac as ct,ad as N,ae as bo,bc as Le,be as ko,ca as er,cc as Lt,ce as So,dc as be,dd as ut,de as Wt,eb as sr,ec as Ce,ed as _r,ee as Ao,f as qn,fc as pe,fd as wr,fe as Mo,ga as Ks,gb as or,gc as Bt,gd as xr,ge as br,ha as Us,hb as st,hc as dt,ia as nt,id as fo,ie as Oo,jc as eo,jd as ho,je as Eo,kc as to,ke as To,ld as Gt,m as Zn,mb as ot,md as Yt,oc as no,pd as go,qa as Gs,qb as Xs,qd as yo,qe as kr,rb as Y,rc as Pe,re as Sr,sb as Ws,sc as ro,se as Ar,ta as fe,te as Io,ue as Do,vb as qs,ve as Fo,wb as Hs,we as $o,yc as so,zb as Te,ze as Mr}from"./chunk-GKM6UZJR.js";import{b as Co,f as Po}from"./chunk-LKUYVFU3.js";import{b as js,d as Hn,f as Jn,h as ze,m as nr,n as po,o as mo}from"./chunk-ZRPZPWZU.js";function qo(n){return Number.isFinite(n)&&n>0?n:1}function je(n,e,t=e){return ot(n)?qs(n,e,t):Math.max(0,Math.min(t,e))/qo(n)}function fd(n,e,t){return ot(n)?Hs(n,e,t):Math.max(0,Math.min(e,t*qo(n)))}function hd(n,e){let t=Math.max(0,(n.trimEnd??e)-(n.trimStart??0));return je(n.speed??1,t)}function Ho(n,e,t,r){let s=n.at??0,o=n.until??1/0,i=n.trimStart??0,a=n.trimEnd??1/0,c=n.loop??!1,d=Te(n.effects),u=e.getMediaDuration(n.src),l=n.speed??1;c&&ot(l)&&(l=Xs(l,1));let f=Math.max(0,(Number.isFinite(a)?a:u)-i),h={id:`${t}|${n.src}|${s}|${r}`,src:n.src,startAt:s,endAt:1/0,trimStart:i,volume:n.volume??1,speed:l,loop:c,ownerId:t};if(ot(l)&&(h.sourceLength=f),d.length>0&&(h.effects=d),n.transitionIn&&(h.transitionIn=n.transitionIn),n.transitionOut&&(h.transitionOut=n.transitionOut),n.bus&&(h.bus=n.bus),n.optional&&(h.optional=!0),c&&a>i&&Number.isFinite(a)&&(h.trimEnd=a),c&&Number.isFinite(o))h.endAt=o;else if(c)h.open=!0;else if(Number.isFinite(a))h.endAt=Math.min(o,s+je(l,f));else{let p=je(l,f);Number.isFinite(o)?h.endAt=Math.min(o,s+p):(h.open=!0,h.mediaDuration=p)}return h}var Er=class{src;volume;speed;loop;trimStart;trimEnd;effects;constructor(e){this.src=e.src,this.volume=e.volume??1,this.speed=e.speed??1,this.loop=e.loop??!1,this.trimStart=e.trimStart??0,this.trimEnd=e.trimEnd??e.duration??1/0,this.effects=Te(e.effects)}clipDurationFor(e){return je(this.speed,e)}sceneDurationFor(e){return this.clipDurationFor(e)}get clipDuration(){return this.trimEnd!==1/0?this.clipDurationFor(this.trimEnd-this.trimStart):void 0}};function ht(n){return!n||n.length===0?"":n.map(e=>{switch(e.type){case"gain":return`gain:${Y(e.value)}`;case"highpass":case"lowpass":return`${e.type}:${Y(e.frequency)}:${Y(e.q)}`;case"tremolo":return`tremolo:${Y(e.rate)}:${Y(e.depth)}`;case"echo":return`echo:${Y(e.delay)}:${Y(e.feedback)}:${Y(e.mix)}`}}).join("|")}var pd=n=>Math.sin(Math.max(0,Math.min(1,n))*Math.PI/2),Jo=new WeakMap;function Zo(n){let e=n.curve;if(e===void 0||e==="equalPower")return pd;let t=Jo.get(e);return t||Jo.set(e,t=st(e)),t}function md(n,e,t){let r={in:Math.max(0,e?.duration??0),out:Math.max(0,t?.duration??0)};if(!Number.isFinite(n))return{in:r.in,out:0};let s=r.in+r.out;if(s<=n||s===0)return r;let o=Math.max(0,n)/s;return{in:r.in*o,out:r.out*o}}function Tp(n,e,t,r){let s=md(e,t,r),o=1;return t&&s.in>0&&n<s.in&&(o*=Math.max(0,Zo(t)(Math.max(0,n)/s.in))),r&&s.out>0&&n>e-s.out&&(o*=Math.max(0,Zo(r)(Math.max(0,e-n)/s.out))),o}function Ve(n){return n?`${n.duration}:${typeof n.curve=="object"?JSON.stringify(n.curve):n.curve??"equalPower"}`:"_"}function Tr(n){return`${n.id}:${Y(n.volume)}:${Y(n.pan)}:${n.mute?1:0}:${ht(n.effects)}:${Ve(n.transitionIn)}:${Ve(n.transitionOut)}:${n.startAt}:${n.endAt}`}var gd=new Set(["number","slider","angle","hue","boolean","color","vector","point"]);function hm(n){return gd.has(n.kind)}var Qo=64,ei=64e3;function ti(n){if(typeof n!="object"||n===null)throw new Error("A shader pack must be an object.");let e=n,t=e.scope;if(t!=="fill"&&t!=="effect")throw new Error(`A shader pack needs scope "fill" or "effect", got ${JSON.stringify(t)}. The two are written against different contracts \u2014 a fill has no backdrop to sample and an effect has no shape box to map coordinates onto.`);let r=typeof e.source=="string"?e.source.trim():"";if(r==="")throw new Error(`Shader pack "${String(e.name??"?")}" has no source.`);if(r.length>ei)throw new Error(`Shader pack "${String(e.name??"?")}" source is ${r.length} characters, over the ${ei} ceiling.`);if(e.language!==void 0&&e.language!=="wgsl")throw new Error(`Shader pack "${String(e.name??"?")}" is written in ${JSON.stringify(e.language)}; only WGSL is supported. Port it to WGSL.`);let s={...typeof e.$kind=="string"?{$kind:e.$kind}:{},...typeof e.id=="string"?{id:e.id}:{},name:typeof e.name=="string"&&e.name!==""?e.name:"Shader",...typeof e.description=="string"?{description:e.description}:{},language:"wgsl",source:r,...mt(e.uniforms)?{uniforms:e.uniforms}:{},properties:yd(e.properties,String(e.name??"?"))};if(t==="fill"){let o=Array.isArray(e.textures)?e.textures.filter(i=>mt(i)&&typeof i.name=="string").map(i=>({name:i.name,...typeof i.description=="string"?{description:i.description}:{}})):[];return{...s,scope:"fill",...o.length?{textures:o}:{}}}return{...s,scope:"effect",...e.backdrop===!0?{backdrop:!0}:{}}}function yd(n,e){if(!mt(n))return{};let t={},r=new Map;for(let[s,o]of Object.entries(n)){if(Object.keys(t).length>=Qo){pt(`shader "${e}" declares more than ${Qo} properties; the rest are ignored.`);break}if(!mt(o)||typeof o.kind!="string"){pt(`shader "${e}" property "${s}" has no kind; ignored.`);continue}let i=o.inputs;if(!mt(i)||Object.keys(i).length===0){pt(`shader "${e}" property "${s}" names no uniform in "inputs"; ignored.`);continue}let a=!1;for(let c of Object.values(i)){if(typeof c!="string"){pt(`shader "${e}" property "${s}" has a non-string uniform name; ignored.`),a=!0;break}let d=r.get(c);if(d!==void 0){pt(`shader "${e}" properties "${d}" and "${s}" both write uniform "${c}"; "${s}" ignored.`),a=!0;break}r.set(c,s)}a||(t[s]=o)}return t}function mt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Qt=new Set;function pt(n){Qt.has(n)||(Qt.size>256&&Qt.clear(),Qt.add(n),console.warn(`[shader] ${n}`))}function ye(n,e){return n===""?String(e):`${n}.${e}`}function Cr(n,e){n.declareAssets(e)}function Pr(n,e){if(!n.mounted)return;Cr(n,e);let t=n._allChildren;for(let r=0;r<t.length;r++)Pr(t[r],e)}function ni(n,e){n.attachDetached(e)}function en(n){n._sample();for(let e of n.children)en(e)}function tn(n,e){n._primeMotion(e);for(let t of n.children)tn(t,e)}function Ir(n,e){let t=r=>{let s=r.key!==void 0?e?.[r.key]:void 0;r._setEditorState(s?.hidden===!0,s?.locked===!0);for(let o of r._allChildren)t(o)};t(n)}var Ie=class extends N{constructor(e){super(e)}zoomTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}panTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}orbitTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}dollyTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}headingTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}fillTo(e){let t=this.fill,r=ve.resolve(e.data),s=e.lerp??ve.lerp;return this.command(o=>({fill:s(t,r,o)}),e.duration,e.easing)}overlayTo(e){let t=this.overlay,r=ve.resolve(e.data),s=e.lerp??ve.lerp;return this.command(o=>({overlay:s(t,r,o)}),e.duration,e.easing)}flowArrangement(){return this}shapeGraphics(){return new nt().rect({width:this.layoutBounds.width,height:this.layoutBounds.height})}renderSelf(e){let t=this.fill;t.length!==0&&e.draw(this.shapeGraphics().fill(t))}renderOverlay(e){let t=this.overlay;t.length!==0&&e.draw(this.shapeGraphics().fill(t))}acceptsChild(e){return e.dimension==="2d"||e.dimension==="audio"}get _childTrees(){return["2d","audio"]}get childrenAudio(){return this._allChildren.filter(e=>e instanceof ut)}declareAssets(e){super.declareAssets(e),e.fill(this.fill),e.fill(this.overlay)}clipSelf(){return new gr().rect({width:this.layoutBounds.width,height:this.layoutBounds.height})}_cameraScope(){return this.space3D||this.zoom===1&&this.heading===0&&this.lookAt.x===0&&this.lookAt.y===0?null:{lookAt:this.lookAt,zoom:this.zoom,heading:this.heading}}_spaceCamera(){if(!this.space3D)return null;let e=this.layoutBounds;return{perspective:this.perspective,orbit:this.orbit,elevation:this.elevation,dolly:this.dolly,lookAt:this.lookAt,zoom:this.zoom,heading:this.heading,viewportX:e?.x??0,viewportY:-(e?.y??0)}}_projection(){return this.space3D?dr:super._projection()}renderChildren(e){let t=this._spaceCamera();if(t){this._renderInSpace(e,Kt(this,t));return}if(this.zoom===1&&this.heading===0&&this.lookAt.x===0&&this.lookAt.y===0){super.renderChildren(e);return}let r=this.layoutBounds,s=r?.width??0,o=r?.height??0,i=r?.x??0,a=r?.y??0;e.beginCamera({x:i,y:-a,width:s,height:o},this.lookAt,this.zoom,this.heading);for(let c of this._children)c instanceof N&&c.render(e);e.endCamera()}};Zs(Ie,{fill:mr(),overlay:mr(),flow:ao(),gap:ne({default:0}),wrap:ne({default:!1}),crossGap:ne({default:void 0}),columns:ne({default:1}),align:io(),zoom:ne({default:1}),lookAt:ne({default:{x:0,y:0},tween:it}),heading:ne({default:0}),space3D:ne({default:!1}),orbit:ne({default:0}),elevation:ne({default:0}),dolly:ne({default:0}),zoomTo:ke({args:[{key:"zoom",kind:"number",min:.01,step:.1,unit:"\xD7"}]}),panTo:ke({args:[{key:"lookAt",kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"},z:{kind:"number"}}}]}),orbitTo:ke({args:[{key:"orbit",kind:"number",step:1,unit:"\xB0"},{key:"elevation",kind:"number",step:1,unit:"\xB0"}]}),dollyTo:ke({args:[{key:"dolly",kind:"number",step:10}]}),headingTo:ke({args:[{key:"heading",kind:"number",step:1,unit:"\xB0"}]}),fillTo:ke(),overlayTo:ke()});var rn={cornerRadius:k.number(0),cornerStyle:k.custom("rounded",{lerp:qn})},ri=E({key:"rect",state:{...F,...j,...Se},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Be(n.size,e))}),si=E({key:"ellipse",state:{...F,...j,startAngle:k.number(0),sweep:k.number(360),ratio:k.number(0)},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,bo(n.size,e))}),oi=E({key:"polygon",state:{...F,...j,sides:k.number(5),...rn},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,ko(n.size,e))}),ii=E({key:"polygram",state:{...F,...j,sides:k.number(5),ratio:k.number(.5),...rn},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,So(n.size,e))}),ai=E({key:"path",state:{...F,...j,data:k.path},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Ao(n.size,e.data),{clipShape:Wt(n.size)})}),pg=E({key:"facePath",state:{...F,...j,data:k.path},defaults:{width:"hug",height:"hug"},commands:{...$},measure:(n,e)=>{let t=nr.size(e.data),r=e.padding;return{width:t.width+r.left+r.right,height:t.height+r.top+r.bottom}},layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Mo(e.data),{clipShape:null})});function yt(n,e){return E({key:n,state:{...F,...j,...rn},commands:{...$},measure:(t,r,s)=>K(t,r,s,T(r)),layout:(t,r,s)=>R(t,r,s,T(r)),render:(t,r)=>Q(t,r,br(e,t.size,r),{clipShape:Wt(t.size)})})}var mg=yt("triangle","triangle"),gg=yt("rightTriangle","rightTriangle"),yg=yt("pentagon","pentagon"),_g=yt("hexagon","hexagon"),wg=yt("octagon","octagon"),xg=E({key:"star",state:{...F,...j,...rn,points:k.number(mo),ratio:k.number(po)},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,br("star",n.size,{cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle,sides:Math.max(3,Math.round(e.points)),ratio:e.ratio}),{clipShape:Wt(n.size)})});var ci=E({key:"boolean",state:{...F,...j,op:k.oneOf(["union","subtract","intersect","exclude"])},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>n.merge(e.op,e)}),di=E({key:"mask",state:{mode:k.oneOf(["alpha","vector","luminance"]),inverted:!1},render:(n,e)=>n.mask(e)});var fi=E({key:"camera",state:{...F,...j,...Oo,...Se},commands:{...$,...Eo},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Be(n.size,e),{children:()=>To(n,e)})}),ui={lookAt:k.custom({x:0,y:0},{lerp:it,kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"},z:{kind:"number"}}}),zoom:k.number(1,{min:.01,step:.1,unit:"\xD7"}),heading:k.number(0,{step:1,unit:"\xB0"}),orbit:k.number(0,{step:1,unit:"\xB0"}),elevation:k.number(0,{step:1,unit:"\xB0"}),dolly:k.number(0,{step:10}),orbitSpeed:k.number(0)},hi=E({key:"orbitCamera",state:ui,defaults:{width:"hug",height:"hug",perspective:1e3},commands:vo(ui,{orbitTo:{args:["orbit","elevation"]},dollyTo:{args:["dolly"]},zoomTo:{args:["zoom"]},panTo:{args:["lookAt"]},headingTo:{args:["heading"]}}),render:(n,e)=>n.space({perspective:e.perspective,orbit:e.orbit+e.orbitSpeed*n.time.total,elevation:e.elevation,dolly:e.dolly,lookAt:e.lookAt,zoom:e.zoom,heading:e.heading,viewportX:0,viewportY:0})}),pi=E({key:"rotated-box",state:{angle:k.number(-90)},defaults:{rotation:n=>n.angle},measure:(n,e,t)=>{let{cos:r,sin:s}=li(e.angle),{width:o,height:i}=n.max,a=Math.abs(e.angle%180)===90,c=o!==void 0&&i!==void 0?{width:o*r+i*s,height:o*s+i*r}:{width:a?i:o,height:a?o:i},d=0,u=0;for(let l of t){let f=l.measure(c);d=Math.max(d,f.width),u=Math.max(u,f.height)}return{width:d*r+u*s,height:d*s+u*r}},layout:(n,e,t)=>{let{cos:r,sin:s}=li(e.angle),o={x:0,y:0,width:n.width*r+n.height*s,height:n.width*s+n.height*r};return R(o,e,t)}});function li(n){let e=n*(Math.PI/180);return{cos:Math.abs(Math.cos(e)),sin:Math.abs(Math.sin(e))}}var{overlay:Bg,...Rr}=F,{overlayTo:jg,...zr}=$,Nr=n=>n.fontSize==="autofit"?"fill":"hug",_d=[];function wd(n){return n==null?null:n instanceof Us?n.toCommands():n}function xd(n){return Array.isArray(n)?n.map(({fill:e,stroke:t,...r})=>({...r,...e===void 0?{}:{fill:ve.resolve(e)},...t===void 0?{}:{stroke:rr.resolve(t)}})):[]}var vd={...Rr,...qt,text:k.text("",{typing:!0}),wrap:!1,path:k.custom(null,{resolve:wd}),runs:k.custom([],{resolve:xd,animatable:!1})},Fr=n=>({text:n.text,wraps:n.wrap,glyphPath:n.path,runs:n.runs}),sn=E({key:"text",allowedChildren:[],state:vd,defaults:{width:n=>n.fontSize==="autofit"||n.wrap?"fill":"hug",height:Nr},commands:{...zr,append:{args:{text:k.text("",{multiline:!0})},run:(n,e)=>n.tween({text:e.text+n.args.text})},prepend:{args:{text:k.text("",{multiline:!0})},run:(n,e)=>n.tween({text:n.args.text+e.text})}},load:(n,e)=>Ar(n,e,Fr(e)),measure:(n,e)=>kr(n,e,Fr(e)),render:(n,e)=>Sr(n,e,Fr(e))}),bd={...Rr,...qt,value:0,format:k.custom("number"),customPattern:"",fractionDigits:0,grouped:!0,currencySymbol:"$"},$r=n=>({text:Co(n.value,Po(n)),wraps:!1,glyphPath:null,runs:_d}),mi=E({key:"number",allowedChildren:[],state:bd,defaults:{width:Nr,height:Nr},commands:{...zr,countTo:{args:["value"]}},load:(n,e)=>Ar(n,e,$r(e)),measure:(n,e)=>kr(n,e,$r(e)),render:(n,e)=>Sr(n,e,$r(e))}),{verticalAlign:Vg,textDecoration:Kg,textCase:Ug,minFontSize:Gg,...kd}=qt,gi=E({key:"richtext",allowedChildren:[],state:{...Rr,...kd,fontSize:k.number(48,{inherit:Ro("fontSize",{autofit:!1})}),spans:k.custom([],{resolve:n=>n==null?[]:Array.isArray(n)?n:[n]})},defaults:{width:"hug",height:"hug"},commands:{...zr},load:(n,e)=>$o(n,e),measure:(n,e)=>Do(n,e),render:(n,e)=>Fo(n,e)}),yi=E({key:"default-text-style",state:zo,provide:(n,e)=>Lo(n,e),render:(n,e)=>n.textStyle(Bo(e),()=>n.children())});var _i=E({key:"provider",state:{context:k.custom(void 0),value:k.custom(void 0)},provide:n=>n.context?[lt(n.context,n.value!==void 0?n.value:n.context.defaultValue)]:[]}),wi=E({key:"theme-provider",state:{theme:k.custom(void 0),data:k.custom(void 0),seed:k.custom(void 0)},provide:(n,e)=>{let t=[];return n.theme&&t.push(lt(Mr,{...e(Mr),...n.theme})),n.data&&t.push(lt(Or,{...e(Or),...n.data})),n.seed!==void 0&&t.push(lt(No,n.seed)),t}});var xi=ft({key:"sound",state:{src:k.custom(void 0),trimStart:0,trimEnd:k.custom(void 0),loop:!1,speed:k.custom(1,{lerp:Ws,kind:"audioParam"})},allowedChildren:[],commands:{play:(n,e)=>n.sound(e.src,{trimStart:e.trimStart,trimEnd:e.trimEnd,loop:e.loop,volume:e.volume,speed:e.speed,effects:e.effects,transitionIn:e.transitionIn,transitionOut:e.transitionOut})}}),vi=ft({key:"audioBus",state:{solo:!1}});var Sd={src:k.custom(void 0),fit:k.custom(void 0),crop:k.insets,zoom:1,anchor:k.alignment,matrix:k.custom(void 0),filters:k.custom([],{resolve:n=>er(n),lerp:Qn}),playing:!0,timestamp:k.custom(void 0),trimStart:k.custom(void 0),trimEnd:k.custom(void 0),speed:k.custom(void 0),loop:k.custom(void 0),duration:k.custom(void 0),volume:1,muted:!1,audioEffects:k.custom([],{resolve:n=>Te(n)}),bus:k.custom(void 0),segments:k.custom([])};function Ad(n,e){if(n.segments.length===0)return null;let t=0;for(let r of n.segments){if(e<=r.at)break;t+=Math.min(e-r.at,r.duration)*(r.speed??n.speed??1)}return t}function Md(n,e){let t=Ad(n,e);if(t===null)return;let r=n.trimStart??0,s=n.segments[0];return Ks(t+(s?s.from-r:0),r,n.trimEnd??1/0,n.loop,n.duration)}var Lr=new WeakMap;function Od(n,e,t){if(!e.src)return Lr.delete(n),null;let r=Md(e,t),s=e.crop,o=e.anchor,i=[e.src,e.fit??"",e.zoom,e.playing?1:0,s.left,s.right,s.top,s.bottom,o.x,o.y,e.timestamp??"",e.trimStart??"",e.trimEnd??"",e.speed??"",e.loop??"",e.duration??"",r??""].join("|"),a=Lr.get(n);if(a&&a.key===i)return a.fill;let c={type:"video",src:e.src,fit:e.fit,crop:e.crop,zoom:e.zoom,anchor:e.anchor,matrix:e.matrix,filters:e.filters,playing:e.playing,timestamp:e.timestamp??r,trimStart:e.trimStart,trimEnd:e.trimEnd,speed:e.speed,loop:e.loop,duration:e.duration},d=zt(c);return Lr.set(n,{key:i,fill:d}),d}var bi=E({key:"video",state:{...F,...j,...Se,...Sd},commands:{...$,play:{args:{from:k.custom(void 0),volume:k.custom(void 0),speed:k.custom(void 0)},run:(n,e)=>{let t=e,r=n.args.from!==void 0;if(!t.src||t.muted||!r&&!t.playing)return n.together([]);let s=n.args.speed??t.speed??1,o=!r&&(t.loop??"none")!=="none";return n.sound(t.src,{volume:n.args.volume??t.volume,loop:o,trimStart:r?n.args.from:t.trimStart,trimEnd:t.trimEnd,speed:s,effects:t.audioEffects,bus:t.bus,optional:!0,closed:!o})}}},load:(n,e)=>{e.src&&n.fill(zt({type:"video",src:e.src,filters:e.filters,trimStart:e.trimStart,trimEnd:e.trimEnd}))},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>{let t=e,r=Od(xo(n).host,t,n.time.elapsed),s={width:n.size.width,height:n.size.height,cornerRadius:t.cornerRadius,cornerStyle:t.cornerStyle,start:t.start,end:t.end};Q(n,e,Be(n.size,e),{fill:[r??Ys,...e.fill],overlay:()=>r?new nt().mask().rect(s).fill([r]).applyMask().rect(s).fill(e.overlay).endMask():null})}});var De={orbit:0,elevation:0,distance:10};function ki(n){return n.orbit!==void 0||n.elevation!==void 0||n.distance!==void 0}function Br(n){let e=Z(n.target??0);if(!ki(n)){let i=n.lookAt??n.target;return{position:Z(n.position??0),lookAt:i===void 0?void 0:Z(i)}}let t=n.distance??De.distance,r=(n.orbit??De.orbit)*Math.PI/180,s=Ed(n.elevation??De.elevation,-89.9,89.9)*Math.PI/180,o=Math.cos(s)*t;return{position:{x:e.x+Math.sin(r)*o,y:e.y+Math.sin(s)*t,z:e.z+Math.cos(r)*o},lookAt:e}}function Ed(n,e,t){return n<e?e:n>t?t:n}var Si=P({key:"group3d"}),_t={geometry:w(),...Vo},Ai=P({key:"mesh3d",state:_t,render:(n,e)=>n.draw(Zt(e,e.geometry))}),Fe={startAngle:w(),sweep:w()},$e=["startAngle","sweep"];function ee(n,e,t,r){return P({key:n,state:{..._t,...t},render:(s,o)=>s.draw(Zt(o,ge(e,o,r)))})}var Mi=ee("box3d","box",{width:w(),height:w(),depth:w(),cornerRadius:w(),segments:w()},["width","height","depth","cornerRadius","segments"]),Oi=ee("sphere3d","sphere",{radius:w(),segments:w(),...Fe,startLatitude:w(),latitudeSweep:w()},["radius","segments","startLatitude","latitudeSweep",...$e]),Ei=ee("plane3d","plane",{width:w(),height:w(),segments:w()},["width","height","segments"]),Ti=ee("cylinder3d","cylinder",{radius:w(),height:w(),segments:w(),capped:w(),...Fe},["radius","height","segments","capped",...$e]),Ci=ee("cone3d","cone",{radius:w(),height:w(),segments:w(),capped:w(),...Fe},["radius","height","segments","capped",...$e]),Pi=ee("torus3d","torus",{radius:w(),thickness:w(),segments:w(),...Fe},["radius","thickness","segments",...$e]),Ii=ee("torus-knot3d","torusKnot",{radius:w(),thickness:w(),segments:w(),windings:w()},["radius","thickness","segments","windings"]),Di=ee("circle3d","circle",{radius:w(),segments:w(),...Fe},["radius","segments",...$e]),Fi=ee("ring3d","ring",{radius:w(),innerRadius:w(),segments:w(),...Fe},["radius","innerRadius","segments",...$e]),$i=ee("capsule3d","capsule",{radius:w(),height:w(),segments:w()},["radius","height","segments"]),Ni=P({key:"polyhedron3d",state:{..._t,shape:k.custom("icosahedron"),radius:w(),segments:w()},render:(n,e)=>n.draw(Zt(e,ge("polyhedron",e,["shape","radius","segments"])))}),Ri=ee("extrude3d","extrude",{path:w(),depth:w(),segments:w(),bevel:w()},["path","depth","segments","bevel"]),zi=ee("lathe3d","lathe",{points:w(),segments:w(),...Fe},["points","segments",...$e]),Li=ee("tube3d","tube",{points:w(),radius:w(),segments:w(),closed:w()},["points","radius","segments","closed"]),Bi=P({key:"instances3d",state:{..._t,instances:w(),colors:w()},render:(n,e)=>{!e.geometry||!e.instances?.length||n.draw(new fe().instances(e.geometry,Ko(e),e.instances,{colors:e.colors}))}}),ji=P({key:"points3d",state:_t,render:(n,e)=>{e.geometry&&n.draw(new fe().points(e.geometry,Uo(e)))}}),Vi=P({key:"line3d",state:{points:w(),geometry:w(),closed:k.custom(!1),segments:k.custom(!1),stroke:w(),opacity:w(),material:w()},render:(n,e)=>{!e.geometry&&!e.points?.length||n.draw(new fe().line({points:e.geometry?void 0:e.points,geometry:e.geometry,closed:e.closed,segments:e.segments,stroke:e.stroke,opacity:e.opacity,material:e.material}))}}),Ki=P({key:"sprite3d",state:{fill:k.custom(void 0,{lerp:Gs}),opacity:w(),material:w()},render:(n,e)=>n.draw(new fe().sprite({fill:e.fill,opacity:e.opacity,material:e.material}))}),Ui=P({key:"model3d",state:{src:w(),animation:w(),override:w()},render:(n,e)=>{e.src&&n.draw(new fe().model({src:e.src,animation:e.animation,override:e.override}))}}),vy=P({key:"modelView3d",state:{src:w(),animation:w(),override:w(),clip:"",clipTime:0},render:(n,e)=>{if(!e.src){n.draw(new fe().box({width:1,height:1,depth:1,material:{type:"basic",color:"#6b7280",wireframe:!0,transparent:!0,opacity:.7}}));return}n.draw(new fe().model({src:e.src,animation:{clip:Td(e.clip),time:e.clipTime},override:e.override}))}});function Td(n){let e=n.trim();if(e==="")return;let t=Number(e);return Number.isInteger(t)&&t>=0?t:e}var jr={shadow:!1},Gi=P({key:"ambient-light3d",state:{color:me(),intensity:w()},render:(n,e)=>n.light(ge("ambient",e,["color","intensity"]))}),Yi=P({key:"hemisphere-light3d",state:{sky:me(),ground:me(),intensity:w()},render:(n,e)=>n.light(ge("hemisphere",e,["sky","ground","intensity"]))}),Xi=P({key:"directional-light3d",state:{color:me(),intensity:w(),target:Jt("origin")},defaults:jr,render:(n,e)=>n.light(ge("directional",e,["color","intensity","target","shadow"]))}),Wi=P({key:"point-light3d",state:{color:me(),intensity:w(),distance:w(),decay:w()},defaults:jr,render:(n,e)=>n.light(ge("point",e,["color","intensity","distance","decay","shadow"]))}),qi=P({key:"spot-light3d",state:{color:me(),intensity:w(),distance:w(),angle:w(),penumbra:w(),decay:w(),target:Jt("origin")},defaults:jr,render:(n,e)=>n.light(ge("spot",e,["color","intensity","distance","angle","penumbra","decay","target","shadow"]))}),Hi=P({key:"area-light3d",state:{color:me(),intensity:w(),width:w(),height:w()},render:(n,e)=>n.light(ge("area",e,["color","intensity","width","height"]))}),Cd=["target","orbit","elevation","distance","fov","frustumHeight","near","far","zoom"],Pd=["orbit","elevation","distance"],Ji=P({key:"camera3d",state:{type:k.custom("perspective"),target:Jt("origin"),orbit:w(),elevation:w(),distance:w(),fov:w(),frustumHeight:w(),near:w(),far:w(),zoom:w()},commands:{orbitTo:{args:{orbit:Ht({step:1,unit:"\xB0"}),elevation:Ht({min:-89,max:89,step:1,unit:"\xB0"}),distance:Ht({min:.01,step:.1})},run:(n,e)=>{let t={orbit:e.orbit??De.orbit,elevation:e.elevation??De.elevation,distance:e.distance??De.distance};return n.animate(r=>{let s={};for(let o of Pd){let i=n.args[o];i!==void 0&&(s[o]=t[o]+(i-t[o])*r)}return s})}},lookTo:{args:["target"]}},render:(n,e)=>{let t={type:e.type};for(let r of Cd)e[r]!==void 0&&(t[r]=e[r]);n.camera(t)}}),Zi=P({key:"fog3d",state:{color:me(),near:w(),far:w(),density:w()},render:(n,e)=>{let t={};e.color!==void 0&&(t.color=e.color),e.density!==void 0?t.density=e.density:(e.near!==void 0&&(t.near=e.near),e.far!==void 0&&(t.far=e.far)),n.fog(t)}}),Qi=P({key:"environment3d",state:{src:w(),faces:w(),preset:w(),intensity:w(),background:w(),blur:w()},render:(n,e)=>{if(e.src===void 0&&e.faces===void 0&&e.preset===void 0)return n.environment(null);let t=jo(e,["src","faces","preset","intensity","background","blur"]);(e.rotationX||e.rotationY||e.rotationZ)&&(t.rotation=[e.rotationX,e.rotationY,e.rotationZ]),n.environment(t)}});var ea=E({key:"canvas3d",state:{...F,...j,...Se,...Go},defaults:{width:"fill",height:"fill"},commands:{...$,...Yo},allowedChildren:["2d","3d"],load:n=>Xo(n),measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Wo(n,e)});function Ke(n){return n.kind==="still"}function Oy(n){return n.kind==="composition"}function on(n){return n.kind==="audio"}function Id(n){return n.kind!=="still"}var b="";function U(n){let e=n;return{start:e.startAt??0,end:e.endAt??1/0}}function Ey(n,e){return Ue(new Map(n.map(t=>[t.id,t])),e)}function ta(n){let e=new Map(n.map(o=>[o.id,o])),t=new Map,r=[],s=new Set;for(let o of e.values()){if(t.has(o.id))continue;r.length=0,s.clear();let i,a=o;for(;a;){let c=t.get(a.id);if(c){i=c;break}if(s.has(a.id)){for(let d of r)t.set(d.id,Ue(e,d.id));r.length=0;break}r.push(a),s.add(a.id),a=a.parentId===null?void 0:e.get(a.parentId)}for(let c=r.length-1;c>=0;c--){let d=U(r[c]);i&&(d.start=Math.max(d.start,i.start),d.end=Math.min(d.end,i.end)),t.set(r[c].id,d),i=d}}return t}function Ue(n,e){let t=n.get(e);if(!t)return;let r=U(t),s=new Set;for(;t.parentId!==null&&!s.has(t.id);){s.add(t.id);let o=n.get(t.parentId);if(!o)break;let i=U(o);r.start=Math.max(r.start,i.start),r.end=Math.min(r.end,i.end),t=o}return r}function Ty(n){let{startAt:e,endAt:t,...r}=n;return r}function Dd(n){let e=n.duration??0;return e<=0||!n.loop||n.loop.count===null?e:e*eo(n.loop)}function de(n){if(!Id(n))return 0;if(n.duration!==void 0)return n.duration;let e=0;for(let t of n.commands)e=Math.max(e,t.at+Dd(t));for(let t of n.nodes)t.startAt!==void 0&&(e=Math.max(e,t.startAt)),t.endAt!==void 0&&Number.isFinite(t.endAt)&&(e=Math.max(e,t.endAt));return e}function Fd(n){return typeof n=="object"&&n!==null&&n.kind==="project"}function na(n,e={}){return Fd(n)?n:{kind:"project",...n.formatVersion!==void 0&&{formatVersion:n.formatVersion},name:e.name??"Untitled",fps:e.fps,viewport:e.viewport,theme:n.theme,tracks:[{id:"clip",clip:n,duration:de(n)}]}}var Kr=2,wt=class extends Error{version;supported;constructor(e,t=2){super(`This document is format ${e}, newer than this engine reads (format ${t}). Open it with a newer engine.`),this.name="DocumentTooNewError",this.version=e,this.supported=t}},ra=[{from:0,description:"Documents start carrying `formatVersion`; a clip's retired `constants` rows become `variables`.",clip:(n,e)=>{if(!Array.isArray(n.constants))return n;let{constants:t,...r}=n,s=Array.isArray(r.variables)?[...r.variables]:[];for(let o of t){if(typeof o!="object"||o===null){s.push(o);continue}let{kind:i,...a}=o;s.push(a)}return e("constants",`${t.length} constant row(s) moved into \`variables\`.`),{...r,variables:s}}},{from:1,description:'SkSL is retired: every shader fill, shader effect and shader pack written in it says `language: "sksl"`, the `sksl` effect key becomes `shader`, and `coords` is dropped.',clip:(n,e)=>Vr(n,"",e)}],$d=/\b(?:half4|float4|vec4)\s+main\s*\(|^\s*uniform\s+\w+\s+\w+/m,Nd=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function Vr(n,e,t){if(Array.isArray(n)){let s;return n.forEach((o,i)=>{let a=Vr(o,`${e}[${i}]`,t);a!==o&&((s??=[...n])[i]=a)}),s??n}if(!Nd(n))return n;let r;for(let[s,o]of Object.entries(n)){let i=Vr(o,e?`${e}.${s}`:s,t);i!==o&&((r??={...n})[s]=i)}return Rd(r??n,e,t)}function Rd(n,e,t){let r=n.type==="sksl";if(!(r||n.type==="shader"&&(typeof n.source=="string"||typeof n.shader=="string")||(n.scope==="fill"||n.scope==="effect")&&typeof n.source=="string"))return n;let o={...n};r&&(o.type="shader");let i=o.type==="shader"&&typeof o.shader=="string"&&o.source===void 0;i&&(o.source=o.shader,delete o.shader);let a=o.language==="sksl"||o.language===void 0&&(r||$d.test(typeof o.source=="string"?o.source:"")),c=a&&o.language===void 0;c&&(o.language="sksl");let d="coords"in o;return delete o.coords,a?t(e,"SkSL shaders no longer draw; port it to WGSL."):r?t(e,"The retired `sksl` effect key is now `shader`."):i?t(e,"The shader's `shader` field is now `source`."):d&&t(e,"`coords` dropped; it only ever applied to SkSL."),r||i||c||d?o:n}function Ur(n){if(typeof n!="object"||n===null)return 0;let e=n.formatVersion;if(e===void 0)return 0;if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new TypeError(`formatVersion must be a whole number >= 0 (got ${JSON.stringify(e)}).`);return e}function Gr(n){return zd(n,ra,2)}function zd(n,e,t){let r=Ur(n);if(r>t)throw new wt(r,t);if(typeof n!="object"||n===null||Array.isArray(n))return{document:n,from:r,to:r,changes:[]};let s=[],o=n;return{document:o.kind==="project"?Ld(o,r,e,t,s):ia(o,r,e,t,s,""),from:r,to:t,changes:s}}function sa(n,e,t){let r=[];for(let s=n;s<e;s++){let o=t.find(i=>i.from===s);if(!o)throw new Error(`No document migration from format ${s} to ${s+1}.`);r.push(o)}return r}function oa(n,e,t){return(r,s)=>n.push({from:e,path:t&&r?`${t}.${r}`:t||r,message:s})}function ia(n,e,t,r,s,o,i=!0){if(e===r)return n;let a=n;for(let c of sa(e,r,t))c.clip&&(a=c.clip(a,oa(s,c.from,o)));return i?{...a,formatVersion:r}:a}function Ld(n,e,t,r,s){let o=n;if(e<r)for(let c of sa(e,r,t))c.project&&(o=c.project(o,oa(s,c.from,"")));let i=!1,a=Array.isArray(o.tracks)?o.tracks.map((c,d)=>{if(typeof c!="object"||c===null)return c;let u=c.clip;if(typeof u!="object"||u===null||Array.isArray(u))return c;let l=u.formatVersion!==void 0,f=l?Ur(u):e;if(f>r)throw new wt(f,r);let h=ia(u,f,t,r,s,`tracks[${d}].clip`,l);return h===u?c:(i=!0,{...c,clip:h})}):o.tracks;return e===r&&!i?n:{...o,...i?{tracks:a}:{},formatVersion:r}}var aa=new Set(["normal","reverse","alternate"]);function z(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ie(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0}function la(n,e,t){if(n===void 0)return;if(!z(n)){t.push({path:e,message:"easing must be an object with a `kind`."});return}let{kind:r,args:s}=n;if(typeof r!="string"||!or.has(r)){t.push({path:`${e}.kind`,message:`easing kind must be one of ${[...or].join(", ")} (got ${JSON.stringify(r)}).`});return}r==="custom"&&s!==void 0&&typeof s!="string"&&!sr(s)&&t.push({path:`${e}.args`,message:"a custom easing's args must be its curve \u2014 two or more `{ x, y }` points \u2014 or a registered ease's key."})}function fa(n,e,t){la(n,e,t),z(n)&&n.kind==="custom"&&!sr(n.args)&&t.push({path:`${e}.args`,message:"an audio ease cannot name a registered ease; draw its curve (two or more `{ x, y }` points) instead."})}function ca(n,e,t){if(!(n===void 0||typeof n=="number"&&Number.isFinite(n)||I.isSource(n))){if(!z(n)||!Array.isArray(n.keys)){t.push({path:e,message:"must be a finite number, an expression or a ramp, `{ keys: [{ at, value }, \u2026] }`."});return}n.keys.forEach((r,s)=>{let o=`${e}.keys[${s}]`;if(!z(r)){t.push({path:o,message:"a ramp key must be an object."});return}(r.at===void 0==(r.before===void 0)||!ie(r.at??r.before))&&t.push({path:o,message:"a ramp key needs exactly one of `at` (seconds after the start) or `before` (seconds before the end), >= 0."}),(typeof r.value!="number"||!Number.isFinite(r.value))&&t.push({path:`${o}.value`,message:"a ramp key's value must be a finite number."}),fa(r.ease,`${o}.ease`,t)})}}var Bd=new Set(["duration","curve"]);function da(n,e,t){if(n!==void 0){if(!z(n)){t.push({path:e,message:"a transition must be an object, `{ duration, curve? }`."});return}ie(n.duration)||t.push({path:`${e}.duration`,message:"a transition's duration must be a finite number of seconds >= 0."}),n.curve!==void 0&&n.curve!=="equalPower"&&fa(n.curve,`${e}.curve`,t);for(let r of Object.keys(n))Bd.has(r)||t.push({path:`${e}.${r}`,message:`a transition has no "${r}" (yet): only duration and curve.`})}}function jd(n,e,t,r){"filters"in e&&r.push({path:`${t}.filters`,message:"audio `filters` was renamed to `effects`."});for(let o of["volume","pan",...n==="sound"?["speed"]:[]])ca(e[o],`${t}.${o}`,r);n==="sound"&&e.loop===!0&&z(e.speed)&&r.push({path:`${t}.speed`,message:"a looping sound cannot ramp its speed: there is no one pass of the source for the ramp to run over."});let s=e.effects;s!==void 0&&(Array.isArray(s)?s:[s]).forEach((i,a)=>{let c=Array.isArray(s)?`${t}.effects[${a}]`:`${t}.effects`;if(!z(i)||typeof i.type!="string"){r.push({path:c,message:"an effect must be an object with a `type`."});return}for(let[d,u]of Object.entries(i))d!=="type"&&ca(u,`${c}.${d}`,r)}),da(e.transitionIn,`${t}.transitionIn`,r),da(e.transitionOut,`${t}.transitionOut`,r)}function Vd(n,e,t){if(n===void 0)return;if(!z(n)){t.push({path:e,message:"loop must be an object with a `count`."});return}let{direction:r,count:s}=n;s!==null&&(typeof s!="number"||!Number.isInteger(s)||s<0)&&t.push({path:`${e}.count`,message:"loop count must be a whole number of repeats >= 0, or null to repeat for the rest of the clip."}),r!==void 0&&!aa.has(r)&&t.push({path:`${e}.direction`,message:`loop direction must be one of ${[...aa].join(", ")} (got ${JSON.stringify(r)}).`})}function Kd(n,e,t){if(!z(n))return t.push({path:e,message:"node must be an object."}),!1;let r=!0,{id:s,type:o,parentId:i,layerOrder:a,props:c,key:d}=n;return typeof s!="string"&&(t.push({path:`${e}.id`,message:"id must be a string."}),r=!1),(typeof o!="string"||o.length===0)&&(t.push({path:`${e}.type`,message:"type must be a non-empty string."}),r=!1),i!==null&&typeof i!="string"&&(t.push({path:`${e}.parentId`,message:"parentId must be a node id or null."}),r=!1),(typeof a!="number"||!Number.isFinite(a))&&(t.push({path:`${e}.layerOrder`,message:"layerOrder must be a finite number."}),r=!1),z(c)?(o==="sound"||o==="audioBus")&&jd(o,c,`${e}.props`,t):(t.push({path:`${e}.props`,message:"props must be an object (`{}` when nothing is set)."}),r=!1),d!==void 0&&(typeof d!="string"||d.length===0?(t.push({path:`${e}.key`,message:"key must be a non-empty string when present."}),r=!1):(d.includes("]")||d.includes("."))&&(t.push({path:`${e}.key`,message:`node key "${d}" cannot contain "]" or "." \u2014 it is referenced as "[${d}.prop]".`}),r=!1)),r}function ha(n,e){let t=new Map;for(let r of n){let s=r.spec.key;if(typeof s!="string"||s.length===0)continue;let o=t.get(s);if(o){e.push({path:`${r.path}.key`,message:`duplicate node key "${s}" (also declared at ${o.path}).`});continue}t.set(s,r)}return t}function Ud(n,e,t,r){n.id===""&&(n.type!==t||n.parentId!==null)&&r.push({path:e,message:`the node with id "" is this document's root and must be \`{ type: "${t}", parentId: null }\`.`})}function Gd(n,e,t){if(!z(n))return t.push({path:e,message:"command must be an object."}),!1;let r=!0,{id:s,type:o,targetId:i,at:a,duration:c,args:d}=n;return(typeof s!="string"||s.length===0)&&(t.push({path:`${e}.id`,message:"id must be a non-empty string."}),r=!1),(typeof o!="string"||o.length===0)&&(t.push({path:`${e}.type`,message:"type must be a non-empty string."}),r=!1),i!==null&&typeof i!="string"&&(t.push({path:`${e}.targetId`,message:"targetId must be a node id, or null for the scene root."}),r=!1),ie(a)||(t.push({path:`${e}.at`,message:"at must be a finite number of seconds >= 0."}),r=!1),c!==void 0&&!ie(c)&&(t.push({path:`${e}.duration`,message:"duration must be a finite number of seconds >= 0."}),r=!1),z(d)||(t.push({path:`${e}.args`,message:"args must be an object (`{}` when there are none)."}),r=!1),la(n.easing,`${e}.easing`,t),Vd(n.loop,`${e}.loop`,t),r}function Yd(n,e,t){if(!z(n))return t.push({path:e,message:"variable must be an object."}),!1;let r=!0,{id:s,name:o,value:i,lerp:a}=n;return typeof s!="string"||s.length===0?(t.push({path:`${e}.id`,message:"id must be a non-empty string."}),r=!1):s.includes("]")&&(t.push({path:`${e}.id`,message:`variable id "${s}" cannot contain "]" \u2014 it is referenced as "[${s}]".`}),r=!1),o!==void 0&&typeof o!="string"&&(t.push({path:`${e}.name`,message:"name must be a string when present."}),r=!1),"value"in n?I.isSource(i)&&(t.push({path:`${e}.value`,message:"a variable holds a value, not an expression \u2014 only a node prop can be bound."}),r=!1):(t.push({path:`${e}.value`,message:"value is required \u2014 a variable is what it holds before anything changes it."}),r=!1),a!==void 0&&typeof a!="string"&&(t.push({path:`${e}.lerp`,message:"lerp must be a registered lerp key when present."}),r=!1),r}function pa(n,e){if(n===void 0)return[];if(!Array.isArray(n))return e.push({path:"variables",message:"variables must be an array."}),[];let t=[];return n.forEach((r,s)=>{let o=`variables[${s}]`;Yd(r,o,e)&&t.push({spec:r,path:o})}),t}function ma(n,e){let t=new Map;for(let r of n){let s=t.get(r.spec.id);if(s){e.push({path:`${r.path}.id`,message:`duplicate variable id "${r.spec.id}" (also declared at ${s.path}).`});continue}t.set(r.spec.id,r)}return t}function ga(n){let e=n.indexOf(".");return e<0?void 0:{key:n.slice(0,e),prop:n.slice(e+1)}}function Yr(n,e,t,r,s){for(let o of I.collect(n,e)){let i=I.tryParse(o.source);if("error"in i){s.push({path:o.path,message:i.error});continue}for(let a of i.expression.refs){let c=ga(a);if(!c){if(t.has(a))continue;s.push({path:o.path,message:r.has(a)?`expression references "[${a}]", which is a node key \u2014 a node is not a value, so name the prop too: "[${a}.x]".`:`expression references "[${a}]", which this document does not declare. Declared: ${[...t].map(d=>`[${d}]`).join(", ")||"none"}.`});continue}if(c.key.length===0||c.prop.length===0||c.prop.includes(".")){s.push({path:o.path,message:`expression references "[${a}]", which is not a node reference \u2014 one is "[key.prop]".`});continue}r.has(c.key)||s.push({path:o.path,message:`expression references "[${a}]", but no node in this document is keyed "${c.key}". Keyed: ${[...r].join(", ")||"none"}.`})}}}function Xr(n,e,t,r){if(z(e))for(let s of Object.keys(e)){let o=[];for(let i of I.collect(e[s],`${t}.${s}`)){let a=I.tryParse(i.source);if(!("error"in a))for(let c of a.expression.refs)ga(c)&&o.push(c)}o.length>0&&r.push({id:`${n}.${s}`,path:`${t}.${s}`,reads:o})}}function ya(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Set,s=[],o=new Set,i=a=>{let c=t.get(a);if(!c||r.has(a))return;let d=s.indexOf(a);if(d>=0){if(!o.has(a)){let u=[...s.slice(d),a];for(let l of u)o.add(l);e.push({path:c.path,message:`expression cycle ${u.join(" \u2192 ")} \u2014 a prop cannot read a prop that reads it back.`})}return}s.push(a);for(let u of c.reads)i(u);s.pop(),r.add(a)};for(let a of n)i(a.id)}function Xd(n,e){let t=new Map;for(let s of n){if(t.has(s.spec.id)){e.push({path:`${s.path}.id`,message:`duplicate node id "${s.spec.id}".`});continue}t.set(s.spec.id,s)}for(let s of n){let o=s.spec.parentId;o!==null&&!t.has(o)&&e.push({path:`${s.path}.parentId`,message:`parentId "${o}" is not a node in this document.`})}let r=new Set;for(let{spec:s}of n){if(r.has(s.id))continue;let o=new Set,i=s;for(;i;){if(o.has(i.id)){e.push({path:`${t.get(i.id)?.path}.parentId`,message:`node "${i.id}" is its own ancestor \u2014 parent chain forms a cycle.`});break}if(o.add(i.id),r.has(i.id))break;let a=i.parentId;i=a===null?void 0:t.get(a)?.spec}for(let a of o)r.add(a)}}function _a(n,e,t){for(let r of n){let s=e.get(r.id);s&&t.push({path:`${s.path}.id`,message:`"${r.id}" is already a node id \u2014 nodes and variables share one id space.`})}}function wa(n,e){n.constants!==void 0&&e.push({path:"constants",message:"constants were merged into `variables` \u2014 move each row there and drop its `kind`."})}function xa(n,e){let t=n.formatVersion;t!==void 0&&(typeof t!="number"||!Number.isInteger(t)||t<0?e.push({path:"formatVersion",message:"formatVersion must be a whole number >= 0 when present."}):t>2&&e.push({path:"formatVersion",message:`format ${t} is newer than this engine reads (${2}) \u2014 open it with a newer engine.`}))}var Wd={visualTracks:"visual and audio tracks were merged into `tracks` \u2014 move each row there.",audioTracks:"visual and audio tracks were merged into `tracks` \u2014 move each row there.",backgrounds:"a background is a track \u2014 put it first in `tracks`.",overlays:"an overlay is a track \u2014 put it last in `tracks`.",commands:"a project has no commands \u2014 each clip carries its own.",constants:"a project has no constants \u2014 declare `variables` in each clip."};function va(n,e,t,r,s,o){let i=new Map([["",t]]);for(let a of n)i.set(a.spec.id,a.spec.type),s.hasNode(a.spec.type)||o.push({path:`${a.path}.type`,message:`node type "${a.spec.type}" is not registered.`});for(let{spec:a,path:c}of e){if(s.command(a.type))continue;if(a.targetId!==null&&r.has(a.targetId)){o.push({path:`${c}.type`,message:`"${a.type}" is not a variable command.`});continue}let d=i.get(a.targetId??"");d===void 0||!s.hasNode(d)||s.takesCommand(d,a.type)||o.push({path:`${c}.type`,message:`node type "${d}" has no command "${a.type}".`})}}function ba(n,e,t){if(!Array.isArray(n))return t.push({path:"nodes",message:"nodes must be an array."}),[];let r=[];return n.forEach((s,o)=>{let i=`nodes[${o}]`;Kd(s,i,t)&&(r.push({spec:s,path:i}),Ud(s,i,e,t))}),Xd(r,t),r}function qd(n,e,t){let{startAt:r,endAt:s}=n;r!==void 0&&!ie(r)&&t.push({path:`${e}.startAt`,message:"startAt must be a finite number of seconds >= 0."}),s!==void 0&&!ie(s)&&t.push({path:`${e}.endAt`,message:"endAt must be a finite number of seconds >= 0."}),ie(s)&&s<=(ie(r)?r:0)&&t.push({path:`${e}.endAt`,message:`endAt (${s}s) must be after startAt (${r??0}s).`}),n.id===""&&(r!==void 0||s!==void 0)&&t.push({path:e,message:"the root is present for the whole clip \u2014 it cannot carry startAt or endAt."})}function Hd(n,e,t){wa(n,e),n.commands!==void 0&&e.push({path:"commands",message:"a still has no timeline, so no commands \u2014 make it a composition to animate it."});let r=ma(pa(n.variables,e),e),s=ba(n.nodes,"canvas2d",e);for(let u of s){let{startAt:l,endAt:f}=u.spec;(l!==void 0||f!==void 0)&&e.push({path:u.path,message:"a still has no timeline \u2014 drop startAt/endAt, or make it a composition."})}let o=s.map(u=>u.spec);_a(o,r,e),t&&va(s,[],"canvas2d",r,t,e);let i=ha(s,e),a=new Set(r.keys()),c=new Set(i.keys()),d=[];for(let u of s)Yr(u.spec.props,`${u.path}.props`,a,c,e),u.spec.key&&Xr(u.spec.key,u.spec.props,`${u.path}.props`,d);ya(d,e)}function Jd(n,e,t){ka(n,"canvas2d",e,t)}function Zd(n,e,t){ka(n,"audioBus",e,t)}var Qd={add:"a node is a row in `nodes` \u2014 its `startAt` is when it enters.",variable:"a variable is declared in `variables`."};function ka(n,e,t,r){if(wa(n,t),!Array.isArray(n.commands)){t.push({path:"commands",message:"commands must be an array."});return}n.duration!==void 0&&!ie(n.duration)&&t.push({path:"duration",message:"duration must be a finite number of seconds >= 0."});let s=ma(pa(n.variables,t),t),o=ba(n.nodes,e,t);for(let p of o)qd(p.spec,p.path,t);let i=o.map(p=>p.spec);_a(i,s,t);let a=ha(o,t),c=[],d=new Set;n.commands.forEach((p,y)=>{if(!Gd(p,`commands[${y}]`,t))return;if(d.has(p.id)){t.push({path:`commands[${y}].id`,message:`duplicate command id "${p.id}".`});return}let m=Qd[p.type];if(m){t.push({path:`commands[${y}].type`,message:`there is no "${p.type}" command \u2014 ${m}`});return}d.add(p.id),c.push({spec:p,path:`commands[${y}]`})});let u=new Map(i.map(p=>[p.id,p]));r&&va(o,c,e,s,r,t);for(let{spec:p,path:y}of c){if(p.targetId===null||s.has(p.targetId))continue;let m=Ue(u,p.targetId);m===void 0?t.push({path:`${y}.targetId`,message:`targetId "${p.targetId}" is not a node or variable in this document.`}):p.at<m.start&&t.push({path:`${y}.at`,message:`command runs at ${p.at}s but its target "${p.targetId}" is not present until ${m.start}s.`})}let l=new Set(s.keys()),f=new Set(a.keys());for(let p of o)Yr(p.spec.props,`${p.path}.props`,l,f,t);for(let{spec:p,path:y}of c)Yr(p.args,`${y}.args`,l,f,t);let h=[];for(let p of o)p.spec.key&&Xr(p.spec.key,p.spec.props,`${p.path}.props`,h);for(let{spec:p,path:y}of c){if(p.type!=="set"||p.targetId===null)continue;let m=u.get(p.targetId)?.key;m&&Xr(m,p.args,`${y}.args`,h)}ya(h,t)}function Wr(n,e={}){let t=[];if(!z(n))return{valid:!1,issues:[{path:"",message:"document must be an object."}]};xa(n,t);let{registry:r}=e,s=n.kind;return s==="still"?Hd(n,t,r):s==="composition"?Jd(n,t,r):s==="audio"?Zd(n,t,r):t.push({path:"kind",message:`kind must be "still", "composition" or "audio" (got ${JSON.stringify(s)}).`}),{valid:t.length===0,issues:t}}function eu(n,e={}){let t=[];if(!z(n))return{valid:!1,issues:[{path:"",message:"document must be an object."}]};let r=n;r.kind!=="project"&&t.push({path:"kind",message:`kind must be "project" (got ${JSON.stringify(r.kind)}).`}),(typeof r.name!="string"||r.name.length===0)&&t.push({path:"name",message:"name must be a non-empty string."}),r.fps!==void 0&&(typeof r.fps!="number"||!(r.fps>0)||!Number.isFinite(r.fps))&&t.push({path:"fps",message:"fps must be a positive number when present."}),xa(r,t);for(let[o,i]of Object.entries(Wd))r[o]!==void 0&&t.push({path:o,message:i});if(!Array.isArray(r.tracks))return t.push({path:"tracks",message:"tracks must be an array."}),{valid:!1,issues:t};let s=new Set;return r.tracks.forEach((o,i)=>{let a=`tracks[${i}]`;if(!z(o)){t.push({path:a,message:"track must be an object."});return}let c=o;if(typeof c.id!="string"||c.id.length===0?t.push({path:`${a}.id`,message:"id must be a non-empty string."}):s.has(c.id)?t.push({path:`${a}.id`,message:`duplicate track id "${c.id}".`}):s.add(c.id),c.name!==void 0&&typeof c.name!="string"&&t.push({path:`${a}.name`,message:"name must be a string when present."}),c.startAt!==void 0&&!ie(c.startAt)&&t.push({path:`${a}.startAt`,message:"startAt must be a finite number of seconds >= 0."}),ie(c.duration)||t.push({path:`${a}.duration`,message:"duration is required, and must be a finite number of seconds >= 0."}),c.clip===void 0){t.push({path:`${a}.clip`,message:"clip is required \u2014 a track places a clip document inline."});return}for(let d of tu(c.clip,e))t.push({path:`${a}.clip${d.path?`.${d.path}`:""}`,message:d.message})}),{valid:t.length===0,issues:t}}var ua=new WeakMap;function tu(n,e){if(!z(n)||e.registry)return Wr(n,e).issues;let t=ua.get(n);return t||(t=Wr(n).issues,ua.set(n,t)),t}function Sa(n,e){let{valid:t,issues:r}=eu(n,e);if(!t){let s=r.map(o=>` ${o.path||"<root>"}: ${o.message}`).join(`
1
+ import{$b as Qs,$c as lo,Ac as lr,Ae as Or,Bc as jt,Be as No,Cb as ir,Ce as lt,Dc as fr,De as Ro,Eb as ar,Ec as ke,Ee as qt,F as Vs,Fb as he,Fc as Vt,Fd as I,Fe as zo,Gb as B,Gc as oo,Gd as vr,Ge as Lo,Ha as zt,Hb as ce,Hd as Xt,He as Bo,Ia as Ys,Ib as cr,Ic as Z,Id as _o,Jc as hr,Jd as wo,Je as ft,Kb as dr,Ke as P,La as tr,Le as w,Ma as ve,Md as xo,Me as Ht,Nd as E,Ne as me,Ob as it,Od as k,Oe as Jt,Pb as ur,Pd as Se,Pe as jo,Qb as Js,Qc as pr,Qd as Be,Qe as ge,Re as Vo,Sc as mr,Sd as j,Se as Zt,Tc as io,Td as K,Te as Ko,Uc as ao,Ud as R,Ue as Uo,Vc as co,Wa as rr,Wc as gr,Wd as vo,We as Go,X as Qn,Xc as Kt,Xd as F,Xe as Yo,Ya as rt,Yb as at,Yc as uo,Yd as $,Ye as Xo,Zb as Zs,Zc as Ut,Zd as Q,Ze as Wo,_b as ne,_c as yr,_d as T,ac as ct,ad as N,ae as bo,bc as Le,be as ko,ca as er,cc as Lt,ce as So,dc as be,dd as ut,de as Wt,eb as sr,ec as Ce,ed as _r,ee as Ao,f as qn,fc as pe,fd as wr,fe as Mo,ga as Ks,gb as or,gc as Bt,gd as xr,ge as br,ha as Us,hb as st,hc as dt,ia as nt,id as fo,ie as Oo,jc as eo,jd as ho,je as Eo,kc as to,ke as To,ld as Gt,m as Zn,mb as ot,md as Yt,oc as no,pd as go,qa as Gs,qb as Xs,qd as yo,qe as kr,rb as Y,rc as Pe,re as Sr,sb as Ws,sc as ro,se as Ar,ta as fe,te as Io,ue as Do,vb as qs,ve as Fo,wb as Hs,we as $o,yc as so,zb as Te,ze as Mr}from"./chunk-7DB6BI27.js";import{b as Co,f as Po}from"./chunk-4BDLFEOC.js";import{b as js,d as Hn,f as Jn,h as ze,m as nr,n as po,o as mo}from"./chunk-Q55UPA3E.js";function qo(n){return Number.isFinite(n)&&n>0?n:1}function je(n,e,t=e){return ot(n)?qs(n,e,t):Math.max(0,Math.min(t,e))/qo(n)}function fd(n,e,t){return ot(n)?Hs(n,e,t):Math.max(0,Math.min(e,t*qo(n)))}function hd(n,e){let t=Math.max(0,(n.trimEnd??e)-(n.trimStart??0));return je(n.speed??1,t)}function Ho(n,e,t,r){let s=n.at??0,o=n.until??1/0,i=n.trimStart??0,a=n.trimEnd??1/0,c=n.loop??!1,d=Te(n.effects),u=e.getMediaDuration(n.src),l=n.speed??1;c&&ot(l)&&(l=Xs(l,1));let f=Math.max(0,(Number.isFinite(a)?a:u)-i),h={id:`${t}|${n.src}|${s}|${r}`,src:n.src,startAt:s,endAt:1/0,trimStart:i,volume:n.volume??1,speed:l,loop:c,ownerId:t};if(ot(l)&&(h.sourceLength=f),d.length>0&&(h.effects=d),n.transitionIn&&(h.transitionIn=n.transitionIn),n.transitionOut&&(h.transitionOut=n.transitionOut),n.bus&&(h.bus=n.bus),n.optional&&(h.optional=!0),c&&a>i&&Number.isFinite(a)&&(h.trimEnd=a),c&&Number.isFinite(o))h.endAt=o;else if(c)h.open=!0;else if(Number.isFinite(a))h.endAt=Math.min(o,s+je(l,f));else{let p=je(l,f);Number.isFinite(o)?h.endAt=Math.min(o,s+p):(h.open=!0,h.mediaDuration=p)}return h}var Er=class{src;volume;speed;loop;trimStart;trimEnd;effects;constructor(e){this.src=e.src,this.volume=e.volume??1,this.speed=e.speed??1,this.loop=e.loop??!1,this.trimStart=e.trimStart??0,this.trimEnd=e.trimEnd??e.duration??1/0,this.effects=Te(e.effects)}clipDurationFor(e){return je(this.speed,e)}sceneDurationFor(e){return this.clipDurationFor(e)}get clipDuration(){return this.trimEnd!==1/0?this.clipDurationFor(this.trimEnd-this.trimStart):void 0}};function ht(n){return!n||n.length===0?"":n.map(e=>{switch(e.type){case"gain":return`gain:${Y(e.value)}`;case"highpass":case"lowpass":return`${e.type}:${Y(e.frequency)}:${Y(e.q)}`;case"tremolo":return`tremolo:${Y(e.rate)}:${Y(e.depth)}`;case"echo":return`echo:${Y(e.delay)}:${Y(e.feedback)}:${Y(e.mix)}`}}).join("|")}var pd=n=>Math.sin(Math.max(0,Math.min(1,n))*Math.PI/2),Jo=new WeakMap;function Zo(n){let e=n.curve;if(e===void 0||e==="equalPower")return pd;let t=Jo.get(e);return t||Jo.set(e,t=st(e)),t}function md(n,e,t){let r={in:Math.max(0,e?.duration??0),out:Math.max(0,t?.duration??0)};if(!Number.isFinite(n))return{in:r.in,out:0};let s=r.in+r.out;if(s<=n||s===0)return r;let o=Math.max(0,n)/s;return{in:r.in*o,out:r.out*o}}function Tp(n,e,t,r){let s=md(e,t,r),o=1;return t&&s.in>0&&n<s.in&&(o*=Math.max(0,Zo(t)(Math.max(0,n)/s.in))),r&&s.out>0&&n>e-s.out&&(o*=Math.max(0,Zo(r)(Math.max(0,e-n)/s.out))),o}function Ve(n){return n?`${n.duration}:${typeof n.curve=="object"?JSON.stringify(n.curve):n.curve??"equalPower"}`:"_"}function Tr(n){return`${n.id}:${Y(n.volume)}:${Y(n.pan)}:${n.mute?1:0}:${ht(n.effects)}:${Ve(n.transitionIn)}:${Ve(n.transitionOut)}:${n.startAt}:${n.endAt}`}var gd=new Set(["number","slider","angle","hue","boolean","color","vector","point"]);function hm(n){return gd.has(n.kind)}var Qo=64,ei=64e3;function ti(n){if(typeof n!="object"||n===null)throw new Error("A shader pack must be an object.");let e=n,t=e.scope;if(t!=="fill"&&t!=="effect")throw new Error(`A shader pack needs scope "fill" or "effect", got ${JSON.stringify(t)}. The two are written against different contracts \u2014 a fill has no backdrop to sample and an effect has no shape box to map coordinates onto.`);let r=typeof e.source=="string"?e.source.trim():"";if(r==="")throw new Error(`Shader pack "${String(e.name??"?")}" has no source.`);if(r.length>ei)throw new Error(`Shader pack "${String(e.name??"?")}" source is ${r.length} characters, over the ${ei} ceiling.`);if(e.language!==void 0&&e.language!=="wgsl")throw new Error(`Shader pack "${String(e.name??"?")}" is written in ${JSON.stringify(e.language)}; only WGSL is supported. Port it to WGSL.`);let s={...typeof e.$kind=="string"?{$kind:e.$kind}:{},...typeof e.id=="string"?{id:e.id}:{},name:typeof e.name=="string"&&e.name!==""?e.name:"Shader",...typeof e.description=="string"?{description:e.description}:{},language:"wgsl",source:r,...mt(e.uniforms)?{uniforms:e.uniforms}:{},properties:yd(e.properties,String(e.name??"?"))};if(t==="fill"){let o=Array.isArray(e.textures)?e.textures.filter(i=>mt(i)&&typeof i.name=="string").map(i=>({name:i.name,...typeof i.description=="string"?{description:i.description}:{}})):[];return{...s,scope:"fill",...o.length?{textures:o}:{}}}return{...s,scope:"effect",...e.backdrop===!0?{backdrop:!0}:{}}}function yd(n,e){if(!mt(n))return{};let t={},r=new Map;for(let[s,o]of Object.entries(n)){if(Object.keys(t).length>=Qo){pt(`shader "${e}" declares more than ${Qo} properties; the rest are ignored.`);break}if(!mt(o)||typeof o.kind!="string"){pt(`shader "${e}" property "${s}" has no kind; ignored.`);continue}let i=o.inputs;if(!mt(i)||Object.keys(i).length===0){pt(`shader "${e}" property "${s}" names no uniform in "inputs"; ignored.`);continue}let a=!1;for(let c of Object.values(i)){if(typeof c!="string"){pt(`shader "${e}" property "${s}" has a non-string uniform name; ignored.`),a=!0;break}let d=r.get(c);if(d!==void 0){pt(`shader "${e}" properties "${d}" and "${s}" both write uniform "${c}"; "${s}" ignored.`),a=!0;break}r.set(c,s)}a||(t[s]=o)}return t}function mt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}var Qt=new Set;function pt(n){Qt.has(n)||(Qt.size>256&&Qt.clear(),Qt.add(n),console.warn(`[shader] ${n}`))}function ye(n,e){return n===""?String(e):`${n}.${e}`}function Cr(n,e){n.declareAssets(e)}function Pr(n,e){if(!n.mounted)return;Cr(n,e);let t=n._allChildren;for(let r=0;r<t.length;r++)Pr(t[r],e)}function ni(n,e){n.attachDetached(e)}function en(n){n._sample();for(let e of n.children)en(e)}function tn(n,e){n._primeMotion(e);for(let t of n.children)tn(t,e)}function Ir(n,e){let t=r=>{let s=r.key!==void 0?e?.[r.key]:void 0;r._setEditorState(s?.hidden===!0,s?.locked===!0);for(let o of r._allChildren)t(o)};t(n)}var Ie=class extends N{constructor(e){super(e)}zoomTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}panTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}orbitTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}dollyTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}headingTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}fillTo(e){let t=this.fill,r=ve.resolve(e.data),s=e.lerp??ve.lerp;return this.command(o=>({fill:s(t,r,o)}),e.duration,e.easing)}overlayTo(e){let t=this.overlay,r=ve.resolve(e.data),s=e.lerp??ve.lerp;return this.command(o=>({overlay:s(t,r,o)}),e.duration,e.easing)}flowArrangement(){return this}shapeGraphics(){return new nt().rect({width:this.layoutBounds.width,height:this.layoutBounds.height})}renderSelf(e){let t=this.fill;t.length!==0&&e.draw(this.shapeGraphics().fill(t))}renderOverlay(e){let t=this.overlay;t.length!==0&&e.draw(this.shapeGraphics().fill(t))}acceptsChild(e){return e.dimension==="2d"||e.dimension==="audio"}get _childTrees(){return["2d","audio"]}get childrenAudio(){return this._allChildren.filter(e=>e instanceof ut)}declareAssets(e){super.declareAssets(e),e.fill(this.fill),e.fill(this.overlay)}clipSelf(){return new gr().rect({width:this.layoutBounds.width,height:this.layoutBounds.height})}_cameraScope(){return this.space3D||this.zoom===1&&this.heading===0&&this.lookAt.x===0&&this.lookAt.y===0?null:{lookAt:this.lookAt,zoom:this.zoom,heading:this.heading}}_spaceCamera(){if(!this.space3D)return null;let e=this.layoutBounds;return{perspective:this.perspective,orbit:this.orbit,elevation:this.elevation,dolly:this.dolly,lookAt:this.lookAt,zoom:this.zoom,heading:this.heading,viewportX:e?.x??0,viewportY:-(e?.y??0)}}_projection(){return this.space3D?dr:super._projection()}renderChildren(e){let t=this._spaceCamera();if(t){this._renderInSpace(e,Kt(this,t));return}if(this.zoom===1&&this.heading===0&&this.lookAt.x===0&&this.lookAt.y===0){super.renderChildren(e);return}let r=this.layoutBounds,s=r?.width??0,o=r?.height??0,i=r?.x??0,a=r?.y??0;e.beginCamera({x:i,y:-a,width:s,height:o},this.lookAt,this.zoom,this.heading);for(let c of this._children)c instanceof N&&c.render(e);e.endCamera()}};Zs(Ie,{fill:mr(),overlay:mr(),flow:ao(),gap:ne({default:0}),wrap:ne({default:!1}),crossGap:ne({default:void 0}),columns:ne({default:1}),align:io(),zoom:ne({default:1}),lookAt:ne({default:{x:0,y:0},tween:it}),heading:ne({default:0}),space3D:ne({default:!1}),orbit:ne({default:0}),elevation:ne({default:0}),dolly:ne({default:0}),zoomTo:ke({args:[{key:"zoom",kind:"number",min:.01,step:.1,unit:"\xD7"}]}),panTo:ke({args:[{key:"lookAt",kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"},z:{kind:"number"}}}]}),orbitTo:ke({args:[{key:"orbit",kind:"number",step:1,unit:"\xB0"},{key:"elevation",kind:"number",step:1,unit:"\xB0"}]}),dollyTo:ke({args:[{key:"dolly",kind:"number",step:10}]}),headingTo:ke({args:[{key:"heading",kind:"number",step:1,unit:"\xB0"}]}),fillTo:ke(),overlayTo:ke()});var rn={cornerRadius:k.number(0),cornerStyle:k.custom("rounded",{lerp:qn})},ri=E({key:"rect",state:{...F,...j,...Se},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Be(n.size,e))}),si=E({key:"ellipse",state:{...F,...j,startAngle:k.number(0),sweep:k.number(360),ratio:k.number(0)},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,bo(n.size,e))}),oi=E({key:"polygon",state:{...F,...j,sides:k.number(5),...rn},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,ko(n.size,e))}),ii=E({key:"polygram",state:{...F,...j,sides:k.number(5),ratio:k.number(.5),...rn},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,So(n.size,e))}),ai=E({key:"path",state:{...F,...j,data:k.path},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Ao(n.size,e.data),{clipShape:Wt(n.size)})}),pg=E({key:"facePath",state:{...F,...j,data:k.path},defaults:{width:"hug",height:"hug"},commands:{...$},measure:(n,e)=>{let t=nr.size(e.data),r=e.padding;return{width:t.width+r.left+r.right,height:t.height+r.top+r.bottom}},layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Mo(e.data),{clipShape:null})});function yt(n,e){return E({key:n,state:{...F,...j,...rn},commands:{...$},measure:(t,r,s)=>K(t,r,s,T(r)),layout:(t,r,s)=>R(t,r,s,T(r)),render:(t,r)=>Q(t,r,br(e,t.size,r),{clipShape:Wt(t.size)})})}var mg=yt("triangle","triangle"),gg=yt("rightTriangle","rightTriangle"),yg=yt("pentagon","pentagon"),_g=yt("hexagon","hexagon"),wg=yt("octagon","octagon"),xg=E({key:"star",state:{...F,...j,...rn,points:k.number(mo),ratio:k.number(po)},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,br("star",n.size,{cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle,sides:Math.max(3,Math.round(e.points)),ratio:e.ratio}),{clipShape:Wt(n.size)})});var ci=E({key:"boolean",state:{...F,...j,op:k.oneOf(["union","subtract","intersect","exclude"])},commands:{...$},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>n.merge(e.op,e)}),di=E({key:"mask",state:{mode:k.oneOf(["alpha","vector","luminance"]),inverted:!1},render:(n,e)=>n.mask(e)});var fi=E({key:"camera",state:{...F,...j,...Oo,...Se},commands:{...$,...Eo},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Q(n,e,Be(n.size,e),{children:()=>To(n,e)})}),ui={lookAt:k.custom({x:0,y:0},{lerp:it,kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"},z:{kind:"number"}}}),zoom:k.number(1,{min:.01,step:.1,unit:"\xD7"}),heading:k.number(0,{step:1,unit:"\xB0"}),orbit:k.number(0,{step:1,unit:"\xB0"}),elevation:k.number(0,{step:1,unit:"\xB0"}),dolly:k.number(0,{step:10}),orbitSpeed:k.number(0)},hi=E({key:"orbitCamera",state:ui,defaults:{width:"hug",height:"hug",perspective:1e3},commands:vo(ui,{orbitTo:{args:["orbit","elevation"]},dollyTo:{args:["dolly"]},zoomTo:{args:["zoom"]},panTo:{args:["lookAt"]},headingTo:{args:["heading"]}}),render:(n,e)=>n.space({perspective:e.perspective,orbit:e.orbit+e.orbitSpeed*n.time.total,elevation:e.elevation,dolly:e.dolly,lookAt:e.lookAt,zoom:e.zoom,heading:e.heading,viewportX:0,viewportY:0})}),pi=E({key:"rotated-box",state:{angle:k.number(-90)},defaults:{rotation:n=>n.angle},measure:(n,e,t)=>{let{cos:r,sin:s}=li(e.angle),{width:o,height:i}=n.max,a=Math.abs(e.angle%180)===90,c=o!==void 0&&i!==void 0?{width:o*r+i*s,height:o*s+i*r}:{width:a?i:o,height:a?o:i},d=0,u=0;for(let l of t){let f=l.measure(c);d=Math.max(d,f.width),u=Math.max(u,f.height)}return{width:d*r+u*s,height:d*s+u*r}},layout:(n,e,t)=>{let{cos:r,sin:s}=li(e.angle),o={x:0,y:0,width:n.width*r+n.height*s,height:n.width*s+n.height*r};return R(o,e,t)}});function li(n){let e=n*(Math.PI/180);return{cos:Math.abs(Math.cos(e)),sin:Math.abs(Math.sin(e))}}var{overlay:Bg,...Rr}=F,{overlayTo:jg,...zr}=$,Nr=n=>n.fontSize==="autofit"?"fill":"hug",_d=[];function wd(n){return n==null?null:n instanceof Us?n.toCommands():n}function xd(n){return Array.isArray(n)?n.map(({fill:e,stroke:t,...r})=>({...r,...e===void 0?{}:{fill:ve.resolve(e)},...t===void 0?{}:{stroke:rr.resolve(t)}})):[]}var vd={...Rr,...qt,text:k.text("",{typing:!0}),wrap:!1,path:k.custom(null,{resolve:wd}),runs:k.custom([],{resolve:xd,animatable:!1})},Fr=n=>({text:n.text,wraps:n.wrap,glyphPath:n.path,runs:n.runs}),sn=E({key:"text",allowedChildren:[],state:vd,defaults:{width:n=>n.fontSize==="autofit"||n.wrap?"fill":"hug",height:Nr},commands:{...zr,append:{args:{text:k.text("",{multiline:!0})},run:(n,e)=>n.tween({text:e.text+n.args.text})},prepend:{args:{text:k.text("",{multiline:!0})},run:(n,e)=>n.tween({text:n.args.text+e.text})}},load:(n,e)=>Ar(n,e,Fr(e)),measure:(n,e)=>kr(n,e,Fr(e)),render:(n,e)=>Sr(n,e,Fr(e))}),bd={...Rr,...qt,value:0,format:k.custom("number"),customPattern:"",fractionDigits:0,grouped:!0,currencySymbol:"$"},$r=n=>({text:Co(n.value,Po(n)),wraps:!1,glyphPath:null,runs:_d}),mi=E({key:"number",allowedChildren:[],state:bd,defaults:{width:Nr,height:Nr},commands:{...zr,countTo:{args:["value"]}},load:(n,e)=>Ar(n,e,$r(e)),measure:(n,e)=>kr(n,e,$r(e)),render:(n,e)=>Sr(n,e,$r(e))}),{verticalAlign:Vg,textDecoration:Kg,textCase:Ug,minFontSize:Gg,...kd}=qt,gi=E({key:"richtext",allowedChildren:[],state:{...Rr,...kd,fontSize:k.number(48,{inherit:Ro("fontSize",{autofit:!1})}),spans:k.custom([],{resolve:n=>n==null?[]:Array.isArray(n)?n:[n]})},defaults:{width:"hug",height:"hug"},commands:{...zr},load:(n,e)=>$o(n,e),measure:(n,e)=>Do(n,e),render:(n,e)=>Fo(n,e)}),yi=E({key:"default-text-style",state:zo,provide:(n,e)=>Lo(n,e),render:(n,e)=>n.textStyle(Bo(e),()=>n.children())});var _i=E({key:"provider",state:{context:k.custom(void 0),value:k.custom(void 0)},provide:n=>n.context?[lt(n.context,n.value!==void 0?n.value:n.context.defaultValue)]:[]}),wi=E({key:"theme-provider",state:{theme:k.custom(void 0),data:k.custom(void 0),seed:k.custom(void 0)},provide:(n,e)=>{let t=[];return n.theme&&t.push(lt(Mr,{...e(Mr),...n.theme})),n.data&&t.push(lt(Or,{...e(Or),...n.data})),n.seed!==void 0&&t.push(lt(No,n.seed)),t}});var xi=ft({key:"sound",state:{src:k.custom(void 0),trimStart:0,trimEnd:k.custom(void 0),loop:!1,speed:k.custom(1,{lerp:Ws,kind:"audioParam"})},allowedChildren:[],commands:{play:(n,e)=>n.sound(e.src,{trimStart:e.trimStart,trimEnd:e.trimEnd,loop:e.loop,volume:e.volume,speed:e.speed,effects:e.effects,transitionIn:e.transitionIn,transitionOut:e.transitionOut})}}),vi=ft({key:"audioBus",state:{solo:!1}});var Sd={src:k.custom(void 0),fit:k.custom(void 0),crop:k.insets,zoom:1,anchor:k.alignment,matrix:k.custom(void 0),filters:k.custom([],{resolve:n=>er(n),lerp:Qn}),playing:!0,timestamp:k.custom(void 0),trimStart:k.custom(void 0),trimEnd:k.custom(void 0),speed:k.custom(void 0),loop:k.custom(void 0),duration:k.custom(void 0),volume:1,muted:!1,audioEffects:k.custom([],{resolve:n=>Te(n)}),bus:k.custom(void 0),segments:k.custom([])};function Ad(n,e){if(n.segments.length===0)return null;let t=0;for(let r of n.segments){if(e<=r.at)break;t+=Math.min(e-r.at,r.duration)*(r.speed??n.speed??1)}return t}function Md(n,e){let t=Ad(n,e);if(t===null)return;let r=n.trimStart??0,s=n.segments[0];return Ks(t+(s?s.from-r:0),r,n.trimEnd??1/0,n.loop,n.duration)}var Lr=new WeakMap;function Od(n,e,t){if(!e.src)return Lr.delete(n),null;let r=Md(e,t),s=e.crop,o=e.anchor,i=[e.src,e.fit??"",e.zoom,e.playing?1:0,s.left,s.right,s.top,s.bottom,o.x,o.y,e.timestamp??"",e.trimStart??"",e.trimEnd??"",e.speed??"",e.loop??"",e.duration??"",r??""].join("|"),a=Lr.get(n);if(a&&a.key===i)return a.fill;let c={type:"video",src:e.src,fit:e.fit,crop:e.crop,zoom:e.zoom,anchor:e.anchor,matrix:e.matrix,filters:e.filters,playing:e.playing,timestamp:e.timestamp??r,trimStart:e.trimStart,trimEnd:e.trimEnd,speed:e.speed,loop:e.loop,duration:e.duration},d=zt(c);return Lr.set(n,{key:i,fill:d}),d}var bi=E({key:"video",state:{...F,...j,...Se,...Sd},commands:{...$,play:{args:{from:k.custom(void 0),volume:k.custom(void 0),speed:k.custom(void 0)},run:(n,e)=>{let t=e,r=n.args.from!==void 0;if(!t.src||t.muted||!r&&!t.playing)return n.together([]);let s=n.args.speed??t.speed??1,o=!r&&(t.loop??"none")!=="none";return n.sound(t.src,{volume:n.args.volume??t.volume,loop:o,trimStart:r?n.args.from:t.trimStart,trimEnd:t.trimEnd,speed:s,effects:t.audioEffects,bus:t.bus,optional:!0,closed:!o})}}},load:(n,e)=>{e.src&&n.fill(zt({type:"video",src:e.src,filters:e.filters,trimStart:e.trimStart,trimEnd:e.trimEnd}))},measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>{let t=e,r=Od(xo(n).host,t,n.time.elapsed),s={width:n.size.width,height:n.size.height,cornerRadius:t.cornerRadius,cornerStyle:t.cornerStyle,start:t.start,end:t.end};Q(n,e,Be(n.size,e),{fill:[r??Ys,...e.fill],overlay:()=>r?new nt().mask().rect(s).fill([r]).applyMask().rect(s).fill(e.overlay).endMask():null})}});var De={orbit:0,elevation:0,distance:10};function ki(n){return n.orbit!==void 0||n.elevation!==void 0||n.distance!==void 0}function Br(n){let e=Z(n.target??0);if(!ki(n)){let i=n.lookAt??n.target;return{position:Z(n.position??0),lookAt:i===void 0?void 0:Z(i)}}let t=n.distance??De.distance,r=(n.orbit??De.orbit)*Math.PI/180,s=Ed(n.elevation??De.elevation,-89.9,89.9)*Math.PI/180,o=Math.cos(s)*t;return{position:{x:e.x+Math.sin(r)*o,y:e.y+Math.sin(s)*t,z:e.z+Math.cos(r)*o},lookAt:e}}function Ed(n,e,t){return n<e?e:n>t?t:n}var Si=P({key:"group3d"}),_t={geometry:w(),...Vo},Ai=P({key:"mesh3d",state:_t,render:(n,e)=>n.draw(Zt(e,e.geometry))}),Fe={startAngle:w(),sweep:w()},$e=["startAngle","sweep"];function ee(n,e,t,r){return P({key:n,state:{..._t,...t},render:(s,o)=>s.draw(Zt(o,ge(e,o,r)))})}var Mi=ee("box3d","box",{width:w(),height:w(),depth:w(),cornerRadius:w(),segments:w()},["width","height","depth","cornerRadius","segments"]),Oi=ee("sphere3d","sphere",{radius:w(),segments:w(),...Fe,startLatitude:w(),latitudeSweep:w()},["radius","segments","startLatitude","latitudeSweep",...$e]),Ei=ee("plane3d","plane",{width:w(),height:w(),segments:w()},["width","height","segments"]),Ti=ee("cylinder3d","cylinder",{radius:w(),height:w(),segments:w(),capped:w(),...Fe},["radius","height","segments","capped",...$e]),Ci=ee("cone3d","cone",{radius:w(),height:w(),segments:w(),capped:w(),...Fe},["radius","height","segments","capped",...$e]),Pi=ee("torus3d","torus",{radius:w(),thickness:w(),segments:w(),...Fe},["radius","thickness","segments",...$e]),Ii=ee("torus-knot3d","torusKnot",{radius:w(),thickness:w(),segments:w(),windings:w()},["radius","thickness","segments","windings"]),Di=ee("circle3d","circle",{radius:w(),segments:w(),...Fe},["radius","segments",...$e]),Fi=ee("ring3d","ring",{radius:w(),innerRadius:w(),segments:w(),...Fe},["radius","innerRadius","segments",...$e]),$i=ee("capsule3d","capsule",{radius:w(),height:w(),segments:w()},["radius","height","segments"]),Ni=P({key:"polyhedron3d",state:{..._t,shape:k.custom("icosahedron"),radius:w(),segments:w()},render:(n,e)=>n.draw(Zt(e,ge("polyhedron",e,["shape","radius","segments"])))}),Ri=ee("extrude3d","extrude",{path:w(),depth:w(),segments:w(),bevel:w()},["path","depth","segments","bevel"]),zi=ee("lathe3d","lathe",{points:w(),segments:w(),...Fe},["points","segments",...$e]),Li=ee("tube3d","tube",{points:w(),radius:w(),segments:w(),closed:w()},["points","radius","segments","closed"]),Bi=P({key:"instances3d",state:{..._t,instances:w(),colors:w()},render:(n,e)=>{!e.geometry||!e.instances?.length||n.draw(new fe().instances(e.geometry,Ko(e),e.instances,{colors:e.colors}))}}),ji=P({key:"points3d",state:_t,render:(n,e)=>{e.geometry&&n.draw(new fe().points(e.geometry,Uo(e)))}}),Vi=P({key:"line3d",state:{points:w(),geometry:w(),closed:k.custom(!1),segments:k.custom(!1),stroke:w(),opacity:w(),material:w()},render:(n,e)=>{!e.geometry&&!e.points?.length||n.draw(new fe().line({points:e.geometry?void 0:e.points,geometry:e.geometry,closed:e.closed,segments:e.segments,stroke:e.stroke,opacity:e.opacity,material:e.material}))}}),Ki=P({key:"sprite3d",state:{fill:k.custom(void 0,{lerp:Gs}),opacity:w(),material:w()},render:(n,e)=>n.draw(new fe().sprite({fill:e.fill,opacity:e.opacity,material:e.material}))}),Ui=P({key:"model3d",state:{src:w(),animation:w(),override:w()},render:(n,e)=>{e.src&&n.draw(new fe().model({src:e.src,animation:e.animation,override:e.override}))}}),vy=P({key:"modelView3d",state:{src:w(),animation:w(),override:w(),clip:"",clipTime:0},render:(n,e)=>{if(!e.src){n.draw(new fe().box({width:1,height:1,depth:1,material:{type:"basic",color:"#6b7280",wireframe:!0,transparent:!0,opacity:.7}}));return}n.draw(new fe().model({src:e.src,animation:{clip:Td(e.clip),time:e.clipTime},override:e.override}))}});function Td(n){let e=n.trim();if(e==="")return;let t=Number(e);return Number.isInteger(t)&&t>=0?t:e}var jr={shadow:!1},Gi=P({key:"ambient-light3d",state:{color:me(),intensity:w()},render:(n,e)=>n.light(ge("ambient",e,["color","intensity"]))}),Yi=P({key:"hemisphere-light3d",state:{sky:me(),ground:me(),intensity:w()},render:(n,e)=>n.light(ge("hemisphere",e,["sky","ground","intensity"]))}),Xi=P({key:"directional-light3d",state:{color:me(),intensity:w(),target:Jt("origin")},defaults:jr,render:(n,e)=>n.light(ge("directional",e,["color","intensity","target","shadow"]))}),Wi=P({key:"point-light3d",state:{color:me(),intensity:w(),distance:w(),decay:w()},defaults:jr,render:(n,e)=>n.light(ge("point",e,["color","intensity","distance","decay","shadow"]))}),qi=P({key:"spot-light3d",state:{color:me(),intensity:w(),distance:w(),angle:w(),penumbra:w(),decay:w(),target:Jt("origin")},defaults:jr,render:(n,e)=>n.light(ge("spot",e,["color","intensity","distance","angle","penumbra","decay","target","shadow"]))}),Hi=P({key:"area-light3d",state:{color:me(),intensity:w(),width:w(),height:w()},render:(n,e)=>n.light(ge("area",e,["color","intensity","width","height"]))}),Cd=["target","orbit","elevation","distance","fov","frustumHeight","near","far","zoom"],Pd=["orbit","elevation","distance"],Ji=P({key:"camera3d",state:{type:k.custom("perspective"),target:Jt("origin"),orbit:w(),elevation:w(),distance:w(),fov:w(),frustumHeight:w(),near:w(),far:w(),zoom:w()},commands:{orbitTo:{args:{orbit:Ht({step:1,unit:"\xB0"}),elevation:Ht({min:-89,max:89,step:1,unit:"\xB0"}),distance:Ht({min:.01,step:.1})},run:(n,e)=>{let t={orbit:e.orbit??De.orbit,elevation:e.elevation??De.elevation,distance:e.distance??De.distance};return n.animate(r=>{let s={};for(let o of Pd){let i=n.args[o];i!==void 0&&(s[o]=t[o]+(i-t[o])*r)}return s})}},lookTo:{args:["target"]}},render:(n,e)=>{let t={type:e.type};for(let r of Cd)e[r]!==void 0&&(t[r]=e[r]);n.camera(t)}}),Zi=P({key:"fog3d",state:{color:me(),near:w(),far:w(),density:w()},render:(n,e)=>{let t={};e.color!==void 0&&(t.color=e.color),e.density!==void 0?t.density=e.density:(e.near!==void 0&&(t.near=e.near),e.far!==void 0&&(t.far=e.far)),n.fog(t)}}),Qi=P({key:"environment3d",state:{src:w(),faces:w(),preset:w(),intensity:w(),background:w(),blur:w()},render:(n,e)=>{if(e.src===void 0&&e.faces===void 0&&e.preset===void 0)return n.environment(null);let t=jo(e,["src","faces","preset","intensity","background","blur"]);(e.rotationX||e.rotationY||e.rotationZ)&&(t.rotation=[e.rotationX,e.rotationY,e.rotationZ]),n.environment(t)}});var ea=E({key:"canvas3d",state:{...F,...j,...Se,...Go},defaults:{width:"fill",height:"fill"},commands:{...$,...Yo},allowedChildren:["2d","3d"],load:n=>Xo(n),measure:(n,e,t)=>K(n,e,t,T(e)),layout:(n,e,t)=>R(n,e,t,T(e)),render:(n,e)=>Wo(n,e)});function Ke(n){return n.kind==="still"}function Oy(n){return n.kind==="composition"}function on(n){return n.kind==="audio"}function Id(n){return n.kind!=="still"}var b="";function U(n){let e=n;return{start:e.startAt??0,end:e.endAt??1/0}}function Ey(n,e){return Ue(new Map(n.map(t=>[t.id,t])),e)}function ta(n){let e=new Map(n.map(o=>[o.id,o])),t=new Map,r=[],s=new Set;for(let o of e.values()){if(t.has(o.id))continue;r.length=0,s.clear();let i,a=o;for(;a;){let c=t.get(a.id);if(c){i=c;break}if(s.has(a.id)){for(let d of r)t.set(d.id,Ue(e,d.id));r.length=0;break}r.push(a),s.add(a.id),a=a.parentId===null?void 0:e.get(a.parentId)}for(let c=r.length-1;c>=0;c--){let d=U(r[c]);i&&(d.start=Math.max(d.start,i.start),d.end=Math.min(d.end,i.end)),t.set(r[c].id,d),i=d}}return t}function Ue(n,e){let t=n.get(e);if(!t)return;let r=U(t),s=new Set;for(;t.parentId!==null&&!s.has(t.id);){s.add(t.id);let o=n.get(t.parentId);if(!o)break;let i=U(o);r.start=Math.max(r.start,i.start),r.end=Math.min(r.end,i.end),t=o}return r}function Ty(n){let{startAt:e,endAt:t,...r}=n;return r}function Dd(n){let e=n.duration??0;return e<=0||!n.loop||n.loop.count===null?e:e*eo(n.loop)}function de(n){if(!Id(n))return 0;if(n.duration!==void 0)return n.duration;let e=0;for(let t of n.commands)e=Math.max(e,t.at+Dd(t));for(let t of n.nodes)t.startAt!==void 0&&(e=Math.max(e,t.startAt)),t.endAt!==void 0&&Number.isFinite(t.endAt)&&(e=Math.max(e,t.endAt));return e}function Fd(n){return typeof n=="object"&&n!==null&&n.kind==="project"}function na(n,e={}){return Fd(n)?n:{kind:"project",...n.formatVersion!==void 0&&{formatVersion:n.formatVersion},name:e.name??"Untitled",fps:e.fps,viewport:e.viewport,theme:n.theme,tracks:[{id:"clip",clip:n,duration:de(n)}]}}var Kr=2,wt=class extends Error{version;supported;constructor(e,t=2){super(`This document is format ${e}, newer than this engine reads (format ${t}). Open it with a newer engine.`),this.name="DocumentTooNewError",this.version=e,this.supported=t}},ra=[{from:0,description:"Documents start carrying `formatVersion`; a clip's retired `constants` rows become `variables`.",clip:(n,e)=>{if(!Array.isArray(n.constants))return n;let{constants:t,...r}=n,s=Array.isArray(r.variables)?[...r.variables]:[];for(let o of t){if(typeof o!="object"||o===null){s.push(o);continue}let{kind:i,...a}=o;s.push(a)}return e("constants",`${t.length} constant row(s) moved into \`variables\`.`),{...r,variables:s}}},{from:1,description:'SkSL is retired: every shader fill, shader effect and shader pack written in it says `language: "sksl"`, the `sksl` effect key becomes `shader`, and `coords` is dropped.',clip:(n,e)=>Vr(n,"",e)}],$d=/\b(?:half4|float4|vec4)\s+main\s*\(|^\s*uniform\s+\w+\s+\w+/m,Nd=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function Vr(n,e,t){if(Array.isArray(n)){let s;return n.forEach((o,i)=>{let a=Vr(o,`${e}[${i}]`,t);a!==o&&((s??=[...n])[i]=a)}),s??n}if(!Nd(n))return n;let r;for(let[s,o]of Object.entries(n)){let i=Vr(o,e?`${e}.${s}`:s,t);i!==o&&((r??={...n})[s]=i)}return Rd(r??n,e,t)}function Rd(n,e,t){let r=n.type==="sksl";if(!(r||n.type==="shader"&&(typeof n.source=="string"||typeof n.shader=="string")||(n.scope==="fill"||n.scope==="effect")&&typeof n.source=="string"))return n;let o={...n};r&&(o.type="shader");let i=o.type==="shader"&&typeof o.shader=="string"&&o.source===void 0;i&&(o.source=o.shader,delete o.shader);let a=o.language==="sksl"||o.language===void 0&&(r||$d.test(typeof o.source=="string"?o.source:"")),c=a&&o.language===void 0;c&&(o.language="sksl");let d="coords"in o;return delete o.coords,a?t(e,"SkSL shaders no longer draw; port it to WGSL."):r?t(e,"The retired `sksl` effect key is now `shader`."):i?t(e,"The shader's `shader` field is now `source`."):d&&t(e,"`coords` dropped; it only ever applied to SkSL."),r||i||c||d?o:n}function Ur(n){if(typeof n!="object"||n===null)return 0;let e=n.formatVersion;if(e===void 0)return 0;if(typeof e!="number"||!Number.isInteger(e)||e<0)throw new TypeError(`formatVersion must be a whole number >= 0 (got ${JSON.stringify(e)}).`);return e}function Gr(n){return zd(n,ra,2)}function zd(n,e,t){let r=Ur(n);if(r>t)throw new wt(r,t);if(typeof n!="object"||n===null||Array.isArray(n))return{document:n,from:r,to:r,changes:[]};let s=[],o=n;return{document:o.kind==="project"?Ld(o,r,e,t,s):ia(o,r,e,t,s,""),from:r,to:t,changes:s}}function sa(n,e,t){let r=[];for(let s=n;s<e;s++){let o=t.find(i=>i.from===s);if(!o)throw new Error(`No document migration from format ${s} to ${s+1}.`);r.push(o)}return r}function oa(n,e,t){return(r,s)=>n.push({from:e,path:t&&r?`${t}.${r}`:t||r,message:s})}function ia(n,e,t,r,s,o,i=!0){if(e===r)return n;let a=n;for(let c of sa(e,r,t))c.clip&&(a=c.clip(a,oa(s,c.from,o)));return i?{...a,formatVersion:r}:a}function Ld(n,e,t,r,s){let o=n;if(e<r)for(let c of sa(e,r,t))c.project&&(o=c.project(o,oa(s,c.from,"")));let i=!1,a=Array.isArray(o.tracks)?o.tracks.map((c,d)=>{if(typeof c!="object"||c===null)return c;let u=c.clip;if(typeof u!="object"||u===null||Array.isArray(u))return c;let l=u.formatVersion!==void 0,f=l?Ur(u):e;if(f>r)throw new wt(f,r);let h=ia(u,f,t,r,s,`tracks[${d}].clip`,l);return h===u?c:(i=!0,{...c,clip:h})}):o.tracks;return e===r&&!i?n:{...o,...i?{tracks:a}:{},formatVersion:r}}var aa=new Set(["normal","reverse","alternate"]);function z(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ie(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0}function la(n,e,t){if(n===void 0)return;if(!z(n)){t.push({path:e,message:"easing must be an object with a `kind`."});return}let{kind:r,args:s}=n;if(typeof r!="string"||!or.has(r)){t.push({path:`${e}.kind`,message:`easing kind must be one of ${[...or].join(", ")} (got ${JSON.stringify(r)}).`});return}r==="custom"&&s!==void 0&&typeof s!="string"&&!sr(s)&&t.push({path:`${e}.args`,message:"a custom easing's args must be its curve \u2014 two or more `{ x, y }` points \u2014 or a registered ease's key."})}function fa(n,e,t){la(n,e,t),z(n)&&n.kind==="custom"&&!sr(n.args)&&t.push({path:`${e}.args`,message:"an audio ease cannot name a registered ease; draw its curve (two or more `{ x, y }` points) instead."})}function ca(n,e,t){if(!(n===void 0||typeof n=="number"&&Number.isFinite(n)||I.isSource(n))){if(!z(n)||!Array.isArray(n.keys)){t.push({path:e,message:"must be a finite number, an expression or a ramp, `{ keys: [{ at, value }, \u2026] }`."});return}n.keys.forEach((r,s)=>{let o=`${e}.keys[${s}]`;if(!z(r)){t.push({path:o,message:"a ramp key must be an object."});return}(r.at===void 0==(r.before===void 0)||!ie(r.at??r.before))&&t.push({path:o,message:"a ramp key needs exactly one of `at` (seconds after the start) or `before` (seconds before the end), >= 0."}),(typeof r.value!="number"||!Number.isFinite(r.value))&&t.push({path:`${o}.value`,message:"a ramp key's value must be a finite number."}),fa(r.ease,`${o}.ease`,t)})}}var Bd=new Set(["duration","curve"]);function da(n,e,t){if(n!==void 0){if(!z(n)){t.push({path:e,message:"a transition must be an object, `{ duration, curve? }`."});return}ie(n.duration)||t.push({path:`${e}.duration`,message:"a transition's duration must be a finite number of seconds >= 0."}),n.curve!==void 0&&n.curve!=="equalPower"&&fa(n.curve,`${e}.curve`,t);for(let r of Object.keys(n))Bd.has(r)||t.push({path:`${e}.${r}`,message:`a transition has no "${r}" (yet): only duration and curve.`})}}function jd(n,e,t,r){"filters"in e&&r.push({path:`${t}.filters`,message:"audio `filters` was renamed to `effects`."});for(let o of["volume","pan",...n==="sound"?["speed"]:[]])ca(e[o],`${t}.${o}`,r);n==="sound"&&e.loop===!0&&z(e.speed)&&r.push({path:`${t}.speed`,message:"a looping sound cannot ramp its speed: there is no one pass of the source for the ramp to run over."});let s=e.effects;s!==void 0&&(Array.isArray(s)?s:[s]).forEach((i,a)=>{let c=Array.isArray(s)?`${t}.effects[${a}]`:`${t}.effects`;if(!z(i)||typeof i.type!="string"){r.push({path:c,message:"an effect must be an object with a `type`."});return}for(let[d,u]of Object.entries(i))d!=="type"&&ca(u,`${c}.${d}`,r)}),da(e.transitionIn,`${t}.transitionIn`,r),da(e.transitionOut,`${t}.transitionOut`,r)}function Vd(n,e,t){if(n===void 0)return;if(!z(n)){t.push({path:e,message:"loop must be an object with a `count`."});return}let{direction:r,count:s}=n;s!==null&&(typeof s!="number"||!Number.isInteger(s)||s<0)&&t.push({path:`${e}.count`,message:"loop count must be a whole number of repeats >= 0, or null to repeat for the rest of the clip."}),r!==void 0&&!aa.has(r)&&t.push({path:`${e}.direction`,message:`loop direction must be one of ${[...aa].join(", ")} (got ${JSON.stringify(r)}).`})}function Kd(n,e,t){if(!z(n))return t.push({path:e,message:"node must be an object."}),!1;let r=!0,{id:s,type:o,parentId:i,layerOrder:a,props:c,key:d}=n;return typeof s!="string"&&(t.push({path:`${e}.id`,message:"id must be a string."}),r=!1),(typeof o!="string"||o.length===0)&&(t.push({path:`${e}.type`,message:"type must be a non-empty string."}),r=!1),i!==null&&typeof i!="string"&&(t.push({path:`${e}.parentId`,message:"parentId must be a node id or null."}),r=!1),(typeof a!="number"||!Number.isFinite(a))&&(t.push({path:`${e}.layerOrder`,message:"layerOrder must be a finite number."}),r=!1),z(c)?(o==="sound"||o==="audioBus")&&jd(o,c,`${e}.props`,t):(t.push({path:`${e}.props`,message:"props must be an object (`{}` when nothing is set)."}),r=!1),d!==void 0&&(typeof d!="string"||d.length===0?(t.push({path:`${e}.key`,message:"key must be a non-empty string when present."}),r=!1):(d.includes("]")||d.includes("."))&&(t.push({path:`${e}.key`,message:`node key "${d}" cannot contain "]" or "." \u2014 it is referenced as "[${d}.prop]".`}),r=!1)),r}function ha(n,e){let t=new Map;for(let r of n){let s=r.spec.key;if(typeof s!="string"||s.length===0)continue;let o=t.get(s);if(o){e.push({path:`${r.path}.key`,message:`duplicate node key "${s}" (also declared at ${o.path}).`});continue}t.set(s,r)}return t}function Ud(n,e,t,r){n.id===""&&(n.type!==t||n.parentId!==null)&&r.push({path:e,message:`the node with id "" is this document's root and must be \`{ type: "${t}", parentId: null }\`.`})}function Gd(n,e,t){if(!z(n))return t.push({path:e,message:"command must be an object."}),!1;let r=!0,{id:s,type:o,targetId:i,at:a,duration:c,args:d}=n;return(typeof s!="string"||s.length===0)&&(t.push({path:`${e}.id`,message:"id must be a non-empty string."}),r=!1),(typeof o!="string"||o.length===0)&&(t.push({path:`${e}.type`,message:"type must be a non-empty string."}),r=!1),i!==null&&typeof i!="string"&&(t.push({path:`${e}.targetId`,message:"targetId must be a node id, or null for the scene root."}),r=!1),ie(a)||(t.push({path:`${e}.at`,message:"at must be a finite number of seconds >= 0."}),r=!1),c!==void 0&&!ie(c)&&(t.push({path:`${e}.duration`,message:"duration must be a finite number of seconds >= 0."}),r=!1),z(d)||(t.push({path:`${e}.args`,message:"args must be an object (`{}` when there are none)."}),r=!1),la(n.easing,`${e}.easing`,t),Vd(n.loop,`${e}.loop`,t),r}function Yd(n,e,t){if(!z(n))return t.push({path:e,message:"variable must be an object."}),!1;let r=!0,{id:s,name:o,value:i,lerp:a}=n;return typeof s!="string"||s.length===0?(t.push({path:`${e}.id`,message:"id must be a non-empty string."}),r=!1):s.includes("]")&&(t.push({path:`${e}.id`,message:`variable id "${s}" cannot contain "]" \u2014 it is referenced as "[${s}]".`}),r=!1),o!==void 0&&typeof o!="string"&&(t.push({path:`${e}.name`,message:"name must be a string when present."}),r=!1),"value"in n?I.isSource(i)&&(t.push({path:`${e}.value`,message:"a variable holds a value, not an expression \u2014 only a node prop can be bound."}),r=!1):(t.push({path:`${e}.value`,message:"value is required \u2014 a variable is what it holds before anything changes it."}),r=!1),a!==void 0&&typeof a!="string"&&(t.push({path:`${e}.lerp`,message:"lerp must be a registered lerp key when present."}),r=!1),r}function pa(n,e){if(n===void 0)return[];if(!Array.isArray(n))return e.push({path:"variables",message:"variables must be an array."}),[];let t=[];return n.forEach((r,s)=>{let o=`variables[${s}]`;Yd(r,o,e)&&t.push({spec:r,path:o})}),t}function ma(n,e){let t=new Map;for(let r of n){let s=t.get(r.spec.id);if(s){e.push({path:`${r.path}.id`,message:`duplicate variable id "${r.spec.id}" (also declared at ${s.path}).`});continue}t.set(r.spec.id,r)}return t}function ga(n){let e=n.indexOf(".");return e<0?void 0:{key:n.slice(0,e),prop:n.slice(e+1)}}function Yr(n,e,t,r,s){for(let o of I.collect(n,e)){let i=I.tryParse(o.source);if("error"in i){s.push({path:o.path,message:i.error});continue}for(let a of i.expression.refs){let c=ga(a);if(!c){if(t.has(a))continue;s.push({path:o.path,message:r.has(a)?`expression references "[${a}]", which is a node key \u2014 a node is not a value, so name the prop too: "[${a}.x]".`:`expression references "[${a}]", which this document does not declare. Declared: ${[...t].map(d=>`[${d}]`).join(", ")||"none"}.`});continue}if(c.key.length===0||c.prop.length===0||c.prop.includes(".")){s.push({path:o.path,message:`expression references "[${a}]", which is not a node reference \u2014 one is "[key.prop]".`});continue}r.has(c.key)||s.push({path:o.path,message:`expression references "[${a}]", but no node in this document is keyed "${c.key}". Keyed: ${[...r].join(", ")||"none"}.`})}}}function Xr(n,e,t,r){if(z(e))for(let s of Object.keys(e)){let o=[];for(let i of I.collect(e[s],`${t}.${s}`)){let a=I.tryParse(i.source);if(!("error"in a))for(let c of a.expression.refs)ga(c)&&o.push(c)}o.length>0&&r.push({id:`${n}.${s}`,path:`${t}.${s}`,reads:o})}}function ya(n,e){let t=new Map(n.map(a=>[a.id,a])),r=new Set,s=[],o=new Set,i=a=>{let c=t.get(a);if(!c||r.has(a))return;let d=s.indexOf(a);if(d>=0){if(!o.has(a)){let u=[...s.slice(d),a];for(let l of u)o.add(l);e.push({path:c.path,message:`expression cycle ${u.join(" \u2192 ")} \u2014 a prop cannot read a prop that reads it back.`})}return}s.push(a);for(let u of c.reads)i(u);s.pop(),r.add(a)};for(let a of n)i(a.id)}function Xd(n,e){let t=new Map;for(let s of n){if(t.has(s.spec.id)){e.push({path:`${s.path}.id`,message:`duplicate node id "${s.spec.id}".`});continue}t.set(s.spec.id,s)}for(let s of n){let o=s.spec.parentId;o!==null&&!t.has(o)&&e.push({path:`${s.path}.parentId`,message:`parentId "${o}" is not a node in this document.`})}let r=new Set;for(let{spec:s}of n){if(r.has(s.id))continue;let o=new Set,i=s;for(;i;){if(o.has(i.id)){e.push({path:`${t.get(i.id)?.path}.parentId`,message:`node "${i.id}" is its own ancestor \u2014 parent chain forms a cycle.`});break}if(o.add(i.id),r.has(i.id))break;let a=i.parentId;i=a===null?void 0:t.get(a)?.spec}for(let a of o)r.add(a)}}function _a(n,e,t){for(let r of n){let s=e.get(r.id);s&&t.push({path:`${s.path}.id`,message:`"${r.id}" is already a node id \u2014 nodes and variables share one id space.`})}}function wa(n,e){n.constants!==void 0&&e.push({path:"constants",message:"constants were merged into `variables` \u2014 move each row there and drop its `kind`."})}function xa(n,e){let t=n.formatVersion;t!==void 0&&(typeof t!="number"||!Number.isInteger(t)||t<0?e.push({path:"formatVersion",message:"formatVersion must be a whole number >= 0 when present."}):t>2&&e.push({path:"formatVersion",message:`format ${t} is newer than this engine reads (${2}) \u2014 open it with a newer engine.`}))}var Wd={visualTracks:"visual and audio tracks were merged into `tracks` \u2014 move each row there.",audioTracks:"visual and audio tracks were merged into `tracks` \u2014 move each row there.",backgrounds:"a background is a track \u2014 put it first in `tracks`.",overlays:"an overlay is a track \u2014 put it last in `tracks`.",commands:"a project has no commands \u2014 each clip carries its own.",constants:"a project has no constants \u2014 declare `variables` in each clip."};function va(n,e,t,r,s,o){let i=new Map([["",t]]);for(let a of n)i.set(a.spec.id,a.spec.type),s.hasNode(a.spec.type)||o.push({path:`${a.path}.type`,message:`node type "${a.spec.type}" is not registered.`});for(let{spec:a,path:c}of e){if(s.command(a.type))continue;if(a.targetId!==null&&r.has(a.targetId)){o.push({path:`${c}.type`,message:`"${a.type}" is not a variable command.`});continue}let d=i.get(a.targetId??"");d===void 0||!s.hasNode(d)||s.takesCommand(d,a.type)||o.push({path:`${c}.type`,message:`node type "${d}" has no command "${a.type}".`})}}function ba(n,e,t){if(!Array.isArray(n))return t.push({path:"nodes",message:"nodes must be an array."}),[];let r=[];return n.forEach((s,o)=>{let i=`nodes[${o}]`;Kd(s,i,t)&&(r.push({spec:s,path:i}),Ud(s,i,e,t))}),Xd(r,t),r}function qd(n,e,t){let{startAt:r,endAt:s}=n;r!==void 0&&!ie(r)&&t.push({path:`${e}.startAt`,message:"startAt must be a finite number of seconds >= 0."}),s!==void 0&&!ie(s)&&t.push({path:`${e}.endAt`,message:"endAt must be a finite number of seconds >= 0."}),ie(s)&&s<=(ie(r)?r:0)&&t.push({path:`${e}.endAt`,message:`endAt (${s}s) must be after startAt (${r??0}s).`}),n.id===""&&(r!==void 0||s!==void 0)&&t.push({path:e,message:"the root is present for the whole clip \u2014 it cannot carry startAt or endAt."})}function Hd(n,e,t){wa(n,e),n.commands!==void 0&&e.push({path:"commands",message:"a still has no timeline, so no commands \u2014 make it a composition to animate it."});let r=ma(pa(n.variables,e),e),s=ba(n.nodes,"canvas2d",e);for(let u of s){let{startAt:l,endAt:f}=u.spec;(l!==void 0||f!==void 0)&&e.push({path:u.path,message:"a still has no timeline \u2014 drop startAt/endAt, or make it a composition."})}let o=s.map(u=>u.spec);_a(o,r,e),t&&va(s,[],"canvas2d",r,t,e);let i=ha(s,e),a=new Set(r.keys()),c=new Set(i.keys()),d=[];for(let u of s)Yr(u.spec.props,`${u.path}.props`,a,c,e),u.spec.key&&Xr(u.spec.key,u.spec.props,`${u.path}.props`,d);ya(d,e)}function Jd(n,e,t){ka(n,"canvas2d",e,t)}function Zd(n,e,t){ka(n,"audioBus",e,t)}var Qd={add:"a node is a row in `nodes` \u2014 its `startAt` is when it enters.",variable:"a variable is declared in `variables`."};function ka(n,e,t,r){if(wa(n,t),!Array.isArray(n.commands)){t.push({path:"commands",message:"commands must be an array."});return}n.duration!==void 0&&!ie(n.duration)&&t.push({path:"duration",message:"duration must be a finite number of seconds >= 0."});let s=ma(pa(n.variables,t),t),o=ba(n.nodes,e,t);for(let p of o)qd(p.spec,p.path,t);let i=o.map(p=>p.spec);_a(i,s,t);let a=ha(o,t),c=[],d=new Set;n.commands.forEach((p,y)=>{if(!Gd(p,`commands[${y}]`,t))return;if(d.has(p.id)){t.push({path:`commands[${y}].id`,message:`duplicate command id "${p.id}".`});return}let m=Qd[p.type];if(m){t.push({path:`commands[${y}].type`,message:`there is no "${p.type}" command \u2014 ${m}`});return}d.add(p.id),c.push({spec:p,path:`commands[${y}]`})});let u=new Map(i.map(p=>[p.id,p]));r&&va(o,c,e,s,r,t);for(let{spec:p,path:y}of c){if(p.targetId===null||s.has(p.targetId))continue;let m=Ue(u,p.targetId);m===void 0?t.push({path:`${y}.targetId`,message:`targetId "${p.targetId}" is not a node or variable in this document.`}):p.at<m.start&&t.push({path:`${y}.at`,message:`command runs at ${p.at}s but its target "${p.targetId}" is not present until ${m.start}s.`})}let l=new Set(s.keys()),f=new Set(a.keys());for(let p of o)Yr(p.spec.props,`${p.path}.props`,l,f,t);for(let{spec:p,path:y}of c)Yr(p.args,`${y}.args`,l,f,t);let h=[];for(let p of o)p.spec.key&&Xr(p.spec.key,p.spec.props,`${p.path}.props`,h);for(let{spec:p,path:y}of c){if(p.type!=="set"||p.targetId===null)continue;let m=u.get(p.targetId)?.key;m&&Xr(m,p.args,`${y}.args`,h)}ya(h,t)}function Wr(n,e={}){let t=[];if(!z(n))return{valid:!1,issues:[{path:"",message:"document must be an object."}]};xa(n,t);let{registry:r}=e,s=n.kind;return s==="still"?Hd(n,t,r):s==="composition"?Jd(n,t,r):s==="audio"?Zd(n,t,r):t.push({path:"kind",message:`kind must be "still", "composition" or "audio" (got ${JSON.stringify(s)}).`}),{valid:t.length===0,issues:t}}function eu(n,e={}){let t=[];if(!z(n))return{valid:!1,issues:[{path:"",message:"document must be an object."}]};let r=n;r.kind!=="project"&&t.push({path:"kind",message:`kind must be "project" (got ${JSON.stringify(r.kind)}).`}),(typeof r.name!="string"||r.name.length===0)&&t.push({path:"name",message:"name must be a non-empty string."}),r.fps!==void 0&&(typeof r.fps!="number"||!(r.fps>0)||!Number.isFinite(r.fps))&&t.push({path:"fps",message:"fps must be a positive number when present."}),xa(r,t);for(let[o,i]of Object.entries(Wd))r[o]!==void 0&&t.push({path:o,message:i});if(!Array.isArray(r.tracks))return t.push({path:"tracks",message:"tracks must be an array."}),{valid:!1,issues:t};let s=new Set;return r.tracks.forEach((o,i)=>{let a=`tracks[${i}]`;if(!z(o)){t.push({path:a,message:"track must be an object."});return}let c=o;if(typeof c.id!="string"||c.id.length===0?t.push({path:`${a}.id`,message:"id must be a non-empty string."}):s.has(c.id)?t.push({path:`${a}.id`,message:`duplicate track id "${c.id}".`}):s.add(c.id),c.name!==void 0&&typeof c.name!="string"&&t.push({path:`${a}.name`,message:"name must be a string when present."}),c.startAt!==void 0&&!ie(c.startAt)&&t.push({path:`${a}.startAt`,message:"startAt must be a finite number of seconds >= 0."}),ie(c.duration)||t.push({path:`${a}.duration`,message:"duration is required, and must be a finite number of seconds >= 0."}),c.clip===void 0){t.push({path:`${a}.clip`,message:"clip is required \u2014 a track places a clip document inline."});return}for(let d of tu(c.clip,e))t.push({path:`${a}.clip${d.path?`.${d.path}`:""}`,message:d.message})}),{valid:t.length===0,issues:t}}var ua=new WeakMap;function tu(n,e){if(!z(n)||e.registry)return Wr(n,e).issues;let t=ua.get(n);return t||(t=Wr(n).issues,ua.set(n,t)),t}function Sa(n,e){let{valid:t,issues:r}=eu(n,e);if(!t){let s=r.map(o=>` ${o.path||"<root>"}: ${o.message}`).join(`
2
2
  `);throw new Error(`Invalid project document:
3
3
  ${s}`)}}function Vy(n,e){let{valid:t,issues:r}=Wr(n,e);if(!t){let s=r.map(o=>` ${o.path||"<root>"}: ${o.message}`).join(`
4
4
  `);throw new Error(`Invalid clip document:
@@ -10,4 +10,4 @@ ${e}
10
10
 
11
11
  Loading it directly also failed: ${String(o)}`))}),!0):!1}recordFor(e,t,r){try{return e==="font"?{type:"font",src:t,startFrame:r,endFrame:r,fontFamily:t,fontWeight:400}:e==="image"?(this.assetCatalog.getImageMeta(t),{type:"image",src:t,startFrame:r,endFrame:r}):(this.assetCatalog.getVideoMeta(t),{type:"video",src:t,startFrame:r,endFrame:r,trimStart:0,trimEnd:this.assetCatalog.getVideoDuration(t)})}catch{return null}}clearRenderErrors(){this.rescuedAssets.clear(),this.renderErrors.length!==0&&(this.renderErrors.length=0,this.onRenderError?.(this.buildErrors))}constructor(e){let{project:t}=e;if(t.fps===void 0||t.viewport===void 0)throw new Error("PlaybackController takes a project whose fps and viewport are resolved \u2014 see Session.");this.renderContext=e.renderContext,this.measurer=e.measurer,this.masterClock=e.masterClock,this.storageAdapter=e.storageAdapter,this.audioDevice=e.audioDevice,this.fps=t.fps,this.viewport=t.viewport,this.precompBudgetMs=e.precompBudgetMs??Ft,this.onPrecompProgress=e.onPrecompProgress,this.assetCatalog=e.assets;let r={registry:e.registry,viewport:this.viewport,fps:this.fps,assets:e.assets,measurer:this.measurer};this.store=new Oe(t,r,{profile:e.precompProfile,isReady:s=>this.assetManager?.isReady(s)??!1}),this.precomper=new zn(t,r,{store:this.store}),this.precomp=this.precomper.ensureCovering(0),this.stateEvaluator=new Nn(t,r,this.store),this.assetManager=new Mn(this.precomp,this.storageAdapter,this.audioDevice,s=>this.captureRenderError(s)),this.masterClock.setDuration(this.totalDuration),this.masterClock.onPlay((s,o,i)=>{this.audioDevice.play(s,o,i),this.storageAdapter.setPlaying(!0)}),this.masterClock.onPause(()=>{this.audioDevice.stop(),this.storageAdapter.setPlaying(!1)}),this.masterClock.onTick(async s=>{let o=++this.seekGeneration,i=xe(s,this.fps);i>=this.totalFrames&&this.masterClock.pause(),this.discoverThrough(i),await this.loadFrame(i),this.isCurrent(o)&&(this.audioDevice.syncTo(s),this.renderAt(i),this.assetManager.prefetch(i),this.trimAround(i))}),this.startBackgroundPrecomp()}startBackgroundPrecomp(){this.precompRunning||this.disposed||this.precomp.complete||(this.precompRunning=!0,(async()=>{try{for(await En();!this.disposed&&!this.precomp.complete;){let e=await this.precomper.runAsync({budgetMs:this.precompBudgetMs,isCancelled:()=>this.disposed,onProgress:t=>this.adoptPrecomp(t)});if(this.disposed)return;this.precomp.complete||this.adoptPrecomp(e)}}finally{this.precompRunning=!1}})())}adoptPrecomp(e){this.disposed||(this.precomp=e,this.assetManager.setPrecomp(e),this.masterClock.setDuration(this.totalDuration),this.onPrecompProgress?.(e))}discoverThrough(e){let t=this.precomper.ensureCovering(Math.floor(e));t!==this.precomp&&this.adoptPrecomp(t)}async loadFrame(e){let t=[];for(let r of Me(this.store.spans,Math.floor(e)))for(let s of this.store.layoutGates(r.id))this.assetManager.isReady(s.src)||t.push(s);if(t.length===0){await this.assetManager.loadAt(e);return}await Promise.all([this.assetManager.loadAt(e),this.assetManager.loadRecords(t)])}trimAround(e){Math.abs(e-this.lastTrimFrame)<this.fps||(this.lastTrimFrame=e,this.store.trim(Math.floor(e),Math.ceil(Ef*this.fps)))}lastTrimFrame=0;get isPlaying(){return this.masterClock.isPlaying}get currentTime(){return this.masterClock.currentTime}get currentFrame(){return xe(this.masterClock.currentTime,this.fps)}onTime(e){this.masterClock.onTime(e)}onPlay(e){this.masterClock.onPlay(()=>e())}onPause(e){this.masterClock.onPause(e)}isCurrent(e){return!this.disposed&&e===this.seekGeneration}renderAt(e){if(!this.disposed){this.hasPainted=!0,this.renders++;try{this.store.settleGates(Me(this.store.spans,Math.floor(e)).map(t=>t.id)),this.stateEvaluator.stateAt(e),this.applyOverrides(),this.stateEvaluator.layout(this.measurer),this.renderContext.execute(()=>{this.stateEvaluator.render(this.renderContext)});for(let t of this.renderContext.takeRenderIssues()){let r=ps(t);this.captureRenderError(new Error(r.message),void 0,r)}}catch(t){this.captureRenderError(t,e)}this.announcePaint(e)}}announcePaint(e){if(this.onFramePainted)try{this.onFramePainted(Math.floor(e))}catch(t){console.error("[PlaybackController] onFramePainted listener threw:",t)}}async seek(e){if(this.disposed)return;let t=++this.seekGeneration;this.paintInFlight=t;try{let r=Math.max(0,Math.min(e,this.totalFrames));if(this.masterClock.pause(),this.discoverThrough(r),this.masterClock.seek(Re(r,this.fps)),await this.loadFrame(r),!this.isCurrent(t)||await this.settle(()=>this.renderAt(r),t)==="superseded")return;this.assetManager.prefetch(r),this.trimAround(r)}finally{this.paintLanded(t)}}setProject(e){if(this.disposed)return;let t=++this.seekGeneration;this.precomper.setProject(e),this.stateEvaluator.setProject(e),this.discoverThrough(this.currentFrame),this.clearRenderErrors(),this.masterClock.setDuration(this.totalDuration);let r=Math.min(this.currentFrame,Math.max(0,this.totalFrames-1));this.pendingSwap=t,this.paintInFlight=t,this.lastReplacePaint=this.loadAndRepaint(r,t),this.startBackgroundPrecomp()}reconcileCatalog(){this.disposed||(this.store.reset(),this.setProject(this.store.project))}whenReplaced(){return this.lastReplacePaint}lastReplacePaint=Promise.resolve();pendingSwap=0;async loadAndRepaint(e,t){try{try{await this.loadFrame(e)}catch(r){console.error("[PlaybackController] swap asset load failed:",r);return}await this.settle(()=>this.renderAt(e),t)}finally{this.pendingSwap===t&&(this.pendingSwap=0),this.paintLanded(t)}}seekWhilePlaying(e){++this.seekGeneration;let t=Math.max(0,Math.min(e,this.totalFrames));this.masterClock.seek(Re(t,this.fps))}async screenshot(){let e=this.stateEvaluator.currentFrame,t=++this.seekGeneration;this.paintInFlight=t;try{return await this.loadFrame(e),!this.isCurrent(t)||await this.settle(()=>this.renderAt(e),t,!0)==="superseded"?void 0:this.renderContext.screenshot()}finally{this.paintLanded(t)}}async settle(e,t,r=!1){let s=r?Tf(this.storageAdapter):this.storageAdapter,o=await Ec(e,s,()=>this.isCurrent(t));return o==="exhausted"&&console.warn(`[PlaybackController] frame ${this.stateEvaluator.currentFrame} still had decodes pending after ${4} passes`),o}paintInFlight=0;renders=0;repaintOwedSince=null;paintLanded(e){if(!(this.paintInFlight!==e||this.disposed)){if(this.paintInFlight=0,this.repaintOwedSince!==null){let t=this.renders===this.repaintOwedSince;this.repaintOwedSince=null,t&&!this.isPlaying&&this.renderAt(this.stateEvaluator.currentFrame)}this.settleTrailing()}}getTreeState(){let e=this.stateEvaluator.currentInstance;if(!e)return null;let t=this.precomp.tracks.find(c=>c.id===this.stateEvaluator.currentTrackId),r=t?.startFrame??0,s=t?.frameCount??We(e.duration,this.fps),o=new Map,i=new Map;e.forEachOwner((c,d,u,l)=>{i.set(d,l);let f=qe(u,this.fps,s);f&&o.set(l,{startFrame:r+f.startFrame,endFrame:r+f.endFrame})});let a=Pf(t?.audioRequests??[],i);return od(e.canvas,"",o,a)}getNodeState(e){let t=this.stateEvaluator.currentCanvas;if(!t)return null;let r=id(t,e);return r?{id:r.id,type:r.className,properties:r.properties}:null}getNodeInitialProps(e){return this.stateEvaluator.currentInstance?.baselineProps(e)??null}getNodeBox(e){let t=this.stateEvaluator.currentCanvas;return t?qc(t,e):null}getNodePropsAt(e){let t=this.stateEvaluator.currentCanvas;if(!t)return null;let r=Ee(t,e);return r?r.properties:null}getNodeBoxes(){let e=this.stateEvaluator.currentCanvas;if(!e)return[];let t=[];return Rs(e,"",t,!0),t}projectNode3D(e,t,r){let s=this.stateEvaluator.currentCanvas;return s?Jc(s,e,t,r):null}parentPlanePoint(e,t){let r=this.stateEvaluator.currentCanvas;return r?Vc(r,e,t):null}childPlanePoint(e,t){let r=this.stateEvaluator.currentCanvas;return r?Kc(r,e,t):null}reparentPlacement(e,t,r){let s=this.stateEvaluator.currentCanvas;return s?Uc(s,e,t,r):null}nodeHandles(e){let t=this.stateEvaluator.currentCanvas;return t?Gc(t,e):null}handleValue(e,t,r){let s=this.stateEvaluator.currentCanvas;return s?Yc(s,e,t,r):null}getTextLayout(e){let t=this.stateEvaluator.currentCanvas;if(!t)return null;let r=sd(t,e);return r instanceof N?this.textLayoutOf(r,e):null}textLayoutOf(e,t){let r=lc(this.measurer);return r?rd(e,t,r):null}pickNode(e,t=0){let r=this.stateEvaluator.currentCanvas;return r?Zc(r,e,t):null}setNodeOverride(e,t){let r=this.overrides.get(e);this.overrides.set(e,r?{...r,...t}:{...t}),this.applyOverrides()}clearNodeOverrides(e){(e===void 0?this.overrides.size>0&&(this.overrides.clear(),!0):this.overrides.delete(e))&&(this.stateEvaluator.rebuild(),this.repaint())}setEditorStates(e,t){this.stateEvaluator.setEditorStates(e,t),this.repaint()}repaint(){this.hasPainted&&(this.pendingSwap!==0&&this.isCurrent(this.pendingSwap)||(this.renderAt(this.stateEvaluator.currentFrame),this.settleTrailing()))}settleTrailing(){this.trailingSettle||this.disposed||this.isPlaying||!this.hasBackgroundDecodes()||this.repaintBehindDecodes().catch(e=>{console.error("[PlaybackController] background decode failed:",e)})}trailingSettle=!1;hasBackgroundDecodes(){return this.storageAdapter.hasPendingDecodes()||this.storageAdapter.hasPendingUpgrades()}async repaintBehindDecodes(){this.trailingSettle=!0;try{for(let e=0;e<4&&this.hasBackgroundDecodes();e++){let[t,r]=await Promise.all([this.storageAdapter.warmPendingDecodes(),this.storageAdapter.warmPendingUpgrades()]);if(!(t||r)||this.disposed||this.isPlaying)return;if(this.paintInFlight!==0){this.repaintOwedSince=this.renders;return}this.renderAt(this.stateEvaluator.currentFrame)}}finally{this.trailingSettle=!1}}applyOverrides(){if(this.overrides.size===0)return;let e=this.stateEvaluator.currentCanvas;if(e)for(let[t,r]of this.overrides)sd(e,t)?.set(r)}play(e=1,t=!1){if(this.currentFrame>=this.totalFrames){this.seek(0).then(()=>this.masterClock.play(e,t)).catch(()=>{});return}this.masterClock.play(e,t)}pause(){this.masterClock.pause()}setMuted(e){this.audioDevice.setMuted(e)}dispose(){this.disposed=!0,this.masterClock.dispose(),this.audioDevice.dispose(),this.stateEvaluator.dispose(),this.store.dispose(),this.assetManager.dispose()}},Ef=30;function Tf(n){return{async warmPendingDecodes(){let[e,t]=await Promise.all([n.warmPendingDecodes(),n.warmPendingUpgrades()]);return e||t}}}function Cf(n,e){switch(n.assetType){case"image":return{type:"image",src:n.src};case"font":return{type:"font",family:n.src,weight:400};case"video":try{return{type:"video",src:n.src,trimStart:0,trimEnd:e.getVideoDuration(n.src)}}catch{return}default:return}}function yk(n){return n.children.length>0}function od(n,e,t,r){let s={id:n.id,path:e,type:n.className,children:n._allChildren.map((a,c)=>od(a,ye(e,c),t,r))},o=r.get(e);o&&o.length>0&&(s.waveform=o);let i=t.get(e);return i&&(s.startFrame=i.startFrame,s.endFrame=i.endFrame),s}function Pf(n,e){let t=new Map;for(let r of n){let s=r.ownerId!==void 0?e.get(r.ownerId):"";if(s===void 0)continue;let o={src:r.src,startTime:r.startAt,endTime:Number.isFinite(r.endAt)?r.endAt:null},i=t.get(s);i?i.push(o):t.set(s,[o])}return t}function sd(n,e){if(e==="")return n;let t=n;for(let r of e.split(".")){let s=t._allChildren[Number(r)];if(!s)return null;t=s}return t}function id(n,e){if(n.id===e)return n;for(let t of n._allChildren){let r=id(t,e);if(r)return r}return null}var Vn=class{manifest;constructor(e){this.manifest=e}reconcile(e){this.manifest=e}normalizeKey(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"")}getImageMeta(e){let t=this.manifest.image[this.normalizeKey(e)];if(!t)throw new Error(`Image asset not found: "${e}". Check the file exists in your public folder and the src matches its filename.`);return t}getVideoMeta(e){let t=this.manifest.video[this.normalizeKey(e)];if(!t)throw new Error(`Video asset not found: "${e}". Check the file exists in your public folder and the src matches its filename.`);return t}getAudioMeta(e){let t=this.manifest.audio[this.normalizeKey(e)];if(!t)throw new Error(`No audio metadata for src: ${e}`);return t}getFontMeta(e){let t=this.manifest.font[e];if(!t)throw new Error(`No font metadata for key: ${e}`);return t}getFontFamilyMetas(e){return Object.values(this.manifest.font).filter(t=>t.fontFamily===e)}getVideoDuration(e){return this.getVideoMeta(e).duration}getAudioDuration(e){return this.getAudioMeta(e).duration}getMediaDuration(e){let t=this.normalizeKey(e),r=this.manifest.audio[t];if(r)return r.duration;let s=this.manifest.video[t];if(s)return s.duration;throw new Error(`Audio asset not found: "${e}". Check the file exists in your public folder and the src matches its filename.`)}getImageSize(e){let{width:t,height:r}=this.getImageMeta(e);return{width:t,height:r}}};var Kn=class{controller;constructor(e){this.controller=e}get isPlaying(){return this.controller.isPlaying}get frame(){return this.controller.currentFrame}play(e=1,t=!1){this.controller.play(e,t)}pause(){this.controller.pause()}seekFrame(e){this.controller.seekWhilePlaying(e)}setMuted(e){this.controller.setMuted(e)}onTime(e){this.controller.onTime(e)}onPlay(e){this.controller.onPlay(e)}onPause(e){this.controller.onPause(e)}};var Un=class{_isPlaying=!1;_currentTime=0;_duration=0;get isPlaying(){return this._isPlaying}get currentTime(){return this._currentTime}get duration(){return this._duration}setDuration(e){this._duration=e}setCurrentTime(e,t=!0){if(this._currentTime!==e&&(this._currentTime=e,!!t))for(let r of this.timeCallbacks)r(e)}setPlaying(e){this._isPlaying=e}play(e,t){this._isPlaying=!0;for(let r of this.playCallbacks)r(this._currentTime,e,t)}async tick(){await Promise.all(this.tickCallbacks.map(e=>e(this._currentTime)))}pause(){this._isPlaying=!1;for(let e of this.pauseCallbacks)e()}tickCallbacks=[];playCallbacks=[];pauseCallbacks=[];timeCallbacks=[];dispose(){this.tickCallbacks.length=0,this.playCallbacks.length=0,this.pauseCallbacks.length=0,this.timeCallbacks.length=0}onTick(e){this.tickCallbacks.push(e)}onPlay(e){this.playCallbacks.push(e)}onPause(e){this.pauseCallbacks.push(e)}onTime(e){this.timeCallbacks.push(e)}};var Gn=class extends Un{seek(e){this.setCurrentTime(e)}};var ad=class{engine;viewport;fps;constructor(e,t){this.engine=e,this._override={viewport:t.viewport,fps:t.fps},this._project=cd(t.document,t,e),this.viewport=this._project.viewport,this.fps=this._project.fps,this._catalog=new Vn(e.manifest),this._unsubscribe=e._onManifestChange(a=>{this._catalog.reconcile(a),this._storage.setCatalog(this._catalog),this._controller.reconcileCatalog()});let r={catalog:this._catalog,viewport:this.viewport,fps:this.fps};this._storage=e.platform.createStorageAdapter(r),this._renderContext=e.platform.createRenderContext(this._storage);let s=e.platform.createMeasureContext(this._storage),o=e.platform.createAudioSink(),i=e.platform.createTicker(this.fps,o);this.applyGlobals(),t.target!==void 0&&this._renderContext.mount(t.target),this._controller=new jn({project:this._project,registry:e._registry,renderContext:this._renderContext,measurer:s,storageAdapter:this._storage,masterClock:i??new Gn,audioDevice:o,assets:this._catalog,onPrecompProgress:t.onPrecompProgress}),this._playback=i===null?null:new Kn(this._controller)}get document(){return this._project}get playback(){return this._playback}get controller(){return this._controller}get surface(){return this._renderContext}get duration(){return this._controller.totalDuration}get totalFrames(){return this._controller.totalFrames}async seek(e){await this.seekFrame(Math.round(xe(e,this.fps)))}async seekFrame(e){this.applyGlobals(),await this._controller.seek(e)}replace(e){let t=cd(e,this._override,this);if(t.fps!==this.fps||t.viewport.width!==this.viewport.width||t.viewport.height!==this.viewport.height)throw new Error(`Cannot replace a ${this.viewport.width}\xD7${this.viewport.height} @ ${this.fps}fps document with a ${t.viewport.width}\xD7${t.viewport.height} @ ${t.fps}fps one \u2014 open a new session.`);this._project=t,this.applyGlobals(),this._controller.setProject(t)}image(e={}){return this.applyGlobals(),this.engine.exporter.exportStill({...e,frame:e.frame??{kind:"last"},project:this._project,registry:this.engine._registry,manifest:e.manifest??this.engine.manifest})}export(e={}){return this.applyGlobals(),this.engine.exporter.exportVideo({...e,project:this._project,registry:this.engine._registry,manifest:e.manifest??this.engine.manifest})}dispose(){this._unsubscribe(),this._controller.dispose(),this._renderContext.dispose()}applyGlobals(){Jn(this._project.theme)}_override;_project;_catalog;_storage;_renderContext;_controller;_playback;_unsubscribe};function cd(n,e,t){let r=na(n),s=Gr(r),o=s.changes.length>0?s.document:r,i={...o,viewport:e.viewport??o.viewport??t.viewport,fps:e.fps??o.fps??t.fps};return Sa(i),i}function Fk(n,e={}){let t=e.delimiter??",",r=Ff(n,t);if(r.length===0)return[];let s=r[0].map(d=>d.trim()),i=r.slice(1).map(d=>{let u={};return s.forEach((l,f)=>{u[l]=d[f]??""}),u}),a=If(s,i,e.numeric),c=Df(s,i,a,e.boolean);return a.length===0&&c.length===0?i:i.map(d=>{let u={...d};for(let l of a){let f=d[l];f!==""&&(u[l]=Number(f))}for(let l of c){let f=d[l];f!==""&&(u[l]=f==="true")}return u})}function $k(n,e){throw new Error(`parseData("${n}") must be called with a static string literal so the @motionscript/vite-plugin macro can inline it at build time. If you're seeing this error at runtime, either the plugin isn't installed/registered, or this call's argument isn't a plain string literal.`)}function If(n,e,t){return t===!1?[]:Array.isArray(t)?t:n.filter(r=>{let s=!1;for(let o of e){let i=o[r];if(i!==""){if(!Number.isFinite(Number(i)))return!1;s=!0}}return s})}function Df(n,e,t,r){if(r===!1)return[];if(Array.isArray(r))return r;let s=new Set(t);return n.filter(o=>{if(s.has(o))return!1;let i=!1;for(let a of e){let c=a[o];if(c!==""){if(c!=="true"&&c!=="false")return!1;i=!0}}return i})}function Ff(n,e){let t=[],r=[],s="",o=!1,i=!1,a=()=>{r.push(s),s=""},c=()=>{a(),t.push(r),r=[],i=!1};for(let d=0;d<n.length;d++){let u=n[d];if(o){u==='"'?n[d+1]==='"'?(s+='"',d++):o=!1:s+=u;continue}if(u==='"'){o=!0,i=!0;continue}if(u===e){i=!0,a();continue}if(u!=="\r"){if(u===`
12
12
  `){(i||s)&&c();continue}s+=u,i=!0}}return(i||s)&&c(),t}var Rk=(n,e)=>{let t=new Array(n);for(let r=0;r<n;r++)t[r]=e(r);return t};function Lk(){let n=null;function e(t){if(t!==void 0)n=t;else{if(n===null)throw new Error("Reference not assigned yet");return n}}return e}var Yn=class{state=0;constructor(e){this.setSeed(e)}setSeed(e){this.state=typeof e=="string"?e.split("").reduce((t,r)=>(t=(t<<5)-t+r.charCodeAt(0),t&t),0):e}next(){this.state|=0,this.state=this.state+1831565813|0;var e=Math.imul(this.state^this.state>>>15,1|this.state);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}},dd=4294967296,zs=class n{_seed;numericSeed;gen;spareGauss=null;constructor(e){this.gen=new Yn(e),this.adopt(e)}get seed(){return this._seed}set seed(e){this.adopt(e)}static toNumeric(e){return typeof e=="string"?e.split("").reduce((t,r)=>(t<<5)-t+r.charCodeAt(0),0):e}adopt(e){this._seed=e,this.numericSeed=n.toNumeric(e),this.gen.setSeed(e),this.spareGauss=null}nextFloat(e=0,t=1){return this.gen.next()*(t-e)+e}nextInt(e=0,t=dd){return Math.floor(this.gen.next()*(t-e))+e}floatArray(e,t=0,r=1){let s=new Array(e);for(let o=0;o<e;o++)s[o]=this.nextFloat(t,r);return s}intArray(e,t=0,r=dd){let s=new Array(e);for(let o=0;o<e;o++)s[o]=this.nextInt(t,r);return s}gauss(e=0,t=1){if(this.spareGauss!==null){let a=this.spareGauss;return this.spareGauss=null,e+t*a}let r,s,o;do r=this.gen.next()*2-1,s=this.gen.next()*2-1,o=r*r+s*s;while(o>=1||o===0);let i=Math.sqrt(-2*Math.log(o)/o);return this.spareGauss=s*i,e+t*(r*i)}noise(e,t=1){let r=e*t,s=Math.floor(r),o=r-s,i=o*o*(3-2*o),a=this.latticeValue(s),c=this.latticeValue(s+1);return a+(c-a)*i}reset(e=this._seed){this.adopt(e)}latticeValue(e){let t=Math.sin(e+this.numericSeed)*1e4;return t-Math.floor(t)}};function Jk(n){return typeof n?._stepper=="function"}export{je as a,fd as b,hd as c,Er as d,ht as e,md as f,Tp as g,Ve as h,Tr as i,hm as j,Qo as k,ei as l,ti as m,ye as n,en as o,tn as p,Ir as q,Ie as r,ri as s,si as t,oi as u,ii as v,ai as w,pg as x,mg as y,gg as z,yg as A,_g as B,wg as C,xg as D,ci as E,di as F,fi as G,hi as H,pi as I,sn as J,mi as K,gi as L,yi as M,_i as N,wi as O,xi as P,vi as Q,bi as R,ki as S,Br as T,Si as U,Ai as V,Mi as W,Oi as X,Ei as Y,Ti as Z,Ci as _,Pi as $,Ii as aa,Di as ba,Fi as ca,$i as da,Ni as ea,Ri as fa,zi as ga,Li as ha,Bi as ia,ji as ja,Vi as ka,Ki as la,Ui as ma,vy as na,Gi as oa,Yi as pa,Xi as qa,Wi as ra,qi as sa,Hi as ta,Ji as ua,Zi as va,Qi as wa,ea as xa,Ke as ya,Oy as za,on as Aa,Id as Ba,b as Ca,U as Da,Ey as Ea,ta as Fa,Ue as Ga,Ty as Ha,Dd as Ia,de as Ja,Fd as Ka,na as La,Kr as Ma,wt as Na,ra as Oa,Ur as Pa,Gr as Qa,Wr as Ra,eu as Sa,Sa as Ta,Vy as Ua,xt as Va,au as Wa,cu as Xa,cn as Ya,pu as Za,mu as _a,gu as $a,k_ as ab,un as bb,xu as cb,ku as db,Ge as eb,yn as fb,Tw as gb,Pw as hb,Fw as ib,$w as jb,fs as kb,ps as lb,xn as mb,hs as nb,cl as ob,dl as pb,ul as qb,ll as rb,fl as sb,pl as tb,hc as ub,wl as vb,xl as wb,_s as xb,vl as yb,bl as zb,vn as Ab,ue as Bb,bn as Cb,le as Db,pc as Eb,bt as Fb,kt as Gb,St as Hb,mc as Ib,kn as Jb,ws as Kb,q as Lb,At as Mb,Sn as Nb,Xe as Ob,An as Pb,Pl as Qb,Il as Rb,Mn as Sb,On as Tb,we as Ub,En as Vb,Dv as Wb,Re as Xb,xe as Yb,$v as Zb,We as _b,Mt as $b,_c as ac,Me as bc,re as cc,qe as dc,Tn as ec,Ft as fc,Oe as gc,Nn as hc,Es as ic,Ec as jc,Pb as kc,zn as lc,Ze as mc,Ds as nc,$c as oc,Nc as pc,se as qc,Vc as rc,Kc as sc,Uc as tc,Gc as uc,Yc as vc,Rt as wc,qc as xc,Ee as yc,Jc as zc,Zc as Ac,Rs as Bc,rd as Cc,Qb as Dc,ek as Ec,jn as Fc,yk as Gc,Vn as Hc,Kn as Ic,Un as Jc,Gn as Kc,ad as Lc,cd as Mc,Fk as Nc,$k as Oc,Rk as Pc,Lk as Qc,Yn as Rc,zs as Sc,Jk as Tc};
13
- //# sourceMappingURL=chunk-AOT33LMS.js.map
13
+ //# sourceMappingURL=chunk-IX53IFBD.js.map