@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.7
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.
- package/CHANGELOG.md +28 -0
- package/README.md +2 -4
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +3 -18
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/index.d.ts +3 -5
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +2 -2
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +19 -140
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +12 -108
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -1
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +4 -3
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +1 -2
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
- package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
- package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +53 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +41 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +149 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +113 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +516 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +99 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +63 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +313 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +109 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +167 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +2 -2
- package/dist/document/command-traits.js +1 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +1 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +1 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +3 -3
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/registry.d.ts +23 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +12 -18
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline.d.ts +3 -3
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +2 -2
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +4 -4
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +1 -1
- package/dist/document/validate.js.map +1 -1
- package/dist/experimental.d.ts +19 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +17 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +11 -5
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +7 -1
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +13 -19
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-update.js +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +3 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +4 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +17 -35
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +3 -3
- package/dist/runtime/engine.js +2 -2
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +1 -1
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +1 -1
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +43 -39
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +24 -25
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +7 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +2 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/index.d.ts +2 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +2 -10
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var m={plain:"#.#",number:"#,##0.##",currency:"$#,##0.00",percent:"#,##0.#%"},y={prefix:"",suffix:"",grouped:!1,minInt:1,minFrac:0,maxFrac:1,percent:!1};function g(t,e){let n=!1;for(let r of t){if(r==="'"){n=!n;continue}e(r,n)}}function p(t,e){let n=!1;return g(t,(r,c)=>{r===e&&!c&&(n=!0)}),n}function d(t,e){let n="",r=!1;for(let c of t){if(c==="'"){r=!r,n+=c;continue}c===e&&!r||(n+=c)}return n}function x(t){let e="";return g(t,n=>{e+=n}),e}function N(t){let e=!1,n=-1;for(let r=0;r<t.length;r++){let c=t[r];if(c==="'"){if(e=!e,n>=0)return[n,r];continue}let o=!e&&"#0,.".includes(c);if(o&&n<0)n=r;else if(!o&&n>=0)return[n,r]}return n<0?null:[n,t.length]}function P(t){let e=N(t);if(!e)return y;let n=t.slice(e[0],e[1]),r=t.slice(0,e[0]),c=t.slice(e[1]),o=p(r,"%")||p(c,"%"),f=x(o?d(r,"%"):r),s=x(o?d(c,"%"):c),u=n.indexOf("."),i=u<0?n:n.slice(0,u),a=u<0?"":n.slice(u+1),l=($,b)=>$.split(b).length-1;return{prefix:f,suffix:o?`${s}%`:s,grouped:i.includes(","),minInt:Math.max(1,l(i,"0")),minFrac:l(a,"0"),maxFrac:a.length,percent:o}}var h=new Map;function S(t){let e=h.get(t);if(e)return e;let n=P(t);return h.set(t,n),n}function T(t){return t.replace(/\B(?=(\d{3})+(?!\d))/g,",")}function I(t,e){if(!Number.isFinite(t))return"";let n=S(e),c=(n.percent?t*100:t).toFixed(n.maxFrac),o=c.startsWith("-"),[f="0",s=""]=(o?c.slice(1):c).split("."),u=f.padStart(n.minInt,"0"),i=s;for(;i.length>n.minFrac&&i.endsWith("0");)i=i.slice(0,-1);let a=(n.grouped?T(u):u)+(i?`.${i}`:"");return`${o&&Number(c)!==0?"-":""}${n.prefix}${a}${n.suffix}`}function F(t,e){if(t==="custom"){let n=e?.trim()??"";return n===""?m.plain:n}return m[t??"plain"]??m.plain}var E=["number","currency","percent","custom"],A=10;function _(t){if(t.format==="custom")return F("custom",t.customPattern);let e=Math.min(A,Math.max(0,Math.round(t.fractionDigits))),n=t.grouped?"#,##0":"0",r=e>0?`.${"0".repeat(e)}`:"",c=`${n}${r}`;return t.format==="currency"?`${D(t.currencySymbol)}${c}`:t.format==="percent"?`${c}%`:c}function D(t){let e=t.replaceAll("'","");return e===""?"":`'${e}'`}var M="";function q(t){M=t}function O(){return M}function k(t){if(t<=0)return 1;let e=Math.pow(10,Math.floor(Math.log10(t))),n=t/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function W(t,e,n,r){let c=n?t*.3:0,o=Math.max(0,t-c),f=Math.max(0,e-1);if(r!==void 0)return{step:r,per:Math.max(0,o-r*f),caption:c};let s=o/(1+f/5);return{step:s/5,per:s,caption:c}}export{m as a,I as b,F as c,E as d,A as e,_ as f,q as g,O as h,k as i,W as j};
|
|
2
|
-
//# sourceMappingURL=chunk-DHB4COFY.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{C as wo,F as Mt,G as _o,L as vo,a as u,b as po,c as O,d as Je,f as mo,g as R,l as ne,m as yo,n as Pe,s as Qe,t as go,v as xo,w as ve,y as kt,z as et}from"./chunk-2RIYH36X.js";import{a as ye}from"./chunk-XAWE4EAK.js";function So(t){return{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t}}function Yl(t,e){return{topLeft:t.top??e.topLeft,topRight:t.top??e.topRight,bottomLeft:t.bottom??e.bottomLeft,bottomRight:t.bottom??e.bottomRight}}function Xl(t,e){return{topLeft:t.left??e.topLeft,topRight:t.right??e.topRight,bottomLeft:t.left??e.bottomLeft,bottomRight:t.right??e.bottomRight}}function bt(t,e,n,r){if(r(t))return So(t);let o=n??So(e),i=t;if("topLeft"in i||"topRight"in i||"bottomLeft"in i||"bottomRight"in i){let s=t;return{topLeft:s.topLeft??o.topLeft,topRight:s.topRight??o.topRight,bottomLeft:s.bottomLeft??o.bottomLeft,bottomRight:s.bottomRight??o.bottomRight}}return"top"in i||"bottom"in i?Yl(t,o):"left"in i||"right"in i?Xl(t,o):{...o}}function Ct(t,e,n,r){return{topLeft:r(t.topLeft,e.topLeft,n),topRight:r(t.topRight,e.topRight,n),bottomLeft:r(t.bottomLeft,e.bottomLeft,n),bottomRight:r(t.bottomRight,e.bottomRight,n)}}function Ot(t,e=Object.is){return e(t.topLeft,t.topRight)&&e(t.topLeft,t.bottomLeft)&&e(t.topLeft,t.bottomRight)}var ge={resolve:(t,e)=>bt(t,0,e,n=>typeof n=="number"),lerp:(t,e,n)=>Ct(t,e,n,u),isUniformInput:t=>typeof t=="number",isUniform:t=>Ot(t),isZero:t=>t.topLeft===0&&t.topRight===0&&t.bottomLeft===0&&t.bottomRight===0};var Le={resolve:(t,e)=>bt(t,"rounded",e,n=>n==="rounded"||n==="angled"),lerp:(t,e,n)=>Ct(t,e,n,(r,o)=>n<.5?r:o),isUniformInput:t=>t==="rounded"||t==="angled",isUniform:t=>Ot(t)},Zh=(t,e,n)=>n<.5?t:e;function tt(t){switch(t){case"x":return{x:1,y:0};case"y":return{x:0,y:1};case"both":return{x:1,y:1};default:return{x:t.x,y:t.y}}}function Se(t,e){let n=tt(t),r=tt(e);return n.x===r.x&&n.y===r.y}function N(t){return Array.isArray(t)?t:R(t)}function ee(t,e){if(t===e)return!0;let n=N(t),r=N(e);return n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3]}var Un=["mode","clip"];function C(t,e){let n={...t};if(!e)return n;for(let r of Un){let o=e[r];o!==void 0&&(n[r]=o)}return n}function A(t,e){return t===void 0?{}:typeof t=="number"?{[e]:t}:t}function At(t){switch(t){case"behind":return-1;case"centered":return 0;case"ahead":return 1;default:return Math.max(-1,Math.min(1,t))}}var ko={lerp:(t,e,n)=>({type:"motionBlur",length:u(t.length,e.length,n),alignment:u(At(t.alignment),At(e.alignment),n),samples:u(t.samples,e.samples,n),strength:u(t.strength,e.strength,n),axis:O(tt(t.axis),tt(e.axis),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.length===e.length&&At(t.alignment)===At(e.alignment)&&t.samples===e.samples&&t.strength===e.strength&&Se(t.axis,e.axis)&&t.mode===e.mode};function q(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}var xe={resolve:Mo,lerp:q,hex(t){let[e,n,r,o]=Mo(t),i=Et(o);return`#${Et(e)}${Et(n)}${Et(r)}${i==="ff"?"":i}`}};function Mo(t){return Array.isArray(t)?t:R(t)}function Et(t){return Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0")}var Ul={standard:" .:-=+*#%@",blocks:" \u2591\u2592\u2593\u2588",braille:" \u2804\u28C0\u28C4\u28E4\u28F6\u28F7\u28FF",binary:"01",hex:"0123456789ABCDEF"};function ud(t){return Ul[t]??t}var bo={lerp:(t,e,n)=>({type:"ascii",size:u(t.size,e.size,n),charset:n<.5?t.charset:e.charset,fontFamily:n<.5?t.fontFamily:e.fontFamily,ink:q(N(t.ink),N(e.ink),n),background:q(N(t.background),N(e.background),n),colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.size===e.size&&t.charset===e.charset&&t.fontFamily===e.fontFamily&&ee(t.ink,e.ink)&&ee(t.background,e.background)&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var Pt=new Set;function Be(t,e){let n=`${t}\0${e}`;Pt.has(n)||(Pt.size>512&&Pt.clear(),Pt.add(n),console.warn(`[SkSL] ${e}`))}function Gl(t,e){if(typeof e=="number")return Number.isFinite(e)?e:(Be("normalize",`uniform "${t}" is ${e}; ignoring it.`),null);if(!Array.isArray(e))return Be("normalize",`uniform "${t}" is not a number or number array; ignoring it.`),null;let n=e.flat(1/0),r=[];for(let o of n){if(typeof o!="number"||!Number.isFinite(o))return Be("normalize",`uniform "${t}" contains a non-finite entry; ignoring it.`),null;r.push(o)}return r}function ae(t){if(!t)return{};let e=Array.isArray(t)?t.map(r=>[r.name,r.value]):Object.entries(t),n={};for(let[r,o]of e.sort(([i],[s])=>i<s?-1:i>s?1:0)){let i=Gl(r,o);i!==null&&(n[r]=i)}return n}function Kl(t,e,n){if(typeof t=="number"&&typeof e=="number")return u(t,e,n);if(Array.isArray(t)&&Array.isArray(e)){let r=Math.max(t.length,e.length);return Array.from({length:r},(o,i)=>u(t[i]??0,e[i]??0,n))}return n<.5?t:e}function Zl(t,e){return typeof t=="number"&&typeof e=="number"?t===e:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):!1}function Tt(t,e,n){let r={};for(let o of[...Object.keys(t),...Object.keys(e)].sort()){if(o in r)continue;let i=t[o],s=e[o];i===void 0?r[o]=s:s===void 0?r[o]=i:r[o]=Kl(i,s,n)}return r}function zt(t,e){let n=Object.keys(t);return n.length!==Object.keys(e).length?!1:n.every(r=>{let o=e[r];return o!==void 0&&Zl(t[r],o)})}function dd(t){let e=[],n=t.getUniformCount();for(let r=0;r<n;r++){let o=t.getUniform(r);e.push({name:t.getUniformName(r),slot:o.slot,length:Math.max(1,o.columns*o.rows),isInteger:!!o.isInteger})}return e}function pd(t,e,n,r,o){let i=new Float32Array(Math.max(0,e)),s=new Int32Array(i.buffer);for(let a of t){let l=a.name in n?n[a.name]:r[a.name];if(l===void 0){Be(o,`uniform "${a.name}" is declared but was not supplied; it will read as 0.`);continue}let c=typeof l=="number"?[l]:l;c.length!==a.length&&Be(o,`uniform "${a.name}" expects ${a.length} float(s) but got ${c.length}; the rest will read as 0.`);let f=Math.min(c.length,a.length);for(let h=0;h<f;h++){let d=a.slot+h;if(d<0||d>=i.length)break;a.isInteger?s[d]=Math.round(c[h]):i[d]=c[h]}}for(let a of Object.keys(n))t.some(l=>l.name===a)||Be(o,`uniform "${a}" was supplied but the shader declares no such uniform.`);return i}function md(t,e){let n=e.right-e.left,r=e.bottom-e.top;switch(t){case"centered":return[r,0,e.left+n/2,0,r,e.top+r/2,0,0,1];case"normalized":return[n,0,e.left,0,r,e.top,0,0,1];default:return[1,0,0,0,1,0,0,0,1]}}var Co=/\buniform\s+(shader|colorFilter|blender)\s+([A-Za-z_]\w*)\s*;/g;function yd(t){let e=t.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/[^\n]*/g," "),n=[];Co.lastIndex=0;let r;for(;(r=Co.exec(e))!==null;)n.push({kind:r[1],name:r[2]});return n}var Oo={lerp:(t,e,n)=>({type:"blur",radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.mode===e.mode};var Ao={lerp:(t,e,n)=>({type:"directionalBlur",radius:u(t.radius,e.radius,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.angle===e.angle&&t.mode===e.mode};var Eo={lerp:(t,e,n)=>({type:"grayscale",amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.mode===e.mode};var Po={lerp:(t,e,n)=>({type:"pixelate",blocks:O(t.blocks,e.blocks,n),sharpColors:n<.5?t.sharpColors:e.sharpColors,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.blocks.x===e.blocks.x&&t.blocks.y===e.blocks.y&&t.sharpColors===e.sharpColors&&t.mode===e.mode};var To={lerp:(t,e,n)=>({type:"bulge",strength:u(t.strength,e.strength,n),center:O(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var zo={lerp:(t,e,n)=>({type:"magnify",center:O(t.center,e.center,n),scale:u(t.scale,e.scale,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&t.scale===e.scale&&t.mode===e.mode,surface:"shader"};var Fo={lerp:(t,e,n)=>({type:"bloom",threshold:u(t.threshold,e.threshold,n),radius:u(t.radius,e.radius,n),intensity:u(t.intensity,e.intensity,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.threshold===e.threshold&&t.radius===e.radius&&t.intensity===e.intensity&&t.mode===e.mode};var Ro={lerp:(t,e,n)=>({type:"vintage",amount:u(t.amount,e.amount,n),warmth:u(t.warmth,e.warmth,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.warmth===e.warmth&&t.mode===e.mode};var No={lerp:(t,e,n)=>({type:"chromaticAberration",amount:u(t.amount,e.amount,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.angle===e.angle&&t.mode===e.mode};var Do={lerp:(t,e,n)=>({type:"invert",channel:n<.5?t.channel:e.channel,strength:u(t.strength,e.strength,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.strength===e.strength&&t.mode===e.mode};var Io={lerp:(t,e,n)=>({type:"scatter",strength:u(t.strength,e.strength,n),axis:n<.5?t.axis:e.axis,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&Se(t.axis,e.axis)&&t.mode===e.mode,surface:"shader"};var jo={lerp:(t,e,n)=>({type:"posterize",levels:u(t.levels,e.levels,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.levels===e.levels&&t.mode===e.mode,surface:"shader"};var Lo={resolve:t=>{let e=t;if(!(t.type!=="shader"||e.shader!==void 0))return t;let{shader:r,...o}=e;return{...o,type:"shader",source:t.source??r??""}},lerp:(t,e,n)=>{let r=n<.5?t:e;return{type:"shader",source:r.source,...r.shaderId!==void 0?{shaderId:r.shaderId}:{},mode:r.mode,blendMode:r.blendMode,uniforms:Tt(ae(t.uniforms),ae(e.uniforms),n)}},equals:(t,e)=>t.source===e.source&&t.mode===e.mode&&t.blendMode===e.blendMode&&zt(ae(t.uniforms),ae(e.uniforms)),surface:t=>t.mode==="backdrop"?"shader":"filter"};var Bo={lerp:(t,e,n)=>({type:"outline",width:u(t.width,e.width,n),color:q(N(t.color),N(e.color),n),position:n<.5?t.position:e.position,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.width===e.width&&ee(t.color,e.color)&&t.position===e.position&&t.mode===e.mode,surface:"shader"};var Wo={lerp:(t,e,n)=>({type:"dropShadow",offsetX:u(t.offsetX,e.offsetX,n),offsetY:u(t.offsetY,e.offsetY,n),blur:u(t.blur,e.blur,n),spread:u(t.spread,e.spread,n),color:q(N(t.color),N(e.color),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.offsetX===e.offsetX&&t.offsetY===e.offsetY&&t.blur===e.blur&&t.spread===e.spread&&ee(t.color,e.color)&&t.mode===e.mode,surface:"shader"};var qo={lerp:(t,e,n)=>({type:"vignette",amount:u(t.amount,e.amount,n),radius:u(t.radius,e.radius,n),softness:u(t.softness,e.softness,n),color:q(N(t.color),N(e.color),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.radius===e.radius&&t.softness===e.softness&&ee(t.color,e.color)&&t.mode===e.mode,surface:"shader"};var $o={lerp:(t,e,n)=>({type:"grain",amount:u(t.amount,e.amount,n),size:u(t.size,e.size,n),seed:u(t.seed,e.seed,n),animated:n<.5?t.animated:e.animated,colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.size===e.size&&t.seed===e.seed&&t.animated===e.animated&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var Vo={lerp:(t,e,n)=>({type:"sharpen",amount:u(t.amount,e.amount,n),radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.radius===e.radius&&t.mode===e.mode,surface:"shader"};var Ho={lerp:(t,e,n)=>({type:"edges",strength:u(t.strength,e.strength,n),kernel:n<.5?t.kernel:e.kernel,colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&t.kernel===e.kernel&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var Yo={lerp:(t,e,n)=>({type:"threshold",level:u(t.level,e.level,n),smoothness:u(t.smoothness,e.smoothness,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.level===e.level&&t.smoothness===e.smoothness&&t.mode===e.mode,surface:"shader"};var Xo={lerp:(t,e,n)=>({type:"radialBlur",amount:u(t.amount,e.amount,n),style:n<.5?t.style:e.style,center:O(t.center,e.center,n),samples:n<.5?t.samples:e.samples,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.style===e.style&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.samples===e.samples&&t.mode===e.mode,surface:"shader"};var Uo={lerp:(t,e,n)=>({type:"halftone",size:u(t.size,e.size,n),angle:u(t.angle,e.angle,n),shape:n<.5?t.shape:e.shape,separation:n<.5?t.separation:e.separation,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.size===e.size&&t.angle===e.angle&&t.shape===e.shape&&t.separation===e.separation&&t.mode===e.mode,surface:"shader"};var Go={lerp:(t,e,n)=>({type:"dither",levels:u(t.levels,e.levels,n),matrix:n<.5?t.matrix:e.matrix,scale:u(t.scale,e.scale,n),monochrome:n<.5?t.monochrome:e.monochrome,noise:n<.5?t.noise:e.noise,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.levels===e.levels&&t.matrix===e.matrix&&t.scale===e.scale&&t.monochrome===e.monochrome&&t.noise===e.noise&&t.mode===e.mode,surface:"shader"};var Ko={lerp:(t,e,n)=>({type:"duotone",amount:u(t.amount,e.amount,n),shadows:q(N(t.shadows),N(e.shadows),n),highlights:q(N(t.highlights),N(e.highlights),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&ee(t.shadows,e.shadows)&&ee(t.highlights,e.highlights)&&t.mode===e.mode};var Zo={lerp:(t,e,n)=>({type:"curves",channel:n<.5?t.channel:e.channel,points:t.points.map(([r,o],i)=>{let[s,a]=e.points[i]??[r,o];return[u(r,s,n),u(o,a,n)]}),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.mode===e.mode&&t.points.length===e.points.length&&t.points.every(([n,r],o)=>n===e.points[o]?.[0]&&r===e.points[o]?.[1]),surface:"shader"};var Jo={lerp:(t,e,n)=>({type:"colorAdjustment",brightness:u(t.brightness??0,e.brightness??0,n),contrast:u(t.contrast??1,e.contrast??1,n),saturation:u(t.saturation??1,e.saturation??1,n),hue:u(t.hue??0,e.hue??0,n),vibrance:u(t.vibrance??0,e.vibrance??0,n),shadows:u(t.shadows??0,e.shadows??0,n),highlights:u(t.highlights??0,e.highlights??0,n),temperature:u(t.temperature??0,e.temperature??0,n),tint:u(t.tint??0,e.tint??0,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.brightness===e.brightness&&t.contrast===e.contrast&&t.saturation===e.saturation&&t.hue===e.hue&&t.vibrance===e.vibrance&&t.shadows===e.shadows&&t.highlights===e.highlights&&t.temperature===e.temperature&&t.tint===e.tint&&t.mode===e.mode};var Gn=(t,e)=>t.x===e.x&&t.y===e.y,Qo={lerp:(t,e,n)=>({type:"rgbShift",red:O(t.red,e.red,n),green:O(t.green,e.green,n),blue:O(t.blue,e.blue,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>Gn(t.red,e.red)&&Gn(t.green,e.green)&&Gn(t.blue,e.blue)&&t.mode===e.mode,surface:"shader"};var ei={lerp:(t,e,n)=>({type:"scanlines",spacing:u(t.spacing,e.spacing,n),thickness:u(t.thickness,e.thickness,n),darkness:u(t.darkness,e.darkness,n),offset:u(t.offset,e.offset,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.spacing===e.spacing&&t.thickness===e.thickness&&t.darkness===e.darkness&&t.offset===e.offset&&t.angle===e.angle&&t.mode===e.mode,surface:"shader"};var ti={lerp:(t,e,n)=>({type:"blockDisplace",amount:u(t.amount,e.amount,n),size:u(t.size,e.size,n),density:u(t.density,e.density,n),seed:u(t.seed,e.seed,n),axis:n<.5?t.axis:e.axis,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.size===e.size&&t.density===e.density&&t.seed===e.seed&&Se(t.axis,e.axis)&&t.mode===e.mode,surface:"shader"};var ni={lerp:(t,e,n)=>({type:"bitCrush",bits:u(t.bits,e.bits,n),palette:n<.5?t.palette:e.palette,amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.bits===e.bits&&t.palette===e.palette&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var ri={lerp:(t,e,n)=>({type:"streak",intensity:u(t.intensity,e.intensity,n),threshold:u(t.threshold,e.threshold,n),length:u(t.length,e.length,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.intensity===e.intensity&&t.threshold===e.threshold&&t.length===e.length&&t.angle===e.angle&&t.mode===e.mode};function Jl(t,e,n){return t.colors.length!==e.colors.length?n<.5?t:e:{colors:t.colors.map((r,o)=>q(N(r),N(e.colors[o]),n)),stops:t.stops.map((r,o)=>u(r,e.stops[o]??r,n))}}function Ql(t,e){return t.colors.length!==e.colors.length||t.stops.length!==e.stops.length?!1:t.colors.every((n,r)=>ee(n,e.colors[r]))&&t.stops.every((n,r)=>n===e.stops[r])}var oi={lerp:(t,e,n)=>({type:"glow",threshold:u(t.threshold,e.threshold,n),radius:u(t.radius,e.radius,n),spread:u(t.spread,e.spread,n),intensity:u(t.intensity,e.intensity,n),cycles:u(t.cycles,e.cycles,n),phase:u(t.phase,e.phase,n),color:q(N(t.color),N(e.color),n),...Jl(t,e,n),channel:n<.5?t.channel:e.channel,axis:n<.5?t.axis:e.axis,original:n<.5?t.original:e.original,blend:n<.5?t.blend:e.blend,tint:n<.5?t.tint:e.tint,loopStyle:n<.5?t.loopStyle:e.loopStyle,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.threshold===e.threshold&&t.radius===e.radius&&t.spread===e.spread&&t.intensity===e.intensity&&Se(t.axis,e.axis)&&t.original===e.original&&t.blend===e.blend&&t.tint===e.tint&&ee(t.color,e.color)&&Ql(t,e)&&t.loopStyle===e.loopStyle&&t.cycles===e.cycles&&t.phase===e.phase&&t.mode===e.mode,surface:"shader"};var ii={lerp:(t,e,n)=>({type:"oilPaint",radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.mode===e.mode,surface:"shader"};var si={lerp:(t,e,n)=>({type:"wave",amplitude:O(t.amplitude,e.amplitude,n),wavelength:u(t.wavelength,e.wavelength,n),phase:u(t.phase,e.phase,n),shape:n<.5?t.shape:e.shape,angle:u(t.angle,e.angle,n),center:O(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amplitude.x===e.amplitude.x&&t.amplitude.y===e.amplitude.y&&t.wavelength===e.wavelength&&t.phase===e.phase&&t.shape===e.shape&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var ai={lerp:(t,e,n)=>({type:"twirl",angle:u(t.angle,e.angle,n),radius:u(t.radius,e.radius,n),center:O(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.angle===e.angle&&t.radius===e.radius&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var li={lerp:(t,e,n)=>({type:"progressiveBlur",radius:u(t.radius,e.radius,n),startRadius:u(t.startRadius,e.startRadius,n),shape:n<.5?t.shape:e.shape,start:u(t.start,e.start,n),end:u(t.end,e.end,n),angle:u(t.angle,e.angle,n),center:O(t.center,e.center,n),samples:n<.5?t.samples:e.samples,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.startRadius===e.startRadius&&t.shape===e.shape&&t.start===e.start&&t.end===e.end&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.samples===e.samples&&t.mode===e.mode,surface:"shader"};var ci={lerp:(t,e,n)=>({type:"kaleidoscope",segments:n<.5?t.segments:e.segments,angle:u(t.angle,e.angle,n),center:O(t.center,e.center,n),offset:u(t.offset,e.offset,n),amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.segments===e.segments&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.offset===e.offset&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var ui={lerp:(t,e,n)=>({type:"glass",lightAngle:u(t.lightAngle,e.lightAngle,n),lightIntensity:u(t.lightIntensity,e.lightIntensity,n),refraction:u(t.refraction,e.refraction,n),depth:u(t.depth,e.depth,n),dispersion:u(t.dispersion,e.dispersion,n),frost:u(t.frost,e.frost,n),splay:u(t.splay,e.splay,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.lightAngle===e.lightAngle&&t.lightIntensity===e.lightIntensity&&t.refraction===e.refraction&&t.depth===e.depth&&t.dispersion===e.dispersion&&t.frost===e.frost&&t.splay===e.splay&&t.mode===e.mode,surface:"shader"};var fi={lerp:(t,e,n)=>({type:"lut",table:n<.5?t.table:e.table,size:n<.5?t.size:e.size,amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.table===e.table&&t.size===e.size&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var hi=new Map([["blur",Oo],["directionalBlur",Ao],["grayscale",Eo],["pixelate",Po],["bulge",To],["magnify",zo],["bloom",Fo],["vintage",Ro],["chromaticAberration",No],["invert",Do],["scatter",Io],["posterize",jo],["motionBlur",ko],["shader",Lo],["outline",Bo],["dropShadow",Wo],["vignette",qo],["grain",$o],["sharpen",Vo],["edges",Ho],["threshold",Yo],["radialBlur",Xo],["halftone",Uo],["dither",Go],["duotone",Ko],["curves",Zo],["colorAdjustment",Jo],["rgbShift",Qo],["scanlines",ei],["blockDisplace",ti],["bitCrush",ni],["ascii",bo],["streak",ri],["glow",oi],["oilPaint",ii],["wave",si],["twirl",ai],["progressiveBlur",li],["kaleidoscope",ci],["glass",ui],["lut",fi]]),ec=new Map([["sksl","shader"]]);function nt(t){let e=hi.get(t);if(e)return e;let n=ec.get(t);return n?hi.get(n):void 0}function Ft(t){let e=nt(t.type);return e?.resolve?e.resolve(t):t}function di(t){return nt(t)!==void 0}function Rt(t){let e=nt(t.type)?.surface;return e===void 0?"filter":typeof e=="function"?e(t):e}function pi(t,e){nt(t.type)?.declare?.(t,e)}function Nt(t,e,n){if(t.type!==e.type)return n<.5?t:e;let r=nt(t.type);if(!r)return n<.5?t:e;let o=r.lerp(t,e,n),i=n<.5?t:e,s;for(let a of Un){if(o[a]===i[a])continue;s??={...o};let l=s;i[a]===void 0?delete l[a]:l[a]=i[a]}return s??o}var tc=["x","y","z","w"],nc=["r","g","b","a"];function jt(t,e){let n={...t.uniforms??{}};for(let[r,o]of Object.entries(t.properties)){let i=e&&r in e?e[r]:o.default,s=rc(o,i,r,t.name);if(s)for(let[a,l]of Object.entries(o.inputs)){let c=s[a];if(c===void 0){It(`shader "${t.name}" property "${r}" has no "${a}" to write to "${l}".`);continue}n[l]=c}}if(e)for(let r of Object.keys(e))r in t.properties||It(`shader "${t.name}" has no property "${r}"; the override is ignored.`);return n}function rc(t,e,n,r){let o=oc(t,e,n,r);if(o===void 0)return;let i=Object.keys(t.inputs);if(i.length===1&&i[0]==="value")return{value:o};let s=typeof o=="number"?[o]:o,a={value:o};for(let[l,c]of tc.entries())s[l]!==void 0&&(a[c]=s[l]);for(let[l,c]of nc.entries())s[l]!==void 0&&(a[c]=s[l]);return a}function oc(t,e,n,r){switch(t.kind){case"number":case"slider":case"angle":case"hue":return ic(e,n,r);case"boolean":return e?1:0;case"color":return sc(e,n,r);case"vector":case"point":return mi(e,n,r);default:return typeof e=="number"||Array.isArray(e)?e:void 0}}function ic(t,e,n){if(typeof t=="number"&&Number.isFinite(t))return t;It(`shader "${n}" property "${e}" expects a number, got ${JSON.stringify(t)}.`)}function sc(t,e,n){if(typeof t=="string"){let[r,o,i,s]=R(t);return[r,o,i,s]}return mi(t,e,n)}function mi(t,e,n){if(Array.isArray(t)&&t.every(r=>typeof r=="number"&&Number.isFinite(r)))return t;if(typeof t=="object"&&t!==null){let r=t;if(typeof r.x=="number"&&typeof r.y=="number")return[r.x,r.y]}It(`shader "${n}" property "${e}" expects numbers, got ${JSON.stringify(t)}.`)}var Dt=new Set;function It(t){Dt.has(t)||(Dt.size>256&&Dt.clear(),Dt.add(t),console.warn(`[shader] ${t}`))}var Te={x:.5,y:.5},ac=["white","#ffa640"],lc=[0,1],cc={x:0,y:0},uc=t=>typeof t=="number"?{x:t,y:t}:t,fc=t=>typeof t=="number"?{x:0,y:t}:t,E=class t{list;constructor(e=[]){this.list=e}append(e){return new t([...this.list,e])}blur(e){let n=A(e,"radius");return this.append(C({type:"blur",radius:n.radius??0},n))}directionalBlur(e){let n=A(e,"radius");return this.append(C({type:"directionalBlur",radius:n.radius??0,angle:n.angle??0},n))}pixelate(e){let n=A(e,"blocks");return this.append(C({type:"pixelate",blocks:uc(n.blocks??1),sharpColors:n.sharpColors??!0},n))}grayscale(e){let n=A(e,"amount");return this.append(C({type:"grayscale",amount:n.amount??0},n))}bulge(e){let n=A(e,"strength");return this.append(C({type:"bulge",strength:n.strength??0,center:n.center??Te},n))}magnify(e){let n=A(e,"scale");return this.append(C({type:"magnify",scale:n.scale??2,center:n.center??Te},{...n,mode:n.mode??"backdrop"}))}bloom(e){let n=A(e,"intensity");return this.append(C({type:"bloom",threshold:n.threshold??.7,radius:n.radius??12,intensity:n.intensity??1},n))}vintage(e){let n=A(e,"amount");return this.append(C({type:"vintage",amount:n.amount??1,warmth:n.warmth??.2},n))}chromaticAberration(e){let n=A(e,"amount");return this.append(C({type:"chromaticAberration",amount:n.amount??4,angle:n.angle??0},n))}invert(e){let n=A(e,"strength");return this.append(C({type:"invert",channel:n.channel??"rgba",strength:n.strength??1},n))}scatter(e){let n=A(e,"strength");return this.append(C({type:"scatter",strength:n.strength??10,axis:n.axis??"both"},n))}posterize(e){let n=A(e,"levels");return this.append(C({type:"posterize",levels:n.levels??4},n))}motionBlur(e){let n=A(e,"length");return this.append(C({type:"motionBlur",length:n.length??50,alignment:n.alignment??"centered",samples:n.samples??16,strength:n.strength??1,axis:n.axis??"both"},n))}outline(e){let n=A(e,"width");return this.append(C({type:"outline",width:n.width??4,color:n.color??"black",position:n.position??"outside"},n))}dropShadow(e){let n=A(e,"blur");return this.append(C({type:"dropShadow",offsetX:n.offsetX??0,offsetY:n.offsetY??-8,blur:n.blur??16,spread:n.spread??0,color:n.color??"black"},n))}vignette(e){let n=A(e,"amount");return this.append(C({type:"vignette",amount:n.amount??.5,radius:n.radius??.75,softness:n.softness??.5,color:n.color??"black"},n))}lut(e){return this.append(C({type:"lut",table:e.table,size:e.size,amount:e.amount??1},e))}grain(e){let n=A(e,"amount");return this.append(C({type:"grain",amount:n.amount??.25,size:n.size??1,seed:n.seed??0,animated:n.animated??!1,colored:n.colored??!1},n))}sharpen(e){let n=A(e,"amount");return this.append(C({type:"sharpen",amount:n.amount??1,radius:n.radius??1},n))}edges(e){let n=A(e,"strength");return this.append(C({type:"edges",strength:n.strength??1,kernel:n.kernel??"sobel",colored:n.colored??!1},n))}threshold(e){let n=A(e,"level");return this.append(C({type:"threshold",level:n.level??.5,smoothness:n.smoothness??.05},n))}radialBlur(e){let n=A(e,"amount");return this.append(C({type:"radialBlur",amount:n.amount??.5,style:n.style??"zoom",center:n.center??Te,samples:n.samples??16},n))}halftone(e){let n=A(e,"size");return this.append(C({type:"halftone",size:n.size??8,angle:n.angle??45,shape:n.shape??"dot",separation:n.separation??"mono"},n))}dither(e){let n=A(e,"levels");return this.append(C({type:"dither",levels:n.levels??2,matrix:n.matrix??4,scale:n.scale??1,monochrome:n.monochrome??!1,noise:n.noise??"bayer"},n))}duotone(e){let n=A(e,"amount");return this.append(C({type:"duotone",amount:n.amount??1,shadows:n.shadows??"black",highlights:n.highlights??"white"},n))}curves(e){return this.append(C({type:"curves",points:e.points,channel:e.channel??"rgb"},e))}colorAdjustment(e){let{mode:n,...r}=e;return this.append(C({type:"colorAdjustment",...r},{mode:n}))}rgbShift(e){let n=A(e,"amount"),r=n.amount??4;return this.append(C({type:"rgbShift",red:n.red??{x:r,y:0},green:n.green??cc,blue:n.blue??{x:-r,y:0}},n))}scanlines(e){let n=A(e,"darkness");return this.append(C({type:"scanlines",spacing:n.spacing??4,thickness:n.thickness??.5,darkness:n.darkness??.5,offset:n.offset??0,angle:n.angle??0},n))}blockDisplace(e){let n=A(e,"amount");return this.append(C({type:"blockDisplace",amount:n.amount??20,size:n.size??16,density:n.density??.3,seed:n.seed??0,axis:n.axis??"x"},n))}bitCrush(e){let n=A(e,"bits");return this.append(C({type:"bitCrush",bits:n.bits??3,palette:n.palette??"none",amount:n.amount??1},n))}ascii(e){let n=A(e,"size");return this.append(C({type:"ascii",size:n.size??12,charset:n.charset??"standard",fontFamily:n.fontFamily??"monospace",ink:n.ink??"white",background:n.background??"black",colored:n.colored??!1},n))}oilPaint(e){let n=A(e,"radius");return this.append(C({type:"oilPaint",radius:n.radius??3},n))}streak(e){let n=A(e,"intensity");return this.append(C({type:"streak",intensity:n.intensity??1,threshold:n.threshold??.7,length:n.length??120,angle:n.angle??0},n))}glow(e){let n=A(e,"intensity");return this.append(C({type:"glow",channel:n.channel??"luminance",threshold:n.threshold??.5,radius:n.radius??25,spread:n.spread??0,intensity:n.intensity??1,axis:n.axis??"both",original:n.original??"behind",blend:n.blend??"screen",tint:n.tint??"none",color:n.color??"white",colors:n.colors??[...ac],stops:n.stops??[...lc],loopStyle:n.loopStyle??"mirror",cycles:n.cycles??1,phase:n.phase??0},n))}shader(e){let n=typeof e.source=="string"?void 0:e.source;if(n&&n.scope!=="effect")throw new Error(`Effects.shader was given a "${n.scope}" shader ("${n.name}"). A fill shader has no backdrop to sample and is bound to a shape's box; use Fills.shader.`);let r=e.mode??(n?.backdrop?"backdrop":"foreground"),o=n?n.source:e.source,i=n?{...jt(n,e.values),...ae(e.uniforms??{})}:e.uniforms??{},s={type:"shader",source:o,uniforms:i,...n?.id!==void 0?{shaderId:n.id}:{}},a=r==="foreground"?{...s,blendMode:e.blendMode??"screen"}:s;return this.append(C(a,{mode:r}))}sksl(e){let{shader:n,...r}=e;return this.shader({...r,source:n})}wave(e){let n=A(e,"amplitude");return this.append(C({type:"wave",amplitude:fc(n.amplitude??20),wavelength:n.wavelength??120,phase:n.phase??0,shape:n.shape??"linear",angle:n.angle??0,center:n.center??Te},n))}twirl(e){let n=A(e,"angle");return this.append(C({type:"twirl",angle:n.angle??180,radius:n.radius??1,center:n.center??Te},n))}progressiveBlur(e){let n=A(e,"radius");return this.append(C({type:"progressiveBlur",radius:n.radius??24,startRadius:n.startRadius??0,shape:n.shape??"linear",start:n.start??0,end:n.end??1,angle:n.angle??90,center:n.center??Te,samples:n.samples??20},n))}kaleidoscope(e){let n=A(e,"segments");return this.append(C({type:"kaleidoscope",segments:Math.round(n.segments??6),angle:n.angle??0,center:n.center??Te,offset:n.offset??0,amount:n.amount??1},n))}glass(e){let n=A(e,"refraction");return this.append(C({type:"glass",lightAngle:n.lightAngle??-45,lightIntensity:n.lightIntensity??80,refraction:n.refraction??80,depth:n.depth??20,dispersion:n.dispersion??50,frost:n.frost??4,splay:n.splay??0},{...n,mode:n.mode??"backdrop"}))}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},ny=new E;function gi(t){if(t===void 0)return[];if(t instanceof E)return yi(t.list);if(Array.isArray(t)){let e=[];for(let n of t)n instanceof E?e.push(...yi(n.list)):Array.isArray(n)?e.push(...gi(n)):e.push(Ft(n));return e}return[Ft(t)]}function yi(t){let e;for(let n=0;n<t.length;n++){let r=Ft(t[n]);!e&&r!==t[n]&&(e=t.slice(0,n)),e?.push(r)}return e??t}var ke={resolve:t=>gi(t),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];s&&a?o.push(Nt(s,a,n)):s?o.push(s):a&&o.push(a)}return o}};var hc=t=>t.mode==="backdrop",xi=[],wi=t=>t.length===0?xi:t.filter(hc);function _i(t){return t.length===0?xi:t.filter(e=>e.mode!=="backdrop"&&Rt(e)==="shader")}function oe(t,e={}){let n={...t};return e.opacity!==void 0&&(n.opacity=e.opacity),e.blend!==void 0&&(n.blend=e.blend),e.space!==void 0&&(n.space=e.space),n}var rt=class t{list;constructor(e=[]){this.list=e}color(e,n){return new t([...this.list,oe({type:"solid",color:e},n)])}image(e,n){let{fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,...f}=n??{};return new t([...this.list,oe({type:"image",src:e,fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c},f)])}video(e,n){let{fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,timestamp:f,playing:h,trimStart:d,trimEnd:p,playStart:m,speed:w,loop:x,duration:y,...g}=n??{};return new t([...this.list,oe({type:"video",src:e,fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,timestamp:f,playing:h??!0,trimStart:d,trimEnd:p,playStart:m,speed:w,loop:x,duration:y},g)])}linearGradient(e,n){let{stops:r,start:o,end:i,...s}=n??{};return new t([...this.list,oe({type:"linear-gradient",colors:e,stops:r,start:o,end:i},s)])}radialGradient(e,n){let{stops:r,center:o,radius:i,...s}=n??{};return new t([...this.list,oe({type:"radial-gradient",colors:e,stops:r,center:o,radius:i},s)])}conicGradient(e,n){let{stops:r,center:o,startAngle:i,...s}=n??{};return new t([...this.list,oe({type:"conic-gradient",colors:e,stops:r,center:o,startAngle:i},s)])}noise(e){let{size:n,density:r,color:o,seed:i,...s}=e??{};return new t([...this.list,oe({type:"noise",size:n,density:r,color:o,seed:i},s)])}fractalNoise(e){let{basis:n,octaves:r,frequency:o,lacunarity:i,gain:s,seed:a,offset:l,angle:c,colors:f,stops:h,contrast:d,...p}=e??{};return new t([...this.list,oe({type:"fractalNoise",basis:n,octaves:r,frequency:o,lacunarity:i,gain:s,seed:a,offset:l,angle:c,colors:f,stops:h,contrast:d},p)])}shader(e,n){let r=typeof e=="string"?void 0:e;if(r&&r.scope!=="fill")throw new Error(`Fills.shader was given a "${r.scope}" shader ("${r.name}"). An effect shader samples a backdrop a fill does not have; use Effects.shader.`);let{uniforms:o,coords:i,textures:s,values:a,...l}=n??{},c=r?{...jt(r,a),...ae(o??{})}:o;return new t([...this.list,oe({type:"shader",source:typeof e=="string"?e:e.source,uniforms:c,coords:i??r?.coords,textures:s,...r?.id!==void 0?{shaderId:r.id}:{}},l)])}stripe(e){let{gap:n,strokeWidth:r,angle:o,color:i,...s}=e??{};return new t([...this.list,oe({type:"stripe",gap:n,strokeWidth:r,angle:o,color:i},s)])}dotGrid(e){let{radius:n,spacing:r,offset:o,color:i,...s}=e??{};return new t([...this.list,oe({type:"dotGrid",radius:n,spacing:r,offset:o,color:i},s)])}grid(e){let{divisions:n,subdivisions:r,offset:o,strokeWidth:i,subdivisionWidth:s,color:a,...l}=e??{};return new t([...this.list,oe({type:"grid",divisions:n,subdivisions:r,offset:o,strokeWidth:i,subdivisionWidth:s,color:a},l)])}canvas3D(e,n){let{maxPixelRatio:r,antialias:o,...i}=n??{};return new t([...this.list,oe({type:"canvas3D",scene:e,maxPixelRatio:r,antialias:o},i)])}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},vi=new rt;function Kn(t){if(t==null)return[];if(t instanceof rt)return t.list;if(Array.isArray(t)){let e=[];for(let n of t)n instanceof rt?e.push(...n.list):Array.isArray(n)?e.push(...Kn(n)):e.push(n);return e}return[t]}var dc=4,pc=1,mc=1,yc=.5,Si={resolve:t=>{let e=t.color??[0,0,0,1],n=t.strokeWidth??mc;return{type:"grid",divisions:t.divisions??dc,subdivisions:t.subdivisions??pc,offset:t.offset??{x:0,y:0},strokeWidth:n,subdivisionWidth:t.subdivisionWidth??n*yc,color:Array.isArray(e)?e:R(e),opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({divisions:u(t.divisions,e.divisions,n),subdivisions:u(t.subdivisions,e.subdivisions,n),offset:{x:u(t.offset.x,e.offset.x,n),y:u(t.offset.y,e.offset.y,n)},strokeWidth:u(t.strokeWidth,e.strokeWidth,n),subdivisionWidth:u(t.subdivisionWidth,e.subdivisionWidth,n),color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.divisions===e.divisions&&t.subdivisions===e.subdivisions&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.strokeWidth===e.strokeWidth&&t.subdivisionWidth===e.subdivisionWidth&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};var ki={lerp:(t,e,n)=>({type:"exposure",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var Mi={lerp:(t,e,n)=>({type:"blur",radius:u(t.radius,e.radius,n)}),equals:(t,e)=>t.radius===e.radius};var bi={lerp:(t,e,n)=>({type:"grayscale",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var Ci={lerp:(t,e,n)=>({type:"alpha",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var Oi={lerp:(t,e,n)=>({type:"colorMatrix",matrix:t.matrix.map((r,o)=>u(r,e.matrix[o]??r,n))}),equals:(t,e)=>t.matrix.length===e.matrix.length&&t.matrix.every((n,r)=>n===e.matrix[r])};var Ai={lerp:(t,e,n)=>({type:"curves",channel:n<.5?t.channel:e.channel,points:t.points.map(([r,o],i)=>{let[s,a]=e.points[i]??[r,o];return[u(r,s,n),u(o,a,n)]})}),equals:(t,e)=>t.channel===e.channel&&t.points.length===e.points.length&&t.points.every(([n,r],o)=>n===e.points[o]?.[0]&&r===e.points[o]?.[1])};var Ei={lerp:(t,e,n)=>({type:"colorAdjustment",brightness:u(t.brightness??0,e.brightness??0,n),contrast:u(t.contrast??1,e.contrast??1,n),saturation:u(t.saturation??1,e.saturation??1,n),hue:u(t.hue??0,e.hue??0,n),vibrance:u(t.vibrance??0,e.vibrance??0,n),shadows:u(t.shadows??0,e.shadows??0,n),highlights:u(t.highlights??0,e.highlights??0,n),temperature:u(t.temperature??0,e.temperature??0,n),tint:u(t.tint??0,e.tint??0,n),vignette:u(t.vignette??0,e.vignette??0,n)}),equals:(t,e)=>t.brightness===e.brightness&&t.contrast===e.contrast&&t.saturation===e.saturation&&t.hue===e.hue&&t.vibrance===e.vibrance&&t.shadows===e.shadows&&t.highlights===e.highlights&&t.temperature===e.temperature&&t.tint===e.tint&&t.vignette===e.vignette};var Pi={lerp:(t,e,n)=>({type:"posterizeTime",fps:u(t.fps,e.fps,n)}),equals:(t,e)=>t.fps===e.fps};var Ti={lerp:(t,e,n)=>({type:"echo",echoes:Math.round(u(t.echoes,e.echoes,n)),delay:u(t.delay,e.delay,n),decay:u(t.decay??.5,e.decay??.5,n),blend:n<.5?t.blend:e.blend}),equals:(t,e)=>t.echoes===e.echoes&&t.delay===e.delay&&(t.decay??.5)===(e.decay??.5)&&t.blend===e.blend};var Lt=new Map([["exposure",ki],["blur",Mi],["grayscale",bi],["alpha",Ci],["colorMatrix",Oi],["curves",Ai],["colorAdjustment",Ei],["posterizeTime",Pi],["echo",Ti]]),gc=new Set(["posterizeTime","echo"]);function By(t){return!gc.has(t)}function Wy(t){return Lt.has(t)||di(t)}function xc(t,e,n){if(t.type!==e.type)return n<.5?t:e;let r=Lt.get(t.type);return r?r.lerp(t,e,n):Nt(t,e,n)}function zi(t,e){Lt.has(t.type)||pi(t,e)}function qy(t){return Lt.has(t.type)?"filter":Rt({...t,mode:"foreground"})}function Fi(t,e,n){let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];s&&a?o.push(xc(s,a,n)):s?o.push(s):a&&o.push(a)}return o}function ot(t,e){return typeof t=="number"?{[e]:t}:t}function z(t){return t.list[0]}var it=class{list;constructor(e=[]){this.list=e}append(e){let n=this.constructor;return new n([...this.list,e])}blur(e){let{radius:n}=ot(e,"radius");return this.append({type:"blur",radius:n})}grayscale(e){let{amount:n}=ot(e,"amount");return this.append({type:"grayscale",amount:n})}alpha(e){let{amount:n}=ot(e,"amount");return this.append({type:"alpha",amount:n})}exposure(e){let{amount:n}=ot(e,"amount");return this.append({type:"exposure",amount:n})}colorAdjustment(e){return this.append({type:"colorAdjustment",...e})}colorMatrix(e){let n=Array.isArray(e)?e:e.matrix;return this.append({type:"colorMatrix",matrix:n})}curves(e){return this.append({type:"curves",points:e.points,channel:e.channel})}directionalBlur(e){return this.append(z(new E().directionalBlur(e)))}radialBlur(e){return this.append(z(new E().radialBlur(e)))}progressiveBlur(e){return this.append(z(new E().progressiveBlur(e)))}bloom(e){return this.append(z(new E().bloom(e)))}streak(e){return this.append(z(new E().streak(e)))}sharpen(e){return this.append(z(new E().sharpen(e)))}invert(e){return this.append(z(new E().invert(e)))}vintage(e){return this.append(z(new E().vintage(e)))}duotone(e){return this.append(z(new E().duotone(e)))}posterize(e){return this.append(z(new E().posterize(e)))}threshold(e){return this.append(z(new E().threshold(e)))}bitCrush(e){return this.append(z(new E().bitCrush(e)))}dither(e){return this.append(z(new E().dither(e)))}halftone(e){return this.append(z(new E().halftone(e)))}grain(e){return this.append(z(new E().grain(e)))}lut(e){return this.append(z(new E().lut(e)))}scanlines(e){return this.append(z(new E().scanlines(e)))}pixelate(e){return this.append(z(new E().pixelate(e)))}oilPaint(e){return this.append(z(new E().oilPaint(e)))}ascii(e){return this.append(z(new E().ascii(e)))}edges(e){return this.append(z(new E().edges(e)))}vignette(e){return this.append(z(new E().vignette(e)))}chromaticAberration(e){return this.append(z(new E().chromaticAberration(e)))}rgbShift(e){return this.append(z(new E().rgbShift(e)))}scatter(e){return this.append(z(new E().scatter(e)))}blockDisplace(e){return this.append(z(new E().blockDisplace(e)))}bulge(e){return this.append(z(new E().bulge(e)))}twirl(e){return this.append(z(new E().twirl(e)))}wave(e){return this.append(z(new E().wave(e)))}kaleidoscope(e){return this.append(z(new E().kaleidoscope(e)))}shader(e){return this.append(z(new E().shader(e)))}sksl(e){return this.append(z(new E().sksl(e)))}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},Zn=class extends it{posterizeTime(e){let{fps:n}=ot(e,"fps");return this.append({type:"posterizeTime",fps:n})}echo(e){return this.append({type:"echo",...e})}},wc=new it,_c=new Zn,Hy=wc,Yy=_c;function Ri(t){return t===void 0?[]:t instanceof it?t.list:Array.isArray(t)?t:[t]}var Bt={topLeft:{x:-1,y:1},topCenter:{x:0,y:1},topRight:{x:1,y:1},centerLeft:{x:-1,y:0},center:{x:0,y:0},centerRight:{x:1,y:0},bottomLeft:{x:-1,y:-1},bottomCenter:{x:0,y:-1},bottomRight:{x:1,y:-1}},Jn=Object.keys(Bt);function Qn(t){if(typeof t=="string"){let e=Object.hasOwn(Bt,t)?Bt[t]:void 0;if(!e)throw new Error(`Unknown alignment value: '${t}'`);return{...e}}return{x:t.x,y:t.y}}var D={resolve:Qn,lerp:O,keys:Jn,isKey(t){return typeof t=="string"&&Object.hasOwn(Bt,t)},validateProps(t){let e=Jn.filter(n=>t[n]!==void 0);if(e.length>1)throw new Error(`Cannot set multiple alignment props at once: ${e.join(", ")}`);if(e.length===1&&t.pivot!==void 0)throw new Error(`Cannot set both alignment prop '${e[0]}' and 'pivot' at the same time`)},findKey(t){return Jn.find(e=>t[e]!==void 0)},resolveTargetOnce(t,e,n){let r=Qn(t);return{pivot:r,x:n.x-r.x*(e.width/2),y:n.y-r.y*(e.height/2)}},bindTarget(t,e,n){let r=Qn(t);return{pivot:r,x:()=>e().x-r.x*(n().width/2),y:()=>e().y-r.y*(n().height/2)}}};var U={resolve:(t,e)=>typeof t=="number"?{left:t,right:t,top:t,bottom:t}:{left:t.left??t.horizontal??e?.left??0,right:t.right??t.horizontal??e?.right??0,top:t.top??t.vertical??e?.top??0,bottom:t.bottom??t.vertical??e?.bottom??0},lerp:(t,e,n)=>({left:u(t.left,e.left,n),right:u(t.right,e.right,n),top:u(t.top,e.top,n),bottom:u(t.bottom,e.bottom,n)}),insetBounds:(t,e,n)=>({width:Math.max(0,t-n.left-n.right),height:Math.max(0,e-n.top-n.bottom),x:(n.left-n.right)/2,y:(n.top-n.bottom)/2}),outsetSize:(t,e,n)=>({width:t+n.left+n.right,height:e+n.top+n.bottom})};function Wt(t,e){let n=t?.adjustments??e,r=Ri(n);if(r.length!==0)return{adjustments:r,intensity:Math.min(1,Math.max(0,t?.intensity??1))}}function qt(t,e,n){if(!t&&!e)return;let r=t??{adjustments:e.adjustments,intensity:0},o=e??{adjustments:t.adjustments,intensity:0};return{adjustments:Fi(r.adjustments,o.adjustments,n),intensity:u(r.intensity,o.intensity,n)}}function $t(t,e){for(let n of t?.adjustments??[])zi(n,e)}var Ni={left:0,right:0,top:0,bottom:0},Di={x:0,y:0};function er(t){return{crop:t.crop===void 0?void 0:U.resolve(t.crop),anchor:t.anchor===void 0?void 0:D.resolve(t.anchor)}}function tr(t,e,n){return{matrix:n<.5?t.matrix:e.matrix,crop:t.crop||e.crop?U.lerp(t.crop??Ni,e.crop??Ni,n):void 0,zoom:u(t.zoom??1,e.zoom??1,n),anchor:O(t.anchor??Di,e.anchor??Di,n)}}var Ii={resolve:({crop:t,anchor:e,preset:n,filters:r,...o})=>({...o,...er({crop:t,anchor:e}),preset:Wt(n,r)}),lerp:(t,e,n)=>({src:n<.5?t.src:e.src,fit:n<.5?t.fit:e.fit,...tr(t,e,n),opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n,preset:qt(t.preset,e.preset,n)}),equals:(t,e)=>t.src===e.src,declare:(t,e)=>{e.image(t.src),$t(t.preset,e)}};function fg(t,e,n){let r=t.trimStart??0;return Mc(t,r,vc(t,e,n,r))}function vc(t,e,n,r){if(t.timestamp!=null)return t.timestamp;if(!t.playing)return r;let o=Math.max(0,e-(t.playStart??0))*(t.speed??1);return kc(o,r,Sc(t,n),t.loop,t.duration)}function Sc(t,e){let n=e!==void 0&&Number.isFinite(e)&&e>0;return t.trimEnd??(n?e:1/0)}function kc(t,e,n,r,o){let i=o??(n!==1/0?n-e:void 0),s=i!==void 0&&i>0?i:void 0;if((r??"none")!=="none"&&s!==void 0){let l=t%s;if(r==="reverse"){let c=Math.floor(t/s)%2===0;return e+(c?l:s-l)}return e+l}let a=e+t;return n!==1/0?Math.min(a,n):a}function Mc(t,e,n){let r=t.preset?.adjustments.find(i=>i.type==="posterizeTime");if(!r||r.fps<=0)return n;let o=1/r.fps;return e+Math.floor((n-e)/o)*o}var ji={resolve:({crop:t,anchor:e,preset:n,filters:r,...o})=>({...o,...er({crop:t,anchor:e}),preset:Wt(n,r),playing:o.playing??!0}),lerp:(t,e,n)=>({src:n<.5?t.src:e.src,fit:n<.5?t.fit:e.fit,...tr(t,e,n),loop:n<.5?t.loop:e.loop,duration:n<.5?t.duration:e.duration,trimStart:n<.5?t.trimStart:e.trimStart,trimEnd:n<.5?t.trimEnd:e.trimEnd,playStart:n<.5?t.playStart:e.playStart,playing:n<.5?t.playing:e.playing,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n,timestamp:t.timestamp==null&&e.timestamp==null?void 0:u(t.timestamp??0,e.timestamp??0,n),speed:u(t.speed??1,e.speed??1,n),preset:qt(t.preset,e.preset,n)}),equals:(t,e)=>t.src===e.src,declare:(t,e)=>{e.video(t.src,{start:t.trimStart??0,end:t.trimEnd}),$t(t.preset,e)}};var he=class{_cmds=[];_x=0;_y=0;_startX=0;_startY=0;_open=!1;moveTo(e,n){return this._cmds.push({type:"M",x:e,y:n}),this._startX=e,this._startY=n,this._at(e,n)}lineTo(e,n){return this._cmds.push({type:"L",x:e,y:n}),this._at(e,n)}bezierCurveTo(e,n,r,o,i,s){return this._cmds.push({type:"C",x1:e,y1:n,x2:r,y2:o,x:i,y:s}),this._at(i,s)}quadraticCurveTo(e,n,r,o){return this._cmds.push({type:"Q",x1:e,y1:n,x:r,y:o}),this._at(r,o)}arcTo(e,n,r,o,i,s,a){return this._cmds.push({type:"A",rx:e,ry:n,rotation:r,largeArc:o,sweep:i,x:s,y:a}),this._at(s,a)}arc(e){let{cx:n,cy:r,rx:o,ry:i,from:s,sweep:a}=Li(e),l=nr(n,r,o,i,s);return this._open?(l.x!==this._x||l.y!==this._y)&&this.lineTo(l.x,l.y):this.moveTo(l.x,l.y),this._sweep(n,r,o,i,s,a)}ellipse(e){let{cx:n,cy:r,rx:o,ry:i,from:s,sweep:a}=Li(e),l=nr(n,r,o,i,s);return this.moveTo(l.x,l.y),this._sweep(n,r,o,i,s,a),this.close()}close(){return this._cmds.push({type:"Z"}),this._at(this._startX,this._startY)}toCommands(){return[...this._cmds]}toPathState(e={}){return{...e,data:this._cmds}}_at(e,n){return this._x=e,this._y=n,this._open=!0,this}_sweep(e,n,r,o,i,s){if(s===0)return this;let a=Math.ceil(Math.abs(s)/90),l=s/a,c=s>0?1:0;for(let f=1;f<=a;f++){let h=nr(e,n,r,o,i+l*f);this.arcTo(r,o,0,0,c,h.x,h.y)}return this}};function Li(t){return{cx:t.x??0,cy:t.y??0,rx:t.width/2,ry:(t.height??t.width)/2,from:t.startAngle??0,sweep:t.sweep??360}}function nr(t,e,n,r,o){let i=o*Math.PI/180;return{x:t+n*Math.cos(i),y:e+r*Math.sin(i)}}var bc=new Set(["rect","ellipse","path","line","polygon","polygram","text","richText"]),$=class t{_ops=[];_opacity=1;_rotation=0;_scale=1;_transformCenter;rect(e){return this._ops.push({kind:"rect",state:e}),this}ellipse(e){return this._ops.push({kind:"ellipse",state:e}),this}path(e){let n=e instanceof he?e.toPathState():e;return this._ops.push({kind:"path",state:n}),this}line(e){return this._ops.push({kind:"line",state:e}),this}polygon(e){return this._ops.push({kind:"polygon",state:e}),this}polygram(e){return this._ops.push({kind:"polygram",state:e}),this}text(e){return this._ops.push({kind:"text",state:e}),this}richText(e){return this._ops.push({kind:"richText",state:e}),this}fill(e){return this._ops.push({kind:"fill",fills:e}),this}stroke(e){return this._ops.push({kind:"stroke",strokes:e}),this}shadow(e){return this._ops.push({kind:"shadow",shadows:e}),this}cut(){return this._ops.push({kind:"cut"}),this}mask(e){return this._ops.push({kind:"mask",options:e}),this}applyMask(){return this._ops.push({kind:"applyMask"}),this}endMask(){return this._ops.push({kind:"endMask"}),this}opacity(e){return this._opacity=e,this}effects(e){return this._ops.push({kind:"effects",effects:ke.resolve(e)}),this}rotation(e,n){return this._rotation=e,n!==void 0&&(this._transformCenter=n),this}scale(e,n){return this._scale=e,n!==void 0&&(this._transformCenter=n),this}ops(){return this._ops}groupOpacity(){return this._opacity}needsGroupLayer(){return this._opacity<1}groupTransform(){return this._rotation===0&&this._scale===1?null:{rotation:this._rotation,scale:this._scale,center:this._transformCenter}}isPaintOnly(){return!this._ops.some(e=>bc.has(e.kind))}_withOps(e){let n=new t;return n._ops=e,n._opacity=this._opacity,n._rotation=this._rotation,n._scale=this._scale,n._transformCenter=this._transformCenter,n}};function Vt(t){return typeof t.ops=="function"?{kind:"graphics",graphics:t}:{kind:"node",node:t}}function Cc(t){return typeof t!="string"&&"data"in t}function st(t){return typeof t!="string"&&"source"in t}function gg(t){return typeof t=="string"?{src:t}:t}function Bi(t){return typeof t=="string"?t:Cc(t)||st(t)?null:t.src}function at(t){return t.startsWith("/")||t.startsWith(".")||/\.(png|jpe?g|webp|avif|svg|ktx2?|hdr|exr|mp4|webm|mov)$/i.test(t)}var Yt=512;function lt(t,e={}){if(t==null)return{};if(typeof t=="string")return at(t)?{map:t}:{color:t};if(Array.isArray(t))return t.every(n=>typeof n=="number")?{color:t}:{map:Wi(t,e)};if(typeof t=="object"){if(Ec(t))return{map:Oc(t,e)};if(Ac(t))return{map:t};if(Hi(t))return{color:t.color}}return{map:Wi(t,e)}}function Oc(t,e){return{source:t,width:e.width??Yt,height:e.height??Yt}}function Wi(t,e){let n=e.width??Yt,r=e.height??Yt;return{source:new $().rect({width:n,height:r}).fill(t),width:n,height:r,static:!0,identity:`fill:${Ht(t)}:${n}x${r}`}}function Ac(t){return"src"in t||"data"in t||"source"in t&&"width"in t}function Ec(t){let e=t;return typeof e.cameraDescriptor=="function"?!1:typeof e.ops=="function"?!0:typeof e.id=="string"&&typeof e.attach=="function"}function Hi(t){let e=t;return e.type!=="solid"||e.color===void 0?!1:e.opacity===void 0&&e.blend===void 0&&e.space===void 0}function Yi(t,e,n){let r=qi(t),o=qi(e);return r!==null&&o!==null?q($i(r),$i(o),n):n<1?t:e}function qi(t){return t==null?null:typeof t=="string"?at(t)?null:t:Array.isArray(t)?t.every(e=>typeof e=="number")?t:null:typeof t=="object"&&Hi(t)?t.color:null}function $i(t){return Array.isArray(t)?t:R(t)}var Vi=new WeakMap,Pc=0;function Ht(t){if(t===null||typeof t!="object")return String(t);if(Array.isArray(t))return`[${t.map(Ht).join(",")}]`;let e=t.list;if(Array.isArray(e))return Ht(e);let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null){let o=Vi.get(t);return o===void 0&&(o=`@${Pc++}`,Vi.set(t,o)),o}let r=t;return`{${Object.keys(r).sort().map(o=>`${o}:${Ht(r[o])}`).join(",")}}`}var Xi=new Set,Tc;function Ui(){return Tc??=!1}function ze(t,e){!Ui()||Xi.has(t)||(Xi.add(t),console.warn(`[motionscript] ${e}`))}function Gi(t){if(Ui()){if("geometry"in t){let e=t.geometry.params;e&&Object.keys(e).length>0&&ze(`geometry-params:${t.geometry.type}`,`\`params\` on a "${t.geometry.type}" geometry is not applied: three builds a geometry from its named fields and nothing assigns \`params\` onto it. Set the geometry's own fields instead. (\`params\` is applied on materials, lights and cameras.)`)}if("material"in t){let e=Array.isArray(t.material)?t.material:[t.material];for(let n of e)n.type==="shader"&&n.extends!=null&&ze("shader-extends",`\`extends: "${n.extends}"\` on a shader material is not applied: the shader replaces the built-in model, so scene lighting, shadows and fog do not reach it. Write the lighting you need in the shader.`)}t.kind==="model"&&/\.obj(?:$|[?#])/i.test(t.src)&&ze("model-obj",`The model "${t.src}" is an OBJ file, and only glTF/GLB models load: it will draw nothing. Convert it to .glb.`)}}var Ki=new Set(["mesh","light","instances","points","line","sprite","model"]),Zi=["position","rotation","quaternion","scale","lookAt","visible","shadow","renderOrder"],Ji=["opacity","roughness","metalness","emission","emissionStrength","normalMap","roughnessMap","metalnessMap","aoMap","alphaMap","envMapIntensity","wireframe","shading","faces","vertexColors","blend"],zc=[...Ji,"fill","material","unlit"];function Xt(t){let e=t,n;for(let r of Zi)e[r]!==void 0&&((n??={})[r]=e[r]);return n}function Ut(t){if(t.material!==void 0)return t.material;let e={type:t.unlit?"basic":"standard"},n=lt(t.fill);n.color!==void 0&&(e.color=n.color),n.map!==void 0&&(e.map=n.map);for(let r of Ji){let o=t[r];o!==void 0&&(e[r]=o)}return e}function Fc(t,e){let n=t,r={type:e};for(let o in n)zc.includes(o)||Zi.includes(o)||n[o]!==void 0&&(r[o]=n[o]);return r}var We=class{_ops=[];record(e){Gi(e),this._ops.push(e)}mesh(e,n,r){return this.record({kind:"mesh",geometry:e,material:n??{type:"standard"},transform:r}),this}sugar(e,n){let r=n??{};return this.mesh(Fc(r,e),Ut(r),Xt(r))}box(e){return this.sugar("box",e)}sphere(e){return this.sugar("sphere",e)}plane(e){return this.sugar("plane",e)}cylinder(e){return this.sugar("cylinder",e)}cone(e){return this.sugar("cone",e)}torus(e){return this.sugar("torus",e)}torusKnot(e){return this.sugar("torusKnot",e)}circle(e){return this.sugar("circle",e)}ring(e){return this.sugar("ring",e)}capsule(e){return this.sugar("capsule",e)}polyhedron(e){return this.sugar("polyhedron",e)}extrude(e){return this.sugar("extrude",e)}lathe(e){return this.sugar("lathe",e)}tube(e){return this.sugar("tube",e)}instances(e,n,r,o){return this.record({kind:"instances",geometry:e,material:n,instances:r,colors:o?.colors,transform:o?.transform}),this}points(e,n,r){return this.record({kind:"points",geometry:e,material:n??{type:"points"},transform:r}),this}line(e){let{points:n,geometry:r,material:o,closed:i,segments:s,stroke:a,opacity:l}=e;if(!n&&!r)throw new Error("Graphics3D.line() needs either `points` or `geometry`.");let c=o??{type:a?.dash!==void 0?"lineDashed":"lineBasic",...a?.fill!==void 0?{color:a.fill}:{},...a?.weight!==void 0?{width:a.weight}:{},...a?.dash!==void 0?{dashSize:a.dash[0],gapSize:a.dash[1]??a.dash[0]}:{},...l!==void 0?{opacity:l}:{}};return this.record({kind:"line",geometry:r??{type:"buffer",position:Rc(n)},material:c,mode:s?"segments":i?"loop":"strip",transform:Xt(e)}),this}sprite(e){let{fill:n,material:r,opacity:o}=e,i=lt(n),s=r??{type:"sprite",...i.map!==void 0?{map:i.map}:{},...i.color!==void 0?{color:i.color}:{},...o!==void 0?{opacity:o}:{}};return this.record({kind:"sprite",material:s,transform:Xt(e)}),this}model(e){let{src:n,animation:r,override:o}=e;return this.record({kind:"model",src:n,animation:r===void 0?void 0:Array.isArray(r)?r:[r],override:o,transform:Xt(e)}),this}ops(){return this._ops}isEmpty(){return this._ops.length===0}};function Rc(t){let e=[];for(let n of t)if(typeof n=="number")e.push(n,n,n);else if(Array.isArray(n))e.push(n[0]??0,n[1]??0,n[2]??0);else{let r=n;e.push(r.x??0,r.y??0,r.z??0)}return e}var Gt=class{};function Kt(t){return t===void 0||t===!1?null:t===!0?{enabled:!0}:{enabled:!0,...t}}var ie=class extends Gt{_ops=[];_camera=null;_fog=null;_environment=null;_shadows=null;_tone=null;_post=[];_depth=0;_shadowScopes=[];begin(e){this._ops.push({kind:"push",transform:{...e.transform,key:e.id}}),this._shadowScopes.push(e.transform?.shadow),this._depth++}end(){this._ops.push({kind:"pop"}),this._shadowScopes.pop(),this._depth--}draw(e){let n=e.ops(),r=this._shadowScopes[this._shadowScopes.length-1];for(let o=0;o<n.length;o++){let i=n[o];r===void 0||i.transform?.shadow!==void 0?this._ops.push(i):this._ops.push({...i,transform:{...i.transform,shadow:r}})}return this}light(e,n){return this._ops.push({kind:"light",light:e,transform:n}),this}camera(e){return this._camera=e,this._ops.push({kind:"camera",camera:e}),this}perspective(e){return this.camera({type:"perspective",...e})}orthographic(e){return this.camera({type:"orthographic",...e})}fog(e){return e===null?this._fog=null:typeof e=="object"&&!Array.isArray(e)?this._fog=e:this._fog={color:e},this}environment(e){return e&&((e.src!==void 0||(e.faces?.length??0)>0)&&ze("environment-src",'An environment\'s `src` and `faces` (HDR, EXR, cubemap) are recorded, and no backend loads them. Only `preset: "studio"` is rendered: without a preset the scene gets no image-based light and its `background` is not drawn.'),e.params&&Object.keys(e.params).length>0&&ze("environment-params","`params` on an environment is not applied: nothing assigns it onto the generated environment.")),this._environment=e,this}shadows(e){return this._shadows=Kt(e??!0),this}tone(e){return this._tone=e,this}post(e){let n=Array.isArray(e)?e:[e];return n.length>0&&ze("post",`Post-processing (${n.map(r=>`"${r.type}"`).join(", ")}) is recorded, and no backend applies a pass: the scene renders exactly as it would without \`post\`. Use the Canvas3D's 2D \`effects\` over the composited result instead.`),this._post.push(...n),this}ops(){return this._ops}cameraDescriptor(){return this._camera}fogDescriptor(){return this._fog}environmentDescriptor(){return this._environment}shadowSettings(){return this._shadows}toneSettings(){return this._tone}postEffects(){return this._post}isEmpty(){return!this._ops.some(e=>Ki.has(e.kind))}assertBalanced(){if(this._depth!==0){let e=this._depth>0?"unclosed begin()":"extra end()";throw new Error(`Scene3D has ${Math.abs(this._depth)} ${e}.`)}}};function Qi(t,e){return`three:${t}:${e}`}function Ng(t){if(!t.startsWith("three:"))return null;let e=t.slice(6),n=e.indexOf(":");return n<=0?null:{kind:e.slice(0,n),src:e.slice(n+1)}}var rr=null,es=null;function Dg(t){rr=t}function Ig(t){es=t}function ts(){return rr?.()}function ns(){return es}function jg(){return rr!==null}var Nc=["map","alphaMap","aoMap","normalMap","displacementMap","envMap","lightMap","emissionMap","roughnessMap","metalnessMap","specularMap","gradientMap","matcap","clearcoatMap","clearcoatNormalMap","clearcoatRoughnessMap","transmissionMap","thicknessMap"];function Dc(t){return typeof t!="object"||t===null||Array.isArray(t)?!1:"src"in t||"data"in t||"source"in t}function Zt(t,e){let n=o=>{if(o)for(let i in o){let s=o[i];(typeof s=="string"&&at(s)||Dc(s))&&e(s)}},r=o=>{if(o===void 0)return;let i=Array.isArray(o)?o:[o];for(let s of i){let a=s;for(let l of Nc)a[l]!==void 0&&e(a[l]);n(a.uniforms)}};for(let o of t.ops())switch(o.kind){case"mesh":case"points":case"line":case"instances":r(o.material);break;case"sprite":r(o.material);break;case"model":if(o.override)for(let i in o.override)r(o.override[i]);break}if(t instanceof ie)for(let o of t.postEffects())n(o.uniforms)}var Ic=new Set(["linear-gradient","radial-gradient","conic-gradient"]);function Jt(t){return Ic.has(t)}function or(t,e){let n=t.type==="solid"||Jt(t.type),r=e.type==="solid"||Jt(e.type);return!n||!r?!1:Jt(t.type)||Jt(e.type)}function jc(t){return Array.from({length:t},(e,n)=>n/Math.max(1,t-1))}function rs(t,e,n,r,o,i){let s=Math.max(2,i),a=Array.from({length:s},()=>[...t]),l=jc(s),c={colors:a,stops:l,opacity:e,blend:n,space:r};switch(o){case"linear-gradient":return{type:"linear-gradient",...c,start:{x:-1,y:1},end:{x:1,y:-1}};case"radial-gradient":return{type:"radial-gradient",...c,center:{x:0,y:0},radius:100};case"conic-gradient":return{type:"conic-gradient",...c,center:{x:0,y:0},startAngle:0}}}function Lc(t,e){if(t.type===e)return t;let n={colors:t.colors,stops:t.stops,opacity:t.opacity,blend:t.blend,space:t.space};switch(e){case"linear-gradient":return{type:"linear-gradient",...n,start:{x:-1,y:1},end:{x:1,y:-1}};case"radial-gradient":return{type:"radial-gradient",...n,center:{x:0,y:0},radius:100};case"conic-gradient":return{type:"conic-gradient",...n,center:{x:0,y:0},startAngle:0}}}function os(t,e){let n=t.type==="solid",r=e.type==="solid";if(n&&!r){let s=e;return[rs(t.color,t.opacity,t.blend,t.space,s.type,s.colors.length),s]}if(r&&!n){let s=t,a=rs(e.color,e.opacity,e.blend,e.space,s.type,s.colors.length);return[s,a]}let o=t,i=e;return[Lc(o,i.type),i]}var is={resolve:t=>({type:"solid",color:Array.isArray(t.color)?t.color:R(t.color),opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.color===e.color};function Bc(t,e){let{colors:n,stops:r}=t,o=n.length-1;if(e<=r[0])return n[0];if(e>=r[o])return n[o];let i=1;for(;r[i]<e;)i++;let s=i-1,a=r[i]-r[s];return q(n[s],n[i],a>0?(e-r[s])/a:0)}function ss(t,e,n){let r=t.stops.indexOf(e);if(r===-1)return Bc(t,e);let o=1;for(;t.stops[r+o]===e;)o++;return t.colors[r+Math.min(n,o-1)]}var Wc=(t,e)=>t.length===e.length&&t.every((n,r)=>n===e[r]);function Me(t,e,n){if(Wc(t.stops,e.stops))return{colors:t.colors.map((s,a)=>q(s,e.colors[a],n)),stops:t.stops.slice()};let r=new Map;for(let s of[t,e]){let a=new Map;for(let l of s.stops)a.set(l,(a.get(l)??0)+1);for(let[l,c]of a)r.set(l,Math.max(r.get(l)??0,c))}let o=[],i=[];for(let s of[...r.keys()].sort((a,l)=>a-l))for(let a=0;a<r.get(s);a++)o.push(q(ss(t,s,a),ss(e,s,a),n)),i.push(s);return{colors:o,stops:i}}function qc(t){return Array.isArray(t)?t:R(t)}var as={resolve:t=>({type:"linear-gradient",colors:t.colors.map(qc),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),start:t.start??{x:-1,y:1},end:t.end??{x:1,y:-1},opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...Me(t,e,n),start:O(t.start,e.start,n),end:O(t.end,e.end,n),opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.start.x===e.start.x&&t.start.y===e.start.y&&t.end.x===e.end.x&&t.end.y===e.end.y&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};function $c(t){return Array.isArray(t)?t:R(t)}var ls={resolve:t=>({type:"radial-gradient",colors:t.colors.map($c),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),center:t.center??{x:0,y:0},radius:t.radius??100,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...Me(t,e,n),center:O(t.center,e.center,n),radius:u(t.radius,e.radius,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&t.radius===e.radius&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};function Vc(t){return Array.isArray(t)?t:R(t)}var cs={resolve:t=>({type:"conic-gradient",colors:t.colors.map(Vc),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),center:t.center??{x:0,y:0},startAngle:t.startAngle,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...Me(t,e,n),center:O(t.center,e.center,n),startAngle:u(t.startAngle??0,e.startAngle??0,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&(t.startAngle??0)===(e.startAngle??0)&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};var us={resolve:t=>{let e=t.color??[0,0,0,1];return{type:"noise",size:t.size??{x:1,y:1},density:t.density??1,color:Array.isArray(e)?e:R(e),seed:t.seed??0,opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({size:{x:u(t.size.x,e.size.x,n),y:u(t.size.y,e.size.y,n)},density:u(t.density,e.density,n),seed:u(t.seed,e.seed,n),color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.size.x===e.size.x&&t.size.y===e.size.y&&t.density===e.density&&t.seed===e.seed&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};function Hc(t){return Array.isArray(t)?t:R(t)}var Yc=[0,0,0,1],Xc=[1,1,1,1],Uc=t=>t===void 0?{x:3,y:3}:typeof t=="number"?{x:t,y:t}:t,fs={resolve:t=>{let e=t.colors?.length?t.colors.map(Hc):[Yc,Xc];return{type:"fractalNoise",basis:t.basis??"simplex",octaves:Math.max(1,Math.min(8,Math.round(t.octaves??4))),frequency:Uc(t.frequency),lacunarity:t.lacunarity??2,gain:t.gain??.5,seed:t.seed??0,offset:t.offset??{x:0,y:0},angle:t.angle??0,colors:e,stops:t.stops??e.map((n,r)=>r/Math.max(1,e.length-1)),contrast:t.contrast??1,opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({basis:n<.5?t.basis:e.basis,octaves:n<.5?t.octaves:e.octaves,frequency:O(t.frequency,e.frequency,n),lacunarity:u(t.lacunarity,e.lacunarity,n),gain:u(t.gain,e.gain,n),seed:u(t.seed,e.seed,n),offset:O(t.offset,e.offset,n),angle:u(t.angle,e.angle,n),...Me(t,e,n),contrast:u(t.contrast,e.contrast,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.basis===e.basis&&t.octaves===e.octaves&&t.frequency.x===e.frequency.x&&t.frequency.y===e.frequency.y&&t.lacunarity===e.lacunarity&&t.gain===e.gain&&t.seed===e.seed&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.angle===e.angle&&t.contrast===e.contrast&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>{let o=e.colors[r];return o!=null&&n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]})&&t.stops.length===e.stops.length&&t.stops.every((n,r)=>n===e.stops[r])};var hs={resolve:t=>({type:"stripe",gap:t.gap,strokeWidth:t.strokeWidth,angle:t.angle,color:t.color!=null?Array.isArray(t.color)?t.color:R(t.color):void 0,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({gap:u(t.gap??8,e.gap??8,n),strokeWidth:u(t.strokeWidth??1,e.strokeWidth??1,n),angle:u(t.angle??-45,e.angle??-45,n),color:t.color&&e.color?[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)]:t.color??e.color,opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.gap===e.gap&&t.strokeWidth===e.strokeWidth&&t.angle===e.angle&&t.color?.[0]===e.color?.[0]&&t.color?.[1]===e.color?.[1]&&t.color?.[2]===e.color?.[2]&&t.color?.[3]===e.color?.[3]};var Gc=2,Kc=16,ds={resolve:t=>{let e=t.color??[0,0,0,1];return{type:"dotGrid",radius:t.radius??Gc,spacing:t.spacing??Kc,offset:t.offset??{x:0,y:0},color:Array.isArray(e)?e:R(e),opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({radius:u(t.radius,e.radius,n),spacing:u(t.spacing,e.spacing,n),offset:{x:u(t.offset.x,e.offset.x,n),y:u(t.offset.y,e.offset.y,n)},color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.radius===e.radius&&t.spacing===e.spacing&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};var ps=4;function Zc(t){if(!t?.length)return;let e=[];for(let n of t)if(!(!n?.name||!n?.src)){if(e.length>=ps){console.warn(`[SkSL] A shader fill declares more than ${ps} textures; the rest are ignored.`);break}e.push({name:n.name,src:n.src})}return e.length?e:void 0}function Jc(t,e){return t===e?!0:!t||!e||t.length!==e.length?!1:t.every((n,r)=>n.name===e[r].name&&n.src===e[r].src)}var ms={resolve:t=>({type:"shader",source:t.source??"",...t.shaderId!==void 0?{shaderId:t.shaderId}:{},uniforms:ae(t.uniforms),coords:t.coords??"normalized",textures:Zc(t.textures),opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({source:n<.5?t.source:e.source,uniforms:Tt(t.uniforms,e.uniforms,n),coords:n<.5?t.coords:e.coords,textures:n<.5?t.textures:e.textures,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.source===e.source&&t.coords===e.coords&&zt(t.uniforms,e.uniforms)&&Jc(t.textures,e.textures),declare:(t,e)=>{for(let n of t.textures??[])e.image(n.src)}};function en(t,e){Zt(t,r=>{if(st(r)){let i=Vt(r.source);i.kind==="node"&&e.subtree(i.node);return}let o=Bi(r);o!==null&&e.image(o)});let n=r=>{r!==void 0&&(r.type==="modelGeometry"?Qt("gltf",r.src,e):(r.type==="edges"||r.type==="wireframe")&&n(r.source))};for(let r of t.ops())switch(r.kind){case"mesh":case"points":case"line":case"instances":n(r.geometry);break;case"model":Qt("gltf",r.src,e);break}t instanceof ie&&ir(t.environmentDescriptor(),e)}function ir(t,e){if(t!==null){t.src!==void 0&&Qt(gs(t.src),t.src,e);for(let n of t.faces??[])Qt(gs(n),n,e)}}var ys=new WeakMap;function Qt(t,e,n){let r=ns();if(!r)return;let o=Qi(t,e),i=ys.get(r);i||ys.set(r,i=new Map);let s=i.get(o);s||i.set(o,s=()=>r(t,e)),n.loader(o,s)}function gs(t){return t.toLowerCase().endsWith(".exr")?"exr":"hdr"}var xs={resolve:t=>({...t}),lerp:(t,e,n)=>({scene:n<.5?t.scene:e.scene,maxPixelRatio:t.maxPixelRatio??e.maxPixelRatio,antialias:t.antialias??e.antialias,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.scene===e.scene,declare:(t,e)=>{en(t.scene,e)}};var _s=new Map([["solid",is],["linear-gradient",as],["radial-gradient",ls],["conic-gradient",cs],["noise",us],["fractalNoise",fs],["stripe",hs],["dotGrid",ds],["grid",Si],["shader",ms],["image",Ii],["video",ji],["canvas3D",xs]]);function ar(t){let e=_s.get(t);if(!e)throw new Error(`Fill "${t}" is not registered`);return e}function tn(t){if(typeof t=="string")return tn({type:"solid",color:t});if(t instanceof ie)return tn({type:"canvas3D",scene:t});let e=ar(t.type).resolve(t),n=t.space;return n!==void 0?{...e,space:n}:e}var Ux=tn({type:"image",src:""});function Qc(t,e){return t.type===e.type?t.blend===e.blend:or(t,e)}function sr(t,e,n){let r=Math.min(1,Math.max(0,n));if(t.type!==e.type){if(!or(t,e))throw new Error(`No registered lerp for fills of type "${t.type}" and "${e.type}"`);let[o,i]=os(t,e);return{...o,...ar(o.type).lerp(o,i,r)}}if(t.blend!==e.blend)throw new Error(`No registered lerp for fills of type "${t.type}" and "${e.type}"`);return{...t,...ar(t.type).lerp(t,e,r)}}function ws(t,e){return{...t,opacity:(t.opacity??1)*Math.max(0,e)}}function Gx(t,e){_s.get(t.type)?.declare?.(t,e)}var V={resolve:t=>Kn(t).map(tn),lerp:(t,e,n)=>{if(t===e)return t;if(!t.length&&!e.length)return[];let r=Math.min(1,Math.max(0,n)),o=Math.max(t.length,e.length),i=[];for(let s=0;s<o;s++){let a=t[s],l=e[s];a&&l?Qc(a,l)?i.push(sr(a,l,r)):(r<1&&i.push(ws(a,1-r)),r>0&&i.push(ws(l,r))):a?i.push(sr(a,{...a,opacity:0},r)):l&&i.push(sr({...l,opacity:0},l,r))}return i}};function eu(t,e){return{blur:t.blur??e?.blur??0,offset:t.offset??e?.offset,fill:t.fill!=null?V.resolve(t.fill):e?.fill??V.resolve("transparent"),inner:t.inner??e?.inner??!1,spread:t.spread??e?.spread??0}}function tu(t,e,n){return{blur:t.blur+(e.blur-t.blur)*n,offset:O(t.offset??{x:0,y:0},e.offset??{x:0,y:0},n),fill:V.lerp(t.fill,e.fill,n),inner:n<1?t.inner:e.inner,spread:t.spread+(e.spread-t.spread)*n}}var we={resolve:(t,e)=>t==null?[]:(Array.isArray(t)?t:[t]).map((r,o)=>eu(r,e?.[o])),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];if(!s){o.push(a);continue}if(!a){o.push(s);continue}o.push(tu(s,a,n))}return o}};function nu(t,e){if(t==null)return e;if(typeof t=="number")return Math.max(-1,Math.min(1,t));switch(t){case"inside":return-1;case"center":return 0;case"outside":return 1}return e}var ru=4;function ou(t){switch(t){case"arrow":case"triangle":case"stealth":case"dot":case"box":case"diamond":case"bar":return!0}return!1}function Ss(t,e){if(t==null)return e;switch(t){case"butt":case"round":case"square":return t}return e}function vs(t,e){return ou(t)?t:Ss(t,e)}function iu(t,e){if(t==null)return e;switch(t){case"miter":case"round":case"bevel":return t}return e}function su(t,e){let n;if(t.dash!=null){let o=Array.isArray(t.dash)?t.dash:[t.dash];n=o.length===1?[o[0],o[0]]:o}else n=e?.dash;let r=Ss(t.cap,e?.cap??"butt");return{weight:t.weight??e?.weight??1,fill:t.fill!=null?V.resolve(t.fill):e?.fill??V.resolve("transparent"),dash:n,dashOffset:t.dashOffset??e?.dashOffset??0,align:nu(t.align,e?.align??-1),cap:r,startCap:t.startCap!=null?vs(t.startCap,r):e?.startCap,endCap:t.endCap!=null?vs(t.endCap,r):e?.endCap,capScale:Math.max(0,t.capScale??e?.capScale??ru),join:iu(t.join,e?.join??"miter"),miterLimit:t.miterLimit??e?.miterLimit??4}}function au(t,e,n){let r=t||[],o=e||[];if(r.length===0&&o.length===0)return t;let i=Math.max(r.length,o.length),s=new Array(i);for(let a=0;a<i;a++){let l=r[a]??0,c=o[a]??0;s[a]=l+(c-l)*n}return s}function lu(t,e,n){return{weight:t.weight+(e.weight-t.weight)*n,fill:V.lerp(t.fill,e.fill,n),dash:au(t.dash,e.dash,n),dashOffset:t.dashOffset+(e.dashOffset-t.dashOffset)*n,align:t.align+(e.align-t.align)*n,cap:n<.5?t.cap:e.cap,startCap:n<.5?t.startCap:e.startCap,endCap:n<.5?t.endCap:e.endCap,capScale:t.capScale+(e.capScale-t.capScale)*n,join:n<.5?t.join:e.join,miterLimit:t.miterLimit+(e.miterLimit-t.miterLimit)*n}}var re={resolve:(t,e)=>t==null?[]:(Array.isArray(t)?t:[t]).map((r,o)=>su(r,e?.[o])),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];if(!s){o.push(a);continue}if(!a){o.push(s);continue}o.push(lu(s,a,n))}return o}};var Ms=new WeakMap,ks=new WeakMap,cu=0;function ct(t,e){return Ms.set(t,e),t}function bs(t){let e=Ms.get(t);if(e!==void 0)return e;let n=ks.get(t);return n===void 0&&(n=`fn#${cu++}`,ks.set(t,n)),n}var Cs="quad",lr=Math.PI,cr=t=>t===void 0?{type:Cs}:typeof t=="string"?{type:t}:{...t,type:t.type??Cs},nn={sine:t=>1-Math.cos(t*lr/2),quad:t=>t*t,cubic:t=>t*t*t,quart:t=>t*t*t*t,quint:t=>t*t*t*t*t,expo:t=>t===0?0:Math.pow(2,10*(t-1)),circ:t=>1-Math.sqrt(1-t*t),back:(t,e)=>{let n=e.overshoot??1.70158;return t*t*((n+1)*t-n)},elastic:(t,e)=>{if(t===0||t===1)return t;let n=e.amplitude??1,r=e.period??.3,o=r/(2*lr)*Math.asin(1/n);return-(n*Math.pow(2,10*(t-1))*Math.sin((t-1-o)*2*lr/r))},bounce:t=>1-(n=>n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375)(1-t)},ur=(t,e)=>`${t}:${e.type}:${e.overshoot??"_"}:${e.amplitude??"_"}:${e.period??"_"}`,Os=()=>ct(t=>Pe(t),"lin"),i0=t=>{let e=cr(t);return ct(n=>nn[e.type](Pe(n),e),ur("in",e))},s0=t=>{let e=cr(t);return ct(n=>1-nn[e.type](1-Pe(n),e),ur("out",e))},a0=t=>{let e=cr(t),n=e.type==="back"?{...e,overshoot:(e.overshoot??1.70158)*1.525}:e.type==="elastic"?{...e,period:e.period??.45}:e;return ct(r=>(r=Pe(r),r<.5?nn[n.type](2*r,n)/2:1-nn[n.type](2*(1-r),n)/2),ur("inOut",e))};var fr=Os(),Fe=class t{segments;constructor(e=[]){this.segments=e}ramp(e,n,r,o){return new t([...this.segments,{from:e,to:n,duration:r,ease:o?.ease}])}hold(e){return new t([...this.segments,{duration:e}])}fadeIn(e,n){return new t([...this.segments,{from:0,to:1,duration:e,ease:n?.ease}])}fadeOut(e,n){return new t([...this.segments,{to:0,duration:e,ease:n?.ease}])}resolve(e,n){let r=this.segments;if(r.length===0)return[];let o=Number.isFinite(e)&&e>0?e:0,i=0,s=0;for(let d of r)d.duration===void 0?s++:i+=Math.max(0,d.duration);s>1,i>o;let a=Math.max(0,o-i),l=s>0?r.findIndex(d=>d.duration===void 0):a>0?r.length-1:-1,c=[],f=0,h=n;for(let d=0;d<r.length;d++){let p=r[d];if(s===0&&d===l&&a>0){let M=Math.min(f,o),k=Math.min(f+a,o);c.push({startTime:M,endTime:k,from:h,to:h,ease:fr,isLinear:!0}),f+=a}let m;p.duration===void 0?m=d===l?a:0:m=Math.max(0,p.duration);let w=p.from??h,x=p.to??w,y=Math.min(f,o),g=Math.min(f+m,o),v=p.ease??fr;c.push({startTime:y,endTime:g,from:w,to:x,ease:v,isLinear:v===fr}),f+=m,h=x}return c}sampleAt(e,n,r){let o=this.resolve(n,r);if(o.length===0)return r;if(e<=o[0].startTime)return o[0].from;for(let i of o)if(e>=i.startTime&&e<=i.endTime){let s=i.endTime-i.startTime,a=s>0?(e-i.startTime)/s:1;return u(i.from,i.to,i.ease(a))}return o[o.length-1].to}staticValue(e){return this.segments[0]?.from??e}};function h0(t,e,n,r){return new Fe().ramp(t,e,n,r)}function d0(t){return new Fe().hold(t)}function p0(t,e){return new Fe().fadeIn(t,e)}function m0(t,e){return new Fe().fadeOut(t,e)}function rn(t){return t instanceof Fe}function y0(t,e=0){return rn(t)?t.staticValue(e):t}function g0(t){return t===void 0?"_":rn(t)?"c["+t.segments.map(e=>`${e.from??"_"},${e.to??"_"},${e.duration??"_"},${e.ease?bs(e.ease):"lin"}`).join(";")+"]":String(t)}function G(t,e,n){return typeof t=="number"&&typeof e=="number"?u(t,e,n):n<.5?t:e}var As={resolve:t=>t,lerp:G};function Z(t,e){return t===e?!0:typeof t=="number"&&typeof e=="number"?t===e:!1}var Es=.001;function x0(t,e,n=e,r=Es){let o=Math.min(n,e);if(o<=0)return 0;let i=0;for(let s=0;s<o;s+=r){let a=Math.min(r,o-s),l=Math.max(1e-6,t.sampleAt(s+a/2,e,1));i+=a/l}return i}function w0(t,e,n,r=Es){if(n<=0)return 0;let o=0,i=0;for(;i<e;){let s=Math.min(r,e-i),a=Math.max(1e-6,t.sampleAt(i+s/2,e,1)),l=s/a;if(o+l>=n){let c=l>0?(n-o)/l:0;return i+s*c}o+=l,i+=s}return e}function qe(t,e){return typeof t=="number"||rn(t)?{[e]:t}:t}var on=class t{list;constructor(e=[]){this.list=e}append(e){return new t([...this.list,e])}gain(e){let{value:n}=qe(e,"value");return this.append({type:"gain",value:n})}volume(e){return this.gain(e)}highpass(e){let{frequency:n,q:r}=qe(e,"frequency");return this.append({type:"highpass",frequency:n,q:r})}lowpass(e){let{frequency:n,q:r}=qe(e,"frequency");return this.append({type:"lowpass",frequency:n,q:r})}tremolo(e){let{rate:n,depth:r}=qe(e,"rate");return this.append({type:"tremolo",rate:n,depth:r??.5})}speed(e){let{value:n}=qe(e,"value");return this.append({type:"speed",value:n})}echo(e){let{delay:n,feedback:r,mix:o}=qe(e,"delay");return this.append({type:"echo",delay:n,feedback:r??.4,mix:o})}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},S0=new on;function Ps(t){return t===void 0?[]:t instanceof on?t.list:Array.isArray(t)?t:[t]}var Ts={lerp:(t,e,n)=>({type:"gain",value:G(t.value,e.value,n)}),equals:(t,e)=>Z(t.value,e.value)};var zs={lerp:(t,e,n)=>({type:"highpass",frequency:G(t.frequency,e.frequency,n),q:G(t.q??1,e.q??1,n)}),equals:(t,e)=>Z(t.frequency,e.frequency)&&Z(t.q??1,e.q??1)};var Fs={lerp:(t,e,n)=>({type:"lowpass",frequency:G(t.frequency,e.frequency,n),q:G(t.q??1,e.q??1,n)}),equals:(t,e)=>Z(t.frequency,e.frequency)&&Z(t.q??1,e.q??1)};var Rs={lerp:(t,e,n)=>({type:"tremolo",rate:G(t.rate,e.rate,n),depth:G(t.depth,e.depth,n)}),equals:(t,e)=>Z(t.rate,e.rate)&&Z(t.depth,e.depth)};var Ns={lerp:(t,e,n)=>({type:"speed",value:G(t.value,e.value,n)}),equals:(t,e)=>Z(t.value,e.value)};var Ds={lerp:(t,e,n)=>({type:"echo",delay:G(t.delay,e.delay,n),feedback:G(t.feedback,e.feedback,n),mix:G(t.mix??.5,e.mix??.5,n)}),equals:(t,e)=>Z(t.delay,e.delay)&&Z(t.feedback,e.feedback)&&Z(t.mix??.5,e.mix??.5)};var uu={gain:Ts,highpass:zs,lowpass:Fs,tremolo:Rs,speed:Ns,echo:Ds},hr=class t{static registry=new Map(Object.entries(uu));static register(e,n){if(this.registry.has(e))throw new Error(`Audio filter "${e}" is already registered`);this.registry.set(e,n)}static get(e){return this.registry.get(e)}static has(e){return this.registry.has(e)}static lerp(e,n,r){if(e.type!==n.type)return r<.5?e:n;let o=this.registry.get(e.type);return o?o.lerp(e,n,r):r<.5?e:n}static lerpArray(e,n,r){let o=Math.max(e.length,n.length),i=[];for(let s=0;s<o;s++){let a=e[s],l=n[s];a&&l?i.push(t.lerp(a,l,r)):a?i.push(a):l&&i.push(l)}return i}},dr={resolve:Ps,lerp:hr.lerpArray};function an(t){return(t.g??0)!==0||(t.h??0)!==0||(t.i??1)!==1}var sn=1e-6;function fu(t){return t>sn||t<-sn?t:t<0?-sn:sn}function Is(){return{a:1,b:0,c:0,d:1,e:0,f:0}}function js(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function be(t,e){return an(t)||an(e)?hu(t,e):{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function hu(t,e){let n=t.g??0,r=t.h??0,o=t.i??1,i=e.g??0,s=e.h??0,a=e.i??1;return{a:t.a*e.a+t.c*e.b+t.e*i,c:t.a*e.c+t.c*e.d+t.e*s,e:t.a*e.e+t.c*e.f+t.e*a,b:t.b*e.a+t.d*e.b+t.f*i,d:t.b*e.c+t.d*e.d+t.f*s,f:t.b*e.e+t.d*e.f+t.f*a,g:n*e.a+r*e.b+o*i,h:n*e.c+r*e.d+o*s,i:n*e.e+r*e.f+o*a}}function $e(t,e){let n=t.a*e.x+t.c*e.y+t.e,r=t.b*e.x+t.d*e.y+t.f;if(!an(t))return{x:n,y:r};let o=fu((t.g??0)*e.x+(t.h??0)*e.y+(t.i??1));return{x:n/o,y:r/o}}function ln(t){if(an(t))return du(t);let e=t.a*t.d-t.b*t.c;if(e===0||!Number.isFinite(e))return null;let n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function du(t){let{a:e,b:n,c:r,d:o,e:i,f:s}=t,a=t.g??0,l=t.h??0,c=t.i??1,f=o*c-s*l,h=s*a-n*c,d=n*l-o*a,p=e*f+r*h+i*d;if(p===0||!Number.isFinite(p))return null;let m=1/p;return{a:f*m,c:(i*l-r*c)*m,e:(r*s-i*o)*m,b:h*m,d:(e*c-i*a)*m,f:(i*n-e*s)*m,g:d*m,h:(r*a-e*l)*m,i:(e*o-r*n)*m}}function V0(t,e,n,r,o){let i=-o*Math.PI/180,s=Math.cos(i),a=Math.sin(i),l=r*s,c=r*a,f=r*-a,h=r*s,d=-n.x,p=n.y;return{a:l,b:c,c:f,d:h,e:t+l*d+f*p,f:e+c*d+h*p}}function pu(t,e,n,r,o,i){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s),c=r*a,f=r*l,h=r*-l,d=r*a;return{a:c,b:f,c:h,d,e:t+o-(c*o+h*i),f:e+i-(f*o+d*i)}}var cn={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};function pr(t){return t.rotationX!==0||t.rotationY!==0||t.rotationZ!==0||t.flipHorizontal||t.flipVertical||t.perspective!==0&&t.depth!==0}function Ls(t,e){let n=Math.PI/180;return Math.cos(t*n)*Math.cos(e*n)<0}function Bs(t,e,n,r,o,i,s){if(!pr(s))return pu(t,e,n,r,o,i);let a=Math.PI/180,l=Math.cos(s.rotationX*a),c=Math.sin(s.rotationX*a),f=Math.cos(s.rotationY*a),h=Math.sin(s.rotationY*a),d=(n+s.rotationZ)*a,p=Math.cos(d),m=Math.sin(d),w=f*p*r,x=-f*m*r,y=(c*h*p+l*m)*r,g=(l*p-c*h*m)*r,v=(c*m-l*h*p)*r,M=(l*h*m+c*p)*r,k=s.perspective!==0?1/s.perspective:0,T=-v*k,L=-M*k,Q=1-(s.depth-(v*o+M*i))*k,fe=t+o,Hn=e+i,Yn=s.flipHorizontal?-1:1,Xn=s.flipVertical?-1:1;return{a:(w+fe*T)*Yn,c:(x+fe*L)*Xn,e:-(w*o+x*i)+fe*Q,b:(y+Hn*T)*Yn,d:(g+Hn*L)*Xn,f:-(y*o+g*i)+Hn*Q,g:T*Yn,h:L*Xn,i:Q}}function mu(t,e,n){let r={x:u(t.x,e.x,n),y:u(t.y,e.y,n)};return(t.z!==void 0||e.z!==void 0)&&(r.z=u(t.z??0,e.z??0,n)),r}function hn(t,e){let n=new Array(12);for(let r=0;r<3;r++){let o=t[r*4],i=t[r*4+1],s=t[r*4+2],a=t[r*4+3];n[r*4]=o*e[0]+i*e[4]+s*e[8],n[r*4+1]=o*e[1]+i*e[5]+s*e[9],n[r*4+2]=o*e[2]+i*e[6]+s*e[10],n[r*4+3]=o*e[3]+i*e[7]+s*e[11]+a}return n}function dn(t,e,n,r,o,i,s){let a=Math.PI/180,l=Math.cos(s.rotationX*a),c=Math.sin(s.rotationX*a),f=Math.cos(s.rotationY*a),h=Math.sin(s.rotationY*a),d=(n+s.rotationZ)*a,p=Math.cos(d),m=Math.sin(d),w=f*p*r,x=-f*m*r,y=h*r,g=(c*h*p+l*m)*r,v=(l*p-c*h*m)*r,M=-c*f*r,k=(c*m-l*h*p)*r,T=(l*h*m+c*p)*r,L=l*f*r,Q=s.flipHorizontal?-1:1,fe=s.flipVertical?-1:1;return[w*Q,x*fe,y,t+o-(w*o+x*i),g*Q,v*fe,M,e+i-(g*o+v*i),k*Q,T*fe,L,s.depth-(k*o+T*i)]}function un(t){let e=Math.PI/180,n=Math.sin(t.orbit*e),r=Math.cos(t.orbit*e),o=Math.sin(t.elevation*e),i=Math.cos(t.elevation*e),s=r,a=0,l=-n,c=n*o,f=i,h=r*o,d=n*i,p=-o,m=r*i,w=t.lookAt.x,x=-t.lookAt.y,y=t.lookAt.z??0;return[s,a,l,-(s*w+a*x+l*y),c,f,h,-(c*w+f*x+h*y),d,p,m,-(d*w+p*x+m*y)+t.dolly]}function yr(t,e){let n=t.perspective>0?1/t.perspective:0,r=-e[8]*n,o=-e[9]*n,i=1-e[11]*n,s=-t.heading*Math.PI/180,a=t.zoom,l=a*Math.cos(s),c=-a*Math.sin(s),f=a*Math.sin(s),h=a*Math.cos(s),d=t.viewportX,p=t.viewportY,m={a:l*e[0]+c*e[4]+d*r,c:l*e[1]+c*e[5]+d*o,e:l*e[3]+c*e[7]+d*i,b:f*e[0]+h*e[4]+p*r,d:f*e[1]+h*e[5]+p*o,f:f*e[3]+h*e[7]+p*i};return n!==0&&(m.g=r,m.h=o,m.i=i),m}function gr(t,e){let n=e.width/2,r=e.height/2,o=[e.x-n,e.x+n,e.x+n,e.x-n],i=[e.y-r,e.y-r,e.y+r,e.y+r],s=new Array(12);for(let l=0;l<4;l++){let c=o[l],f=i[l];s[l*3]=t[0]*c+t[1]*f+t[3],s[l*3+1]=t[4]*c+t[5]*f+t[7],s[l*3+2]=t[8]*c+t[9]*f+t[11]}let a=Math.hypot(t[2],t[6],t[10])||1;return{corners:s,cx:t[0]*e.x+t[1]*e.y+t[3],cy:t[4]*e.x+t[5]*e.y+t[7],cz:t[8]*e.x+t[9]*e.y+t[11],nx:t[2]/a,ny:t[6]/a,nz:t[10]/a}}var xr=.01,Ws=.001;function fn(t,e){if(t.perspective>0){let n=-e.cx,r=-e.cy,o=t.perspective-e.cz,i=e.nx*n+e.ny*r+e.nz*o;return{side:i,edgeOn:Math.abs(i)<=Ws*Math.hypot(n,r,o)}}return{side:e.nz,edgeOn:Math.abs(e.nz)<=Ws}}function Vs(t,e){if(t.perspective<=0)return"all";let n=0;for(let r=0;r<4;r++)1-e.corners[r*3+2]/t.perspective>xr&&n++;return n===4?"all":n===0?"none":"some"}function Hs(t,e,n){let r=t.g??0,o=t.h??0,i=t.i??1,s=e.width/2+n,a=e.height/2+n,l=[{x:e.x-s,y:e.y-a},{x:e.x+s,y:e.y-a},{x:e.x+s,y:e.y+a},{x:e.x-s,y:e.y+a}],c=h=>r*h.x+o*h.y+i-xr,f=[];for(let h=0;h<l.length;h++){let d=l[h],p=l[(h+1)%l.length],m=c(d),w=c(p);if(m>=0&&f.push(d),m>=0!=w>=0){let x=m/(m-w);f.push({x:d.x+(p.x-d.x)*x,y:d.y+(p.y-d.y)*x})}}return f.length>=3?f:null}var mr=.01;function qs(t,e,n){let r=0,o=0;for(let s=0;s<4;s++){let a=t.nx*(e.corners[s*3]-t.cx)+t.ny*(e.corners[s*3+1]-t.cy)+t.nz*(e.corners[s*3+2]-t.cz);a>mr?r++:a<-mr&&o++}if(r===0&&o===0)return 0;let i=n>0?1:-1;return o===0?i:r===0?-i:0}function ut(t,e){return t.perspective>0?e.cx*e.cx+e.cy*e.cy+(t.perspective-e.cz)**2:-e.cz}function yu(t,e,n){let r=fn(t,e);if(!r.edgeOn){let a=qs(e,n,r.side);if(a!==0)return a>0?-1:1;if(gu(e,n))return 0}let o=fn(t,n);if(!o.edgeOn){let a=qs(n,e,o.side);if(a!==0)return a>0?1:-1}let i=ut(t,e),s=ut(t,n);return i===s?0:i>s?-1:1}function gu(t,e){for(let n=0;n<4;n++){let r=t.nx*(e.corners[n*3]-t.cx)+t.ny*(e.corners[n*3+1]-t.cy)+t.nz*(e.corners[n*3+2]-t.cz);if(Math.abs(r)>mr)return!1}return!0}function $s(t){return{...t,viewportX:0,viewportY:0}}var X0={lerpLookAt:mu,project(t,e){let n=$s(t),r=un(n),o=e.x,i=-e.y,s=e.z??0,a=r[0]*o+r[1]*i+r[2]*s+r[3],l=r[4]*o+r[5]*i+r[6]*s+r[7],c=r[8]*o+r[9]*i+r[10]*s+r[11],f=n.perspective>0?1-c/n.perspective:1;if(f<=xr)return null;let h=-n.heading*Math.PI/180,d=n.zoom*a/f,p=n.zoom*l/f;return{x:Math.cos(h)*d-Math.sin(h)*p,y:-(Math.sin(h)*d+Math.cos(h)*p)}},focusVector(t,e){let n=$s(t),r=-n.heading*Math.PI/180,o=n.zoom||1,i=e.x,s=-e.y,a=(Math.cos(r)*i+Math.sin(r)*s)/o,l=(-Math.sin(r)*i+Math.cos(r)*s)/o,c=n.perspective>0?1-n.dolly/n.perspective:1,f=un(n),h=a*c,d=l*c;return{x:h*f[0]+d*f[4],y:-(h*f[1]+d*f[5]),z:h*f[2]+d*f[6]}}},xu=96;function Ys(t,e){let n=e.length;if(n>xu)return e.map((a,l)=>l).sort((a,l)=>ut(t,e[l])-ut(t,e[a])||a-l);let r=Array.from({length:n},()=>[]),o=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=a+1;l<n;l++){let c=yu(t,e[a],e[l]);c<0?(r[a].push(l),o[l]++):c>0&&(r[l].push(a),o[a]++)}let i=[],s=new Array(n).fill(!1);for(;i.length<n;){let a=-1;for(let l=0;l<n;l++)if(!s[l]&&o[l]===0){a=l;break}if(a===-1){let l=-1/0;for(let c=0;c<n;c++){if(s[c])continue;let f=ut(t,e[c]);f>l&&(l=f,a=c)}}s[a]=!0,i.push(a);for(let l of r[a])o[l]--}return i}var wr={resolve:t=>t,lerp:(t,e,n)=>({width:u(t.width,e.width,n),height:u(t.height,e.height,n)}),expand:t=>{t.size!==void 0&&(t.width===void 0&&(t.width=t.size),t.height===void 0&&(t.height=t.size))}},J={resolve:t=>t,lerp:(t,e,n)=>typeof t=="number"&&typeof e=="number"?u(t,e,n):n===1?e:t,resolveLayout:(t,e,n)=>typeof t=="number"?t:t==="fill"?e:t==="hug"?n:e,isAuto:t=>typeof t!="number"};var wu=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","fill","stroke","shadow"],vr=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign"],ft=Object.freeze({}),H={resolve:t=>t,lerp:_u,preset:vu,mergeStyle:Xs,resolveStyle:Su,lerpStyle:ku,lerpFontSize:Us,styleProps:Mu,flatten:bu,applyCase:Ou};function _u(t,e,n){if(n<=0)return t;if(n>=1)return e;let r=0,o=Math.min(t.length,e.length);for(;r<o&&t.charCodeAt(r)===e.charCodeAt(r);)r++;let i=0,s=Math.min(t.length-r,e.length-r);for(;i<s&&t.charCodeAt(t.length-1-i)===e.charCodeAt(e.length-1-i);)i++;let a=t.length-r-i,l=e.length-r-i,c=a+l;if(c===0)return e;let f=t.substring(0,r),h=t.substring(t.length-i),d=a/c;if(n<d){let w=d===0?1:n/d,x=Math.round(a*(1-w));return f+t.substring(r,r+x)+h}let p=d===1?1:(n-d)/(1-d),m=Math.round(l*p);return f+e.substring(r,r+m)+h}function vu(t){return mo(t)??ft}function Xs(t,e){let n=null;for(let r of wu){let o=e?.[r];o!==void 0&&((n??={...t})[r]=o)}return n??t}function Su(t,e){let n=t??{};return{fontFamily:n.fontFamily??e.fontFamily,fontSize:n.fontSize??e.fontSize,fontWeight:n.fontWeight??e.fontWeight,fontStyle:n.fontStyle??e.fontStyle,letterSpacing:n.letterSpacing??e.letterSpacing,lineHeight:n.lineHeight??e.lineHeight,textAlign:n.textAlign??e.textAlign,fill:V.resolve(n.fill??e.fill??[]),stroke:re.resolve(n.stroke??e.stroke??[]),shadow:we.resolve(n.shadow??e.shadow??[])}}function ku(t,e,n){return{fontFamily:n<.5?t.fontFamily:e.fontFamily,fontSize:Us(t.fontSize,e.fontSize,n),fontWeight:_r(t.fontWeight,e.fontWeight,n),fontStyle:n<.5?t.fontStyle:e.fontStyle,letterSpacing:_r(t.letterSpacing,e.letterSpacing,n),lineHeight:_r(t.lineHeight,e.lineHeight,n),textAlign:n<.5?t.textAlign:e.textAlign,fill:V.lerp(t.fill,e.fill,n),stroke:re.lerp(t.stroke,e.stroke,n),shadow:we.lerp(t.shadow,e.shadow,n)}}function Mu(t){return Xs({},t)}function bu(t,e){let n=[],r=(o,i)=>{let s={fontFamily:o.fontFamily??i.fontFamily,fontSize:o.fontSize??i.fontSize,fontWeight:o.fontWeight??i.fontWeight,fontStyle:o.fontStyle??i.fontStyle,letterSpacing:o.letterSpacing??i.letterSpacing,fill:o.fill!=null?V.resolve(o.fill):i.fill,stroke:o.stroke!=null?re.resolve(o.stroke):i.stroke};o.text&&n.push({text:o.text,...s});for(let a of o.children??[])r(a,s)};for(let o of t)r(o,e);return n}var Cu=/[\p{L}\p{N}'\u2019]/u;function Ou(t,e){if(e!=="upper"&&e!=="lower"&&e!=="title")return t;let n="",r="";for(let o of t){let i=e==="upper"||e==="title"&&!Cu.test(r),s=e==="lower"?o.toLowerCase():i?o.toUpperCase():o;n+=s.length===o.length?s:o,r=o}return n}function Us(t,e,n){return typeof t=="number"&&typeof e=="number"?u(t,e,n):n<.5?t:e}function _r(t,e,n){return t==null||e==null?n<.5?t:e:u(t,e,n)}var pn=Symbol("propertyMeta");function ht(t){return Sr(t,pn)}function Sr(t,e){let n=[],r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)n.unshift(r),r=Object.getPrototypeOf(r);let o=[],i=new Map;for(let s of n)if(Object.prototype.hasOwnProperty.call(s,e))for(let a of s[e]){let l=i.get(a.key);l===void 0?(i.set(a.key,o.length),o.push(a)):o[l]=a}return o}function b(t){return function(e,n){let r=n,{default:o,mapper:i,tween:s,...a}=t??{},l={key:r,default:o,options:i!=null||s!=null?{mapper:i,tween:s}:void 0,...Object.keys(a).length>0?{editor:a}:{}};Object.prototype.hasOwnProperty.call(e,pn)||(e[pn]=[]);let c=e[pn];c.some(f=>f.key===r)||c.push(l)}}function de(t,e,n){if(t.measure){let r=t.measure(e,n);return{width:r.width??0,height:r.height??0}}return{width:Gs(t.width,e.maxWidth),height:Gs(t.height,e.maxHeight)}}function Gs(t,e){return typeof t=="number"?t:t==="fill"?e??0:0}function Zs(t,e,n,r,o){let i=e?"width":"height",s=e?"height":"width",a=(e?r.hugWidth:r.hugHeight)===!0,l=(e?r.hugHeight:r.hugWidth)===!0,c={maxWidth:r.width,maxHeight:r.height},f=t.length,h=new Array(f),d=t.map(k=>Eu(k.gapScale)),p=n==="auto"?0:n*Math.max(0,d.reduce((k,T)=>k+T,0)-1),m=0,w=0;for(let k=0;k<f;k++)t[k][i]==="fill"||l&&t[k][s]==="fill"||(h[k]=de(t[k],c,o),m+=h[k][i],h[k][s]>w&&(w=h[k][s]));let x=l?w:r[s];if(l)for(let k=0;k<f;k++){if(t[k][i]==="fill"||t[k][s]!=="fill")continue;let T=de(t[k],c,o);h[k]=ta(T,x,e),m+=T[i]}let y=Math.max(0,r[i]-p-m),g=0;for(let k of t)k[i]==="fill"&&(g+=Ks(k.flex));for(let k=0;k<f;k++){let T=t[k];if(T[i]!=="fill")continue;let L,Q;a?(Q=Js(T,e,r,o),L=Q[i]):(L=g>0?y*Ks(T.flex)/g:0,Q=de(T,e?{maxWidth:L,maxHeight:r.height}:{maxWidth:r.width,maxHeight:L},o));let fe=T[s]==="fill"?x:Q[s];h[k]=e?{width:L,height:fe}:{width:fe,height:L}}let v=p,M=0;for(let k of h)v+=k[i],k[s]>M&&(M=k[s]);return{sizes:h,lines:f>0?[{start:0,end:f,cross:M}]:[],gapScales:d,hug:e?{width:v,height:M}:{width:M,height:v}}}function Js(t,e,n,r){let o=de(t,e?{maxWidth:1/0,maxHeight:n.height}:{maxWidth:n.width,maxHeight:1/0},r),i=e?"width":"height";return Number.isFinite(o[i])?o:{...o,[i]:0}}function Qs(t,e,n,r,o,i){let s=e?"width":"height",a=e?"height":"width",l=(e?o.hugWidth:o.hugHeight)===!0,c=l?1/0:o[s],f=n==="auto"?0:n,h={maxWidth:o.width,maxHeight:o.height},d=t.map(y=>l&&y[s]==="fill"?Js(y,e,o,i):de(y,h,i)),p=[],m=0,w=0,x=0;for(;x<d.length;){let y=x+1,g=d[x][s];for(;y<d.length&&g+f+d[y][s]<=c;)g+=f+d[y][s],y++;let v=0;for(let M=x;M<y;M++)t[M][a]!=="fill"&&d[M][a]>v&&(v=d[M][a]);for(let M=x;M<y;M++)t[M][a]==="fill"&&(d[M]=ta(d[M],v,e));p.push({start:x,end:y,cross:v}),g>m&&(m=g),w+=v,x=y}return w+=r*Math.max(0,p.length-1),{sizes:d,lines:p,gapScales:d.map(()=>1),hug:e?{width:m,height:w}:{width:w,height:m}}}function ea(t,e,n,r,o,i,s,a){let l=r?"width":"height",c=r?"height":"width",f=r?(1+s.x)/2:(1-s.y)/2,h=r?(1-s.y)/2:(1+s.x)/2,d=i*Math.max(0,e.length-1);for(let w of e)d+=w.cross;let p=h*(a[c]-d),m=new Array(t.length);for(let w of e){let x=w.end-w.start,y=0,g=0;for(let T=w.start;T<w.end;T++)y+=t[T][l],g+=n[T];let v,M=0;if(o==="auto"){let T=x>1?Math.max(0,a[l]-y)/(x-1):0;v=()=>T,y+=T*(x-1)}else{let T=L=>L<w.end?n[L]:1;v=L=>o*(n[L]+T(L+1))/2,y+=o*Math.max(0,g-1),M=o*(1-n[w.start])/2}let k=f*(a[l]-y)-M;for(let T=w.start;T<w.end;T++){let L=t[T],Q=p+h*(w.cross-L[c]);m[T]=Au(r?k:Q,r?Q:k,L,a),k+=L[l]+v(T)}p+=w.cross+i}return m}function Au(t,e,n,r){return{x:t+n.width/2-r.width/2,y:r.height/2-e-n.height/2,width:n.width,height:n.height}}function ta(t,e,n){return n?{width:t.width,height:e}:{width:e,height:t.height}}function Ks(t){return t==null?1:Number.isFinite(t)&&t>=0?t:1}function Eu(t){return t==null?1:Number.isFinite(t)?yo(t,0,1):1}function na(t,e,n){let r={maxWidth:e.width,maxHeight:e.height},o=[],i={width:0,height:0};for(let s of t){let a=de(s,r,n);o.push(a),a.width>i.width&&(i.width=a.width),a.height>i.height&&(i.height=a.height)}return{sizes:o,hug:i}}function kr(t,e,n){return t.map(r=>({x:n.x*Math.max(0,e.width-r.width)/2,y:n.y*Math.max(0,e.height-r.height)/2,width:r.width,height:r.height}))}function ra(t,e,n,r,o,i){let s=Math.max(1,Math.round(e)),a=Math.max(0,(o.width-n*(s-1))/s),l=Pu(t,s),c=l.reduce((g,v)=>Math.max(g,v.row+v.rowSpan),0),f=o.hugHeight!==!0&&c>0,h=f?Math.max(0,(o.height-r*(c-1))/c):0,d=new Array(c).fill(h),p=t.map((g,v)=>{let M=l[v],k=Mr(a,M.colSpan,n),T=f?{maxWidth:k,maxHeight:Mr(h,M.rowSpan,r)}:{maxWidth:k},L=de(g,T,i);return f||Tu(d,M.row,M.rowSpan,L.height,r),L}),m=[],w=0;for(let g of d)m.push(w),w+=g+r;let x=l.map(g=>({x:g.col*(a+n),y:m[g.row]??0,width:Mr(a,g.colSpan,n),height:ia(d,g.row,g.rowSpan,r)})),y=d.reduce((g,v)=>g+v,0)+r*Math.max(0,c-1);return{sizes:p,cells:x,hug:{width:o.width,height:y}}}function oa(t,e){return t.map(n=>({x:n.x+n.width/2-e.width/2,y:e.height/2-n.y-n.height/2,width:Math.min(n.width,e.width),height:Math.min(n.height,e.height)}))}function Pu(t,e){let n=[],r=[],o=(l,c,f,h)=>{for(let d=0;d<h;d++)for(let p=0;p<f;p++)if(r[l+d]?.[c+p])return!1;return!0},i=(l,c,f,h)=>{for(let d=0;d<h;d++){r[l+d]??=[];for(let p=0;p<f;p++)r[l+d][c+p]=!0}},s=0,a=0;for(let l of t){let c=Math.min(l.colSpan??1,e),f=l.rowSpan??1;if(l.column!==void 0&&l.row!==void 0){i(l.row-1,l.column-1,c,f),n.push({col:l.column-1,row:l.row-1,colSpan:c,rowSpan:f});continue}for(;a+c>e&&(s++,a=0),!o(s,a,c,f);)a++;i(s,a,c,f),n.push({col:a,row:s,colSpan:c,rowSpan:f}),a+=c}return n}function Tu(t,e,n,r,o){if(n===1){r>t[e]&&(t[e]=r);return}let i=r-ia(t,e,n,o);i>0&&(t[e]+=i)}function Mr(t,e,n){return t*e+n*(e-1)}function ia(t,e,n,r){let o=r*(n-1);for(let i=e;i<e+n;i++)o+=t[i]??0;return o}var zu={x:0,y:0};function Fu(t,e,n,r){let o=U.insetBounds(n.width,n.height,U.resolve(t.padding??0));return ua(ca(t,e,o,r),t,o).map(s=>({x:s.x+o.x,y:s.y-o.y,width:s.width,height:s.height}))}function ca(t,e,n,r){let o=t.flow??"freeform";if(typeof o=="string")return br(o,t,e,n,r);let i=br(o.from,t,e,n,r),s=br(o.to,t,e,n,r);return{...s,hug:Bu(i.hug,s.hug,o.t),from:i,t:o.t}}function ua(t,e,n){let r=sa(t,e,n),o=t.from;if(!o)return r;let i=sa(o,e,n),s=t.t??1;return r.map((a,l)=>({x:u(i[l].x,a.x,s),y:u(i[l].y,a.y,s),width:u(i[l].width,a.width,s),height:u(i[l].height,a.height,s)}))}function Ru(t,e){let{space:n,hug:r}=t;return aa(e.width,n.width,n.hugWidth,r.width)&&aa(e.height,n.height,n.hugHeight,r.height)}function Nu(t,e,n){let r=mn(t.width,e.maxWidth),o=mn(t.height,e.maxHeight),i=U.insetBounds(r,o,n);return{width:i.width,height:i.height,hugWidth:t.width==="hug",hugHeight:t.height==="hug"}}function Du(t,e,n,r){let o=U.outsetSize(r.width,r.height,n);return{width:t.width==="hug"?o.width:mn(t.width,e.maxWidth),height:t.height==="hug"?o.height:mn(t.height,e.maxHeight)}}function Iu(t,e){if(t.mode!=="horizontal"&&t.mode!=="vertical"||(t.mode==="horizontal"?e.width:e.height)>0)return null;let n=t.sizes.filter(r=>r.width>0||r.height>0).length;return n===0?null:`is laying out ${n} sized child${n===1?"":"ren"} in a run of length 0 (${e.width}\xD7${e.height}, ${t.mode}). They will be positioned from its centre rather than its leading edge.`}function ju(t,e,n){let r=typeof t=="string"?t:t.to,o=typeof e=="string"?e:e.to;return n>=1||r===o?o:{from:r,to:o,t:n}}function br(t,e,n,r,o){if(t==="freeform")return{mode:t,items:n,space:r,...na(n,r,o)};if(t==="grid"){let a=ra(n,e.columns??1,ha(e),Cr(e),r,o);return{mode:t,items:n,space:r,...a}}let i=t==="horizontal",s=e.wrap?Qs(n,i,e.gap??0,Cr(e),r,o):Zs(n,i,e.gap??0,r,o);return{mode:t,items:n,space:r,...s}}function sa(t,e,n){if(t.mode==="grid")return oa(t.cells??[],n);let r=fa(e);return t.mode==="freeform"?kr(t.sizes,n,r):ea(t.sizes,t.lines??[],t.gapScales??[],t.mode==="horizontal",e.gap??0,Cr(e),r,n)}function Lu(t,e,n){return(t.flow??"freeform")!=="freeform"?null:kr([n],e,fa(t))[0]}function fa(t){let e=t.align;return e===void 0?zu:typeof e=="string"?D.resolve(e):e}function ha(t){let e=t.gap??0;return e==="auto"?0:e}function Cr(t){return t.crossGap??ha(t)}function mn(t,e){let n=e??0;return t==="hug"?n:J.resolveLayout(t,n,0)}function Bu(t,e,n){return{width:u(t.width,e.width,n),height:u(t.height,e.height,n)}}function aa(t,e,n,r){return la(t,e)||n===!0&&la(t,r)}function la(t,e){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:Math.abs(t-e)<=1e-6*Math.max(1,Math.abs(t),Math.abs(e))}var B={resolve:t=>t,lerp:ju,arrange:Fu,measure:ca,place:ua,reusable:Ru,freeSlot:Lu,contentBox:Nu,size:Du,collapsedRun:Iu};var da={x:0,y:0,z:0};function Ve(t){if(t===void 0)return{...da};if(typeof t=="number")return{x:t,y:t,z:t};if(Array.isArray(t))return{x:t[0]??0,y:t[1]??0,z:t[2]??0};let e=t;return{x:e.x??0,y:e.y??0,z:e.z??0}}function Or(t,e,n){return{x:u(t.x,e.x,n),y:u(t.y,e.y,n),z:u(t.z,e.z,n)}}var Ar={resolve:t=>Ve(t),lerp:Or};function yn(t){return t===void 0?void 0:Ve(t)}function gn(t,e,n,r){return e===void 0?t:t!==void 0?Or(t,e,n):r==="origin"?Or(da,e,n):n>=1?e:t}function Wu(t,e,n){return{x:u(t.x,e.x,n),y:u(t.y,e.y,n),z:u(t.z,e.z,n),order:n<.5?t.order:e.order}}var Er={resolve:t=>{let e=Ve(t),n=t?.order;return n?{...e,order:n}:e},lerp:Wu},qu={x:0,y:0,z:0,w:1};function $u(t,e,n){let{x:r,y:o,z:i,w:s}=e,a=t.x*r+t.y*o+t.z*i+t.w*s;if(a<0&&(r=-r,o=-o,i=-i,s=-s,a=-a),a>.9995)return Vu({x:u(t.x,r,n),y:u(t.y,o,n),z:u(t.z,i,n),w:u(t.w,s,n)});let l=Math.acos(a),c=Math.sin(l),f=Math.sin((1-n)*l)/c,h=Math.sin(n*l)/c;return{x:t.x*f+r*h,y:t.y*f+o*h,z:t.z*f+i*h,w:t.w*f+s*h}}function Vu(t){let e=Math.hypot(t.x,t.y,t.z,t.w);return e===0?{...qu}:{x:t.x/e,y:t.y/e,z:t.z/e,w:t.w/e}}function vw(t){let e=Math.PI/360,n=Math.cos(t.x*e),r=Math.sin(t.x*e),o=Math.cos(t.y*e),i=Math.sin(t.y*e),s=Math.cos(t.z*e),a=Math.sin(t.z*e);switch(t.order??"XYZ"){case"YXZ":return{x:r*o*s+n*i*a,y:n*i*s-r*o*a,z:n*o*a-r*i*s,w:n*o*s+r*i*a};case"ZXY":return{x:r*o*s-n*i*a,y:n*i*s+r*o*a,z:n*o*a+r*i*s,w:n*o*s-r*i*a};case"ZYX":return{x:r*o*s-n*i*a,y:n*i*s+r*o*a,z:n*o*a-r*i*s,w:n*o*s+r*i*a};case"YZX":return{x:r*o*s+n*i*a,y:n*i*s+r*o*a,z:n*o*a-r*i*s,w:n*o*s-r*i*a};case"XZY":return{x:r*o*s-n*i*a,y:n*i*s-r*o*a,z:n*o*a+r*i*s,w:n*o*s+r*i*a};default:return{x:r*o*s+n*i*a,y:n*i*s-r*o*a,z:n*o*a+r*i*s,w:n*o*s-r*i*a}}}var pa={resolve:t=>t,lerp:$u};function X(t,e,n,r){return o=>b({default:o&&"default"in o?o.default:t(),mapper:o?.mapper??e,tween:o?.tween??n,...o?.kind??r?{kind:o?.kind??r}:{}})}var Ww=X(()=>[],V.resolve,V.lerp,"fills"),qw=X(()=>[],re.resolve,re.lerp,"strokes"),$w=X(()=>[],we.resolve,we.lerp,"shadows"),ma=X(()=>[],ke.resolve,ke.lerp,"effects"),Vw=X(()=>"black",xe.resolve,xe.lerp,"color"),Hw=X(()=>0,ge.resolve,ge.lerp,"cornerRadius"),Yw=X(()=>"rounded",Le.resolve,Le.lerp,"cornerStyle"),Xw=X(()=>"",void 0,ne.lerp,"path"),ya=X(()=>0,U.resolve,U.lerp,"insets"),ga=X(()=>"center",D.resolve,D.lerp,"alignment"),Uw=X(()=>"freeform",void 0,B.lerp),Gw=X(()=>({x:0,y:0}),void 0,Je.lerp,"vector2"),Kw=X(()=>"fill",void 0,J.lerp,"size"),Zw=X(()=>"",void 0,H.lerp,"text"),Jw=X(()=>({x:0,y:0,z:0}),Ar.resolve,Ar.lerp,"vector3");function xa(t){return b({default:void 0,mapper:yn,tween:(e,n,r)=>gn(e,n,r,t),kind:"vector3"})}var Qw=X(()=>({x:0,y:0,z:0}),Er.resolve,Er.lerp,"euler3"),wa=X(()=>({x:0,y:0,z:0,w:1}),void 0,pa.lerp,"quaternion"),Pr=X(()=>0,void 0,As.lerp,"audioParam"),_a=X(()=>[],dr.resolve,dr.lerp,"audioFilters");var F=null;function dt(t){let e=F;return F=t,e}var Ce=class{_host;_name;_value;_fn=null;_running=!1;constructor(e,n=null,r=""){this._host=n,this._name=r,this._value=e}get(){if(F!==null&&F.read(this),!this._fn||this._running)return this._value;this._running=!0;try{return this._value=this._fn()}finally{this._running=!1}}set(e){F!==null&&F.write(this),this._fn=null,this._value=e}bind(e){F!==null&&F.write(this),this._fn=e}unbind(){this._fn&&(F!==null&&F.write(this),this._value=this.get(),this._fn=null)}isBound(){return this._fn!==null}snapshot(){return this._fn?{value:this.get(),fn:this._fn}:{value:this._value}}restoreFrom(e){e.fn?this.bind(e.fn):this.set(e.value)}dispose(){this._fn=null,this._value=void 0}};var Tr=class{target;props;duration;easing;atPrepared=null;constructor(e,n,r,o){this.target=e,this.props=n,this.duration=r,this.easing=o}at(e){return this.atPrepared||(this.atPrepared=this.prepare()),this.atPrepared.seek(Pe(e)*this.duration),{}}_stepper(){return this.prepare()}prepare(){return this.target._prepareStep(this.props,this.duration,this.easing)}};function xn(t,e,n,r){return new Tr(t,e,n,r)}function o_(t,e){let n=Object.keys(e).filter(i=>e[i]!==void 0),r=new Array(n.length),o=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=t[n[i]],o[i]=e[n[i]];return i=>{for(let s=0;s<n.length;s++)t[n[s]]=r[s]+(o[s]-r[s])*i}}function va(t,e,n){return r=>{for(let o=0;o<t.length;o++)t[o].set(e[o]+(n[o]-e[o])*r)}}function mt(t,e){return{id:Symbol(e??"context"),defaultValue:t,name:e}}var pt=class t{entries;constructor(e){this.entries=e}static EMPTY=new t(new Map);with(e,n){let r=new Map(this.entries);return r.set(e.id,n),new t(r)}get(e){return this.entries.has(e.id)?this.entries.get(e.id):e.defaultValue}};function a_(t,e){return t.__cells?.slots.get(e)}function wn(t){return t.__cells??={slots:new Map}}var _n=Symbol("commandMeta");function Sa(t){return Sr(t,_n)}function W(t){return function(e,n){let r=n,o=t?.key??r;Object.prototype.hasOwnProperty.call(e,_n)||(e[_n]=[]);let i=e[_n];i.some(s=>s.key===o)||i.push({key:o,method:r,...t?.name?{name:t.name}:{},...t?.args?{args:t.args}:{}})}}var ka="layoutBounds",h_="var:",d_="presence:",Ma="structure";function p_(t,e){let n=dt(t);try{return e()}finally{dt(n)}}function m_(t){let e=dt(null);try{return t()}finally{dt(e)}}function y_(t){return t._host?`${t._host.id}.${t._name}`:t._name}function ba(t,e){return{duration:e,at:()=>({}),_stepper:()=>zr(e)}}function zr(t){let e=0;return{seek:n=>{e=n},advance:n=>(e+=n,e>=t)}}function Hu(t,e,n){let r=new Ce(void 0,t,e),o=wn(t);o.slots.set(e,r),n?.tween&&(o.tweens??=new Map).set(e,n.tween),n?.mapper&&(o.mappers??=new Map).set(e,n.mapper),Object.defineProperty(t,e,{get:()=>r.get(),set:i=>t._writeProp(e,i),enumerable:!0,configurable:!0})}function Ca(t,e,n,r){t.__cells?.slots.get(e)?r&&(r.tween&&(wn(t).tweens??=new Map).set(e,r.tween),r.mapper&&(wn(t).mappers??=new Map).set(e,r.mapper)):Hu(t,e,r),t._writeProp(e,n)}function Oa(t){let e={};if(t.__cells)for(let n of t.__cells.slots.keys())e[n]=t[n];return e}function Yu(t){let e=new Map,n=t.__cells?.slots;if(!n)return e;for(let[r,o]of n)e.set(r,o.snapshot());return e}function Aa(t){t.__cells&&t._stateStack.push(Yu(t))}function Ea(t){return t._stateStack.pop()}function Fr(t,e){let n=t.__cells?.slots;if(n)for(let[r,o]of e)n.get(r)?.restoreFrom(o)}function Pa(t,e,n,r){let o=null;return ve(n,i=>{if(!o){let s={};if(e)for(let[a,l]of e)s[a]=l.value;o=t._prepareStep(s,n)}o.seek(i*n),e&&i>=1&&Fr(t,e)},r)}function Ta(){return{total:0,creation:0,elapsed:0,started:!1}}function za(t,e){t.started||(t.creation=e,t.started=!0),t.total=e,t.elapsed=e-t.creation}var Rr=function(t,e,n,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(i=(o<3?s(i):o>3?s(e,n,i):s(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},Xu={"2d":"2D nodes go in the 2D tree, or inside a Canvas3D as a HUD over its scene.","3d":"Put 3D nodes inside a Canvas3D, which is the one node that holds both.",audio:"Put audio nodes under an AudioBus, or directly on the scene root."};function Uu(t){let e=t.options?.mapper,n=typeof t.default=="function"?t.default():t.default,r=n===void 0||!e?n:e(n,void 0);return{...t.options,mapper:()=>r}}var le=class t{get _childTrees(){return[this.dimension]}constructor(e){this._props=e;let n=e;this.key=n?.key,this.id=n?.id??crypto.randomUUID()}key;_hidden=!1;_locked=!1;get hidden(){return this._hidden}get locked(){return this._locked}_setEditorState(e,n){this._hidden=e,this._locked=n}initProps(e){e?.ref&&e.ref(this);for(let n of ht(this)){if(n.withdrawn){this.applyProp(n.key,n.default,Uu(n));continue}let r=e?e[n.key]:void 0,o=r!==void 0?r:n.default;this.applyProp(n.key,o,n.options)}}adoptChildrenProp(e){if(e&&e.children){let r=(Array.isArray(e.children)?e.children:[e.children]).flat(1/0).filter(o=>o instanceof t);r.length>0&&this._addChildren(r)}}acceptsChild(e){return e.dimension===this.dimension}assertAcceptsChild(e){if(!this.acceptsChild(e)){let r=e.dimension===this.dimension?this._childRule():Xu[e.dimension];throw new TypeError(`${this.className} (${this.dimension}) cannot hold ${e.className} (${e.dimension}).${r?` ${r}`:""}`)}let n=e._parentRefusal(this);if(n)throw new TypeError(n)}_childRule(){return""}_parentRefusal(e){return null}_assets=null;_parent=null;_mounted=!1;get mounted(){return this._mounted}get parent(){return F!==null&&F.read(this._structureSlot()),this._parent}get assets(){if(!this._assets)throw new Error("Assets not bound \u2014 this node is not attached to a scene. See Node.attach().");return this._assets}_context=pt.EMPTY;_contextBound=!1;_props;useContext(e){return this._context.get(e)}id;__cells;_children=[];static flattenChildrenProp(e){let n=e?e.children:void 0;return n?(Array.isArray(n)?n:[n]).flat(1/0).filter(o=>o instanceof t):[]}applyProp(e,n,r){Ca(this,e,n,r)}_writeProp(e,n){if(n===void 0)return;let r=this.__cells?.slots.get(e);if(!r)return;let o=this.__cells?.mappers?.get(e);if(typeof n=="function"){let i=n;if(o){let s;r.bind(()=>{let a=i();return a===void 0?(s??={value:this._unsetValue(e,o)}).value:o(a,r.get())})}else r.bind(i)}else r.set(o?o(n,r.get()):n)}get properties(){return Oa(this)}get className(){return this.constructor.name}set(e){let n=this.__cells?.slots;if(n)for(let r in e){let o=e[r];o!==void 0&&n.has(r)&&this._writeProp(r,o)}}to(e){return xn(this,e.data??{},e.duration,e.easing)}command(e,n=1,r){return this._mounted?xo(this,e,n,r):ba(this,n)}_prepareStep(e,n,r){if(!this._mounted)return zr(n);let o=[],i=[],s=[],a=[],l=[];for(let m of Object.keys(e)){let w=this.__cells?.slots.get(m);if(!w)continue;let x=e[m],y=this.__cells?.mappers?.get(m),g=y?y(x,this[m]):x,v=this.__cells?.tweens?.get(m);if(v){let M=this[m];a.push(k=>{w.set(v(M,g,k))})}else typeof g=="number"?(o.push(w),i.push(this[m]),s.push(g)):typeof g=="string"&&l.push([w,g])}let c=va(o,i,s),f=a.length>0,h=l.length>0,d=m=>{let w=r?r(m):m;if(c(w),f)for(let x of a)x(w);if(h&&m>=1)for(let[x,y]of l)x.set(y)},p=0;return{seek:m=>{p=m,d(n>0?Math.min(m/n,1):1)},advance:m=>(p+=m,p<n?(d(p/n),!1):(d(1),!0))}}_unsetValue(e,n){let r=ht(this).find(i=>i.key===e)?.default,o=typeof r=="function"?r():r;return o===void 0?void 0:n(o,void 0)}_stateStack=[];save(){Aa(this)}restore(e){let n=Ea(this),r=e?.duration;if(r===void 0||r<=0){n&&Fr(this,n);return}return Pa(this,n,r,e?.easing)}_time=Ta();tick(){}get time(){return F!==null&&F.clock?.(this),this._time}_advanceOwnTime(e){za(this._time,e),this.tick(),this._sample()}_sample(){}_primeMotion(e){}attach(e){let n=!this._mounted;this._mounted=!0,this._assets!==e.assets&&(this._assets=e.assets);let r=this.provideContext(e.context);if((!this._contextBound||this._context!==r)&&(this._context=r,this._contextBound=!0),n&&this.resolveContext(r),this._advanceOwnTime(e.time),this._children.length===0)return;let i=r===e.context?e:{...e,context:r};for(let s of this._children)s.attach(i)}detach(){if(this._mounted){this._mounted=!1;for(let e of this._children)e.detach()}}_currentScope(){return this._assets&&this._contextBound?{assets:this._assets,context:this._context,time:this._time.total}:null}_attachChild(e){if(!this._mounted)return;let n=this._currentScope();n&&e.attach(n)}resolveContext(e){}provideContext(e){return e}attachDetached(e){let n=this._currentScope();n&&e.attach(n)}declareAssets(e){}declareAudio(e){}get children(){return F!==null&&F.read(this._structureSlot()),this._children}get _allChildren(){return F!==null&&F.read(this._structureSlot()),this._children}add(e){if(e instanceof t){this._addChild(e);return}let n=t.flattenChildrenProp({children:e});n.length>0&&this._addChildren(n)}remove(e){if(e instanceof t){this._removeChild(e);return}for(let n of t.flattenChildrenProp({children:e}))this._removeChild(n)}clear(){for(let e of this._children)F!==null&&this._structureChanged(e),e._parent=null,e.detach();this._children.length=0}addChildAt(e){let{child:n,index:r}=e.data;this.assertAcceptsChild(n),this._insertChildAt(n,r)}_insertChildAt(e,n){F!==null&&this._structureChanged(e),this._children.splice(n,0,e),e._parent=this,this._attachChild(e)}_structureSlot(){return this._structure??=new Ce(null,this,Ma)}_structureChanged(e){F.write(this._structureSlot()),e&&F.write(e._structureSlot())}_structure=null;_addChild(e){this.assertAcceptsChild(e),F!==null&&this._structureChanged(e),this._children.push(e),e._parent=this,this._attachChild(e)}_addChildren(e){for(let n of e)this.assertAcceptsChild(n);if(F!==null)for(let n of e)this._structureChanged(n);this._children.push(...e);for(let n of e)n._parent=this;for(let n of e)this._attachChild(n)}_removeChild(e){let n=this._children.indexOf(e);if(n<0)return;F!==null&&this._structureChanged(e);let[r]=this._children.splice(n,1);r&&(r._parent=null,r.detach())}dispose(){if(this.__cells)for(let e of this.__cells.slots.values())e.dispose();this.__cells=void 0,this._assets=null,this._mounted=!1,this._context=pt.EMPTY,this._contextBound=!1}};Rr([W()],le.prototype,"to",null);Rr([W()],le.prototype,"restore",null);Rr([W({args:["child","index"]})],le.prototype,"addChildAt",null);var vn=class extends Error{assetType;src;nodeId;constructor(e,n,r){super(`${e} asset "${n}" is not loaded. `+(r??Gu(e))),this.name="AssetNotLoadedError",this.assetType=e,this.src=n}};function Gu(t){return`Declare it from the node's ${t==="audio"?"declareAudio()":`declareAssets() (e.g. assets.${t}(...))`}, so the asset timeline loads it before this frame draws.`}var He=class{_ops=[];rect(e){return this._ops.push({kind:"rect",state:e}),this}ellipse(e){return this._ops.push({kind:"ellipse",state:e}),this}path(e){let n=e instanceof he?e.toPathState():e;return this._ops.push({kind:"path",state:n}),this}line(e){return this._ops.push({kind:"line",state:e}),this}polygon(e){return this._ops.push({kind:"polygon",state:e}),this}polygram(e){return this._ops.push({kind:"polygram",state:e}),this}cut(){return this._ops.push({kind:"cut"}),this}ops(){return this._ops}isEmpty(){return!this._ops.some(e=>e.kind!=="cut")}};function Fa(t,e,n,r,o,i){t.prevPos?(t.prevPos.x=e,t.prevPos.y=n):t.prevPos={x:e,y:n},t.prevTime=i,t.prevRotation=r,t.prevScale=o}function Ra(){return{prevPos:null,prevTime:0,prevRotation:0,prevScale:1}}function Na(t,e,n,r,o,i,s){let a=s-e.prevTime,l=e.prevPos;if(l&&a>0&&a<=.2){let c=(n-l.x)/a,f=(r-l.y)/a;t.dt=a,t.velocity.x=c,t.velocity.y=f,t.speed=Math.hypot(c,f),t.direction=Math.atan2(f,c)*180/Math.PI,t.angularVelocity=(o-e.prevRotation)/a,t.scaleVelocity=(i-e.prevScale)/a}else t.dt=0,t.velocity.x=0,t.velocity.y=0,t.speed=0,t.direction=0,t.angularVelocity=0,t.scaleVelocity=0;l?(l.x=n,l.y=r):e.prevPos={x:n,y:r},e.prevTime=s,e.prevRotation=o,e.prevScale=i}function Ku(t,e){let n=t.lastMeasure,r=n?.measurer;if(!r)return null;let o=n?.constraints??{maxWidth:t.measuredWidth||Number.MAX_SAFE_INTEGER,maxHeight:t.measuredHeight||Number.MAX_SAFE_INTEGER},i=e.measure(o,r);return{width:i.width??0,height:i.height??0}}var Sn=.7;function Da(t,e,n,r,o){let i=null,s=!1,a=!1,l,c,f=()=>{let h=e.opacity;l=e.width,c=e.height,s=typeof l=="number",a=typeof c=="number";let d=s&&a?null:Ku(t,e),p=s||d!==null,m=a||d!==null,w=s?l:d?.width??0,x=a?c:d?.height??0;e.set({opacity:0,gapScale:0,...p?{width:0}:{},...m?{height:0}:{}}),t.addChildAt({data:{child:e,index:n}});let y={};p&&(y.width=w),m&&(y.height=x);let g=r*Sn,v=r-g;return kt(e,et(e,e.to({data:y,duration:g,easing:o}),e.to({data:{gapScale:1},duration:g,easing:o})),e.to({data:{opacity:h},duration:v,easing:o}))};return ve(r,h=>{if(i||(i=f()),i.at(h),h>=1){let d={};s||(d.width=l),a||(d.height=c),(!s||!a)&&e.set(d)}})}function Ia(t,e,n,r){let o=null,i=null,s=!1,a=()=>{if(s=!0,e<0||e>=t.children.length)return;o=t.children[e];let l=o.measuredWidth,c=o.measuredHeight;o.set({width:l,height:c});let f=n*(1-Sn),h=n-f;i=kt(o,o.to({data:{opacity:0},duration:f,easing:r}),et(o,o.to({data:{width:0,height:0},duration:h,easing:r}),o.to({data:{gapScale:0},duration:h,easing:r})))};return ve(n,l=>{if(s||a(),!i||!o)return;let c=l>=1;!c&&o.parent!==t&&t.addChildAt({data:{child:o,index:Math.min(e,t.children.length)}}),i.at(l),c&&(t.remove(o),o.set({gapScale:1}))})}function ja(t,e,n,r){let o=n/2,i=null,s=null,a=()=>{let l=t.opacity;s=t.parent;let c=t.measuredWidth,f=t.measuredHeight;t.set({width:c,height:f});let h=o*(1-Sn),d=o-h,p=o*Sn,m=o-p;return kt(t,t.to({data:{opacity:0},duration:h,easing:r}),et(t,t.to({data:{width:0,height:0},duration:d,easing:r}),t.to({data:{gapScale:0},duration:d,easing:r})),et(t,t.to({data:{width:c,height:f},duration:p,easing:r}),t.to({data:{gapScale:1},duration:p,easing:r})),t.to({data:{opacity:l},duration:m,easing:r}))};return ve(n,l=>{i||(i=a());let f=l*n>=o;f&&t.parent!==e?(s&&s.remove(t),e.add(t)):!f&&t.parent!==s&&(e.remove(t),s&&s.add(t)),i.at(l)})}var Zu=[["rotationX","rotationX"],["rotationY","rotationY"],["rotationZ","rotationZ"],["depth","depth"],["perspective","perspective"],["backfaceVisible","backfaceVisible"],["flipHorizontal","flipHorizontal"],["flipVertical","flipVertical"],["origin","transformOrigin"]];function kn(t){let e=t.transform3D;if(e==null||typeof e!="object")return;let n=e;for(let[r,o]of Zu){let i=n[r];i!==void 0&&t[o]===void 0&&(t[o]=i)}}function Nr(t,e,n,r,o){if(n===0)return{x:t+r,y:e+o};let i=n*Math.PI/180,s=Math.cos(i),a=Math.sin(i);return{x:t+s*r+a*o,y:e-a*r+s*o}}function Re(t,e,n,r,o,i,s,a=cn){let l=o.x*(i/2),c=-o.y*(s/2);return Bs(t,e,n,r,l,c,a)}function Mn(t,e,n){let r=(o,i)=>{let s=$e(t,{x:o,y:-i});return{x:s.x,y:-s.y}};return{center:r(0,0),topLeft:r(-e,n),topRight:r(e,n),bottomLeft:r(-e,-n),bottomRight:r(e,-n),topCenter:r(0,n),bottomCenter:r(0,-n),centerLeft:r(-e,0),centerRight:r(e,0)}}var bn=Is();function On(t,e){let n=un(e);return{root:t,camera:e,view:n,screen:yr(e,n),pushed:bn,local:bn,flat:!0,plane:gr(n,{x:0,y:0,width:0,height:0}),paints:!1,facesAway:!1,nearCut:null}}function Cn(t,e){let n=e._spaceMatrix(),r=hn(t.view,n),o=t.camera,i=yr(o,r),s=Qu(e),a=gr(r,s),{side:l,edgeOn:c}=fn(o,a),f=Vs(o,a),h=bn,d=!c&&f!=="none";if(d)if(t.pushed===bn)h=i;else{let p=ln(t.pushed);p?h=be(p,i):d=!1}return{root:t.root,camera:o,view:r,screen:i,pushed:d?i:t.pushed,local:h,flat:n[2]===0&&n[6]===0&&n[8]===0&&n[9]===0&&n[11]===0,plane:a,paints:d,facesAway:!c&&l<0,nearCut:d&&f==="some"?tf(i,s):null}}function Ju(t){let e=[];for(let n=t.parent;n;n=n.parent){let r=n._spaceCamera();if(r){let o=On(n,r);for(let i=e.length-1;i>=0;i--)o=Cn(o,e[i]);return Cn(o,t)}if(!n._rendersChildrenInSpace())return null;e.push(n)}return null}function G_(t){let e=t._spaceCamera();return e?On(t,e):t._rendersChildrenInSpace()?Ju(t):null}function La(t){return t.length<2||t.every(e=>e.flat)?t.map((e,n)=>n):Ys(t[0].camera,t.map(e=>e.plane))}function Qu(t){let e=t._localBounds();return{x:e.x,y:-e.y,width:e.width,height:e.height}}var ef=128;function tf(t,e){let n=Hs(t,e,Math.max(e.width,e.height)/2+ef);if(!n)return null;let r=new he().moveTo(n[0].x,-n[0].y);for(let i=1;i<n.length;i++)r.lineTo(n[i].x,-n[i].y);let o=Math.max(...n.map(i=>Math.max(Math.abs(i.x),Math.abs(i.y))));return new He().path(r.close().toPathState({centerBounds:[-o,-o,o,o]}))}function Ba(t,e,n,r){if(!t)return{};let o=e.x+n,i=e.y-r;return{parent:{left:-t.width/2-o,top:-t.height/2-i,right:t.width/2-o,bottom:t.height/2-i}}}function Wa(t,e,n,r,o){let i=wi(e);i.length!==0&&(!n||n.isEmpty()||(t.beginClip(n),t.beginEffects(i,"backdrop",r,o),t.endEffects(),t.endClip()))}function qa(t,e,n,r,o,i){let s=_i(e),a=s.length>0;a&&t.beginEffects(s,"foreground",r,o);let l=n!=null&&!n.isEmpty();l&&t.beginClip(n),i(),l&&t.endClip(),a&&t.endEffects()}var P=function(t,e,n,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(i=(o<3?s(i):o>3?s(e,n,i):s(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},nf={},Dr={x:0,y:0},rf=[],An={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};function $a(t){return An.rotationX=t.rotationX,An.rotationY=t.rotationY,An.depth=t.depth,An}var of=Object.freeze({}),sf={width:0,height:0},S=class t extends le{get dimension(){return"2d"}get parent2D(){let e=this._parent;return e instanceof t?e:null}get parent(){return F!==null&&F.read(this._structureSlot()),this.parent2D}get children(){F!==null&&F.read(this._structureSlot());let e=this._children;for(let n=0;n<e.length;n++)if(!(e[n]instanceof t))return e.filter(r=>r instanceof t);return e}constructor(e){if(super(e),e&&(wr.expand(e),kn(e)),this.initProps(e),e&&e.flex!==void 0?(e.width===void 0&&this.applyProp("width","fill",{tween:J.lerp}),e.height===void 0&&this.applyProp("height","fill",{tween:J.lerp})):this.applyDefaultSize(e),e){D.validateProps(e);let n=D.findKey(e);if(n){let r=e[n],o=typeof r=="function"?r:()=>r,{pivot:i,x:s,y:a}=D.bindTarget(n,o,()=>this._layoutBounds.get());this._writeProp("pivot",i),this._writeProp("x",s),this._writeProp("y",a)}}this.adoptChildrenProp(e)}set(e){let n=e.size;e.transform3D!==void 0&&(e={...e},kn(e)),super.set(e),n!==void 0&&(e.width===void 0&&this._writeProp("width",n),e.height===void 0&&this._writeProp("height",n))}_prepareStep(e,n,r){wr.expand(e),kn(e);let o=e.pivot;o!==void 0&&delete e.pivot,D.validateProps(e);let i=D.findKey(e);if(i){let s=e[i],{pivot:a,x:l,y:c}=D.resolveTargetOnce(i,this._layoutBounds.get(),s);this._writeProp("transformOrigin",o!==void 0?D.resolve(o):a),e.x=l,e.y=c}else o!==void 0&&this._writeProp("transformOrigin",D.resolve(o));return super._prepareStep(e,n,r)}declareAssets(e){e.effects(this.effects)}_sample(){this._sampleMotion()}_primeMotion(e){let n=this.layoutBounds,r=this._offset();Fa(this._motionHistory,(n?.x??0)+r.x,(n?.y??0)-r.y,this.rotation,this.scale,e)}_layoutBounds=new Ce({x:0,y:0,width:0,height:0},this,ka);lastMeasure;get constraints(){return this.lastMeasure?.constraints??{}}get layoutBounds(){return this._layoutBounds.get()}static flowChildrenProp(e){return t.flattenChildrenProp(e).filter(n=>n instanceof t)}static hasFillChild(e,n){return e.some(r=>(n==="width"?r.width:r.height)==="fill")}applyDefaultSize(e){let r=t.flowChildrenProp(e).length>0?"hug":"fill";(!e||e.width===void 0)&&this.applyProp("width",r,{tween:J.lerp}),(!e||e.height===void 0)&&this.applyProp("height",r,{tween:J.lerp})}moveTo(e){let{path:n,target:r,targetAnchor:o,...i}=e.data??{},s=i.x!==void 0||i.y!==void 0,a=typeof r=="string"&&r!=="";if(a&&s)throw new Error("moveTo takes a `target` or an `x`/`y` destination, not both \u2014 the target's anchor is where the move ends.");let l=a?this._pointOnNode(r,o):null;if(n==null)return this.to({data:{...i,...l},duration:e.duration,easing:e.easing});if(s)throw new Error("moveTo takes a `path` or an `x`/`y` destination, not both \u2014 the path's own end is where the move ends.");let c=ne.sampler(n instanceof he?n.toCommands():n),{length:f}=c,h=c.frameAt(0),d=c.frameAt(f),p=l&&h&&d?ne.endFit(h,d,l):null,m=i.pivot;return this.command(w=>{let x=c.frameAt(f*w);if(!x)return{};let y=p?p(x):x,g={x:y.x,y:y.y};return m!==void 0&&(g.transformOrigin=m),g},e.duration,e.easing)}fadeTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}rotateTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}scaleTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}layoutTo(e){return this.to({data:Va(e.data),duration:e.duration,easing:e.easing})}pulse(e){let n=this.scale,r=e.data?.factor??1.2;return this.command(o=>({scale:n*(1+(r-1)*Math.sin(Math.PI*o))}),e.duration,e.easing)}wiggle(e){let n=this.rotation,r=e.data?.angle??8,o=e.data?.turns??3;return this.command(i=>({rotation:n+r*Math.sin(2*Math.PI*o*i)*Math.sin(Math.PI*i)}),e.duration,e.easing)}effectTo(e){return this.to({data:Va(e.data),duration:e.duration,easing:e.easing})}get measuredWidth(){return this.layoutBounds.width}get measuredHeight(){return this.layoutBounds.height}_rotateOffset(e,n){let r=this._offset();return Nr(r.x,r.y,this.rotation,e,n)}get center(){let e=this._offset();return{x:e.x,y:e.y}}get topLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,e.height/2)}get topRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,e.height/2)}get bottomLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,-e.height/2)}get bottomRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,-e.height/2)}get topCenter(){let e=this.layoutBounds;return this._rotateOffset(0,e.height/2)}get bottomCenter(){let e=this.layoutBounds;return this._rotateOffset(0,-e.height/2)}get centerLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,0)}get centerRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,0)}_localMatrix(){let e=this.layoutBounds,n=this._slotMatrix(),{x:r,y:o}=this._offset();if(n)return be(n,Re(r,-o,this.rotation,this.scale,this._transformOrigin(),e?.width??0,e?.height??0));let i=(e?.x??0)+r,s=(e?.y??0)-o;return Re(i,s,this.rotation,this.scale,this._transformOrigin(),e?.width??0,e?.height??0)}_placement(){return this.parent2D?._placementOf(this)??null}_placementOf(e){return null}_planeOf(e){return null}_slotFor(e){let n=this._childBox,r=n?B.freeSlot(this.flowArrangement(),n,e):null;return n&&r?{x:n.x+r.x,y:n.y-r.y}:null}_centreShift(e=this.rotation,n=this.scale){let r=this.layoutBounds,o=Re(0,0,e,n,this._transformOrigin(),r?.width??0,r?.height??0);return $e(o,{x:0,y:0})}_handles(){return rf}_handleValue(e,n){return null}_offsetScratch={x:0,y:0};_offset(){let e=this.parent2D?._planeOf(this);if(e)return e.toOffset(this.x,this.y);let n=this._offsetScratch;return n.x=this.x,n.y=this.y,n}_slotMatrix(e=!1){let n=this._placement();if(!n)return null;let r=this.layoutBounds;return Re(r?.x??0,r?.y??0,n.rotation,n.scale,Dr,0,0,e?$a(n):void 0)}_slotAffine(){let e=this._placement();if(!e)return null;let n=this.layoutBounds;return dn(n?.x??0,n?.y??0,e.rotation,e.scale,0,0,$a(e))}_transformOrigin(){return this.transformOrigin??this.pivot}_projectionScratch={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};_projection(){let e=this._projectionScratch;return e.rotationX=this.rotationX,e.rotationY=this.rotationY,e.rotationZ=this.rotationZ,e.depth=this.depth,e.perspective=this.perspective,e.flipHorizontal=this.flipHorizontal,e.flipVertical=this.flipVertical,e}_spaceMatrix(){let e=this.layoutBounds,n=e?.width??0,r=e?.height??0,o=this._transformOrigin(),i=this._slotAffine(),{x:s,y:a}=this._offset();return i?hn(i,dn(s,-a,this.rotation,this.scale,o.x*(n/2),-o.y*(r/2),this._projection())):dn((e?.x??0)+s,(e?.y??0)-a,this.rotation,this.scale,o.x*(n/2),-o.y*(r/2),this._projection())}worldMatrix(){let e=this._localMatrix(),n=this.parent2D;return n?be(n.worldMatrix(),e):e}get global(){let e=this.layoutBounds,n=Mn(this.worldMatrix(),(e?.width??0)/2,(e?.height??0)/2),r=0,o=1,i=1;for(let s=this;s;s=s.parent2D){let a=s._placement();r+=s.rotation+(a?.rotation??0),o*=s.scale*(a?.scale??1),i*=s.opacity*(a?.opacity??1)}return{x:n.center.x,y:n.center.y,...n,rotation:r,scale:o,opacity:i}}_pointOnNode(e,n){let r=af(this,e);if(!r)return null;let o=D.resolve(n??"center"),i=r.layoutBounds,s=$e(r.worldMatrix(),{x:o.x*((i?.width??0)/2),y:-o.y*((i?.height??0)/2)}),a=this.parent2D,l=a?ln(a.worldMatrix()):null;if(a&&!l)return null;let c=l?$e(l,s):s,f=this.layoutBounds,h=c.x-(f?.x??0),d=(f?.y??0)-c.y;return a?._planeOf(this)?.toCoords(h,d)??{x:h,y:d}}resolveSizeInput(e,n,r){return J.resolveLayout(e,n,r)}addChildAt(e){let{child:n,index:r}=e.data;if(this.assertAcceptsChild(n),e.duration===void 0){this._insertChildAt(n,r);return}return Da(this,n,r,e.duration,e.easing)}removeChildAt(e){let n=e.data.index;if(e.duration===void 0){if(n<0||n>=this._children.length)return null;F!==null&&this._structureChanged(this._children[n]);let[r]=this._children.splice(n,1);return r&&(r._parent=null,r.detach()),r??null}return Ia(this,n,e.duration,e.easing)}_transformScratch={x:0,y:0,width:0,height:0,scale:1,rotation:0,opacity:1,blend:"pass-through",effects:[],pivot:{x:0,y:0}};_motionHistory=Ra();_renderState={id:this.id,rects:{},elapsed:0,dt:0,velocity:{x:0,y:0},direction:0,speed:0,angularVelocity:0,scaleVelocity:0};_sampleMotion(){let e=this.layoutBounds,n=this._offset(),r=(e?.x??0)+n.x,o=(e?.y??0)-n.y;Na(this._renderState,this._motionHistory,r,o,this.rotation,this.scale,this._time.total)}applyTransform(e){let n=this.layoutBounds,r=this._transformScratch,{x:o,y:i}=this._offset();r.x=(n?.x??0)+o,r.y=(n?.y??0)-i,r.width=n?.width??0,r.height=n?.height??0,r.scale=this.scale,r.rotation=this.rotation,r.opacity=this.opacity,r.blend=this.blend,r.effects=this.effects,r.pivot=this._transformOrigin();let s=this._placement()?.opacity;s!==void 0&&(r.opacity*=s);let a=this._spaceFrame,l=a?null:this._slotMatrix(!0);if(a)r.matrix=a.local;else if(l)r.matrix=be(l,Re(o,-i,r.rotation,r.scale,r.pivot,r.width,r.height,this._projection()));else{let c=this._projection();r.matrix=pr(c)?Re(r.x,r.y,r.rotation,r.scale,r.pivot,r.width,r.height,c):void 0}e.transform(r)}renderSelf(e){}renderOverlay(e){}renderStroke(e){}clipSelf(){return null}_cameraScope(){return null}_spaceCamera(){return null}_rendersChildrenInSpace(){return!0}_spaceFrame=null;_confinesChildren(){if(this._cameraScope()!==null)return!0;if(!this.clip)return!1;let e=this.clipSelf();return e!==null&&!e.isEmpty()}hitTestSelf(e,n){let r=this._localBounds();return Math.abs(e.x-r.x)<=r.width/2+n&&Math.abs(e.y-r.y)<=r.height/2+n}_localBounds(){return{x:0,y:0,width:this.measuredWidth,height:this.measuredHeight}}_hitTestSelf(e,n){return this.hitTestSelf(e,n)}clipPathSelf(){return null}applyClip(e){let n=this.clipSelf();return!n||n.isEmpty()?!1:(e.beginClip(n),!0)}applyBackdropEffects(e){let n=this.effects;n.length!==0&&Wa(e,n,this.clipSelf(),this.layoutBounds?.width??0,this.layoutBounds?.height??0)}renderContentWithEffects(e,n){this.applyBackdropEffects(e),qa(e,this.effects,this.clipPathSelf(),this.layoutBounds?.width??0,this.layoutBounds?.height??0,n)}renderChildren(e){let n=this._spaceCamera();if(n){this._renderInSpace(e,On(this,n));return}let r=this._spaceFrame;if(r){this._renderInSpace(e,r);return}for(let o of this._children)o instanceof t&&o.render(e)}_renderInSpace(e,n){let r=[];for(let s of this._children)s instanceof t&&r.push(s);let o=r.map(s=>Cn(n,s)),i=e.drawsVisibleOnly?La(o):o.map((s,a)=>a);for(let s of i){let a=r[s];a._spaceFrame=o[s];try{a.render(e)}finally{a._spaceFrame=null}}}_paintInFront(e,n,r){if(!n){r();return}e.beginClip(n);try{r()}finally{e.endClip()}}beforeRender(e){}renderState(e){let n=this._renderState;return n.rects=e.readsSpaceRects?this._spaceRects():nf,n.elapsed=this._time.elapsed,n}_spaceRects(){let e=this._offset();return Ba(this.parent2D?.layoutBounds,this.layoutBounds,e.x,e.y)}afterRender(e){}render(e){if(!this.mounted||e.drawsVisibleOnly&&this.opacity*(this._placement()?.opacity??1)<=0||e.drawsVisibleOnly&&this.hidden)return;let n=this._spaceFrame;if(!(e.drawsVisibleOnly&&!this.backfaceVisible&&this._facesAway(n))&&!(e.drawsVisibleOnly&&n&&!n.paints&&!this._rendersChildrenInSpace()))try{e.begin(this.renderState(e));try{this.beforeRender(e),this.renderContent(e),this.afterRender(e)}finally{e.end()}}catch(r){throw r instanceof vn&&(r.nodeId??=this.id),r}}renderContent(e){this.applyTransform(e);let n=this._spaceFrame;if(n&&!n.paints){this.renderChildren(e);return}let r=n?.nearCut??null;this.renderContentWithEffects(e,()=>{this._paintInFront(e,r,()=>this.renderSelf(e));let o=this.clip&&this.applyClip(e);this.renderChildren(e),o&&e.endClip(),this._paintInFront(e,r,()=>{this.renderOverlay(e),this.renderStroke(e)})})}_facesAway(e){if(e)return e.facesAway;let n=this._projection();return Ls(n.rotationX,n.rotationY)}_flowMeasure=null;_childBox=null;_flowWarned=!1;setLayoutBounds(e){let n=this._layoutBounds.get();n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height||this._layoutBounds.set(e)}flowChildren(){let e=this._children,n=0;for(;n<e.length;n++){let r=e[n];if(!(r instanceof t)||r.hidden)break}return n===e.length?e:e.filter(r=>r instanceof t&&!r.hidden)}effectivePadding(){return this.padding}flowArrangement(){return of}layout(e,n){this.setLayoutBounds(e),this.layoutChildren(e,n)}layoutChildren(e,n){let r=this._flowMeasure;this._flowMeasure=null;let o=U.insetBounds(e.width,e.height,this.effectivePadding());this._childBox=o;let i=this.flowChildren();if(i.length===0)return;let s=this.flowArrangement(),a=r&&B.reusable(r,o)?r:B.measure(s,i,{width:o.width,height:o.height,hugWidth:this.width==="hug",hugHeight:this.height==="hug"},n),l=B.place(a,s,o);for(let f=0;f<l.length;f++){let h=l[f];a.items[f].layout({x:o.x+h.x,y:o.y-h.y,width:h.width,height:h.height},n)}if(this._flowWarned)return;let c=B.collapsedRun(a,e);c!==null&&(this._flowWarned=!0,console.warn(`[motionscript] "${this.className}" ${c}`))}measure(e,n){this.lastMeasure={constraints:e,measurer:n};let r=this.effectivePadding(),o=this.flowChildren();if(o.length===0)return this._flowMeasure=null,B.size(this,e,r,sf);let i=B.contentBox(this,e,r),s=B.measure(this.flowArrangement(),o,i,n);return this._flowMeasure=s,B.size(this,e,r,s.hug)}reparent(e){let n=e.data.newParent;if(e.duration===void 0){let r=this.parent;r&&r.remove(this),n.add(this);return}return ja(this,n,e.duration,e.easing)}};P([b({default:0})],S.prototype,"x",void 0);P([b({default:0})],S.prototype,"y",void 0);P([b({default:"fill",tween:J.lerp})],S.prototype,"width",void 0);P([b({default:"fill",tween:J.lerp})],S.prototype,"height",void 0);P([b({default:1})],S.prototype,"scale",void 0);P([b({default:0})],S.prototype,"rotation",void 0);P([b({default:1})],S.prototype,"opacity",void 0);P([b({default:"pass-through"})],S.prototype,"blend",void 0);P([ma()],S.prototype,"effects",void 0);P([ya()],S.prototype,"padding",void 0);P([ga()],S.prototype,"pivot",void 0);P([b({default:!1})],S.prototype,"flipHorizontal",void 0);P([b({default:!1})],S.prototype,"flipVertical",void 0);P([b({default:0})],S.prototype,"rotationX",void 0);P([b({default:0})],S.prototype,"rotationY",void 0);P([b({default:0})],S.prototype,"rotationZ",void 0);P([b({default:0})],S.prototype,"depth",void 0);P([b({default:0,tween:po})],S.prototype,"perspective",void 0);P([b({default:!0})],S.prototype,"backfaceVisible",void 0);P([b({default:void 0,mapper:t=>t==null?void 0:D.resolve(t),tween:(t,e,n)=>D.lerp(t??e??Dr,e??Dr,n)})],S.prototype,"transformOrigin",void 0);P([b({default:!1})],S.prototype,"clip",void 0);P([b({default:1})],S.prototype,"flex",void 0);P([b({default:1})],S.prototype,"gapScale",void 0);P([b({default:void 0})],S.prototype,"column",void 0);P([b({default:void 0})],S.prototype,"row",void 0);P([b({default:1})],S.prototype,"colSpan",void 0);P([b({default:1})],S.prototype,"rowSpan",void 0);P([W({args:["x","y",{key:"path",kind:"path"},{key:"target",kind:"nodeRef"},{key:"targetAnchor",kind:"alignment"}]})],S.prototype,"moveTo",null);P([W({args:["opacity"]})],S.prototype,"fadeTo",null);P([W({args:["rotation"]})],S.prototype,"rotateTo",null);P([W({args:["scale"]})],S.prototype,"scaleTo",null);P([W({args:[{key:"width",kind:"size"},{key:"height",kind:"size"},{key:"padding",kind:"insets"}]})],S.prototype,"layoutTo",null);P([W({args:[{key:"factor",kind:"number",min:0,step:.05,unit:"\xD7",default:1.2}]})],S.prototype,"pulse",null);P([W({args:[{key:"angle",kind:"number",min:0,unit:"\xB0",default:8},{key:"turns",kind:"number",min:1,step:1,default:3}]})],S.prototype,"wiggle",null);P([W({args:[{key:"effects",kind:"effects"}]})],S.prototype,"effectTo",null);P([W({args:["index"]})],S.prototype,"removeChildAt",null);P([W({args:["newParent"]})],S.prototype,"reparent",null);function Va(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function af(t,e){let n=t;for(;n.parent;)n=n.parent;return Ha(n,e)}function Ha(t,e){if(t.id===e)return t instanceof S?t:null;for(let n of t._allChildren){let r=Ha(n,e);if(r)return r}return null}function Ya(t,e){let n=e.global,r=t.global,o=r.scale===0?0:1/r.scale,i=Nr(0,0,-r.rotation,(n.x-r.x)*o,(n.y-r.y)*o);return{x:i.x,y:i.y,rotation:n.rotation-r.rotation,scale:n.scale*o}}function pe(t){return D.resolve(t??{x:0,y:0})}var En=["center","topLeft","topRight","bottomLeft","bottomRight","topCenter","bottomCenter","centerLeft","centerRight"];function lf(t){let e=En.filter(n=>t[n]!==void 0);if(e.length>1)throw new Error(`Cannot set multiple shape alignment props at once: ${e.join(", ")}`);if(e.length===1){let n=["pivot","x","y"].find(r=>t[r]!==void 0);if(n)throw new Error(`Cannot set both shape alignment prop '${e[0]}' and '${n}' at the same time`)}}function Oe(t){let e={...t};for(let n of En)delete e[n];return e}function Ae(t,e,n){lf(t);let r=En.find(o=>t[o]!==void 0);if(r){let o=t[r],i=D.resolve(r);return{x:o.x-i.x*(e/2),y:o.y-i.y*(n/2),pivot:i}}return{x:t.x??0,y:t.y??0,pivot:t.pivot??{x:0,y:0}}}function kv(t,e,n){if(En.find(s=>t[s]!==void 0)||t.pivot===void 0)return t;let o=D.resolve(t.pivot);if(o.x===0&&o.y===0)return t;let i={x:t.x??0,y:t.y??0};return{...t,x:i.x-o.x*(e/2),y:i.y-o.y*(n/2),pivot:o}}function Xa(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=Ae(t,e,n);return{...Oe(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:pe(i),width:e,height:n,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function Ua(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=Ae(t,e,n);return{...Oe(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:pe(i),width:e,height:n,ratio:t.ratio??0,sweep:t.sweep??360,startAngle:t.startAngle??0}}function Ga(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=Ae(t,e,n);return{...Oe(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:pe(i),width:e,height:n,sides:t.sides??5,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function Ka(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=Ae(t,e,n);return{...Oe(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:pe(i),width:e,height:n,sides:t.sides??5,ratio:t.ratio??.5,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function Za(t){return{opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:t.x??0,y:t.y??0,start:t.start??0,end:t.end??1,width:t.width??0,height:t.height??0,pivot:pe(t.pivot),points:t.points??[],radius:t.radius??0,closed:t.closed??!1}}var Pn=1e-9;function tl(t,e,n=0){return cf(t.ops(),e,n)}function cf(t,e,n=0){let r=!1,o=null,i=()=>{o&&Ja(o,e,n)&&(r=!0),o=null};for(let s of t){if(s.kind==="cut"){o&&Ja(o,e,n)&&(r=!1),o=null;continue}i(),o=s}return i(),r}function Ja(t,e,n){switch(t.kind){case"rect":{let r=Xa(t.state),o=yt(e,r,r.width,r.height);return o!==null&&Qa(o,r.width,r.height,ge.resolve(r.cornerRadius),n)}case"ellipse":{let r=Ua(t.state),o=yt(e,r,r.width,r.height);return o!==null&&uf(o,r.width,r.height,r.ratio,r.sweep,r.startAngle,n)}case"polygon":{let r=Ga(t.state),o=yt(e,r,r.width,r.height);return o!==null&&Ir(o,hf(r.width,r.height,r.sides),!0,n)}case"polygram":{let r=Ka(t.state),o=yt(e,r,r.width,r.height);return o!==null&&Ir(o,df(r.width,r.height,r.sides,r.ratio),!0,n)}case"line":{let r=Za(t.state),o=yt(e,r,r.width,r.height);return o===null||r.points.length===0?!1:r.points.length>=3&&Ir(o,r.points,!0,n)?!0:nl(o,r.points,r.closed,n)}case"path":{let r=t.state,o={x:e.x-(r.x??0),y:e.y-(r.y??0)};return Qa(o,r.width??0,r.height??0,ge.resolve(0),n)}}}function yt(t,e,n,r){if(e.scale===0)return null;let o=e.pivot,i=o.x*(n/2),s=o.y*(r/2),a=t.x-(e.x+i),l=t.y-(e.y+s),c=e.rotation*Math.PI/180,f=Math.cos(c),h=Math.sin(c),d=(f*a-h*l)/e.scale,p=(h*a+f*l)/e.scale;return{x:d+i,y:p+s}}function Qa(t,e,n,r,o){let i=e/2+o,s=n/2+o;if(Math.abs(t.x)>i||Math.abs(t.y)>s)return!1;let a=Math.min(e,n)/2,l=Math.min(a,t.x<=0?t.y>=0?r.topLeft:r.bottomLeft:t.y>=0?r.topRight:r.bottomRight);if(l<=0)return!0;let c=Math.sign(t.x||1),f=Math.sign(t.y||1),h=t.x-c*(e/2-l),d=t.y-f*(n/2-l);return Math.sign(h||1)!==c||Math.sign(d||1)!==f?!0:h*h+d*d<=(l+o)*(l+o)}function uf(t,e,n,r,o,i,s){let a=e/2,l=n/2;if(a<=0||l<=0)return!1;let c=Math.max(0,Math.min(1,r)),f=Math.abs(o)>=360;return el(t,a+s,l+s)>1||c>0&&el(t,Math.max(Pn,a*c-s),Math.max(Pn,l*c-s))<1?!1:f?!0:ff(Math.atan2(t.y/l,t.x/a)*(180/Math.PI),i,o,t,s)}function el(t,e,n){return Math.hypot(t.x/e,t.y/n)}function ff(t,e,n,r,o){let i=n>=0?e:e+n,s=Math.abs(n),a=Math.hypot(r.x,r.y);if(a<=o)return!0;let l=o>0?o/Math.max(a,Pn)*(180/Math.PI):0,c=(t-i)%360;return c<0&&(c+=360),c<=s+l||c>=360-l}function hf(t,e,n){let r=Math.max(3,Math.round(n)),o=t/2,i=e/2,s=2*Math.PI/r,a=[];for(let l=0;l<r;l++){let c=Math.PI/2-l*s;a.push({x:o*Math.cos(c),y:i*Math.sin(c)})}return a}function df(t,e,n,r){let o=Math.max(3,Math.round(n)),i=Math.max(0,Math.min(1,r)),s=t/2,a=e/2,l=Math.PI/o,c=[];for(let f=0;f<o*2;f++){let h=Math.PI/2-f*l,d=f%2===0?1:i;c.push({x:s*d*Math.cos(h),y:a*d*Math.sin(h)})}return c}function Ir(t,e,n,r){return e.length>=3&&pf(t,e)?!0:r>0&&nl(t,e,n,r)}function pf(t,e){if(e.length<3)return!1;let n=!1;for(let r=0,o=e.length-1;r<e.length;o=r++){let i=e[r],s=e[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function nl(t,e,n,r){if(e.length===0)return!1;if(e.length===1)return Math.hypot(t.x-e[0].x,t.y-e[0].y)<=r;let o=n?e.length:e.length-1;for(let i=0;i<o;i++)if(mf(t,e[i],e[(i+1)%e.length])<=r)return!0;return!1}function mf(t,e,n){let r=n.x-e.x,o=n.y-e.y,i=r*r+o*o;if(i<=Pn)return Math.hypot(t.x-e.x,t.y-e.y);let s=((t.x-e.x)*r+(t.y-e.y)*o)/i;return s=s<0?0:s>1?1:s,Math.hypot(t.x-(e.x+s*r),t.y-(e.y+s*o))}var Tn=function(t,e,n,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(i=(o<3?s(i):o>3?s(e,n,i):s(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},ce=class t extends le{get dimension(){return"audio"}constructor(e){super(e),this.initProps(e),this.adoptChildrenProp(e)}get childrenAudio(){return this._allChildren.filter(e=>e instanceof t)}get _busId(){let e=this._props?.id;return`bus:${typeof e=="string"?e:xf(this)}`}_prepareStep(e,n,r){for(let o of yf)if(o in e)throw new TypeError(`${this.className}: "${o}" cannot be tweened \u2014 an audio level is scheduled once, not written per frame, so a tween on it would render flat. Automate it with a curve instead: ${o}: fadeOut(1), or filters: AudioFilters.gain(ramp(1, 0, 1)).`);return super._prepareStep(e,n,r)}};Tn([Pr({default:1})],ce.prototype,"volume",void 0);Tn([Pr({default:0})],ce.prototype,"pan",void 0);Tn([b({default:!1})],ce.prototype,"mute",void 0);Tn([_a()],ce.prototype,"filters",void 0);var yf=["volume","pan"];function gf(t,e){let n=[],r=t.parent;for(;r instanceof ce;)n.push(ol(r,e)),r=r.parent;return n.length>0?n:void 0}function Hv(t,e){return[ol(t,e),...gf(t,e)??[]]}function Yv(t,e){let n=t;for(;n.parent;)n=n.parent;return rl(n,e)}function rl(t,e){if(t instanceof ce&&t.id===e)return t;for(let n of t._allChildren){let r=rl(n,e);if(r)return r}return null}function ol(t,e){let n=t.filters,r=e._spanOf(t);return{id:t._busId,volume:t.volume,pan:t.pan,mute:t.mute,...n.length>0?{filters:n}:{},startAt:r.start,endAt:r.end}}function xf(t){let e=[],n=t;for(;n;){let r=n.parent;if(!r)break;e.push(String(r._allChildren.indexOf(n))),n=r}return e.reverse().join(".")}var zn=mt({},"text-style"),Gv=mt({},"theme"),Kv=mt({},"data"),Zv=mt(void 0,"seed");var wf=function(t,e,n,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(i=(o<3?s(i):o>3?s(e,n,i):s(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i},Fn=100,il=new Set(["fontFamily","fontStyle"]),jr=class{node;ranges;overrides;constructor(e,n){this.node=e,this.ranges=_f(n,e.text.length),this.overrides={opacity:1,x:0,y:0,scale:1,rotation:0,fontFamily:e.fontFamily,fontSize:typeof e.fontSize=="number"?e.fontSize:Fn,fontStyle:e.fontStyle,fontWeight:e.fontWeight,letterSpacing:e.letterSpacing,fill:null,stroke:null},e._registerSelection(this)}get isIdentity(){let e=this.overrides,n=typeof this.node.fontSize=="number"?this.node.fontSize:Fn;return e.opacity===1&&e.x===0&&e.y===0&&e.scale===1&&e.rotation===0&&e.fontFamily===this.node.fontFamily&&e.fontSize===n&&e.fontStyle===this.node.fontStyle&&e.fontWeight===this.node.fontWeight&&e.letterSpacing===this.node.letterSpacing&&e.fill===null&&e.stroke===null}set(e){let n=this.overrides;for(let r of Object.keys(e)){let o=e[r];o!==void 0&&(r==="fill"?n.fill=V.resolve(o):r==="stroke"?n.stroke=re.resolve(o):(il.has(r)||typeof o=="number")&&(n[r]=o))}return this}to(e){return xn(this,e.data??{},e.duration,e.easing)}_prepareStep(e,n,r){let o=this.overrides,i=[],s=[];for(let c of Object.keys(e)){let f=e[c];if(f!==void 0){if(c==="fill"){let h=o.fill??this.node.fill,d=V.resolve(f);s.push(p=>{o.fill=V.lerp(h,d,p)})}else if(c==="stroke"){let h=o.stroke??this.node.stroke,d=re.resolve(f);s.push(p=>{o.stroke=re.lerp(h,d,p)})}else if(il.has(c)){let h=f,d=o[c];s.push(p=>{o[c]=p>=1?h:d})}else if(typeof f=="number"){let h=c;i.push({key:h,from:o[h],to:f})}}}let a=c=>{let f=r?r(c):c;for(let h of i)o[h.key]=h.from+(h.to-h.from)*f;for(let h of s)h(f)},l=0;return{seek:c=>a(n>0?Math.min(c/n,1):1),advance:c=>(l+=c,l<n?(a(l/n),!1):(a(1),!0))}}};wf([W()],jr.prototype,"to",null);function _f(t,e){let n=t.map(o=>({start:Math.max(0,Math.min(o.start,e)),end:Math.max(0,Math.min(o.end,e))})).filter(o=>o.end>o.start).sort((o,i)=>o.start-i.start),r=[];for(let o of n){let i=r[r.length-1];i&&o.start<=i.end?i.end=Math.max(i.end,o.end):r.push({...o})}return r}var K=function(t,e,n,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(i=(o<3?s(i):o>3?s(e,n,i):s(e,n))||i);return o>3&&i&&Object.defineProperty(e,n,i),i};function vf(t){let e=t.parent;return typeof e?._spaceOf=="function"?e._spaceOf(t):null}var sl={position:["x","y","z"],rotation:["rotationX","rotationY","rotationZ"],scale:["scaleX","scaleY","scaleZ"]},I=class t extends le{get dimension(){return"3d"}constructor(e){super(e),this.initProps(Lr(e)),this.adoptChildrenProp(e)}moveTo(e){return this.to({data:Br(e.data),duration:e.duration,easing:e.easing})}rotateTo(e){return this.to({data:Br(e.data),duration:e.duration,easing:e.easing})}scaleTo(e){return this.to({data:Br(e.data),duration:e.duration,easing:e.easing})}get position(){return{x:this.x,y:this.y,z:this.z}}set position(e){this.set({position:e})}get rotation(){return{x:this.rotationX,y:this.rotationY,z:this.rotationZ,order:this.rotationOrder}}set rotation(e){this.set({rotation:e})}get scale(){return{x:this.scaleX,y:this.scaleY,z:this.scaleZ}}set scale(e){this.set({scale:e})}set(e){super.set(Lr(e))}_prepareStep(e,n,r){return super._prepareStep(Lr(e),n,r)}transform3D(){let e=this.quaternion,n=e.x===0&&e.y===0&&e.z===0&&e.w===1,r=vf(this);return{position:r?r.toLocal(this.x,this.y,this.z):this.position,rotation:this.rotation,quaternion:n?void 0:e,scale:this.scale,lookAt:this.lookAt,visible:this.visible,shadow:this.shadow,renderOrder:this.renderOrder}}_spaceOf(e){return null}groupTransform(){return this.transform3D()}renderSelf(e){}render(e){if(this.hidden){e.begin({id:this.id,transform:{...this.groupTransform(),visible:!1}}),e.end();return}e.begin({id:this.id,transform:this.groupTransform()}),this.renderSelf(e);for(let n of this._children)n instanceof t&&n.render(e);e.end()}declareAssets(e){if(this.renderSelf===t.prototype.renderSelf)return;let n=new ie;this.renderSelf(n),en(n,e)}};K([b({default:0})],I.prototype,"x",void 0);K([b({default:0})],I.prototype,"y",void 0);K([b({default:0})],I.prototype,"z",void 0);K([b({default:0})],I.prototype,"rotationX",void 0);K([b({default:0})],I.prototype,"rotationY",void 0);K([b({default:0})],I.prototype,"rotationZ",void 0);K([b({default:"XYZ"})],I.prototype,"rotationOrder",void 0);K([wa()],I.prototype,"quaternion",void 0);K([b({default:1})],I.prototype,"scaleX",void 0);K([b({default:1})],I.prototype,"scaleY",void 0);K([b({default:1})],I.prototype,"scaleZ",void 0);K([xa("snap")],I.prototype,"lookAt",void 0);K([b({default:!0})],I.prototype,"visible",void 0);K([b({default:!0})],I.prototype,"shadow",void 0);K([b({default:0})],I.prototype,"renderOrder",void 0);K([W({args:["x","y","z"]})],I.prototype,"moveTo",null);K([W({args:["rotationX","rotationY","rotationZ"]})],I.prototype,"rotateTo",null);K([W({args:[{key:"scale",kind:"number",min:0,step:.05,unit:"\xD7"},"scaleX","scaleY","scaleZ"]})],I.prototype,"scaleTo",null);function Lr(t){if(!t)return t;let e;for(let n in sl){let r=t[n];if(r===void 0)continue;e??={...t},delete e[n];let o=sl[n];if(typeof r=="function"){let s=r;for(let a=0;a<3;a++){let l=o[a];e[l]===void 0&&(e[l]=()=>al(Ve(s()),a))}continue}let i=Ve(r);for(let s=0;s<3;s++){let a=o[s];e[a]===void 0&&(e[a]=al(i,s))}if(n==="rotation"){let s=r.order;s!==void 0&&e.rotationOrder===void 0&&(e.rotationOrder=s)}}return e??t}function Br(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function al(t,e){return e===0?t.x:e===1?t.y:t.z}var Wr=Symbol("nodeMeta");function ll(t){return function(e){let n=typeof t=="string"?{key:t}:t;return e.prototype[Wr]=n,e}}function Rn(t){let e=t.prototype;if(!(!e||!Object.prototype.hasOwnProperty.call(e,Wr)))return e[Wr]}var Sf=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing"],kf=["lineHeight","textAlign"];function ul(t,e){let n=cl(e)?e:ft,r=t.ops(),o=null;for(let i=0;i<r.length;i++){let s=r[i];if(s.kind!=="text"&&s.kind!=="richText")continue;let a=Mf(s.state.variant,n);if(!cl(a))continue;let l=s.kind==="text"?bf(s,a):Cf(s,a);l&&(o||(o=r.slice()),o[i]=l)}return o?t._withOps(o):t}function Mf(t,e){return H.mergeStyle(e,t?H.preset(t):void 0)}function cl(t){for(let e of vr)if(t[e]!==void 0)return!0;return!1}function bf(t,e){let n=qr(t.state,e,vr);return n?{kind:"text",state:n}:null}function Cf(t,e){let n=qr(t.state,e,kf),r=Of(t.state.spans,e);return r&&(n={...n??t.state,spans:r}),n?{kind:"richText",state:n}:null}function Of(t,e){if(!t||t.length===0)return null;let n=e.fontSize==="autofit"?{...e,fontSize:void 0}:e,r=null;for(let o=0;o<t.length;o++){let i=qr(t[o],n,Sf);i&&((r??=t.slice())[o]=i)}return r}function qr(t,e,n){let r=t,o=null;for(let i of n){if(r[i]!==void 0)continue;let s=e[i];s!==void 0&&((o??={...r})[i]=s)}return o}var Nn=class{textStyleStack=[];pushTextStyle(e){this.textStyleStack.push(e===null?ft:H.mergeStyle(this.defaultTextStyle,e))}popTextStyle(){this.textStyleStack.pop()}get defaultTextStyle(){return this.textStyleStack[this.textStyleStack.length-1]??H.preset("default")}draw(e){this.drawGraphics(ul(e,this.defaultTextStyle))}layoutTextBlock(e){return null}currentNodeStack=[];currentNodeId(){if(this.currentNodeStack.length===0)throw new Error("No current node in context");return this.currentNodeStack[this.currentNodeStack.length-1]}_disposed=!1;isDisposed(){return this._disposed}dispose(){this._disposed=!0}beginEffects(e,n,r,o){}endEffects(){}rasterize(e,n,r,o){return null}renderStateStack=[];readsSpaceRects=!0;drawsVisibleOnly=!0;begin(e){this.currentNodeStack.push(e.id),this.renderStateStack.push(e)}end(){this.currentNodeStack.pop(),this.renderStateStack.pop()}currentSpaceRects(){return this.renderStateStack[this.renderStateStack.length-1]?.rects??{}}currentRenderState(){return this.renderStateStack[this.renderStateStack.length-1]}_resetScopes(){this.textStyleStack.length=0,this.currentNodeStack.length=0,this.renderStateStack.length=0}};var Af={width:0,height:0},Dn=class extends Nn{readsSpaceRects=!1;drawGraphics(e){}measureText(){return Af}unmount(){}execute(e){e()}screenshot(){}rasterize(e,n,r){return r(),null}transform(e){return this}beginBoolean(e){}endBoolean(){}beginMask(e){}applyMask(){}endMask(){}beginClip(e){}endClip(){}beginCamera(e,n,r,o){}endCamera(){}};function Ye(t){let e=new He;for(let n of t.ops())switch(n.kind){case"rect":e.rect(n.state);break;case"ellipse":e.ellipse(n.state);break;case"path":e.path(n.state);break;case"line":e.line(n.state);break;case"polygon":e.polygon(n.state);break;case"polygram":e.polygram(n.state);break;case"cut":e.cut();break;default:break}return e}var Ne=t=>({_piece:t});function Vr(t,e,n,r){return{args:t,duration:e,easing:n,node:r,tween:o=>Ne({kind:"tween",targets:o}),animate:(o,i)=>Ne({kind:"animate",frame:o,eased:i?.eased!==!1}),ease:o=>n?n(o):o,sound:(o,i)=>Ne({kind:"sound",src:o,options:i??{}}),wait:o=>Ne({kind:"wait",seconds:o}),together:o=>Ne({kind:"together",pieces:o}),sequence:o=>Ne({kind:"sequence",pieces:o}),stagger:(o,i)=>Ne({kind:"stagger",pieces:o,overlap:i?.overlap??0})}}var jn=[];function In(t,e,n=!0){return t.at(1),{duration:e,settles:n,sounds:jn,apply:r=>t.at(e>0?r/e:1)}}function $r(t,e){return{duration:t.reduce((r,o,i)=>Math.max(r,e[i]+o.duration),0),settles:t.every(r=>r.settles),sounds:t.flatMap((r,o)=>r.sounds.map(i=>({...i,at:i.at+e[o],until:i.until===void 0?void 0:i.until+e[o]}))),apply(r){for(let o=0;o<t.length;o++)r<e[o]||t[o].apply(Math.min(r-e[o],t[o].duration))}}}function Ln(t,e,n,r){let o=e._piece;switch(o.kind){case"tween":return In(t.to({data:o.targets,duration:n,easing:r}),n);case"animate":return In(t._animate(o.frame,n,o.eased?r:void 0),n);case"child":return In(o.node.to({data:o.targets,duration:n,easing:r}),n);case"run":{let i=Ef(o.node,o.name,o.args,n,r);return In(i,n,go(i))}case"wait":return{duration:o.seconds,settles:!0,sounds:jn,apply:()=>{}};case"sound":return{duration:0,settles:!0,sounds:o.src?[{at:0,until:void 0,src:o.src,options:o.options}]:jn,apply:()=>{}};case"together":{let i=o.pieces.map(s=>Ln(t,s,n,r));return $r(i,i.map(()=>0))}case"sequence":{let i=o.pieces.reduce((h,d)=>h+(d._piece.kind==="wait"?d._piece.seconds:0),0),s=o.pieces.filter(h=>h._piece.kind!=="wait").length,a=s>0?Math.max(0,n-i)/s:0,l=[],c=[],f=0;for(let h of o.pieces){let d=Ln(t,h,a,r);l.push(d),c.push(f),f+=d.duration}return $r(l,c)}case"stagger":{let i=o.pieces.length;if(i===0)return{duration:n,settles:!0,sounds:jn,apply:()=>{}};let s=1-Math.min(1,Math.max(0,o.overlap)),a=n/(1+(i-1)*s),l=o.pieces.map(c=>Ln(t,c,a,r));return $r(l,l.map((c,f)=>f*a*s))}}}function Ef(t,e,n,r,o){let i=Sa(t).find(l=>l.key===e),s=i?t[i.method]:void 0;if(typeof s!="function")throw new Error(`${t.className} has no command "${e}".`);let a=s.call(t,{data:n??{},duration:r,easing:o});if(!a||typeof a!="object"||!("at"in a))throw new Error(`${t.className}.${e} did not return a command.`);return a}var fl=new WeakMap;function MS(t){return fl.get(t)}function Hr(t,e,n,r){if(e._piece.kind==="tween")return Qe(t.to({data:e._piece.targets,duration:n,easing:r}));let o=Ln(t,e,n,r),i=ve(n,a=>o.apply(a*n)),s=o.sounds.map(a=>a.until===void 0&&n>0?{...a,until:n}:a);return s.length>0&&fl.set(i,{host:t,sounds:s}),o.settles?Qe(i):i}var Pf="_def";function Yr(t){return(typeof t=="object"||typeof t=="function")&&t!==null&&Pf in t}function Xe(t){if(Yr(t))return t._def;switch(typeof t){case"number":return{default:t,editor:{kind:"number"},private:!1};case"string":return{default:t,editor:{kind:"text"},private:!1};case"boolean":return{default:t,editor:{kind:"boolean"},private:!1};default:throw new TypeError(`A state entry is a Types.* value, a number, a string or a boolean; got ${String(t)}.`)}}var j=Symbol("componentNode"),Ee=null;function Kr(t,e,n,r){let o=Ee;Ee={node:t,scope:e,room:n,sizes:new Map};try{return r()}finally{Ee=o}}var yl=new WeakSet;function gl(t){yl.add(t)}function xl(t){return yl.delete(t)}function De(){if(!Ee)throw new Error("A component's measure or layout helper ran outside a measure or layout pass.");return Ee}function hl(t,e){let n=De(),r={maxWidth:e.width,maxHeight:e.height},o=t.measure(r,n.scope),i={width:o.width??0,height:o.height??0};return n.sizes.set(t,i),i}var dl=new WeakMap,Ur=class{[j];state;constructor(e){this[j]=e,this.state=new Proxy(e,{set:()=>{throw new TypeError("A child's state is read-only to its parent; animate it with a command.")}})}get id(){return this[j].id}get key(){return Zr(this[j])??this[j].className}get size(){if(!Ee){let e=this[j].layoutBounds;return{width:e?.width??0,height:e?.height??0}}return Ee.sizes.get(this[j])??hl(this[j],Ee.room)}get children(){let e=this[j];return e._commandChildren?e._commandChildren():e.children.map(_e)}measure(e){return hl(this[j],e)}to(e){return{_piece:{kind:"child",node:this[j],targets:e}}}run(e,n){return{_piece:{kind:"run",node:this[j],name:e,args:n}}}};function _e(t){let e=dl.get(t);return e||dl.set(t,e=new Ur(t)),e}function gt(t){return t[j]}var pl=new WeakMap,Tf={x:0,y:0,rotation:0,scale:1},Gr=class{reader;[j];state;constructor(e,n){this.reader=n,this[j]=e;let r=e._view??e;this.state=new Proxy(r,{get:(o,i)=>{if(i==="constructor")return e.constructor;if(i in o)return Reflect.get(o,i);let s=Reflect.get(e,i);return typeof s=="function"?s.bind(e):s},set:()=>{throw new TypeError("Another node's state is read-only to a component; animate it with a command.")}})}get id(){return this[j].id}get key(){return Zr(this[j])??this[j].className}get size(){let e=this[j],n=e instanceof S?e.layoutBounds:void 0;return{width:n?.width??0,height:n?.height??0}}get frame(){let e=this[j];return e instanceof S&&this.reader instanceof S?Ya(this.reader,e):Tf}};function xt(t,e){let n=pl.get(t);n||pl.set(t,n=new WeakMap);let r=n.get(e);return r||n.set(e,r=new Gr(t,e)),r}function wl(t){return t[j]}var ml=new WeakMap;function zf(t,e){if(typeof e!="string"||e==="")return null;let n=ml.get(t),r=n?.get(e);if(!r||r.id!==e||Xr(r)!==Xr(t)){if(r=_l(Xr(t),e)??void 0,!r)return n?.delete(e),null;n||ml.set(t,n=new Map),n.set(e,r)}return xt(r,t)}function Xr(t){let e=t;for(;e.parent;)e=e.parent;return e}function _l(t,e){if(t.id===e)return t;for(let n of t._allChildren){let r=_l(n,e);if(r)return r}return null}var Zr=()=>{};function Wn(t){Zr=t}function vl(t,e=new Set){let n={};for(let o of t)n[o]=e.has(o)?{get(){return zf(this[j],this[j][o])},enumerable:!0}:{get(){return this[j][o]},enumerable:!0};let r={};return Object.defineProperty(r,"children",{get(){return this[j]._commandChildren()},enumerable:!1}),{proto:r,entries:n}}function Jr(t,e){let n=Object.create(t.proto);return Object.defineProperties(n,t.entries),n[j]=e,n}function Qr(t){let e={};for(let n in t)e[n]=t[n];return e}var Bn=class{host;max={};scope=null;constructor(e){this.host=e}get time(){return this.host.time}text(e,n){if(!this.scope)throw new Error("measurer.text was called outside measure.");return this.scope.measureText(e,n.fontSize,n.fontFamily,n.fontWeight,n.letterSpacing)}},Ue=class{host;probing;pass=null;cut=null;constructor(e,n=!1){this.host=e,this.probing=n}get size(){let e=this.host.layoutBounds;return{width:e?.width??0,height:e?.height??0}}get time(){return this.host.time}draw(e){if(!e||this.probing)return;let n=this.target();if(Array.isArray(e))for(let r of e)n.draw(r);else n.draw(e)}children(){this.probing||(this.composite||(this.host._record=null),this.host._renderOwnChildren(this.target()))}composite=null;_declare(e){this.composite={...this.composite,...e},this.probing||(this.host._record=this.composite)}mask(e){if(this._declare({bounds:"first"}),this.probing)return;let n=this.target(),[r,...o]=this.host.children;if(r){if(o.length===0){r.render(n);return}n.beginMask({mode:e.mode,inverted:e.inverted}),r.render(n),n.applyMask();for(let i of o)i.render(n);n.endMask()}}merge(e,n){if(this._declare({bounds:e==="subtract"?"first":e==="intersect"?"intersect":"union"}),this.probing)return;let r=this.target();r.beginBoolean(e);for(let o of this.host._allChildren)o instanceof S&&o.render(r);r.endBoolean(),r.draw(new $().shadow(n.shadow).fill(n.fill)),n.overlay&&n.overlay.length>0&&r.draw(new $().fill(n.overlay)),r.draw(new $().stroke(n.stroke))}camera(e){if(this._declare({camera:e}),this.probing)return;let n=this.target(),r=this.host.layoutBounds;n.beginCamera({x:r?.x??0,y:-(r?.y??0),width:r?.width??0,height:r?.height??0},e.lookAt,e.zoom,e.heading);for(let o of this.host._allChildren)o instanceof S&&o.render(n);n.endCamera()}scene3D(){let e=new ie;for(let n of this.host._allChildren)n instanceof I&&n.render(e);return this._declare({scene:e}),e}space(e){this._declare({space:e}),this.probing||this.host._renderOwnChildren(this.target())}textStyle(e,n){if(this.probing)return n();let r=this.target();r.pushTextStyle(e);try{n()}finally{r.popTextStyle()}}clip(e,n){if(this.probing)return n();let r=Ye(e);if(r.isEmpty())return n();let o=this.target();o.beginClip(r);try{n()}finally{o.endClip()}}get inSpace(){for(let e=this.host.parent;e;e=e.parent){if(!(e instanceof S))return!1;if(e._spaceCamera())return!0;if(!e._rendersChildrenInSpace())return!1}return!1}ancestor(e){for(let n=this.host.parent;n;n=n.parent)if(n instanceof e.node)return xt(n,this.host);return null}inFront(e){if(this.probing)return;let n=this.target();if(!this.cut){e();return}n.beginClip(this.cut);try{e()}finally{n.endClip()}}target(){if(this.probing)return Ff;if(!this.pass)throw new Error("A component's render context was used outside render.");return this.pass}},Ff=new Dn;function me(t){if(!(t instanceof Ue))throw new TypeError("Paint.draw takes the render context its render field was given.");return t}function Ge(t,e,n=new Set){let r=new Map(ht(Object.create(e.prototype)).map(a=>[a.key,a])),o=new Map(Object.entries(t.state??{}).map(([a,l])=>[a,Xe(l)])),i=t.defaults??{};for(let[a,l]of Object.entries(i)){if(typeof l=="function")continue;let c=o.get(a);if(c)o.set(a,{...c,default:l});else if(!r.has(a))throw new TypeError(`${t.key}: "defaults.${a}" names no entry.`)}let s=new Set([...o].filter(([,a])=>a.editor.kind==="nodeRef").map(([a])=>a));return{spec:t,entries:o,defaults:i,builtIn:r,view:vl([...r.keys(),...o.keys()],s),ownsDefault:n}}function qn(t){return typeof t.default=="function"?t.default():t.default}function Ke(t,e){let{spec:n,entries:r,defaults:o}=e;class i extends t{constructor(...a){let l=a[0],c=n.children?l?.children:void 0;super(n.children&&l?{...l,children:void 0}:l),this._view=Jr(e.view,this),this._built=0;for(let[h,d]of r)d.private?this.applyProp(h,qn(d),{mapper:d.mapper,tween:d.tween}):typeof d.default=="function"&&l?.[h]===void 0&&this._writeProp(h,qn(d));let f;for(let[h,d]of Object.entries(o))if(typeof d=="function"&&l?.[h]===void 0){let p=f??=Object.freeze({...l});this._writeProp(h,()=>d(this._view,p))}if(n.children){let h=Jr(e.view,this);Object.defineProperty(h,"children",{value:[c??[]].flat(1/0).filter(Boolean)});let d=[n.children(h)].flat(1/0).filter(Boolean);for(let p of d)this.add(p);this._built=d.length}}resolveContext(a){super.resolveContext(a);let l=this._props??{},c=this;for(let[f,h]of r){if(!h.inherit||l[f]!==void 0)continue;let d=h.inherit(p=>a.get(p),l);d!==void 0&&(c[f]=d)}}provideContext(a){if(!n.provide)return super.provideContext(a);let l=n.provide(this._view,h=>a.get(h)),c=this._provided;if(c&&c.parent===a&&c.values.length===l.length&&c.values.every((h,d)=>h.context===l[d].context&&h.value===l[d].value))return c.map;let f=a;for(let{context:h,value:d}of l)f.get(h)!==d&&(f=f.with(h,d));return this._provided={parent:a,values:l,map:f},f}declareAssets(a){super.declareAssets(a);let l=this;for(let[c,f]of r)jf(a,f.editor.kind??"",l[c]);n.load&&n.load(Bf(a),this._view)}acceptsChild(a){let l=n.allowedChildren;return l==null?super.acceptsChild(a):l.some(c=>Sl(a,c))}_childRule(){let a=n.allowedChildren;return a?a.length===0?"It takes no children.":`It takes only ${kl(a)}.`:super._childRule()}_parentRefusal(a){let l=n.allowedParents;return!l||l.some(c=>Sl(a,c))?null:`${this.className} goes only inside ${kl(l)}, not ${a.className}.`}_commandChildren(){return[]}_animate(a,l,c){return this.command(a,l,c)}}return i}function Ze(t,e){let{spec:n,entries:r,defaults:o,builtIn:i}=e;Object.defineProperty(t,"name",{value:Nf(n.key)});let s=t.prototype;n.provide||wt(s,"provideContext"),[...r.values()].some(c=>c.inherit)||wt(s,"resolveContext"),(n.allowedChildren===void 0||n.allowedChildren===null)&&(wt(s,"acceptsChild"),wt(s,"_childRule")),n.allowedParents||wt(s,"_parentRefusal");let a=n.allowedChildren;if(a){let c=[...new Set(a.map(f=>typeof f=="string"?f:Object.create(f.node.prototype).dimension))];Object.defineProperty(s,"_childTrees",{get:()=>c,configurable:!0})}for(let[c,f]of r)f.private||b({default:typeof f.default=="function"?void 0:f.default,mapper:f.mapper,tween:f.tween,...f.editor})(s,c);for(let[c,f]of Object.entries(o)){if(r.has(c)||e.ownsDefault.has(c)||typeof f=="function")continue;let h=i.get(c);b({default:f,mapper:h.options?.mapper,tween:h.options?.tween,...h.editor})(s,c)}let l=Object.getPrototypeOf(Object.getPrototypeOf(s));for(let[c,f]of Object.entries(n.commands??{})){let h=c in l?`_command_${c}`:c,d;if(typeof f=="function")s[h]=function(p={}){let m=p.duration??0,w=Vr({},m,p.easing,xt(this,this)),x=f(w,Qr(this._view),this._commandChildren());return Hr(this,x,m,p.easing)};else{let{args:p,run:m,easing:w}=f;if(Array.isArray(p)){let x=p;for(let y of x)if(!r.has(y)&&!i.has(y))throw new TypeError(`${n.key}.${c}: args names "${y}", which is no entry.`);d=x.map(y=>({key:y,...r.get(y)?.editor??i.get(y)?.editor??{}})),s[h]=function(y={}){let g=Df(y.data,x),v={};for(let M of x)g[M]!==void 0&&(v[M]=g[M]);return Qe(this.to({data:v,duration:y.duration??0,easing:y.easing??w}))}}else{let x=p;d=Object.entries(x).map(([y,g])=>{let v=Xe(g);return{key:y,default:Yr(g)?qn(v):g,...v.editor}}),s[h]=function(y={}){let g=y.duration??0,v=y.easing??w,M=Vr(If(x,y.data),g,v,xt(this,this)),k=m(M,Qr(this._view),this._commandChildren());return Hr(this,k,g,v)}}}W({key:c,...d?{args:d}:{}})(s,h)}return ll({key:n.key})(t),Rf(n.key,t)}function wt(t,e){for(let n=t;n;n=Object.getPrototypeOf(n))if(Object.prototype.hasOwnProperty.call(n,e)){delete n[e];return}}function Rf(t,e){let n=function(r){return new e(r)};return n.prototype=e.prototype,Object.defineProperty(n,"name",{value:e.name}),Object.assign(n,{key:t,node:e,is:r=>gt(r)instanceof e})}function Nf(t){return t.replace(/(^|[-_ ])(\w)/g,(e,n,r)=>r.toUpperCase())}function Sl(t,e){return typeof e=="string"?t.dimension===e:t instanceof e.node}function kl(t){let e=t.map(n=>typeof n=="string"?`any ${n.toUpperCase()} node`:n.node.name);return e.length===1?e[0]:`${e.slice(0,-1).join(", ")} or ${e.at(-1)}`}function Df(t,e){return e.length===1&&!(typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype&&e[0]in t)?{[e[0]]:t}:t??{}}function If(t,e){let n=e??{},r={};for(let o in t){let i=Xe(t[o]),s=n[o]===void 0?qn(i):n[o];r[o]=i.mapper?i.mapper(s):s}return r}function jf(t,e,n){if(!(n==null||n===""))switch(e){case"fills":return t.fill(n);case"strokes":for(let r of n)t.fill(r.fill);return;case"shadows":for(let r of n)t.fill(r.fill);return;case"image":return t.image(n);case"video":return t.video(n);case"font":return t.font(n)}}var Ml=new WeakMap;function Lf(t){let e=Ml.get(t);return e||(e=async()=>{let n=await t();return typeof n=="function"?n:void 0},Ml.set(t,e)),e}function Bf(t){return{font:(e,n)=>t.font(e,n),image:e=>t.image(e),video:(e,n)=>t.video(e,n),task:(e,n,r)=>t.loader(e,Lf(n),{gate:r?.before==="layout"?"layout":"render"}),fill:e=>t.fill(e)}}function eo(t){let e=t._localBounds(),n=t._localMatrix(),r=e.x===0&&e.y===0?n:be(n,js(e.x,-e.y)),o=Mn(r,e.width/2,e.height/2);return[o.topLeft,o.topRight,o.bottomRight,o.bottomLeft]}function to(t){if(t.length===0)return null;let e=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of t)i.x<e&&(e=i.x),i.x>r&&(r=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y);return{minX:e,minY:n,maxX:r,maxY:o}}function no(t){return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2,width:t.maxX-t.minX,height:t.maxY-t.minY}}function bl(t,e){let n=t.children;if(n.length===0)return null;if(e==="first"){let o=to(eo(n[0]));return o?no(o):null}if(e==="union"){let o=to(n.flatMap(eo));return o?no(o):null}let r=null;for(let o of n){let i=to(eo(o));if(!i||(r=r?{minX:Math.max(r.minX,i.minX),minY:Math.max(r.minY,i.minY),maxX:Math.min(r.maxX,i.maxX),maxY:Math.min(r.maxY,i.maxY)}:i,r.minX>r.maxX||r.minY>r.maxY))return null}return r?no(r):null}var Wf={left:0,right:0,top:0,bottom:0},Cl=new Set(["width","height"]);Wn(t=>Rn(t.constructor)?.key);function qf(t){return t.rotation===void 0&&t.scale===void 0&&t.opacity===void 0&&t.depth===void 0&&t.rotationX===void 0&&t.rotationY===void 0?null:{rotation:t.rotation??0,scale:t.scale??1,opacity:t.opacity??1,depth:t.depth??0,rotationX:t.rotationX??0,rotationY:t.rotationY??0}}function t1(t){let e=t,n=Ge(e,S,Cl),{defaults:r}=n,o=n.entries.has("flow");class i extends Ke(S,n){_lastShape=null;constructor(l){if(super(l),this._measurer=new Bn(this),this._ctx=new Ue(this),this._slots=null,this._planes=null,this._box=null,this._built>0&&l?.flex===void 0)for(let c of Cl)l?.[c]===void 0&&r[c]===void 0&&this.applyProp(c,"hug",{tween:J.lerp})}applyDefaultSize(l){let c=S.flowChildrenProp(l),f=l?.flow??"freeform",h=o?{width:f!=="vertical",height:f==="vertical"||f==="freeform"}:{width:!1,height:!1};for(let d of["width","height"]){if(l?.[d]!==void 0)continue;let p=r[d],m=p!==void 0&&typeof p!="function"?p:c.length===0||h[d]&&S.hasFillChild(c,d)?"fill":"hug";this.applyProp(d,m,{tween:J.lerp})}}measure(l,c){if(!e.measure)return super.measure(l,c);this.lastMeasure={constraints:l,measurer:c};let f=this._measurer;f.max={width:l.maxWidth,height:l.maxHeight},f.scope=c;let h=Kr(this,c,f.max,()=>e.measure(f,this._view,this.flowChildren().map(_e)));return xl(this)?h:B.size(this,l,Wf,h)}layoutChildren(l,c){if(!e.layout)return super.layoutChildren(l,c);let f=this.flowChildren(),h={x:0,y:0,width:l.width,height:l.height,time:this.time};this._box=h;let d=Kr(this,c,{width:l.width,height:l.height},()=>e.layout(h,this._view,f.map(_e))),p=null,m=null;d.forEach((w,x)=>{let y=f[x];if(!y)return;y.layout({x:w.x,y:0-w.y,width:w.width,height:w.height},c);let g=qf(w);g&&(p??=new Map).set(y,g),w.plane&&(m??=new Map).set(y,w.plane)}),this._slots=p,this._planes=m}_placementOf(l){return this._slots?.get(l)??super._placementOf(l)}_planeOf(l){if(l)return this._planes?.get(l)??null;let c=this._box??{x:0,y:0,width:this.layoutBounds?.width??0,height:this.layoutBounds?.height??0,time:this.time};return e.plane?e.plane(c,this._view):null}renderContent(l){if(!e.render)return super.renderContent(l);this.applyTransform(l);let c=this._spaceFrame;if(c&&!c.paints){this.renderChildren(l);return}let f=this._ctx;f.pass=l,f.cut=c?.nearCut??null,f.composite=null;try{this.renderContentWithEffects(l,()=>e.render(f,this._view))}finally{f.pass=null,f.cut=null,this._record=f.composite}}clipSelf(){return this._probeRender(),this._lastShape?Ye(this._lastShape):null}_rendersChildrenInSpace(){let l=this._observed();return!(l?.bounds||l?.camera)&&super._rendersChildrenInSpace()}_localBounds(){let l=this._observed()?.bounds;return(l&&bl(this,l))??super._localBounds()}_cameraScope(){return this._observed()?.camera??super._cameraScope()}_spaceCamera(){return this._observed()?.space??super._spaceCamera()}_projection(){return this._observed()?.space?cn:super._projection()}_isViewport3D(){return this._observed()?.scene!==void 0}_scene3D(){return this._probeRender()?.scene??null}_observed(){return this._record===void 0&&this._probeRender(),this._record??null}_probeRender(){if(!e.render)return this._record=null;let l=this._probe??=new Ue(this,!0);return this._lastShape=null,l.composite=null,e.render(l,this._view),this._record=l.composite}hitTestSelf(l,c){let f=this.clipSelf();return!f||f.isEmpty()?super.hitTestSelf(l,c):tl(f,l,c)}_renderOwnChildren(l){this.renderChildren(l)}_commandChildren(){return this.flowChildren().map(_e)}}let s=i.prototype;if(e.handles){let a=Object.entries(e.handles),l=c=>({width:c.layoutBounds?.width??0,height:c.layoutBounds?.height??0});s._handles=function(){let c=[];for(let[f,h]of a){let d=h.at(this._view,l(this));d&&c.push({prop:f,at:d})}return c},s._handleValue=function(c,f){let h=e.handles[c];return h?h.value?h.value(f,this._view,l(this)):{x:f.x,y:f.y}:null}}if(e.bounds){let a=e.bounds;s._localBounds=function(){return a({width:this.layoutBounds?.width??0,height:this.layoutBounds?.height??0},this._view)}}if(e.space){let a=e.space;i.prototype._spaceOf=function(){return a(this._view)}}return Ze(i,n)}function te(t){return{_def:t}}function Ie(t,e,n){let{private:r,typing:o,inherit:i,...s}=e??{};return{kind:t,...n,...s}}function se(t,e,n,r){let o={default:e,mapper:n,tween:r,editor:{kind:t},private:!1};return Object.assign((s,a)=>te({...o,default:s===void 0?o.default:s,editor:Ie(t,a),private:a?.private===!0,inherit:a?.inherit}),{_def:o})}function $f(t){let e={};for(let n in t)e[n]=Xe(t[n]).default;return e}var _={number(t=0,e){return te({default:t,editor:Ie("number",e),private:e?.private===!0,inherit:e?.inherit})},text(t="",e){return te({default:t,tween:e?.typing?H.lerp:void 0,editor:Ie("text",e),private:e?.private===!0,inherit:e?.inherit})},boolean(t=!1,e){return te({default:t,editor:Ie("boolean",e),private:e?.private===!0,inherit:e?.inherit})},oneOf(t,e){let{default:n,...r}=e??{};return te({default:n??t[0],editor:Ie("enum",r,{options:t}),private:e?.private===!0,inherit:e?.inherit})},fill:se("fills",[],V.resolve,V.lerp),stroke:se("strokes",[],re.resolve,re.lerp),shadow:se("shadows",[],we.resolve,we.lerp),effects:se("effects",[],ke.resolve,ke.lerp),color:se("color","black",xe.resolve,xe.lerp),cornerRadius:se("cornerRadius",0,ge.resolve,ge.lerp),cornerStyle:se("cornerStyle","rounded",Le.resolve,Le.lerp),path:se("path","",void 0,ne.lerp),insets:se("insets",0,U.resolve,U.lerp),alignment:se("alignment","center",D.resolve,D.lerp),vector2:se("vector2",{x:0,y:0},void 0,Je.lerp),size:se("size","fill",void 0,J.lerp),point(t={x:0,y:0},e){return te({default:t,tween:Je.lerp,editor:Ie("point",e),private:e?.private===!0,inherit:e?.inherit})},list(t,e){return te({default:()=>[],editor:Ie("list",e,{item:t._def.editor}),private:e?.private===!0,inherit:e?.inherit})},object(t){return te({default:()=>$f(t),editor:{kind:"object"},private:!1})},custom(t,e){let{resolve:n,lerp:r,private:o,inherit:i,...s}=e??{};return te({default:t,mapper:n,tween:r,editor:s,private:e?.private===!0,inherit:e?.inherit})},image:(t="")=>te({default:t,editor:{kind:"image"},private:!1}),video:(t="")=>te({default:t,editor:{kind:"video"},private:!1}),audio:(t="")=>te({default:t,editor:{kind:"audio"},private:!1}),font:(t="")=>te({default:t,editor:{kind:"font"},private:!1}),nodeRef:(t="")=>te({default:t,editor:{kind:"nodeRef",animatable:!1},private:!1}),seed:(t=1)=>te({default:t,editor:{kind:"seed"},private:!1})};var Ol={};ye(Ol,{rect:()=>_t,state:()=>ro});var ro={cornerRadius:_.cornerRadius,cornerStyle:_.cornerStyle};function _t(t,e){return new $().rect({width:t.width,height:t.height,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}var Uf={};ye(Uf,{layout:()=>Xf,measure:()=>Yf,state:()=>Vf});var Vf={flow:_.custom("freeform",{lerp:B.lerp}),gap:_.custom(0),wrap:!1,crossGap:_.custom(void 0),columns:_.number(1),align:_.alignment},Hf={width:0,height:0},$n=new WeakMap;function Al(t,e){let n=t.padding;return e?{left:n.left+e.left,right:n.right+e.right,top:n.top+e.top,bottom:n.bottom+e.bottom}:n}function Yf(t,e,n,r){let{node:o,scope:i}=De(),s=Al(e,r),a={maxWidth:t.max.width,maxHeight:t.max.height};if(n.length===0)return $n.delete(o),B.size(e,a,s,Hf);let l=B.contentBox(e,a,s),c=B.measure(e,n.map(gt),l,i);return $n.set(o,c),B.size(e,a,s,c.hug)}function Xf(t,e,n,r){let{node:o,scope:i}=De(),s=$n.get(o);if($n.delete(o),n.length===0)return[];let a=U.insetBounds(t.width,t.height,Al(e,r)),l=s&&B.reusable(s,a)?s:B.measure(e,n.map(gt),{width:a.width,height:a.height,hugWidth:e.width==="hug",hugHeight:e.height==="hug"},i);return B.place(l,e,a).map(c=>({x:a.x+c.x,y:c.y-a.y,width:c.width,height:c.height}))}function Vn(t,e){return e}var Pl={};ye(Pl,{commands:()=>Gf,draw:()=>io,inset:()=>Qf,state:()=>El});var oo={min:0,max:1,step:.01,scale:100,unit:"%"},El={fill:_.fill,stroke:_.stroke,shadow:_.shadow,overlay:_.fill,start:_.number(0,oo),end:_.number(1,oo)},Gf=Vn(El,{fillTo:{args:["fill"]},strokeTo:{args:["stroke"]},shadowTo:{args:["shadow"]},overlayTo:{args:["overlay"]},progressTo:{args:["start","end"]},flash:{args:{portion:_.number(.25,{...oo,min:.01})},run:(t,e)=>{let n={start:e.start,end:e.end},r=Math.min(1,Math.max(.01,t.args.portion));return t.animate(o=>{if(o<=0||o>=1)return n;let i=o*(1+r);return{start:Math.max(0,i-r),end:Math.min(1,i)}})}}}),Kf=new Set(["rect","ellipse","path","line","polygon","polygram"]);function Zf(t,e,n){return t._withOps(t.ops().map(r=>Kf.has(r.kind)?{...r,state:{...r.state,start:e,end:n}}:r))}function vt(t){return t._withOps([...t.ops()])}function Jf(t){return t.shadow.length===0?!1:!t.fill.some(e=>(e.opacity??1)>0)}function io(t,e,n,r={}){let o=me(t),i=o.target(),s=r.clipShape===void 0?n:r.clipShape;if(o.host._lastShape=s,o.probing){r.children?.();return}let a=n?Zf(n,e.start,e.end):null;o.inFront(()=>{a&&i.draw(vt(a).shadow(e.shadow).fill(r.fill??e.fill))});let l=e.clip&&s?Ye(s):null,c=l!==null&&!l.isEmpty();c&&i.beginClip(l),r.children?r.children():t.children(),c&&i.endClip(),o.inFront(()=>{if(!a)return;if(e.overlay&&e.overlay.length>0){let h=r.overlay?r.overlay(vt(a)):vt(a).fill(e.overlay);h&&i.draw(h)}let f=e.stroke;f.length!==0&&i.draw(Jf(e)?vt(a).shadow(e.shadow).stroke(f):vt(a).stroke(f))})}function Qf(t){let e=0;for(let n of t.stroke){let r=n.weight*(1-n.align)/2;r>e&&(e=r)}return{left:e,right:e,top:e,bottom:e}}var ah={};ye(ah,{box:()=>rh,corners:()=>ro,ellipse:()=>eh,facePath:()=>ih,outline:()=>sh,polygon:()=>th,polygram:()=>nh,rect:()=>_t,unitPath:()=>oh});function eh(t,e){return new $().ellipse({width:t.width,height:t.height,startAngle:e.startAngle,sweep:e.sweep,ratio:e.ratio})}function th(t,e){return new $().polygon({width:t.width,height:t.height,sides:e.sides,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}function nh(t,e){return new $().polygram({width:t.width,height:t.height,sides:e.sides,ratio:e.ratio,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}function rh(t){return new $().rect({x:0,y:0,width:t.width,height:t.height})}function oh(t,e){let{width:n,height:r}=t;return new $().path({data:ne.anchorCommands(ne.anchors(e),o=>({x:o.x*n,y:-o.y*r})),centerBounds:[-n/2,-r/2,n/2,r/2]})}function ih(t){let e=ne.bounds(t);return new $().path({data:t,centerBounds:e?[e.minX,e.minY,e.maxX,e.maxY]:void 0})}function sh(t,e,n){let{width:r,height:o}=e;return new $().path({data:ne.anchorCommands(wo(t,{...n,width:r,height:o}),i=>({x:i.x,y:-i.y})),centerBounds:[-r/2,-o/2,r/2,o/2]})}var fh={};ye(fh,{aim:()=>zl,camera:()=>ch,commands:()=>lh,state:()=>Tl});var Tl={zoom:_.number(1,{min:.01,step:.1,unit:"\xD7"}),lookAt:_.custom({x:0,y:0},{lerp:O,kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"}}}),heading:_.number(0,{step:1,unit:"\xB0"}),follow:_.nodeRef()},lh=Vn(Tl,{zoomTo:{args:["zoom"]},panTo:{args:["lookAt"]},headingTo:{args:["heading"]}});function zl(t,e){let n=e.follow;if(!n)return e.lookAt;let r=wl(n);if(!(r instanceof S)||!uh(r,me(t).host))return e.lookAt;let o=n.frame;return{x:o.x+e.lookAt.x,y:o.y+e.lookAt.y}}function ch(t,e){t.camera({lookAt:zl(t,e),zoom:e.zoom,heading:e.heading})}function uh(t,e){for(let n=t.parent;n;n=n.parent)if(n===e)return!0;return!1}var Sh={};ye(Sh,{draw:()=>yh,drawRichText:()=>_h,load:()=>gh,loadRichText:()=>vh,measure:()=>mh,measureRichText:()=>wh,textStateOf:()=>xh});function so(t,e){return H.applyCase(e.text,t.textCase)}function Fl(t,e,n,r){if(e.glyphPath!=null){let{width:x,height:y}=ne.size(e.glyphPath),g=t.width,v=t.height;return{width:typeof g=="number"?g:g==="hug"?x:n.maxWidth??x,height:typeof v=="number"?v:v==="hug"?y:n.maxHeight??y}}let o=t.fontSize==="autofit"?16:t.fontSize,i=so(t,e).split(`
|
|
2
|
-
`),s=ao(t,e),a=s===null?null:hh(s,{fontFamily:t.fontFamily,fontSize:o,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing}),l=o*t.lineHeight,c=Math.max(...a?a.map(x=>x.runs.reduce((y,g)=>y+r.measureText(g.text,g.fontSize,g.fontFamily,g.fontWeight,g.letterSpacing,g.fontStyle).width,0)):i.map(x=>r.measureText(x,o,t.fontFamily,t.fontWeight,t.letterSpacing,t.fontStyle).width)),f=t.width,h=t.height,d=typeof f=="number"?f:f==="hug"?c:n.maxWidth??0,p=e.wraps&&d>0,m=a===null?null:p?dh(a,d,r):a.map(x=>Math.max(...x.runs.map(y=>y.fontSize))),w=m?m.reduce((x,y)=>x+y*t.lineHeight,0):(p?i.reduce((x,y)=>x+ph(y,d,o,t.fontFamily,t.fontWeight,r,t.letterSpacing,t.fontStyle),0):i.length)*l;return{width:d,height:typeof h=="number"?h:w}}function ao(t,e){if(e.glyphPath!=null)return null;let n=e.selections.filter(m=>m.ranges.length>0&&!m.isIdentity),r=e.runs.filter(m=>m.end>m.start),o=so(t,e);if(o.length===0)return null;let i=t.start>0||t.end<1;if(n.length===0&&r.length===0&&!i)return null;let s=Math.round(t.start*o.length),a=Math.round(t.end*o.length),l=typeof t.fontSize=="number"?t.fontSize:Fn,c=t.fill,f=t.stroke,h=new Set([0,o.length]);for(let m of r)h.add(m.start),h.add(m.end);for(let m of n)for(let w of m.ranges)h.add(w.start),h.add(w.end);i&&(h.add(s),h.add(a));let d=[...h].filter(m=>m>=0&&m<=o.length).sort((m,w)=>m-w),p=[];for(let m=0;m<d.length-1;m++){let w=d[m],x=d[m+1];if(x<=w)continue;let y={text:o.slice(w,x),fontFamily:t.fontFamily,fontSize:l,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,textDecoration:t.textDecoration,opacity:1,x:0,y:0,scale:1,rotation:0,fill:c,stroke:f};for(let g of r)w<g.start||x>g.end||(g.fontFamily!==void 0&&(y.fontFamily=g.fontFamily),g.fontSize!==void 0&&(y.fontSize=g.fontSize),g.fontStyle!==void 0&&(y.fontStyle=g.fontStyle),g.fontWeight!==void 0&&(y.fontWeight=g.fontWeight),g.letterSpacing!==void 0&&(y.letterSpacing=g.letterSpacing),g.textDecoration!==void 0&&(y.textDecoration=g.textDecoration),g.fill!==void 0&&(y.fill=g.fill),g.stroke!==void 0&&(y.stroke=g.stroke));for(let g of n){if(!g.ranges.some(M=>w>=M.start&&x<=M.end))continue;let v=g.overrides;y.opacity*=v.opacity,y.x=v.x,y.y=v.y,y.scale=v.scale,y.rotation=v.rotation,v.fontFamily!==t.fontFamily&&(y.fontFamily=v.fontFamily),v.fontSize!==l&&(y.fontSize=v.fontSize),v.fontStyle!==t.fontStyle&&(y.fontStyle=v.fontStyle),v.fontWeight!==t.fontWeight&&(y.fontWeight=v.fontWeight),v.letterSpacing!==t.letterSpacing&&(y.letterSpacing=v.letterSpacing),v.fill!==null&&(y.fill=v.fill),v.stroke!==null&&(y.stroke=v.stroke)}i&&!(w>=s&&x<=a)&&(y.opacity=0),p.push(y)}return p}function lo(t,e,n){return{text:so(t,e),fontSize:t.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textAlign:t.textAlign,verticalAlign:t.verticalAlign,textDecoration:t.textDecoration,wrap:e.wraps,minFontSize:t.minFontSize,width:n?.width??0,height:n?.height??0,segments:ao(t,e)??void 0,path:e.glyphPath}}function Rl(t,e,n){t.fontFamily&&n.font(t.fontFamily,t.fontWeight);for(let r of ao(t,e)??[]){let o=r.fontFamily??t.fontFamily;o&&n.font(o,r.fontWeight),n.fill(r.fill??[]);for(let i of r.stroke??[])n.fill(i.fill)}}function hh(t,e){let n=[{runs:[]}];for(let r of t){let o={fontFamily:r.fontFamily??e.fontFamily,fontSize:r.fontSize??e.fontSize,fontStyle:r.fontStyle??e.fontStyle,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing},i=r.text.split(`
|
|
3
|
-
`);for(let s=0;s<i.length;s++)s>0&&n.push({runs:[]}),n[n.length-1].runs.push({text:i[s],...o})}for(let r of n)r.runs.length===0&&r.runs.push({...e,text:""});return n}function dh(t,e,n){let r=[];for(let o of t){let i=[];for(let l of o.runs)for(let c of l.text.split(/(\s+)/)){if(c.length===0)continue;let f=/^\s+$/.test(c),h=n.measureText(c,l.fontSize,l.fontFamily,l.fontWeight,l.letterSpacing,l.fontStyle).width,d=i[i.length-1];d&&!d.space&&!f?(d.width+=h,d.size=Math.max(d.size,l.fontSize)):i.push({width:h,size:l.fontSize,space:f})}if(i.length===0){r.push(Math.max(...o.runs.map(l=>l.fontSize)));continue}let s=i[0].width,a=i[0].size;for(let l of i.slice(1))s+l.width<=e?(s+=l.width,a=Math.max(a,l.size)):(r.push(a),s=l.space?0:l.width,a=l.space?0:l.size);r.push(a>0?a:Math.max(...o.runs.map(l=>l.fontSize)))}return r}function ph(t,e,n,r,o,i,s=0,a="normal"){if(t.length===0||i.measureText(t,n,r,o,s,a).width<=e)return 1;let l=t.split(/(\s+)/).filter(h=>h.length>0),c=1,f=0;for(let h of l){let d=i.measureText(h,n,r,o,s,a).width;f===0?f=d:f+d<=e?f+=d:(c++,f=/^\s+$/.test(h)?0:d)}return c}function co(t){return H.flatten(t.spans,{fontFamily:t.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,letterSpacing:t.letterSpacing,fill:t.fill,stroke:t.stroke})}function Nl(t,e,n){let r=0,o=0,i=0,s=0,a=()=>{r>i&&(i=r),s+=o,r=0,o=0};for(let f of co(t)){let h=f.fontSize*t.lineHeight,d=f.text.split(`
|
|
4
|
-
`);for(let p=0;p<d.length;p++)p>0&&a(),r+=n.measureText(d[p],f.fontSize,f.fontFamily,f.fontWeight,f.letterSpacing,f.fontStyle).width,h>o&&(o=h)}a(),s===0&&(s=t.fontSize*t.lineHeight);let l=t.width,c=t.height;return{width:typeof l=="number"?l:l==="hug"?i:e.maxWidth??0,height:typeof c=="number"?c:c==="hug"?s:e.maxHeight??0}}function Dl(t,e){return{spans:co(t),lineHeight:t.lineHeight,textAlign:t.textAlign,width:e?.width??0,height:e?.height??0}}function Il(t,e){for(let n of co(t)){n.fontFamily&&e.font(n.fontFamily,n.fontWeight),e.fill(n.fill);for(let r of n.stroke)e.fill(r.fill)}}function mh(t,e,n){let{node:r,scope:o}=De();return gl(r),Fl(e,n,{maxWidth:t.max.width,maxHeight:t.max.height},o)}var jl=new WeakMap;function yh(t,e,n){let r=me(t);if(jl.set(r.host,{s:e,source:n}),r.probing)return;let o=r.target(),i=lo(e,n,r.host.layoutBounds),s=i.segments!=null;r.inFront(()=>{let a=new $().text(i).shadow(e.shadow);s||a.fill(e.fill),o.draw(a)}),t.children(),r.inFront(()=>{let a=e.stroke;a.length===0||s||o.draw(new $().text(i).stroke(a))})}function gh(t,e,n){Rl(e,n,t)}function xh(t){let e=jl.get(t);return e?lo(e.s,e.source,t.layoutBounds):null}function wh(t,e){let{scope:n}=De();return Nl(e,{maxWidth:t.max.width,maxHeight:t.max.height},n)}function _h(t,e){let n=me(t);if(n.probing)return;let r=n.target();n.inFront(()=>r.draw(new $().richText(Dl(e,n.host.layoutBounds)))),t.children()}function vh(t,e){Il(e,t)}function Ll(t,e){return{context:t,value:e}}var Ah={};ye(Ah,{current:()=>Oh,inherit:()=>ue,provide:()=>Ch,provided:()=>bh,state:()=>Mh});function kh(t,e){let n=e.variant;return H.mergeStyle(H.mergeStyle(H.preset("default"),t(zn)),n?H.preset(n):void 0)}function ue(t,e={}){return(n,r)=>{let o=kh(n,r)[t];return t==="fontSize"&&o==="autofit"&&e.autofit===!1?void 0:o}}var Mh={fontFamily:_.custom(void 0,{inherit:ue("fontFamily")}),fontSize:_.custom(48,{lerp:(t,e,n)=>H.lerpFontSize(t,e,n),inherit:ue("fontSize")}),fontWeight:_.number(400,{inherit:ue("fontWeight")}),fontStyle:_.custom("normal",{inherit:ue("fontStyle")}),letterSpacing:_.number(0,{inherit:ue("letterSpacing")}),lineHeight:_.number(1.2,{inherit:ue("lineHeight")}),textAlign:_.custom("center",{inherit:ue("textAlign")}),verticalAlign:_.oneOf(["top","center","bottom"],{default:"center"}),textDecoration:_.oneOf(["none","underline","line-through"]),textCase:_.oneOf(["none","upper","lower","title"]),minFontSize:_.number(12),variant:_.custom(void 0),fill:_.fill(void 0,{inherit:ue("fill")}),stroke:_.stroke(void 0,{inherit:ue("stroke")}),shadow:_.shadow(void 0,{inherit:ue("shadow")})},bh={fontFamily:_.custom(void 0),fontSize:_.custom(void 0),fontWeight:_.custom(void 0),fontStyle:_.custom(void 0),letterSpacing:_.custom(void 0),lineHeight:_.custom(void 0),textAlign:_.custom(void 0),fill:_.custom(void 0),stroke:_.custom(void 0),shadow:_.custom(void 0)};function Ch(t,e){return[Ll(zn,H.mergeStyle(e(zn),t))]}function Oh(t){return H.mergeStyle({},t)}function Q1(t){let e=Ge(t,ce);class n extends Ke(ce,e){_commandChildren(){return this.childrenAudio.map(_e)}}return Ze(n,e)}Wn(t=>Rn(t.constructor)?.key);var uo=class{host;target=null;camera3D=!1;environment3D=null;constructor(e){this.host=e}get time(){return this.host.time}draw(e){e&&this.target?.draw(e)}light(e,n){this.target?.light(e,n)}camera(e){this.camera3D=!0,this.target?.camera({...this.host._ownTransform(),...e})}fog(e){this.target?.fog(e)}environment(e){this.environment3D=e,this.target?.environment(e)}};function sk(t){let e=t,n=Ge(e,I);class r extends Ke(I,n){constructor(i){super(i),this._ctx3d=new uo(this)}renderSelf(i){if(!e.render)return;let s=this._ctx3d;s.target=i;try{e.render(s,this._view)}finally{s.target=null}}groupTransform(){return this._rendersCamera()?{}:super.groupTransform()}_rendersCamera(){if(this._isCamera===void 0){let i=this._ctx3d;i.camera3D=!1,e.render&&e.render(i,this._view),this._isCamera=i.camera3D}return this._isCamera}_ownTransform(){return this.transform3D()}declareAssets(i){this._ctx3d.environment3D=null,super.declareAssets(i),ir(this._ctx3d.environment3D,i)}_commandChildren(){return this.children.filter(i=>i instanceof I).map(_e)}}if(e.space){let o=e.space;r.prototype._spaceOf=function(){return o(this._view)}}return Ze(r,n)}var Dh={};ye(Dh,{mesh:()=>zh,points:()=>Nh,shorthand:()=>fo,single:()=>Fh,state:()=>Ph});function Y(){return _.custom(void 0)}function fk(t){return _.custom(void 0,{kind:"number",...t})}function Bl(){return _.custom(void 0,{resolve:t=>t===void 0?void 0:xe.resolve(t),lerp:xe.lerp,kind:"color"})}function hk(t){return _.custom(void 0,{resolve:yn,lerp:(e,n,r)=>gn(e,n,r,t),kind:"vector3"})}function Eh(t,e){let n={};for(let r of e){let o=t[r];o!==void 0&&(n[r]=o)}return n}function dk(t,e,n){return{type:t,...Eh(e,n)}}var Ph={material:Y(),fill:_.custom("white",{lerp:Yi}),opacity:Y(),roughness:Y(),metalness:Y(),emission:Bl(),emissionStrength:Y(),normalMap:Y(),roughnessMap:Y(),metalnessMap:Y(),aoMap:Y(),alphaMap:Y(),envMapIntensity:Y(),wireframe:Y(),shading:Y(),faces:Y(),vertexColors:Y(),blend:Y(),unlit:_.custom(!1)},Th=["opacity","roughness","metalness","emission","emissionStrength","normalMap","roughnessMap","metalnessMap","aoMap","alphaMap","envMapIntensity","wireframe","shading","faces","vertexColors","blend"];function fo(t){let e={};t.material!==void 0&&(e.material=t.material),t.fill!==void 0&&(e.fill=t.fill);for(let n of Th)t[n]!==void 0&&(e[n]=t[n]);return t.unlit&&(e.unlit=!0),e}function zh(t,e){let n=new We;return e&&n.mesh(e,Ut(fo(t))),n}function Fh(t){let e=Ut(fo(t));return Array.isArray(e)?e[0]:e}var Rh=["opacity","alphaMap","blend","vertexColors"];function Nh(t){if(t.material!==void 0)return Array.isArray(t.material)?t.material[0]:t.material;let e={type:"points"},n=lt(t.fill);n.color!==void 0&&(e.color=n.color),n.map!==void 0&&(e.map=n.map);for(let r of Rh)t[r]!==void 0&&(e[r]=t[r]);return e}var Hh={};ye(Hh,{commands:()=>jh,draw:()=>Wh,load:()=>Bh,scene:()=>Hl,state:()=>Ih});function $l(t){let{size:e,divisions:n,majorEvery:r,showAxes:o,fade:i}=t,s=e/2,a=e/n,l=St(t.minorColor),c=St(t.majorColor),f=St(t.axisXColor),h=St(t.axisZColor),d=St(t.fadeTo),p=[],m=[],w=(x,y,g,v,M)=>{p.push(x,0,y,g,0,v),ql(m,M,d,Wl(x,y,s,i)),ql(m,M,d,Wl(g,v,s,i))};for(let x=0;x<=n;x++){let y=-s+x*a,g=Math.abs(x-n/2);if(Math.abs(y)<a/2&&o)continue;let M=Number.isInteger(g)&&g%r===0?c:l;w(y,-s,y,s,M),w(-s,y,s,y,M)}return o&&(w(-s,0,s,0,f),w(0,-s,0,s,h)),{type:"buffer",position:new Float32Array(p),color:new Float32Array(m),computeNormals:!1,staticData:!0}}function Wl(t,e,n,r){if(r<=0)return 0;let o=Math.hypot(t,e)/n,i=1-r;if(o<=i)return 0;let s=Math.min(1,(o-i)/Math.max(r,1e-6));return s*s}function ql(t,e,n,r){t.push(e[0]+(n[0]-e[0])*r,e[1]+(n[1]-e[1])*r,e[2]+(n[2]-e[2])*r)}function St(t){let[e,n,r]=Mt(t);return[ho(e),ho(n),ho(r)]}function ho(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function je(t){return _.custom(t,{resolve:Mt,lerp:_o})}var Ih={orbit:_.number(35,{step:1,unit:"\xB0"}),elevation:_.number(20,{min:-89,max:89,step:1,unit:"\xB0"}),zoom:_.number(12,{min:.01,step:.1}),fov:_.custom(45),ambientIntensity:_.custom(.45),ambientColor:je("#ffffff"),keyIntensity:_.custom(2.4),keyColor:je("#ffffff"),showGrid:_.custom(!1),gridSize:_.custom(40),gridDivisions:_.custom(40),gridMajorEvery:_.custom(5),gridColor:je("#26292f"),gridMajorColor:je("#363a42"),showAxes:_.custom(!1),axisXColor:je("#c8404f"),axisZColor:je("#2f6fd0"),gridFade:_.custom(.55),gridFadeColor:je("#0b0d12"),maxPixelRatio:_.custom(2),antialias:_.custom(!0),shadows:_.custom(!1),tone:Y(),exposure:Y(),post:Y()},jh={orbitTo:{args:["orbit","elevation","zoom"]}},Lh=async()=>{await ts()};function Bh(t){t.task("three:runtime",Lh)}var Vl=new WeakMap;function Hl(t,e,n){let r=t.scene3D(),o=r.ops().length>0,i=Kt(e.shadows);i&&r.shadows(i),(e.tone!==void 0||e.exposure!==void 0)&&r.tone({mapping:e.tone,exposure:e.exposure}),e.post!==void 0&&r.post(e.post);let s=r.fogDescriptor();if(s&&s.color===void 0){let a=Vh(e.fill);a!==void 0&&r.fog({...s,color:a})}return e.showGrid&&r.draw(new We().line({geometry:qh(me(t).host,e),segments:!0,material:{type:"lineBasic",vertexColors:!0,toneMapped:!1}})),!n&&r.isEmpty()&&!o?null:(r.cameraDescriptor()===null&&r.perspective({fov:e.fov,orbit:vo(e.orbit),elevation:e.elevation,distance:e.zoom}),r.ops().some(a=>a.kind==="light")||r.light({type:"ambient",intensity:e.ambientIntensity,color:e.ambientColor}).light({type:"directional",intensity:e.keyIntensity,color:e.keyColor},{position:[4,6,3]}).light({type:"directional",intensity:e.keyIntensity*.35,color:e.keyColor},{position:[-5,-2,-4]}),n?.(r),r.isEmpty()?null:r)}function Wh(t,e,n){let r=Hl(t,e,n),o=me(t);if(r&&!o.probing){r.assertBalanced();let s=o.host;Zt(r,a=>{if(!st(a))return;let l=Vt(a.source);l.kind==="node"&&s.attachDetached(l.node)})}let i=r?[...e.fill,...vi.canvas3D(r,{maxPixelRatio:e.maxPixelRatio,antialias:e.antialias})]:e.fill;io(t,e,_t(t.size,e),{fill:i})}function qh(t,e){let n={size:e.gridSize,divisions:Math.max(1,Math.round(e.gridDivisions)),majorEvery:Math.max(1,Math.round(e.gridMajorEvery)),minorColor:e.gridColor,majorColor:e.gridMajorColor,axisXColor:e.axisXColor,axisZColor:e.axisZColor,showAxes:e.showAxes,fadeTo:$h(e),fade:e.gridFade},r=JSON.stringify(n),o=Vl.get(t);return o?.key!==r&&Vl.set(t,o={key:r,geometry:$l(n)}),o.geometry}function $h(t){for(let e of t.fill){if(e?.type!=="solid")continue;let n=e.color;if(typeof n=="string"||Array.isArray(n)&&(n[3]??1)>0)return n}return t.gridFadeColor}function Vh(t){for(let e of t)if(e&&e.type==="solid")return e.color}export{bt as a,Ct as b,Ot as c,ge as d,Le as e,Zh as f,tt as g,Se as h,N as i,ee as j,Un as k,C as l,At as m,q as n,xe as o,Ul as p,ud as q,ae as r,Kl as s,Zl as t,Tt as u,zt as v,dd as w,pd as x,md as y,yd as z,Rt as A,pi as B,Nt as C,jt as D,E,ny as F,gi as G,ke as H,hc as I,wi as J,_i as K,rt as L,vi as M,Kn as N,yc as O,By as P,Wy as Q,xc as R,qy as S,Fi as T,it as U,Zn as V,wc as W,_c as X,Hy as Y,Yy as Z,Ri as _,D as $,U as aa,fg as ba,kc as ca,he as da,$ as ea,Vt as fa,Cc as ga,st as ha,gg as ia,Bi as ja,at as ka,lt as la,Yi as ma,Ki as na,Ut as oa,We as pa,Gt as qa,Kt as ra,ie as sa,Qi as ta,Ng as ua,Dg as va,Ig as wa,ts as xa,ns as ya,jg as za,Nc as Aa,Dc as Ba,Zt as Ca,en as Da,tn as Ea,Ux as Fa,Qc as Ga,sr as Ha,Gx as Ia,V as Ja,eu as Ka,we as La,nu as Ma,ru as Na,ou as Oa,Ss as Pa,vs as Qa,iu as Ra,su as Sa,re as Ta,ct as Ua,Cs as Va,Os as Wa,i0 as Xa,s0 as Ya,a0 as Za,Fe as _a,h0 as $a,d0 as ab,p0 as bb,m0 as cb,rn as db,y0 as eb,g0 as fb,G as gb,As as hb,Z as ib,x0 as jb,w0 as kb,on as lb,S0 as mb,Ps as nb,hr as ob,dr as pb,an as qb,Is as rb,js as sb,be as tb,$e as ub,ln as vb,V0 as wb,pu as xb,cn as yb,pr as zb,Ls as Ab,Bs as Bb,mu as Cb,hn as Db,yr as Eb,X0 as Fb,wr as Gb,J as Hb,wu as Ib,vr as Jb,ft as Kb,H as Lb,pn as Mb,ht as Nb,b as Ob,B as Pb,Ve as Qb,Or as Rb,Ar as Sb,Wu as Tb,Er as Ub,qu as Vb,$u as Wb,Vu as Xb,vw as Yb,pa as Zb,Ww as _b,qw as $b,$w as ac,ma as bc,Vw as cc,Hw as dc,Yw as ec,Xw as fc,ya as gc,ga as hc,Uw as ic,Gw as jc,Kw as kc,Zw as lc,F as mc,Ce as nc,ka as oc,h_ as pc,d_ as qc,Ma as rc,p_ as sc,m_ as tc,y_ as uc,xn as vc,o_ as wc,va as xc,mt as yc,pt as zc,a_ as Ac,Yu as Bc,Fr as Cc,_n as Dc,Sa as Ec,W as Fc,le as Gc,vn as Hc,Mn as Ic,He as Jc,On as Kc,Cn as Lc,Ju as Mc,G_ as Nc,La as Oc,S as Pc,af as Qc,Ya as Rc,pe as Sc,En as Tc,lf as Uc,Oe as Vc,Ae as Wc,kv as Xc,Xa as Yc,Ua as Zc,Ga as _c,Ka as $c,Za as ad,tl as bd,cf as cd,hf as dd,df as ed,pf as fd,nl as gd,mf as hd,ce as id,gf as jd,Hv as kd,Yv as ld,xf as md,zn as nd,Gv as od,Kv as pd,Zv as qd,Fn as rd,jr as sd,_f as td,Fl as ud,ao as vd,lo as wd,Rl as xd,vf as yd,I as zd,$l as Ad,Wr as Bd,ll as Cd,Rn as Dd,MS as Ed,Nn as Fd,Dn as Gd,me as Hd,t1 as Id,_ as Jd,ro as Kd,_t as Ld,Ol as Md,Vf as Nd,Yf as Od,Xf as Pd,Uf as Qd,Vn as Rd,El as Sd,Gf as Td,io as Ud,Qf as Vd,Pl as Wd,eh as Xd,th as Yd,nh as Zd,rh as _d,oh as $d,ih as ae,sh as be,ah as ce,Tl as de,lh as ee,ch as fe,fh as ge,mh as he,yh as ie,gh as je,xh as ke,wh as le,_h as me,vh as ne,Sh as oe,Ll as pe,ue as qe,Mh as re,bh as se,Ch as te,Oh as ue,Ah as ve,Q1 as we,sk as xe,Y as ye,fk as ze,Bl as Ae,hk as Be,Eh as Ce,dk as De,Ph as Ee,zh as Fe,Fh as Ge,Nh as He,Dh as Ie,Ih as Je,jh as Ke,Bh as Le,Wh as Me,Hh as Ne};
|
|
5
|
-
//# sourceMappingURL=chunk-EJDPYDQI.js.map
|