af-motion 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE +201 -0
- package/README.md +203 -3
- package/RELEASE_NOTES.md +115 -0
- package/bin/af-motion.js +16 -0
- package/bin/mcp-server.js +21 -0
- package/dist/3d/adapter.d.ts +29 -0
- package/dist/3d/assets/cache.d.ts +71 -0
- package/dist/3d/assets/index.d.ts +10 -0
- package/dist/3d/assets/inspection.d.ts +19 -0
- package/dist/3d/assets/loaders.d.ts +30 -0
- package/dist/3d/assets/manager.d.ts +69 -0
- package/dist/3d/assets/scene-integration.d.ts +23 -0
- package/dist/3d/assets/types.d.ts +80 -0
- package/dist/3d/assets/validation.d.ts +12 -0
- package/dist/3d/camera/index.d.ts +7 -0
- package/dist/3d/camera/presets.d.ts +8 -0
- package/dist/3d/camera/transitions.d.ts +19 -0
- package/dist/3d/camera/types.d.ts +37 -0
- package/dist/3d/camera/validation.d.ts +9 -0
- package/dist/3d/capabilities.d.ts +11 -0
- package/dist/3d/composition/fallback.d.ts +20 -0
- package/dist/3d/composition/generation.d.ts +24 -0
- package/dist/3d/composition/index.d.ts +12 -0
- package/dist/3d/composition/quality.d.ts +35 -0
- package/dist/3d/composition/recipes.d.ts +34 -0
- package/dist/3d/composition/types.d.ts +88 -0
- package/dist/3d/composition/unified.d.ts +18 -0
- package/dist/3d/environment/index.d.ts +6 -0
- package/dist/3d/environment/presets.d.ts +8 -0
- package/dist/3d/environment/types.d.ts +36 -0
- package/dist/3d/environment/validation.d.ts +9 -0
- package/dist/3d/geometry/cache.d.ts +37 -0
- package/dist/3d/geometry/generators.d.ts +24 -0
- package/dist/3d/geometry/hash.d.ts +10 -0
- package/dist/3d/geometry/index.d.ts +9 -0
- package/dist/3d/geometry/three-adapter.d.ts +15 -0
- package/dist/3d/geometry/types.d.ts +120 -0
- package/dist/3d/geometry/validation.d.ts +6 -0
- package/dist/3d/index.d.ts +32 -0
- package/dist/3d/interaction/camera-controls.d.ts +58 -0
- package/dist/3d/interaction/index.d.ts +8 -0
- package/dist/3d/interaction/manager.d.ts +61 -0
- package/dist/3d/interaction/presets.d.ts +9 -0
- package/dist/3d/interaction/raycaster.d.ts +20 -0
- package/dist/3d/interaction/types.d.ts +78 -0
- package/dist/3d/lighting/index.d.ts +6 -0
- package/dist/3d/lighting/presets.d.ts +8 -0
- package/dist/3d/lighting/types.d.ts +31 -0
- package/dist/3d/lighting/validation.d.ts +17 -0
- package/dist/3d/materials/bridge.d.ts +11 -0
- package/dist/3d/materials/index.d.ts +7 -0
- package/dist/3d/materials/presets.d.ts +9 -0
- package/dist/3d/materials/types.d.ts +43 -0
- package/dist/3d/materials/validation.d.ts +9 -0
- package/dist/3d/morphing/animator.d.ts +19 -0
- package/dist/3d/morphing/correspondence.d.ts +32 -0
- package/dist/3d/morphing/geometry.d.ts +28 -0
- package/dist/3d/morphing/index.d.ts +16 -0
- package/dist/3d/morphing/interpolation.d.ts +45 -0
- package/dist/3d/morphing/morph.d.ts +18 -0
- package/dist/3d/morphing/presets.d.ts +31 -0
- package/dist/3d/morphing/react.d.ts +29 -0
- package/dist/3d/morphing/topology.d.ts +34 -0
- package/dist/3d/morphing/types.d.ts +138 -0
- package/dist/3d/morphing/validation.d.ts +19 -0
- package/dist/3d/optimization/analysis.d.ts +14 -0
- package/dist/3d/optimization/colliders.d.ts +16 -0
- package/dist/3d/optimization/geometry.d.ts +22 -0
- package/dist/3d/optimization/hierarchy.d.ts +14 -0
- package/dist/3d/optimization/index.d.ts +33 -0
- package/dist/3d/optimization/lod.d.ts +13 -0
- package/dist/3d/optimization/materials.d.ts +12 -0
- package/dist/3d/optimization/recommendations.d.ts +13 -0
- package/dist/3d/optimization/skeleton.d.ts +20 -0
- package/dist/3d/optimization/types.d.ts +252 -0
- package/dist/3d/physics/benchmark.d.ts +76 -0
- package/dist/3d/physics/body/inertia.d.ts +61 -0
- package/dist/3d/physics/collision/ccd.d.ts +26 -0
- package/dist/3d/physics/collision/narrowphase.d.ts +15 -0
- package/dist/3d/physics/collision/shapes.d.ts +45 -0
- package/dist/3d/physics/constraints/advanced.d.ts +40 -0
- package/dist/3d/physics/constraints/solver.d.ts +34 -0
- package/dist/3d/physics/constraints/types.d.ts +106 -0
- package/dist/3d/physics/events.d.ts +34 -0
- package/dist/3d/physics/index.d.ts +29 -0
- package/dist/3d/physics/material.d.ts +27 -0
- package/dist/3d/physics/math.d.ts +79 -0
- package/dist/3d/physics/soft/cloth.d.ts +12 -0
- package/dist/3d/physics/soft/collision.d.ts +12 -0
- package/dist/3d/physics/soft/gpu.d.ts +19 -0
- package/dist/3d/physics/soft/pbd.d.ts +20 -0
- package/dist/3d/physics/soft/rope.d.ts +16 -0
- package/dist/3d/physics/soft/soft-body.d.ts +12 -0
- package/dist/3d/physics/soft/types.d.ts +212 -0
- package/dist/3d/physics/solver/integrators.d.ts +25 -0
- package/dist/3d/physics/solver/types.d.ts +28 -0
- package/dist/3d/physics/spatial/spatial-hash.d.ts +51 -0
- package/dist/3d/physics/types.d.ts +579 -0
- package/dist/3d/physics/world.d.ts +106 -0
- package/dist/3d/r3f.d.ts +34 -0
- package/dist/3d/scene.d.ts +8 -0
- package/dist/3d/schema.d.ts +739 -0
- package/dist/3d/schemas/ai-integration.d.ts +201 -0
- package/dist/3d/schemas/correction.d.ts +11 -0
- package/dist/3d/schemas/index.d.ts +12 -0
- package/dist/3d/schemas/schemas.d.ts +361 -0
- package/dist/3d/schemas/serialization.d.ts +22 -0
- package/dist/3d/schemas/types.d.ts +199 -0
- package/dist/3d/schemas/validation.d.ts +33 -0
- package/dist/3d/scroll/controller.d.ts +32 -0
- package/dist/3d/scroll/index.d.ts +6 -0
- package/dist/3d/scroll/presets.d.ts +9 -0
- package/dist/3d/scroll/types.d.ts +53 -0
- package/dist/3d/terrain/biomes.d.ts +18 -0
- package/dist/3d/terrain/chunks.d.ts +20 -0
- package/dist/3d/terrain/erosion.d.ts +15 -0
- package/dist/3d/terrain/heightmap.d.ts +27 -0
- package/dist/3d/terrain/index.d.ts +18 -0
- package/dist/3d/terrain/materials.d.ts +20 -0
- package/dist/3d/terrain/noise.d.ts +25 -0
- package/dist/3d/terrain/physics.d.ts +34 -0
- package/dist/3d/terrain/terrain.d.ts +12 -0
- package/dist/3d/terrain/types.d.ts +235 -0
- package/dist/3d/terrain/vegetation.d.ts +14 -0
- package/dist/3d/types.d.ts +176 -0
- package/dist/3d/world/hydrology.d.ts +12 -0
- package/dist/3d/world/index.d.ts +15 -0
- package/dist/3d/world/lighting.d.ts +16 -0
- package/dist/3d/world/pipeline.d.ts +20 -0
- package/dist/3d/world/population.d.ts +12 -0
- package/dist/3d/world/presets.d.ts +11 -0
- package/dist/3d/world/streaming.d.ts +13 -0
- package/dist/3d/world/types.d.ts +272 -0
- package/dist/3d/world/world.d.ts +64 -0
- package/dist/backgrounds/advanced-gradient.d.ts +32 -0
- package/dist/backgrounds/atmospheric-backgrounds.d.ts +79 -0
- package/dist/backgrounds/aurora.d.ts +24 -0
- package/dist/backgrounds/cosmic-background.d.ts +31 -0
- package/dist/backgrounds/energy-effects.d.ts +78 -0
- package/dist/backgrounds/floating-orbs.d.ts +26 -0
- package/dist/backgrounds/fluid-backgrounds.d.ts +72 -0
- package/dist/backgrounds/geometric-backgrounds.d.ts +78 -0
- package/dist/backgrounds/gradient.d.ts +20 -0
- package/dist/backgrounds/grid.d.ts +22 -0
- package/dist/backgrounds/internal/canvas-lifecycle.d.ts +29 -0
- package/dist/backgrounds/noise.d.ts +20 -0
- package/dist/backgrounds/particle-background.d.ts +37 -0
- package/dist/backgrounds/particle-field.d.ts +22 -0
- package/dist/backgrounds/spotlight.d.ts +20 -0
- package/dist/backgrounds/wave.d.ts +22 -0
- package/dist/catalogue.d.ts +227 -0
- package/dist/catalogue.js +4 -0
- package/dist/chunks/catalogue-ZmbeEdRo.js +59850 -0
- package/dist/chunks/core-animation-CeiI_TEe.js +1394 -0
- package/dist/chunks/motion-choreography-DC6LWvDk.js +4089 -0
- package/dist/chunks/pointer-capture-lrnKAl2I.js +158 -0
- package/dist/chunks/safe-json-D5j34GEB.js +62 -0
- package/dist/chunks/scroll-velocity-BNUHaS0-.js +904 -0
- package/dist/cli/commands/doctor.d.ts +9 -0
- package/dist/cli/commands/example.d.ts +9 -0
- package/dist/cli/commands/info.d.ts +8 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/presets.d.ts +10 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/types.d.ts +115 -0
- package/dist/cli/utils/safety.d.ts +11 -0
- package/dist/cli/utils/templates.d.ts +16 -0
- package/dist/cli/utils/terminal.d.ts +29 -0
- package/dist/cli.js +825 -0
- package/dist/core/adaptive-motion.d.ts +100 -0
- package/dist/core/adaptive-quality/controller.d.ts +61 -0
- package/dist/core/adaptive-quality/index.d.ts +13 -0
- package/dist/core/adaptive-quality/metrics.d.ts +33 -0
- package/dist/core/adaptive-quality/policies.d.ts +40 -0
- package/dist/core/adaptive-quality/profile.d.ts +58 -0
- package/dist/core/adaptive-quality/react.d.ts +57 -0
- package/dist/core/adaptive-quality/recommendation.d.ts +12 -0
- package/dist/core/adaptive-quality/resolution.d.ts +22 -0
- package/dist/core/adaptive-quality/types.d.ts +362 -0
- package/dist/core/advanced-motion/adapters.d.ts +20 -0
- package/dist/core/advanced-motion/controller.d.ts +52 -0
- package/dist/core/advanced-motion/index.d.ts +12 -0
- package/dist/core/advanced-motion/recipes.d.ts +16 -0
- package/dist/core/advanced-motion/timeline.d.ts +35 -0
- package/dist/core/advanced-motion/types.d.ts +174 -0
- package/dist/core/advanced-motion/validation.d.ts +11 -0
- package/dist/core/agent-workflows/agent-registry.d.ts +21 -0
- package/dist/core/agent-workflows/agents/accessibility-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/composition-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/design-to-motion-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/index.d.ts +13 -0
- package/dist/core/agent-workflows/agents/motion-intelligence-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/performance-agent.d.ts +9 -0
- package/dist/core/agent-workflows/agents/scene-generation-agent.d.ts +9 -0
- package/dist/core/agent-workflows/collaboration-planner.d.ts +38 -0
- package/dist/core/agent-workflows/collaboration-workflows.d.ts +83 -0
- package/dist/core/agent-workflows/communication.d.ts +29 -0
- package/dist/core/agent-workflows/conflict-resolver.d.ts +25 -0
- package/dist/core/agent-workflows/context.d.ts +36 -0
- package/dist/core/agent-workflows/execution-engine.d.ts +30 -0
- package/dist/core/agent-workflows/index.d.ts +20 -0
- package/dist/core/agent-workflows/orchestration-types.d.ts +144 -0
- package/dist/core/agent-workflows/orchestrator.d.ts +29 -0
- package/dist/core/agent-workflows/react.d.ts +71 -0
- package/dist/core/agent-workflows/shared-context.d.ts +36 -0
- package/dist/core/agent-workflows/task-planner.d.ts +42 -0
- package/dist/core/agent-workflows/templates.d.ts +14 -0
- package/dist/core/agent-workflows/tool-registry.d.ts +24 -0
- package/dist/core/agent-workflows/types.d.ts +167 -0
- package/dist/core/ai-ecosystem/capability-registry.d.ts +23 -0
- package/dist/core/ai-ecosystem/index.d.ts +13 -0
- package/dist/core/ai-ecosystem/pipeline.d.ts +19 -0
- package/dist/core/ai-ecosystem/provider.d.ts +19 -0
- package/dist/core/ai-ecosystem/types.d.ts +69 -0
- package/dist/core/ai-motion-intelligence/engine.d.ts +51 -0
- package/dist/core/ai-motion-intelligence/explanation-engine.d.ts +8 -0
- package/dist/core/ai-motion-intelligence/index.d.ts +15 -0
- package/dist/core/ai-motion-intelligence/intent-classifier.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/knowledge-base.d.ts +12 -0
- package/dist/core/ai-motion-intelligence/provider.d.ts +31 -0
- package/dist/core/ai-motion-intelligence/quality-evaluator.d.ts +9 -0
- package/dist/core/ai-motion-intelligence/react.d.ts +14 -0
- package/dist/core/ai-motion-intelligence/recommendation-engine.d.ts +16 -0
- package/dist/core/ai-motion-intelligence/types.d.ts +134 -0
- package/dist/core/ai-motion-registry.d.ts +201 -0
- package/dist/core/animate.d.ts +57 -0
- package/dist/core/animation-intelligence/engine.d.ts +42 -0
- package/dist/core/animation-intelligence/index.d.ts +11 -0
- package/dist/core/animation-intelligence/intent.d.ts +15 -0
- package/dist/core/animation-intelligence/schema.d.ts +42 -0
- package/dist/core/animation-intelligence/scoring.d.ts +15 -0
- package/dist/core/animation-intelligence/types.d.ts +91 -0
- package/dist/core/animation-parallel.d.ts +37 -0
- package/dist/core/animation-presets.d.ts +56 -0
- package/dist/core/animation-sequence.d.ts +37 -0
- package/dist/core/animation-timeline.d.ts +46 -0
- package/dist/core/animation.d.ts +48 -0
- package/dist/core/built-in-palettes.d.ts +331 -0
- package/dist/core/choreography-intelligence/bridge.d.ts +43 -0
- package/dist/core/choreography-intelligence/generator.d.ts +11 -0
- package/dist/core/choreography-intelligence/index.d.ts +11 -0
- package/dist/core/choreography-intelligence/intent.d.ts +11 -0
- package/dist/core/choreography-intelligence/schema.d.ts +76 -0
- package/dist/core/choreography-intelligence/types.d.ts +87 -0
- package/dist/core/composition.d.ts +170 -0
- package/dist/core/configuration-corrector.d.ts +85 -0
- package/dist/core/design-intelligence.d.ts +199 -0
- package/dist/core/design-system.d.ts +206 -0
- package/dist/core/design-to-motion/design-analyzer.d.ts +13 -0
- package/dist/core/design-to-motion/engine.d.ts +34 -0
- package/dist/core/design-to-motion/generator.d.ts +16 -0
- package/dist/core/design-to-motion/index.d.ts +15 -0
- package/dist/core/design-to-motion/input-parser.d.ts +17 -0
- package/dist/core/design-to-motion/motion-planner.d.ts +11 -0
- package/dist/core/design-to-motion/presets.d.ts +11 -0
- package/dist/core/design-to-motion/react.d.ts +13 -0
- package/dist/core/design-to-motion/types.d.ts +221 -0
- package/dist/core/design-to-motion/validator.d.ts +13 -0
- package/dist/core/device-capabilities/classification.d.ts +25 -0
- package/dist/core/device-capabilities/detection.d.ts +27 -0
- package/dist/core/device-capabilities/graphics.d.ts +22 -0
- package/dist/core/device-capabilities/hardware.d.ts +27 -0
- package/dist/core/device-capabilities/index.d.ts +14 -0
- package/dist/core/device-capabilities/monitor.d.ts +19 -0
- package/dist/core/device-capabilities/react.d.ts +24 -0
- package/dist/core/device-capabilities/runtime.d.ts +11 -0
- package/dist/core/device-capabilities/scoring.d.ts +18 -0
- package/dist/core/device-capabilities/types.d.ts +171 -0
- package/dist/core/effect-composer.d.ts +41 -0
- package/dist/core/generation-pipeline.d.ts +135 -0
- package/dist/core/inertia.d.ts +30 -0
- package/dist/core/interactions/cursor-controller.d.ts +9 -0
- package/dist/core/interactions/custom-gestures.d.ts +28 -0
- package/dist/core/interactions/device-capabilities.d.ts +12 -0
- package/dist/core/interactions/drag-controller.d.ts +60 -0
- package/dist/core/interactions/errors.d.ts +13 -0
- package/dist/core/interactions/gesture-classifier.d.ts +43 -0
- package/dist/core/interactions/gesture-intelligence-controller.d.ts +9 -0
- package/dist/core/interactions/gesture-recognizers.d.ts +160 -0
- package/dist/core/interactions/gesture-sequence.d.ts +9 -0
- package/dist/core/interactions/index.d.ts +27 -0
- package/dist/core/interactions/input-normalizer.d.ts +8 -0
- package/dist/core/interactions/interaction-manager.d.ts +43 -0
- package/dist/core/interactions/keyboard-manager.d.ts +16 -0
- package/dist/core/interactions/magnetic-controller.d.ts +9 -0
- package/dist/core/interactions/magnetic-group.d.ts +11 -0
- package/dist/core/interactions/multitouch-controller.d.ts +62 -0
- package/dist/core/interactions/pointer-controller.d.ts +34 -0
- package/dist/core/interactions/pointer-tracker.d.ts +32 -0
- package/dist/core/interactions/prioritizer.d.ts +17 -0
- package/dist/core/interactions/touch-controller.d.ts +35 -0
- package/dist/core/interactions/types.d.ts +710 -0
- package/dist/core/layout/controller.d.ts +56 -0
- package/dist/core/layout/flip.d.ts +21 -0
- package/dist/core/layout/group.d.ts +46 -0
- package/dist/core/layout/index.d.ts +12 -0
- package/dist/core/layout/measure.d.ts +30 -0
- package/dist/core/layout/presets.d.ts +24 -0
- package/dist/core/layout/types.d.ts +189 -0
- package/dist/core/microinteractions/generator.d.ts +11 -0
- package/dist/core/microinteractions/index.d.ts +11 -0
- package/dist/core/microinteractions/intent.d.ts +11 -0
- package/dist/core/microinteractions/runtime.d.ts +25 -0
- package/dist/core/microinteractions/schema.d.ts +82 -0
- package/dist/core/microinteractions/types.d.ts +79 -0
- package/dist/core/motion-choreography.d.ts +163 -0
- package/dist/core/motion-dna.d.ts +129 -0
- package/dist/core/motion-path/animator.d.ts +13 -0
- package/dist/core/motion-path/engine.d.ts +27 -0
- package/dist/core/motion-path/follower.d.ts +8 -0
- package/dist/core/motion-path/index.d.ts +15 -0
- package/dist/core/motion-path/lut.d.ts +33 -0
- package/dist/core/motion-path/parser.d.ts +26 -0
- package/dist/core/motion-path/segments.d.ts +16 -0
- package/dist/core/motion-path/types.d.ts +178 -0
- package/dist/core/motion-path/vector3.d.ts +49 -0
- package/dist/core/motion-recipe.d.ts +171 -0
- package/dist/core/motion-states.d.ts +43 -0
- package/dist/core/motion-validation/consistency.d.ts +11 -0
- package/dist/core/motion-validation/index.d.ts +11 -0
- package/dist/core/motion-validation/optimizer.d.ts +11 -0
- package/dist/core/motion-validation/schema.d.ts +81 -0
- package/dist/core/motion-validation/types.d.ts +53 -0
- package/dist/core/motion-validation/validator.d.ts +11 -0
- package/dist/core/motion.d.ts +7 -0
- package/dist/core/natural-motion.d.ts +110 -0
- package/dist/core/palette-colors.d.ts +16 -0
- package/dist/core/palette-styles.d.ts +12 -0
- package/dist/core/palettes.d.ts +59 -0
- package/dist/core/performance-intelligence/conflicts.d.ts +21 -0
- package/dist/core/performance-intelligence/context.d.ts +48 -0
- package/dist/core/performance-intelligence/coordinator.d.ts +84 -0
- package/dist/core/performance-intelligence/decisions.d.ts +17 -0
- package/dist/core/performance-intelligence/history.d.ts +44 -0
- package/dist/core/performance-intelligence/index.d.ts +15 -0
- package/dist/core/performance-intelligence/policies.d.ts +59 -0
- package/dist/core/performance-intelligence/react.d.ts +78 -0
- package/dist/core/performance-intelligence/report.d.ts +16 -0
- package/dist/core/performance-intelligence/scoring.d.ts +16 -0
- package/dist/core/performance-intelligence/types.d.ts +203 -0
- package/dist/core/performance-optimizer/bottlenecks.d.ts +9 -0
- package/dist/core/performance-optimizer/index.d.ts +13 -0
- package/dist/core/performance-optimizer/optimizer.d.ts +43 -0
- package/dist/core/performance-optimizer/profiler.d.ts +38 -0
- package/dist/core/performance-optimizer/react.d.ts +55 -0
- package/dist/core/performance-optimizer/strategies.d.ts +22 -0
- package/dist/core/performance-optimizer/types.d.ts +227 -0
- package/dist/core/performance-optimizer/workers.d.ts +27 -0
- package/dist/core/physics/collision-constraints.d.ts +15 -0
- package/dist/core/physics/collision-detection.d.ts +93 -0
- package/dist/core/physics/collision-response.d.ts +24 -0
- package/dist/core/physics/collision-types.d.ts +381 -0
- package/dist/core/physics/collision-world.d.ts +11 -0
- package/dist/core/physics/composition-behaviors.d.ts +97 -0
- package/dist/core/physics/composition-choreography.d.ts +14 -0
- package/dist/core/physics/composition-engine.d.ts +25 -0
- package/dist/core/physics/composition-recipes.d.ts +46 -0
- package/dist/core/physics/composition-types.d.ts +265 -0
- package/dist/core/physics/composition-validation.d.ts +33 -0
- package/dist/core/physics/index.d.ts +37 -0
- package/dist/core/physics/inertia-animation.d.ts +11 -0
- package/dist/core/physics/inertia-math.d.ts +56 -0
- package/dist/core/physics/inertia-presets.d.ts +25 -0
- package/dist/core/physics/inertia-simulation.d.ts +11 -0
- package/dist/core/physics/inertia-types.d.ts +355 -0
- package/dist/core/physics/inertia-validation.d.ts +22 -0
- package/dist/core/physics/math.d.ts +99 -0
- package/dist/core/physics/presets.d.ts +28 -0
- package/dist/core/physics/simulation.d.ts +11 -0
- package/dist/core/physics/spring-animation.d.ts +11 -0
- package/dist/core/physics/spring-math.d.ts +47 -0
- package/dist/core/physics/spring-presets.d.ts +29 -0
- package/dist/core/physics/spring-simulation.d.ts +11 -0
- package/dist/core/physics/spring-types.d.ts +350 -0
- package/dist/core/physics/spring-validation.d.ts +22 -0
- package/dist/core/physics/stepper.d.ts +24 -0
- package/dist/core/physics/types.d.ts +280 -0
- package/dist/core/physics/validation.d.ts +62 -0
- package/dist/core/pointer-capture.d.ts +7 -0
- package/dist/core/reference-analysis/index.d.ts +10 -0
- package/dist/core/reference-analysis/interpreter.d.ts +12 -0
- package/dist/core/reference-analysis/planner.d.ts +15 -0
- package/dist/core/reference-analysis/specification.d.ts +14 -0
- package/dist/core/reference-analysis/types.d.ts +244 -0
- package/dist/core/resource-intelligence/cache.d.ts +43 -0
- package/dist/core/resource-intelligence/gpu.d.ts +19 -0
- package/dist/core/resource-intelligence/index.d.ts +16 -0
- package/dist/core/resource-intelligence/leaks.d.ts +13 -0
- package/dist/core/resource-intelligence/memory.d.ts +27 -0
- package/dist/core/resource-intelligence/pooling.d.ts +32 -0
- package/dist/core/resource-intelligence/pressure.d.ts +32 -0
- package/dist/core/resource-intelligence/react.d.ts +63 -0
- package/dist/core/resource-intelligence/registry.d.ts +33 -0
- package/dist/core/resource-intelligence/reports.d.ts +14 -0
- package/dist/core/resource-intelligence/types.d.ts +232 -0
- package/dist/core/scene-generation/engine.d.ts +31 -0
- package/dist/core/scene-generation/generator.d.ts +14 -0
- package/dist/core/scene-generation/index.d.ts +14 -0
- package/dist/core/scene-generation/input-parser.d.ts +24 -0
- package/dist/core/scene-generation/presets.d.ts +10 -0
- package/dist/core/scene-generation/react.d.ts +13 -0
- package/dist/core/scene-generation/scene-analyzer.d.ts +9 -0
- package/dist/core/scene-generation/scene-planner.d.ts +12 -0
- package/dist/core/scene-generation/types.d.ts +236 -0
- package/dist/core/scene-generation/validator.d.ts +18 -0
- package/dist/core/schema.d.ts +185 -0
- package/dist/core/scroll-intelligence/generator.d.ts +11 -0
- package/dist/core/scroll-intelligence/index.d.ts +11 -0
- package/dist/core/scroll-intelligence/intent.d.ts +11 -0
- package/dist/core/scroll-intelligence/runtime.d.ts +21 -0
- package/dist/core/scroll-intelligence/schema.d.ts +78 -0
- package/dist/core/scroll-intelligence/types.d.ts +85 -0
- package/dist/core/spring.d.ts +38 -0
- package/dist/core/svg-morph/animator.d.ts +10 -0
- package/dist/core/svg-morph/arc-to-cubic.d.ts +11 -0
- package/dist/core/svg-morph/index.d.ts +10 -0
- package/dist/core/svg-morph/interpolate.d.ts +23 -0
- package/dist/core/svg-morph/normalize.d.ts +34 -0
- package/dist/core/svg-morph/parser.d.ts +13 -0
- package/dist/core/svg-morph/shapes.d.ts +32 -0
- package/dist/core/svg-morph/types.d.ts +144 -0
- package/dist/core/transform.d.ts +27 -0
- package/dist/core/transitions/controller.d.ts +45 -0
- package/dist/core/transitions/engine.d.ts +26 -0
- package/dist/core/transitions/group-transition.d.ts +30 -0
- package/dist/core/transitions/index.d.ts +15 -0
- package/dist/core/transitions/presets.d.ts +16 -0
- package/dist/core/transitions/schema.d.ts +71 -0
- package/dist/core/transitions/shared-element-transition.d.ts +88 -0
- package/dist/core/transitions/shared-element.d.ts +84 -0
- package/dist/core/transitions/types.d.ts +185 -0
- package/dist/core/transitions/view-transition.d.ts +25 -0
- package/dist/core/typography/engine.d.ts +19 -0
- package/dist/core/typography/index.d.ts +15 -0
- package/dist/core/typography/path-motion.d.ts +24 -0
- package/dist/core/typography/presets.d.ts +14 -0
- package/dist/core/typography/properties.d.ts +19 -0
- package/dist/core/typography/segmenter.d.ts +32 -0
- package/dist/core/typography/stagger.d.ts +15 -0
- package/dist/core/typography/transitions.d.ts +11 -0
- package/dist/core/typography/types.d.ts +154 -0
- package/dist/core/utils/safe-json.d.ts +50 -0
- package/dist/core/visual-style-registry.d.ts +659 -0
- package/dist/easing/easings.d.ts +44 -0
- package/dist/effects/border-beam.d.ts +28 -0
- package/dist/effects/count-up.d.ts +30 -0
- package/dist/effects/cursor-trail.d.ts +23 -0
- package/dist/effects/drag.d.ts +41 -0
- package/dist/effects/draw-svg.d.ts +19 -0
- package/dist/effects/follow-pointer.d.ts +19 -0
- package/dist/effects/glow.d.ts +25 -0
- package/dist/effects/gradient-text.d.ts +22 -0
- package/dist/effects/hover-motion.d.ts +32 -0
- package/dist/effects/in-view.d.ts +14 -0
- package/dist/effects/magnetic.d.ts +40 -0
- package/dist/effects/morph-svg.d.ts +15 -0
- package/dist/effects/parallax.d.ts +42 -0
- package/dist/effects/pinch.d.ts +27 -0
- package/dist/effects/reveal.d.ts +33 -0
- package/dist/effects/ripple.d.ts +21 -0
- package/dist/effects/scroll-animate.d.ts +23 -0
- package/dist/effects/scroll-direction.d.ts +19 -0
- package/dist/effects/scroll-progress.d.ts +29 -0
- package/dist/effects/scroll-trigger.d.ts +22 -0
- package/dist/effects/scroll-velocity.d.ts +29 -0
- package/dist/effects/shine.d.ts +23 -0
- package/dist/effects/split-text.d.ts +17 -0
- package/dist/effects/spotlight.d.ts +24 -0
- package/dist/effects/stagger.d.ts +46 -0
- package/dist/effects/swipe.d.ts +27 -0
- package/dist/effects/text-highlight.d.ts +25 -0
- package/dist/effects/text-mask.d.ts +25 -0
- package/dist/effects/text-reveal.d.ts +28 -0
- package/dist/effects/text-scramble.d.ts +18 -0
- package/dist/effects/tilt.d.ts +42 -0
- package/dist/effects/typewriter.d.ts +26 -0
- package/dist/graphics/capabilities.d.ts +12 -0
- package/dist/graphics/composition/engine.d.ts +14 -0
- package/dist/graphics/composition/fallback.d.ts +13 -0
- package/dist/graphics/composition/index.d.ts +10 -0
- package/dist/graphics/composition/ordering.d.ts +29 -0
- package/dist/graphics/composition/quality.d.ts +24 -0
- package/dist/graphics/composition/schema.d.ts +156 -0
- package/dist/graphics/composition/types.d.ts +81 -0
- package/dist/graphics/composition/unified.d.ts +23 -0
- package/dist/graphics/effects/advanced/engine.d.ts +9 -0
- package/dist/graphics/effects/advanced/index.d.ts +1 -0
- package/dist/graphics/effects/composer.d.ts +9 -0
- package/dist/graphics/effects/distortion/engine.d.ts +9 -0
- package/dist/graphics/effects/distortion/index.d.ts +1 -0
- package/dist/graphics/effects/fluid/engine.d.ts +9 -0
- package/dist/graphics/effects/fluid/index.d.ts +1 -0
- package/dist/graphics/effects/index.d.ts +10 -0
- package/dist/graphics/effects/particles/engine.d.ts +9 -0
- package/dist/graphics/effects/particles/index.d.ts +2 -0
- package/dist/graphics/effects/particles/pool.d.ts +17 -0
- package/dist/graphics/effects/schema.d.ts +312 -0
- package/dist/graphics/effects/types.d.ts +85 -0
- package/dist/graphics/engine.d.ts +5 -0
- package/dist/graphics/environment/clouds.d.ts +28 -0
- package/dist/graphics/environment/environment.d.ts +50 -0
- package/dist/graphics/environment/fire-smoke.d.ts +32 -0
- package/dist/graphics/environment/fog.d.ts +28 -0
- package/dist/graphics/environment/index.d.ts +18 -0
- package/dist/graphics/environment/lightning.d.ts +33 -0
- package/dist/graphics/environment/rain.d.ts +33 -0
- package/dist/graphics/environment/snow.d.ts +30 -0
- package/dist/graphics/environment/types.d.ts +184 -0
- package/dist/graphics/environment/weather.d.ts +19 -0
- package/dist/graphics/environment/wind.d.ts +23 -0
- package/dist/graphics/fluid/flow-field.d.ts +74 -0
- package/dist/graphics/fluid/grid.d.ts +43 -0
- package/dist/graphics/fluid/index.d.ts +13 -0
- package/dist/graphics/fluid/interactions.d.ts +39 -0
- package/dist/graphics/fluid/rendering.d.ts +32 -0
- package/dist/graphics/fluid/simulation.d.ts +50 -0
- package/dist/graphics/fluid/solver.d.ts +19 -0
- package/dist/graphics/fluid/types.d.ts +186 -0
- package/dist/graphics/gpu-simulation/backends/backend.d.ts +24 -0
- package/dist/graphics/gpu-simulation/backends/cpu.d.ts +21 -0
- package/dist/graphics/gpu-simulation/backends/selection.d.ts +15 -0
- package/dist/graphics/gpu-simulation/backends/webgl2.d.ts +28 -0
- package/dist/graphics/gpu-simulation/backends/webgpu.d.ts +23 -0
- package/dist/graphics/gpu-simulation/capabilities.d.ts +14 -0
- package/dist/graphics/gpu-simulation/device.d.ts +17 -0
- package/dist/graphics/gpu-simulation/engine.d.ts +8 -0
- package/dist/graphics/gpu-simulation/index.d.ts +22 -0
- package/dist/graphics/gpu-simulation/ping-pong.d.ts +23 -0
- package/dist/graphics/gpu-simulation/pipeline.d.ts +18 -0
- package/dist/graphics/gpu-simulation/resource-manager.d.ts +8 -0
- package/dist/graphics/gpu-simulation/shaders.d.ts +50 -0
- package/dist/graphics/gpu-simulation/types.d.ts +288 -0
- package/dist/graphics/index.d.ts +23 -0
- package/dist/graphics/materials/glass.d.ts +22 -0
- package/dist/graphics/materials/index.d.ts +9 -0
- package/dist/graphics/materials/lighting.d.ts +22 -0
- package/dist/graphics/materials/presets.d.ts +28 -0
- package/dist/graphics/materials/schema.d.ts +574 -0
- package/dist/graphics/materials/surface.d.ts +13 -0
- package/dist/graphics/materials/types.d.ts +150 -0
- package/dist/graphics/particle-fields/composition.d.ts +32 -0
- package/dist/graphics/particle-fields/forces.d.ts +103 -0
- package/dist/graphics/particle-fields/index.d.ts +12 -0
- package/dist/graphics/particle-fields/interaction.d.ts +32 -0
- package/dist/graphics/particle-fields/spatial-index.d.ts +20 -0
- package/dist/graphics/particle-fields/system.d.ts +52 -0
- package/dist/graphics/particle-fields/types.d.ts +138 -0
- package/dist/graphics/particles/behaviors.d.ts +11 -0
- package/dist/graphics/particles/controller.d.ts +82 -0
- package/dist/graphics/particles/data-layout.d.ts +51 -0
- package/dist/graphics/particles/emitters.d.ts +24 -0
- package/dist/graphics/particles/index.d.ts +15 -0
- package/dist/graphics/particles/random.d.ts +25 -0
- package/dist/graphics/particles/rendering.d.ts +16 -0
- package/dist/graphics/particles/simulation.d.ts +23 -0
- package/dist/graphics/particles/types.d.ts +282 -0
- package/dist/graphics/renderer.d.ts +66 -0
- package/dist/graphics/resource-manager.d.ts +6 -0
- package/dist/graphics/schema.d.ts +177 -0
- package/dist/graphics/simulation/adapters.d.ts +36 -0
- package/dist/graphics/simulation/coordinator.d.ts +64 -0
- package/dist/graphics/simulation/index.d.ts +11 -0
- package/dist/graphics/simulation/optimizer.d.ts +101 -0
- package/dist/graphics/simulation/resource-manager.d.ts +40 -0
- package/dist/graphics/simulation/types.d.ts +126 -0
- package/dist/graphics/textures/cache.d.ts +29 -0
- package/dist/graphics/textures/canvas-utils.d.ts +31 -0
- package/dist/graphics/textures/engine.d.ts +34 -0
- package/dist/graphics/textures/generators.d.ts +29 -0
- package/dist/graphics/textures/index.d.ts +11 -0
- package/dist/graphics/textures/material-integration.d.ts +20 -0
- package/dist/graphics/textures/prng.d.ts +27 -0
- package/dist/graphics/textures/schema.d.ts +219 -0
- package/dist/graphics/textures/types.d.ts +80 -0
- package/dist/graphics/types.d.ts +152 -0
- package/dist/graphics/viewport.d.ts +32 -0
- package/dist/index.d.ts +132 -0
- package/dist/index.js +4921 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/prompts.d.ts +9 -0
- package/dist/mcp/resources.d.ts +9 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/tools.d.ts +9 -0
- package/dist/mcp/transport.d.ts +33 -0
- package/dist/mcp/types.d.ts +96 -0
- package/dist/presets.d.ts +176 -0
- package/dist/presets.js +3 -0
- package/dist/react.d.ts +5358 -0
- package/dist/react.js +7557 -0
- package/package.json +112 -6
|
@@ -0,0 +1,1394 @@
|
|
|
1
|
+
// src/easing/easings.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return Number.isNaN(e) ? 0 : Math.min(Math.max(e, 0), 1);
|
|
4
|
+
}
|
|
5
|
+
var t = (t) => e(t), n = (t) => {
|
|
6
|
+
let n = e(t);
|
|
7
|
+
return n * n;
|
|
8
|
+
}, r = (t) => {
|
|
9
|
+
let n = e(t);
|
|
10
|
+
return 1 - (1 - n) * (1 - n);
|
|
11
|
+
}, i = (t) => {
|
|
12
|
+
let n = e(t);
|
|
13
|
+
return n < .5 ? 2 * n * n : 1 - (-2 * n + 2) ** 2 / 2;
|
|
14
|
+
}, a = (t) => {
|
|
15
|
+
let n = e(t);
|
|
16
|
+
return n * n * n;
|
|
17
|
+
}, o = (t) => 1 - (1 - e(t)) ** 3, s = (t) => {
|
|
18
|
+
let n = e(t);
|
|
19
|
+
return n < .5 ? 4 * n * n * n : 1 - (-2 * n + 2) ** 3 / 2;
|
|
20
|
+
}, c = (t) => {
|
|
21
|
+
let n = e(t);
|
|
22
|
+
return n === 1 ? 1 : 1 - Math.cos(n * Math.PI / 2);
|
|
23
|
+
}, l = (t) => {
|
|
24
|
+
let n = e(t);
|
|
25
|
+
return Math.sin(n * Math.PI / 2);
|
|
26
|
+
}, u = (t) => {
|
|
27
|
+
let n = e(t);
|
|
28
|
+
return n === 0 ? 0 : n === 1 ? 1 : -(Math.cos(Math.PI * n) - 1) / 2;
|
|
29
|
+
}, d = (t) => {
|
|
30
|
+
let n = e(t);
|
|
31
|
+
return n === 1 ? 1 : 1 - 2 ** (-10 * n);
|
|
32
|
+
}, f = (t) => {
|
|
33
|
+
let n = e(t);
|
|
34
|
+
if (n === 0) return 0;
|
|
35
|
+
if (n === 1) return 1;
|
|
36
|
+
let r = n - 1;
|
|
37
|
+
return 1 + 2.70158 * r ** 3 + 1.70158 * r ** 2;
|
|
38
|
+
}, p = {
|
|
39
|
+
linear: t,
|
|
40
|
+
easeInQuad: n,
|
|
41
|
+
easeOutQuad: r,
|
|
42
|
+
easeInOutQuad: i,
|
|
43
|
+
easeInCubic: a,
|
|
44
|
+
easeOutCubic: o,
|
|
45
|
+
easeInOutCubic: s,
|
|
46
|
+
easeInSine: c,
|
|
47
|
+
easeOutSine: l,
|
|
48
|
+
easeInOutSine: u,
|
|
49
|
+
easeOutExpo: d,
|
|
50
|
+
easeOutBack: f
|
|
51
|
+
}, m = /* @__PURE__ */ new Map(), h = new Set(Object.keys(p));
|
|
52
|
+
function g(e) {
|
|
53
|
+
if (typeof e != "string" || e.trim() === "" || e !== e.trim()) throw TypeError("Easing name must be a non-empty string without surrounding whitespace");
|
|
54
|
+
}
|
|
55
|
+
function _(e) {
|
|
56
|
+
if (typeof e != "function") throw TypeError("Easing must be a function");
|
|
57
|
+
}
|
|
58
|
+
function v(e, t) {
|
|
59
|
+
if (g(e), _(t), h.has(e)) throw TypeError(`Cannot replace built-in easing "${e}"`);
|
|
60
|
+
m.set(e, t);
|
|
61
|
+
}
|
|
62
|
+
function y(e) {
|
|
63
|
+
return g(e), Object.prototype.hasOwnProperty.call(p, e) ? p[e] : m.get(e);
|
|
64
|
+
}
|
|
65
|
+
function b(e) {
|
|
66
|
+
return g(e), !h.has(e) && m.delete(e);
|
|
67
|
+
}
|
|
68
|
+
var x = Object.freeze({
|
|
69
|
+
register: v,
|
|
70
|
+
get: y,
|
|
71
|
+
remove: b
|
|
72
|
+
});
|
|
73
|
+
function S(e) {
|
|
74
|
+
if (e === void 0) return t;
|
|
75
|
+
if (typeof e == "function") return e;
|
|
76
|
+
if (typeof e != "string") throw TypeError("easing must be a function or a registered easing name");
|
|
77
|
+
let n = y(e);
|
|
78
|
+
if (!n) throw TypeError(`Unknown easing "${e}"`);
|
|
79
|
+
return n;
|
|
80
|
+
}
|
|
81
|
+
// src/core/motion.ts
|
|
82
|
+
var C = "(prefers-reduced-motion: reduce)";
|
|
83
|
+
function w() {
|
|
84
|
+
return typeof matchMedia == "function" && matchMedia(C)?.matches === !0;
|
|
85
|
+
}
|
|
86
|
+
function T(e) {
|
|
87
|
+
if (typeof matchMedia != "function") return () => void 0;
|
|
88
|
+
let t = matchMedia(C);
|
|
89
|
+
if (!t) return () => void 0;
|
|
90
|
+
let n = (t) => {
|
|
91
|
+
e(t?.matches ?? w());
|
|
92
|
+
};
|
|
93
|
+
return typeof t.addEventListener == "function" ? (t.addEventListener("change", n), () => t.removeEventListener?.("change", n)) : typeof t.addListener == "function" ? (t.addListener(n), () => t.removeListener?.(n)) : () => void 0;
|
|
94
|
+
}
|
|
95
|
+
// src/core/animation.ts
|
|
96
|
+
var ee = 1e3, te = 0, E = /* @__PURE__ */ new Set(), D = null, O = !1, k = null, A = null, j = null, M = 0, N = null, P = !1;
|
|
97
|
+
function F() {
|
|
98
|
+
return typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now();
|
|
99
|
+
}
|
|
100
|
+
function I() {
|
|
101
|
+
return typeof document < "u" && document.hidden;
|
|
102
|
+
}
|
|
103
|
+
function ne() {
|
|
104
|
+
let e = F();
|
|
105
|
+
return e - M - (j === null ? 0 : Math.max(0, e - j));
|
|
106
|
+
}
|
|
107
|
+
function L() {
|
|
108
|
+
k && N && k.removeEventListener("visibilitychange", N), k = null, N = null, P = !1, j = null, M = 0;
|
|
109
|
+
}
|
|
110
|
+
function R() {
|
|
111
|
+
I() ? (j === null && (j = F()), D !== null && (cancelAnimationFrame(D), D = null)) : (j !== null && (M += Math.max(0, F() - j), j = null), z());
|
|
112
|
+
}
|
|
113
|
+
function re() {
|
|
114
|
+
k || typeof document > "u" || (k = document, typeof document.addEventListener != "function" || typeof document.removeEventListener != "function" ? (k = null, I() && (j = F())) : (P = !0, N = R, document.addEventListener("visibilitychange", N), I() && (j = F())));
|
|
115
|
+
}
|
|
116
|
+
function z() {
|
|
117
|
+
D !== null || O || E.size === 0 || P && I() || (D = requestAnimationFrame((e) => {
|
|
118
|
+
if (D = null, I()) {
|
|
119
|
+
P ? R() : (j === null && (j = F()), z());
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
!P && j !== null && (M += Math.max(0, F() - j), j = null), O = !0;
|
|
123
|
+
let t = [];
|
|
124
|
+
try {
|
|
125
|
+
for (let n of [...E]) if (E.has(n)) try {
|
|
126
|
+
n(e - M);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
t.push(e);
|
|
129
|
+
}
|
|
130
|
+
} finally {
|
|
131
|
+
O = !1, z();
|
|
132
|
+
}
|
|
133
|
+
if (t.length > 0) throw t[0];
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
function ie(e) {
|
|
137
|
+
return A !== null && typeof document < "u" && A !== document && (E.clear(), D !== null && (cancelAnimationFrame(D), D = null), L()), typeof document < "u" && (A = document), re(), E.add(e), z(), () => {
|
|
138
|
+
E.delete(e), E.size === 0 && D !== null && (cancelAnimationFrame(D), D = null), E.size === 0 && L();
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function ae(e) {
|
|
142
|
+
if (typeof e != "function") throw TypeError("Animation frame callback must be a function");
|
|
143
|
+
return ie(e);
|
|
144
|
+
}
|
|
145
|
+
function oe(e, t) {
|
|
146
|
+
if (typeof t != "number" || !Number.isFinite(t) || t < 0) throw RangeError(`${e} must be a finite number >= 0, received ${String(t)}`);
|
|
147
|
+
}
|
|
148
|
+
function se(e = {}) {
|
|
149
|
+
let { duration: t = ee, delay: n = te, repeat: r = 0, yoyo: i = !1, playbackRate: a = 1, respectReducedMotion: o = !0, onStart: s, onUpdate: c, onComplete: l, onCancel: u } = e, d = S(e.easing);
|
|
150
|
+
oe("duration", t), oe("delay", n), le(r), ue(i), ce(a);
|
|
151
|
+
let f = null, p = null, m = null, h = n, g = 0, _ = 0, v = 1, y = a, b = !1, x = !0, C = !1, E = !1, D = !1, O = !1, k = !1, A = !1, j = o && w(), M = () => void 0, N = ne, P = (e) => {
|
|
152
|
+
if (j) h = 0, g = +(v > 0);
|
|
153
|
+
else {
|
|
154
|
+
if (h > 0) {
|
|
155
|
+
let t = Math.min(e, h);
|
|
156
|
+
h -= t, e -= t;
|
|
157
|
+
}
|
|
158
|
+
h > 0 || (t === 0 ? g = +(v > 0) : e > 0 && (g = Math.max(0, Math.min(1, g + v * e * y / t))));
|
|
159
|
+
}
|
|
160
|
+
}, F = () => {
|
|
161
|
+
if (p === null || m === null) return;
|
|
162
|
+
let e = N() + m, t = Math.max(0, e - p);
|
|
163
|
+
p = e, P(t);
|
|
164
|
+
}, I = () => {
|
|
165
|
+
x && !b && f === null && (f = ie(re));
|
|
166
|
+
}, L = () => {
|
|
167
|
+
f?.(), f = null;
|
|
168
|
+
}, R = () => {
|
|
169
|
+
E = !0, x = !1, M(), L();
|
|
170
|
+
}, re = (e) => {
|
|
171
|
+
if (!x || b) return;
|
|
172
|
+
m === null && (m = e - N()), p === null && (p = e);
|
|
173
|
+
let t = Math.max(0, e - p);
|
|
174
|
+
if (p = e, P(t), !j && h > 0) {
|
|
175
|
+
I();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!O) {
|
|
179
|
+
O = !0;
|
|
180
|
+
try {
|
|
181
|
+
s?.();
|
|
182
|
+
} catch (e) {
|
|
183
|
+
throw R(), e;
|
|
184
|
+
}
|
|
185
|
+
if (!x || C || b) return;
|
|
186
|
+
}
|
|
187
|
+
let n = v > 0 ? g >= 1 : g <= 0;
|
|
188
|
+
if (n && _ < r && !j) {
|
|
189
|
+
_ += 1;
|
|
190
|
+
try {
|
|
191
|
+
c?.(d(g));
|
|
192
|
+
} catch (e) {
|
|
193
|
+
throw R(), e;
|
|
194
|
+
}
|
|
195
|
+
if (!x || C || b) return;
|
|
196
|
+
i && (v *= -1), g = v > 0 ? 0 : 1, p = e, I();
|
|
197
|
+
} else {
|
|
198
|
+
n && (k = !0, x = !1, L(), M(), D = !0);
|
|
199
|
+
try {
|
|
200
|
+
c?.(d(g));
|
|
201
|
+
} catch (e) {
|
|
202
|
+
throw R(), e;
|
|
203
|
+
} finally {
|
|
204
|
+
n && (D = !1);
|
|
205
|
+
}
|
|
206
|
+
if (n) {
|
|
207
|
+
if (C) return;
|
|
208
|
+
try {
|
|
209
|
+
l?.();
|
|
210
|
+
} catch (e) {
|
|
211
|
+
throw R(), e;
|
|
212
|
+
}
|
|
213
|
+
} else I();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
return o && (M = T((e) => {
|
|
217
|
+
e && x && (j = !0, h = 0, I());
|
|
218
|
+
})), I(), {
|
|
219
|
+
seek: (e) => {
|
|
220
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0 || e > 1) throw RangeError(`progress must be a finite number between 0 and 1, received ${String(e)}`);
|
|
221
|
+
if (!(C || E || k || D)) {
|
|
222
|
+
if (!O) {
|
|
223
|
+
O = !0;
|
|
224
|
+
try {
|
|
225
|
+
s?.();
|
|
226
|
+
} catch (e) {
|
|
227
|
+
throw R(), e;
|
|
228
|
+
}
|
|
229
|
+
if (!x || C) return;
|
|
230
|
+
}
|
|
231
|
+
h = 0, v = 1, g = e, _ = e >= 1 ? r : _, x = e < 1 || _ < r, p = x && m !== null ? N() + m : null, e >= 1 && _ >= r ? (x = !1, L(), M()) : I(), e >= 1 && _ >= r && (D = !0);
|
|
232
|
+
try {
|
|
233
|
+
c?.(d(g));
|
|
234
|
+
} catch (e) {
|
|
235
|
+
throw R(), e;
|
|
236
|
+
} finally {
|
|
237
|
+
e >= 1 && (D = !1);
|
|
238
|
+
}
|
|
239
|
+
if (e >= 1 && _ >= r && (k = !0), e >= 1 && _ >= r && !C) try {
|
|
240
|
+
l?.();
|
|
241
|
+
} catch (e) {
|
|
242
|
+
throw R(), e;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
pause: () => {
|
|
247
|
+
x && !b && (F(), b = !0, p = null, L());
|
|
248
|
+
},
|
|
249
|
+
resume: () => {
|
|
250
|
+
x && b && (b = !1, p = m === null ? null : N() + m, I());
|
|
251
|
+
},
|
|
252
|
+
reverse: () => {
|
|
253
|
+
x && (F(), v *= -1);
|
|
254
|
+
},
|
|
255
|
+
setPlaybackRate: (e) => {
|
|
256
|
+
ce(e), x && F(), y = e;
|
|
257
|
+
},
|
|
258
|
+
getPlaybackRate: () => y,
|
|
259
|
+
cancel: () => {
|
|
260
|
+
(x || D) && (C = !0, R(), !A && (A = !0, u?.()));
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function ce(e) {
|
|
265
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(e)}`);
|
|
266
|
+
}
|
|
267
|
+
function le(e) {
|
|
268
|
+
if (typeof e != "number" || e !== Infinity && (!Number.isInteger(e) || e < 0)) throw RangeError(`repeat must be a non-negative integer or Infinity, received ${String(e)}`);
|
|
269
|
+
}
|
|
270
|
+
function ue(e) {
|
|
271
|
+
if (typeof e != "boolean") throw TypeError(`yoyo must be a boolean, received ${String(e)}`);
|
|
272
|
+
}
|
|
273
|
+
// src/core/motion-dna.ts
|
|
274
|
+
var de = "1.0.0";
|
|
275
|
+
function B(e) {
|
|
276
|
+
if (typeof e != "object" || !e || Object.isFrozen(e)) return e;
|
|
277
|
+
for (let t of Object.keys(e)) {
|
|
278
|
+
let n = e[t];
|
|
279
|
+
typeof n == "object" && n && B(n);
|
|
280
|
+
}
|
|
281
|
+
return Object.freeze(e);
|
|
282
|
+
}
|
|
283
|
+
var V = [
|
|
284
|
+
{
|
|
285
|
+
name: "duration",
|
|
286
|
+
type: "number",
|
|
287
|
+
description: "Baseline animation duration in milliseconds.",
|
|
288
|
+
range: { min: 0 }
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "delay",
|
|
292
|
+
type: "number",
|
|
293
|
+
description: "Delay before animation begins.",
|
|
294
|
+
range: { min: 0 }
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: "playbackRate",
|
|
298
|
+
type: "number",
|
|
299
|
+
description: "Playback speed multiplier.",
|
|
300
|
+
range: { min: .1 }
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "respectReducedMotion",
|
|
304
|
+
type: "boolean",
|
|
305
|
+
description: "Whether to respect reduced-motion preference (defaults to true)."
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "easing",
|
|
309
|
+
type: "EasingOption",
|
|
310
|
+
description: "Default easing function or registered easing name."
|
|
311
|
+
}
|
|
312
|
+
], H = [
|
|
313
|
+
"animate",
|
|
314
|
+
"animateSpring",
|
|
315
|
+
"animateProgress",
|
|
316
|
+
"presets",
|
|
317
|
+
"recipes",
|
|
318
|
+
"choreography",
|
|
319
|
+
"effects"
|
|
320
|
+
], U = [
|
|
321
|
+
{
|
|
322
|
+
id: "dna-snappy",
|
|
323
|
+
name: "snappy",
|
|
324
|
+
personality: "snappy",
|
|
325
|
+
description: "Crisp, responsive, low-latency motion identity for productivity dashboards, toolbars, and high-frequency UI.",
|
|
326
|
+
duration: 200,
|
|
327
|
+
delay: 0,
|
|
328
|
+
playbackRate: 1,
|
|
329
|
+
respectReducedMotion: !0,
|
|
330
|
+
easing: "easeOutQuad",
|
|
331
|
+
characteristics: {
|
|
332
|
+
personality: "snappy",
|
|
333
|
+
intensity: 1.2,
|
|
334
|
+
distanceMultiplier: .75,
|
|
335
|
+
entranceEasing: "easeOutQuad",
|
|
336
|
+
exitEasing: "easeInQuad",
|
|
337
|
+
interactionEasing: "easeOutQuad",
|
|
338
|
+
entranceDurationMultiplier: 1,
|
|
339
|
+
exitDurationMultiplier: .75,
|
|
340
|
+
hoverDurationMultiplier: .5,
|
|
341
|
+
pressDurationMultiplier: .35,
|
|
342
|
+
spring: {
|
|
343
|
+
stiffness: 300,
|
|
344
|
+
damping: 25,
|
|
345
|
+
mass: 1
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
metadata: {
|
|
349
|
+
compatibleSystems: H,
|
|
350
|
+
configurableParameters: V,
|
|
351
|
+
tags: [
|
|
352
|
+
"snappy",
|
|
353
|
+
"quick",
|
|
354
|
+
"responsive",
|
|
355
|
+
"productive",
|
|
356
|
+
"compact"
|
|
357
|
+
],
|
|
358
|
+
exampleUsage: "const options = applyMotionDNA(\"snappy\");",
|
|
359
|
+
examples: ["const options = applyMotionDNA(\"snappy\");"]
|
|
360
|
+
},
|
|
361
|
+
compatibleSystems: H,
|
|
362
|
+
configurableParameters: V,
|
|
363
|
+
tags: [
|
|
364
|
+
"snappy",
|
|
365
|
+
"quick",
|
|
366
|
+
"responsive",
|
|
367
|
+
"productive",
|
|
368
|
+
"compact"
|
|
369
|
+
],
|
|
370
|
+
exampleUsage: "const options = applyMotionDNA(\"snappy\");"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: "dna-energetic",
|
|
374
|
+
name: "energetic",
|
|
375
|
+
personality: "energetic",
|
|
376
|
+
description: "Dynamic, punchy, high-momentum motion identity with subtle overshoot for marketing, onboarding, and CTAs.",
|
|
377
|
+
duration: 320,
|
|
378
|
+
delay: 0,
|
|
379
|
+
playbackRate: 1,
|
|
380
|
+
respectReducedMotion: !0,
|
|
381
|
+
easing: "easeOutCubic",
|
|
382
|
+
characteristics: {
|
|
383
|
+
personality: "energetic",
|
|
384
|
+
intensity: 1.3,
|
|
385
|
+
distanceMultiplier: 1.2,
|
|
386
|
+
entranceEasing: "easeOutBack",
|
|
387
|
+
exitEasing: "easeInCubic",
|
|
388
|
+
interactionEasing: "easeOutBack",
|
|
389
|
+
entranceDurationMultiplier: 1,
|
|
390
|
+
exitDurationMultiplier: .7,
|
|
391
|
+
hoverDurationMultiplier: .6,
|
|
392
|
+
pressDurationMultiplier: .4,
|
|
393
|
+
spring: {
|
|
394
|
+
stiffness: 220,
|
|
395
|
+
damping: 18,
|
|
396
|
+
mass: 1
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
metadata: {
|
|
400
|
+
compatibleSystems: H,
|
|
401
|
+
configurableParameters: V,
|
|
402
|
+
tags: [
|
|
403
|
+
"energetic",
|
|
404
|
+
"punchy",
|
|
405
|
+
"vibrant",
|
|
406
|
+
"marketing",
|
|
407
|
+
"cta",
|
|
408
|
+
"dynamic"
|
|
409
|
+
],
|
|
410
|
+
exampleUsage: "const options = applyMotionDNA(\"energetic\");",
|
|
411
|
+
examples: ["const options = applyMotionDNA(\"energetic\");"]
|
|
412
|
+
},
|
|
413
|
+
compatibleSystems: H,
|
|
414
|
+
configurableParameters: V,
|
|
415
|
+
tags: [
|
|
416
|
+
"energetic",
|
|
417
|
+
"punchy",
|
|
418
|
+
"vibrant",
|
|
419
|
+
"marketing",
|
|
420
|
+
"cta",
|
|
421
|
+
"dynamic"
|
|
422
|
+
],
|
|
423
|
+
exampleUsage: "const options = applyMotionDNA(\"energetic\");"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
id: "dna-calm",
|
|
427
|
+
name: "calm",
|
|
428
|
+
personality: "calm",
|
|
429
|
+
description: "Graceful, fluid, organic motion identity for content-heavy reading, wellness, and editorial layouts.",
|
|
430
|
+
duration: 500,
|
|
431
|
+
delay: 0,
|
|
432
|
+
playbackRate: 1,
|
|
433
|
+
respectReducedMotion: !0,
|
|
434
|
+
easing: "easeOutSine",
|
|
435
|
+
characteristics: {
|
|
436
|
+
personality: "calm",
|
|
437
|
+
intensity: .7,
|
|
438
|
+
distanceMultiplier: 1,
|
|
439
|
+
entranceEasing: "easeOutSine",
|
|
440
|
+
exitEasing: "easeInSine",
|
|
441
|
+
interactionEasing: "easeOutSine",
|
|
442
|
+
entranceDurationMultiplier: 1,
|
|
443
|
+
exitDurationMultiplier: .85,
|
|
444
|
+
hoverDurationMultiplier: .75,
|
|
445
|
+
pressDurationMultiplier: .5,
|
|
446
|
+
spring: {
|
|
447
|
+
stiffness: 120,
|
|
448
|
+
damping: 20,
|
|
449
|
+
mass: 1
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
metadata: {
|
|
453
|
+
compatibleSystems: H,
|
|
454
|
+
configurableParameters: V,
|
|
455
|
+
tags: [
|
|
456
|
+
"calm",
|
|
457
|
+
"gentle",
|
|
458
|
+
"serene",
|
|
459
|
+
"reading",
|
|
460
|
+
"editorial",
|
|
461
|
+
"smooth"
|
|
462
|
+
],
|
|
463
|
+
exampleUsage: "const options = applyMotionDNA(\"calm\");",
|
|
464
|
+
examples: ["const options = applyMotionDNA(\"calm\");"]
|
|
465
|
+
},
|
|
466
|
+
compatibleSystems: H,
|
|
467
|
+
configurableParameters: V,
|
|
468
|
+
tags: [
|
|
469
|
+
"calm",
|
|
470
|
+
"gentle",
|
|
471
|
+
"serene",
|
|
472
|
+
"reading",
|
|
473
|
+
"editorial",
|
|
474
|
+
"smooth"
|
|
475
|
+
],
|
|
476
|
+
exampleUsage: "const options = applyMotionDNA(\"calm\");"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
id: "dna-cinematic",
|
|
480
|
+
name: "cinematic",
|
|
481
|
+
personality: "cinematic",
|
|
482
|
+
description: "Theatrical, expansive, high-friction motion identity with deliberate pacing for hero showcases and storytelling.",
|
|
483
|
+
duration: 600,
|
|
484
|
+
delay: 0,
|
|
485
|
+
playbackRate: 1,
|
|
486
|
+
respectReducedMotion: !0,
|
|
487
|
+
easing: "easeOutCubic",
|
|
488
|
+
characteristics: {
|
|
489
|
+
personality: "cinematic",
|
|
490
|
+
intensity: .9,
|
|
491
|
+
distanceMultiplier: 1.5,
|
|
492
|
+
entranceEasing: "easeOutCubic",
|
|
493
|
+
exitEasing: "easeInCubic",
|
|
494
|
+
interactionEasing: "easeOutCubic",
|
|
495
|
+
entranceDurationMultiplier: 1,
|
|
496
|
+
exitDurationMultiplier: .75,
|
|
497
|
+
hoverDurationMultiplier: .6,
|
|
498
|
+
pressDurationMultiplier: .45,
|
|
499
|
+
spring: {
|
|
500
|
+
stiffness: 140,
|
|
501
|
+
damping: 22,
|
|
502
|
+
mass: 1
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
metadata: {
|
|
506
|
+
compatibleSystems: H,
|
|
507
|
+
configurableParameters: V,
|
|
508
|
+
tags: [
|
|
509
|
+
"cinematic",
|
|
510
|
+
"luxurious",
|
|
511
|
+
"dramatic",
|
|
512
|
+
"theatrical",
|
|
513
|
+
"hero"
|
|
514
|
+
],
|
|
515
|
+
exampleUsage: "const options = applyMotionDNA(\"cinematic\");",
|
|
516
|
+
examples: ["const options = applyMotionDNA(\"cinematic\");"]
|
|
517
|
+
},
|
|
518
|
+
compatibleSystems: H,
|
|
519
|
+
configurableParameters: V,
|
|
520
|
+
tags: [
|
|
521
|
+
"cinematic",
|
|
522
|
+
"luxurious",
|
|
523
|
+
"dramatic",
|
|
524
|
+
"theatrical",
|
|
525
|
+
"hero"
|
|
526
|
+
],
|
|
527
|
+
exampleUsage: "const options = applyMotionDNA(\"cinematic\");"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
id: "dna-minimal",
|
|
531
|
+
name: "minimal",
|
|
532
|
+
personality: "minimal",
|
|
533
|
+
description: "Functional, unobtrusive, lightweight motion identity for data-dense grids, developer tools, and enterprise forms.",
|
|
534
|
+
duration: 150,
|
|
535
|
+
delay: 0,
|
|
536
|
+
playbackRate: 1,
|
|
537
|
+
respectReducedMotion: !0,
|
|
538
|
+
easing: "linear",
|
|
539
|
+
characteristics: {
|
|
540
|
+
personality: "minimal",
|
|
541
|
+
intensity: 1,
|
|
542
|
+
distanceMultiplier: .5,
|
|
543
|
+
entranceEasing: "easeOutQuad",
|
|
544
|
+
exitEasing: "easeInQuad",
|
|
545
|
+
interactionEasing: "linear",
|
|
546
|
+
entranceDurationMultiplier: 1,
|
|
547
|
+
exitDurationMultiplier: .8,
|
|
548
|
+
hoverDurationMultiplier: .4,
|
|
549
|
+
pressDurationMultiplier: .3,
|
|
550
|
+
spring: {
|
|
551
|
+
stiffness: 350,
|
|
552
|
+
damping: 30,
|
|
553
|
+
mass: 1
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
metadata: {
|
|
557
|
+
compatibleSystems: H,
|
|
558
|
+
configurableParameters: V,
|
|
559
|
+
tags: [
|
|
560
|
+
"minimal",
|
|
561
|
+
"subtle",
|
|
562
|
+
"data",
|
|
563
|
+
"grid",
|
|
564
|
+
"enterprise",
|
|
565
|
+
"accessible"
|
|
566
|
+
],
|
|
567
|
+
exampleUsage: "const options = applyMotionDNA(\"minimal\");",
|
|
568
|
+
examples: ["const options = applyMotionDNA(\"minimal\");"]
|
|
569
|
+
},
|
|
570
|
+
compatibleSystems: H,
|
|
571
|
+
configurableParameters: V,
|
|
572
|
+
tags: [
|
|
573
|
+
"minimal",
|
|
574
|
+
"subtle",
|
|
575
|
+
"data",
|
|
576
|
+
"grid",
|
|
577
|
+
"enterprise",
|
|
578
|
+
"accessible"
|
|
579
|
+
],
|
|
580
|
+
exampleUsage: "const options = applyMotionDNA(\"minimal\");"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
id: "dna-playful",
|
|
584
|
+
name: "playful",
|
|
585
|
+
personality: "playful",
|
|
586
|
+
description: "Bouncy, energetic, joyful motion identity with spring rebound for badges, gamification, and delight moments.",
|
|
587
|
+
duration: 380,
|
|
588
|
+
delay: 0,
|
|
589
|
+
playbackRate: 1,
|
|
590
|
+
respectReducedMotion: !0,
|
|
591
|
+
easing: "easeOutBack",
|
|
592
|
+
characteristics: {
|
|
593
|
+
personality: "playful",
|
|
594
|
+
intensity: 1.5,
|
|
595
|
+
distanceMultiplier: 1.3,
|
|
596
|
+
entranceEasing: "easeOutBack",
|
|
597
|
+
exitEasing: "easeInBack",
|
|
598
|
+
interactionEasing: "easeOutBack",
|
|
599
|
+
entranceDurationMultiplier: 1,
|
|
600
|
+
exitDurationMultiplier: .8,
|
|
601
|
+
hoverDurationMultiplier: .5,
|
|
602
|
+
pressDurationMultiplier: .35,
|
|
603
|
+
spring: {
|
|
604
|
+
stiffness: 180,
|
|
605
|
+
damping: 14,
|
|
606
|
+
mass: 1
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
metadata: {
|
|
610
|
+
compatibleSystems: H,
|
|
611
|
+
configurableParameters: V,
|
|
612
|
+
tags: [
|
|
613
|
+
"playful",
|
|
614
|
+
"bouncy",
|
|
615
|
+
"elastic",
|
|
616
|
+
"onboarding",
|
|
617
|
+
"delight",
|
|
618
|
+
"bounce"
|
|
619
|
+
],
|
|
620
|
+
exampleUsage: "const options = applyMotionDNA(\"playful\");",
|
|
621
|
+
examples: ["const options = applyMotionDNA(\"playful\");"]
|
|
622
|
+
},
|
|
623
|
+
compatibleSystems: H,
|
|
624
|
+
configurableParameters: V,
|
|
625
|
+
tags: [
|
|
626
|
+
"playful",
|
|
627
|
+
"bouncy",
|
|
628
|
+
"elastic",
|
|
629
|
+
"onboarding",
|
|
630
|
+
"delight",
|
|
631
|
+
"bounce"
|
|
632
|
+
],
|
|
633
|
+
exampleUsage: "const options = applyMotionDNA(\"playful\");"
|
|
634
|
+
}
|
|
635
|
+
];
|
|
636
|
+
for (let e of U) B(e);
|
|
637
|
+
var fe = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
638
|
+
for (let e of U) e.id && fe.set(e.id, e), e.name && pe.set(e.name, e);
|
|
639
|
+
var me = new Set(U.map((e) => e.id)), he = new Set(U.map((e) => e.name)), W = /* @__PURE__ */ new Map();
|
|
640
|
+
function ge(e) {
|
|
641
|
+
if (typeof e != "string" || e.trim() === "" || e !== e.trim()) throw TypeError("Motion DNA name must be a non-empty string without surrounding whitespace");
|
|
642
|
+
}
|
|
643
|
+
var _e = /* @__PURE__ */ new Set([
|
|
644
|
+
"duration",
|
|
645
|
+
"delay",
|
|
646
|
+
"playbackRate",
|
|
647
|
+
"respectReducedMotion",
|
|
648
|
+
"easing",
|
|
649
|
+
"id",
|
|
650
|
+
"name",
|
|
651
|
+
"personality",
|
|
652
|
+
"description",
|
|
653
|
+
"characteristics",
|
|
654
|
+
"metadata",
|
|
655
|
+
"compatibleSystems",
|
|
656
|
+
"configurableParameters",
|
|
657
|
+
"tags",
|
|
658
|
+
"exampleUsage"
|
|
659
|
+
]);
|
|
660
|
+
function ve(e) {
|
|
661
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Motion DNA must be an object");
|
|
662
|
+
for (let [t, n] of Object.entries(e)) {
|
|
663
|
+
if (!_e.has(t)) throw TypeError(`Unknown Motion DNA option "${t}"`);
|
|
664
|
+
if (t === "duration" || t === "delay") {
|
|
665
|
+
if (typeof n != "number" || !Number.isFinite(n) || n < 0) throw RangeError(`${t} must be a finite number >= 0, received ${String(n)}`);
|
|
666
|
+
} else if (t === "playbackRate") {
|
|
667
|
+
if (typeof n != "number" || !Number.isFinite(n) || n <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(n)}`);
|
|
668
|
+
} else if (t === "respectReducedMotion") {
|
|
669
|
+
if (typeof n != "boolean") throw TypeError(`respectReducedMotion must be a boolean, received ${String(n)}`);
|
|
670
|
+
} else if (t === "easing") {
|
|
671
|
+
if (typeof n != "string" && typeof n != "function") throw TypeError("easing must be a function or a registered easing name");
|
|
672
|
+
S(n);
|
|
673
|
+
} else if (t === "characteristics" && typeof n == "object" && n && !Array.isArray(n)) {
|
|
674
|
+
let e = n;
|
|
675
|
+
if (e.intensity !== void 0 && (typeof e.intensity != "number" || !Number.isFinite(e.intensity) || e.intensity <= 0)) throw RangeError(`intensity must be a finite number > 0, received ${String(e.intensity)}`);
|
|
676
|
+
e.entranceEasing !== void 0 && S(e.entranceEasing), e.exitEasing !== void 0 && S(e.exitEasing), e.interactionEasing !== void 0 && S(e.interactionEasing);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
function G(e) {
|
|
681
|
+
return ge(e), pe.get(e) ?? fe.get(e) ?? W.get(e);
|
|
682
|
+
}
|
|
683
|
+
function ye() {
|
|
684
|
+
let e = Array.from(W.values());
|
|
685
|
+
return Object.freeze([...U, ...e]);
|
|
686
|
+
}
|
|
687
|
+
function be(e) {
|
|
688
|
+
if (!e || typeof e != "string") return [];
|
|
689
|
+
let t = e.trim().toLowerCase();
|
|
690
|
+
if (t.length === 0) return [];
|
|
691
|
+
let n = ye();
|
|
692
|
+
return Object.freeze(n.filter((e) => {
|
|
693
|
+
let n = e.id?.toLowerCase() ?? "", r = e.name?.toLowerCase() ?? "", i = e.description?.toLowerCase() ?? "", a = (e.personality ?? e.characteristics?.personality ?? "").toLowerCase(), o = e.tags ?? e.metadata?.tags ?? [];
|
|
694
|
+
return n.includes(t) || r.includes(t) || i.includes(t) || a.includes(t) || o.some((e) => e.toLowerCase().includes(t));
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
function xe(e, t) {
|
|
698
|
+
if (ge(e), he.has(e) || me.has(e)) throw TypeError(`Cannot overwrite built-in Motion DNA "${e}"`);
|
|
699
|
+
ve(t);
|
|
700
|
+
let n = B({ ...t });
|
|
701
|
+
W.set(e, n), t.id && W.set(t.id, n);
|
|
702
|
+
}
|
|
703
|
+
function Se(e) {
|
|
704
|
+
if (ge(e), he.has(e) || me.has(e)) throw TypeError(`Cannot remove built-in Motion DNA "${e}"`);
|
|
705
|
+
let t = W.get(e);
|
|
706
|
+
return t && t.id && W.delete(t.id), W.delete(e);
|
|
707
|
+
}
|
|
708
|
+
function Ce(e, t = {}) {
|
|
709
|
+
let n = typeof e == "string" ? G(e) : e;
|
|
710
|
+
if (!n) throw TypeError(`Unknown Motion DNA profile "${String(e)}"`);
|
|
711
|
+
let r = {
|
|
712
|
+
...n,
|
|
713
|
+
...t,
|
|
714
|
+
personality: t.personality ?? t.characteristics?.personality ?? n.personality,
|
|
715
|
+
characteristics: {
|
|
716
|
+
...n.characteristics,
|
|
717
|
+
...t.characteristics ?? {},
|
|
718
|
+
personality: t.characteristics?.personality ?? t.personality ?? n.characteristics?.personality ?? n.personality
|
|
719
|
+
},
|
|
720
|
+
metadata: {
|
|
721
|
+
compatibleSystems: t.metadata?.compatibleSystems ?? n.metadata?.compatibleSystems ?? H,
|
|
722
|
+
configurableParameters: t.metadata?.configurableParameters ?? n.metadata?.configurableParameters ?? V,
|
|
723
|
+
tags: t.metadata?.tags ?? n.metadata?.tags ?? n.tags ?? [],
|
|
724
|
+
exampleUsage: t.metadata?.exampleUsage ?? n.metadata?.exampleUsage ?? n.exampleUsage ?? "",
|
|
725
|
+
examples: t.metadata?.examples ?? n.metadata?.examples ?? []
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
return ve(r), B(r);
|
|
729
|
+
}
|
|
730
|
+
function we(e, t) {
|
|
731
|
+
if (typeof e == "string") {
|
|
732
|
+
let n = G(e);
|
|
733
|
+
if (!n) throw TypeError(`Unknown Motion DNA profile "${e}"`);
|
|
734
|
+
return t ? Ce(n, t) : n;
|
|
735
|
+
}
|
|
736
|
+
return t ? Ce(e, t) : B(e);
|
|
737
|
+
}
|
|
738
|
+
function Te(e) {
|
|
739
|
+
let t = [];
|
|
740
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
741
|
+
valid: !1,
|
|
742
|
+
errors: [{ message: "Motion DNA must be an object" }]
|
|
743
|
+
};
|
|
744
|
+
let n = e;
|
|
745
|
+
n.name !== void 0 && (typeof n.name != "string" || n.name.trim() === "") && t.push({
|
|
746
|
+
parameter: "name",
|
|
747
|
+
message: "name must be a non-empty string"
|
|
748
|
+
}), n.duration !== void 0 && (typeof n.duration != "number" || !Number.isFinite(n.duration) || n.duration < 0) && t.push({
|
|
749
|
+
parameter: "duration",
|
|
750
|
+
message: "duration must be a finite number >= 0"
|
|
751
|
+
}), n.delay !== void 0 && (typeof n.delay != "number" || !Number.isFinite(n.delay) || n.delay < 0) && t.push({
|
|
752
|
+
parameter: "delay",
|
|
753
|
+
message: "delay must be a finite number >= 0"
|
|
754
|
+
}), n.playbackRate !== void 0 && (typeof n.playbackRate != "number" || !Number.isFinite(n.playbackRate) || n.playbackRate <= 0) && t.push({
|
|
755
|
+
parameter: "playbackRate",
|
|
756
|
+
message: "playbackRate must be a finite number > 0"
|
|
757
|
+
}), n.respectReducedMotion !== void 0 && typeof n.respectReducedMotion != "boolean" && t.push({
|
|
758
|
+
parameter: "respectReducedMotion",
|
|
759
|
+
message: "respectReducedMotion must be a boolean"
|
|
760
|
+
});
|
|
761
|
+
let r = /* @__PURE__ */ new Set([
|
|
762
|
+
"snappy",
|
|
763
|
+
"energetic",
|
|
764
|
+
"calm",
|
|
765
|
+
"cinematic",
|
|
766
|
+
"minimal",
|
|
767
|
+
"playful"
|
|
768
|
+
]);
|
|
769
|
+
return n.personality !== void 0 && !r.has(n.personality) && t.push({
|
|
770
|
+
parameter: "personality",
|
|
771
|
+
message: `personality must be one of: ${Array.from(r).join(", ")}`
|
|
772
|
+
}), n.characteristics && (n.characteristics.personality !== void 0 && !r.has(n.characteristics.personality) && t.push({
|
|
773
|
+
parameter: "characteristics.personality",
|
|
774
|
+
message: `personality must be one of: ${Array.from(r).join(", ")}`
|
|
775
|
+
}), n.characteristics.intensity !== void 0 && (typeof n.characteristics.intensity != "number" || !Number.isFinite(n.characteristics.intensity) || n.characteristics.intensity <= 0) && t.push({
|
|
776
|
+
parameter: "characteristics.intensity",
|
|
777
|
+
message: "intensity must be a finite number > 0"
|
|
778
|
+
}), n.characteristics.distanceMultiplier !== void 0 && (typeof n.characteristics.distanceMultiplier != "number" || !Number.isFinite(n.characteristics.distanceMultiplier) || n.characteristics.distanceMultiplier < 0) && t.push({
|
|
779
|
+
parameter: "characteristics.distanceMultiplier",
|
|
780
|
+
message: "distanceMultiplier must be a number >= 0"
|
|
781
|
+
})), {
|
|
782
|
+
valid: t.length === 0,
|
|
783
|
+
errors: t
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
function Ee(e, t) {
|
|
787
|
+
let n = we(e, t), r = t?.duration ?? n.duration, i = t?.delay ?? n.delay, a = t?.playbackRate ?? n.playbackRate, o = t?.easing ?? n.easing, s = t?.respectReducedMotion === void 0 ? n.respectReducedMotion : t.respectReducedMotion, c = {};
|
|
788
|
+
return r !== void 0 && (c.duration = r), i !== void 0 && (c.delay = i), a !== void 0 && (c.playbackRate = a), o !== void 0 && (c.easing = o), s !== void 0 && (c.respectReducedMotion = s), c;
|
|
789
|
+
}
|
|
790
|
+
function De(e, t = !0) {
|
|
791
|
+
return JSON.stringify(e, null, t ? 2 : void 0);
|
|
792
|
+
}
|
|
793
|
+
function Oe() {
|
|
794
|
+
let e = ye();
|
|
795
|
+
return {
|
|
796
|
+
$schema: "https://af-motion.dev/schemas/motion-dna-v1.json",
|
|
797
|
+
version: de,
|
|
798
|
+
totalProfiles: e.length,
|
|
799
|
+
profiles: e
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function ke(e) {
|
|
803
|
+
if (typeof e != "string" || e.trim() === "") throw TypeError("Motion DNA JSON must be a non-empty string");
|
|
804
|
+
let t;
|
|
805
|
+
try {
|
|
806
|
+
t = JSON.parse(e, (e, t) => e === "__proto__" || e === "constructor" || e === "prototype" ? void 0 : t);
|
|
807
|
+
} catch (e) {
|
|
808
|
+
throw TypeError(`Invalid Motion DNA JSON: ${e.message}`);
|
|
809
|
+
}
|
|
810
|
+
let n = Te(t);
|
|
811
|
+
if (!n.valid) throw TypeError(`Invalid Motion DNA JSON: ${n.errors.map((e) => e.message).join(", ")}`);
|
|
812
|
+
return ve(t), B(t);
|
|
813
|
+
}
|
|
814
|
+
var Ae = {
|
|
815
|
+
get: G,
|
|
816
|
+
register: xe,
|
|
817
|
+
remove: Se
|
|
818
|
+
}, je = "1.0.0";
|
|
819
|
+
function Me(e, t) {
|
|
820
|
+
if (typeof t != "number" || !Number.isFinite(t) || t <= 0 || t > 1) throw RangeError(`${e} must be a finite number > 0 and <= 1, received ${String(t)}`);
|
|
821
|
+
}
|
|
822
|
+
function Ne(e) {
|
|
823
|
+
for (let [t, n] of Object.entries(e)) {
|
|
824
|
+
if (![
|
|
825
|
+
"duration",
|
|
826
|
+
"delay",
|
|
827
|
+
"playbackRate",
|
|
828
|
+
"respectReducedMotion",
|
|
829
|
+
"easing"
|
|
830
|
+
].includes(t)) throw TypeError(`Unknown animation option "${t}"`);
|
|
831
|
+
if (t === "duration" || t === "delay") {
|
|
832
|
+
if (typeof n != "number" || !Number.isFinite(n) || n < 0) throw RangeError(`${t} must be a finite number >= 0, received ${String(n)}`);
|
|
833
|
+
} else if (t === "playbackRate") {
|
|
834
|
+
if (typeof n != "number" || !Number.isFinite(n) || n <= 0) throw RangeError(`playbackRate must be a finite number > 0, received ${String(n)}`);
|
|
835
|
+
} else if (t === "respectReducedMotion") {
|
|
836
|
+
if (typeof n != "boolean") throw TypeError("respectReducedMotion must be a boolean");
|
|
837
|
+
} else if (t === "easing") {
|
|
838
|
+
if (typeof n != "string" && typeof n != "function") throw TypeError("easing must be a function or a registered easing name");
|
|
839
|
+
S(n);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
function Pe(e) {
|
|
844
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Adaptive motion profile must be an object");
|
|
845
|
+
if (e.intensity !== void 0 && Me("intensity", e.intensity), e.lowPowerIntensity !== void 0 && Me("lowPowerIntensity", e.lowPowerIntensity), e.reducedMotion !== void 0 && e.reducedMotion !== "respect" && e.reducedMotion !== "ignore") throw TypeError("reducedMotion must be \"respect\" or \"ignore\"");
|
|
846
|
+
let { motionDNA: t, intensity: n, lowPowerIntensity: r, reducedMotion: i, ...a } = e;
|
|
847
|
+
Ne(a), e.motionDNA !== void 0 && Ee(e.motionDNA, a);
|
|
848
|
+
}
|
|
849
|
+
function Fe(e) {
|
|
850
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Adaptive motion conditions must be an object");
|
|
851
|
+
for (let t of ["reducedMotion", "lowPower"]) if (e[t] !== void 0 && typeof e[t] != "boolean") throw TypeError(`${t} condition must be a boolean`);
|
|
852
|
+
e.intensity !== void 0 && Me("condition intensity", e.intensity);
|
|
853
|
+
}
|
|
854
|
+
function Ie(e, t = {}, n = {}) {
|
|
855
|
+
if (Pe(e), Fe(t), typeof n != "object" || !n || Array.isArray(n)) throw TypeError("Adaptive motion overrides must be an object");
|
|
856
|
+
Ne(n);
|
|
857
|
+
let { motionDNA: r, intensity: i, lowPowerIntensity: a, reducedMotion: o, ...s } = e, c = r ? Ee(r, s) : s, l = t.intensity ?? (t.lowPower ? a ?? i : i) ?? 1;
|
|
858
|
+
return {
|
|
859
|
+
...c,
|
|
860
|
+
...l === 1 && c.duration === void 0 ? {} : { duration: (c.duration ?? 1e3) / l },
|
|
861
|
+
...t.reducedMotion === !0 ? { respectReducedMotion: (o ?? "respect") === "respect" } : {},
|
|
862
|
+
...n
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
var Le = {
|
|
866
|
+
enabled: !0,
|
|
867
|
+
intensity: 1,
|
|
868
|
+
lowPowerIntensity: .6,
|
|
869
|
+
mobileIntensity: 1,
|
|
870
|
+
reducedMotion: "respect",
|
|
871
|
+
autoDetect: !0
|
|
872
|
+
}, K = { ...Le }, q = /* @__PURE__ */ new Set(), Re = null, J = null;
|
|
873
|
+
function Y() {
|
|
874
|
+
if (q.size === 0) return;
|
|
875
|
+
let e = Ye();
|
|
876
|
+
for (let t of q) try {
|
|
877
|
+
t(e);
|
|
878
|
+
} catch {}
|
|
879
|
+
}
|
|
880
|
+
function ze() {
|
|
881
|
+
q.size !== 0 && (Re ||= T(() => {
|
|
882
|
+
Y();
|
|
883
|
+
}), !J && typeof window < "u" && typeof window.addEventListener == "function" && (J = () => {
|
|
884
|
+
Y();
|
|
885
|
+
}, window.addEventListener("resize", J)));
|
|
886
|
+
}
|
|
887
|
+
function Be() {
|
|
888
|
+
q.size > 0 || (Re &&= (Re(), null), J && typeof window < "u" && typeof window.removeEventListener == "function" && (window.removeEventListener("resize", J), J = null));
|
|
889
|
+
}
|
|
890
|
+
function Ve(e) {
|
|
891
|
+
let t = typeof window < "u", n = w(), r = typeof navigator < "u" && !!navigator.connection?.saveData, i = typeof navigator < "u" && typeof navigator.hardwareConcurrency == "number" ? navigator.hardwareConcurrency : 4, a = t && typeof window.innerWidth == "number" ? window.innerWidth : 1024, o = {
|
|
892
|
+
reducedMotion: n,
|
|
893
|
+
lowPower: r,
|
|
894
|
+
saveData: r,
|
|
895
|
+
hardwareConcurrency: i,
|
|
896
|
+
viewportWidth: a,
|
|
897
|
+
viewportHeight: t && typeof window.innerHeight == "number" ? window.innerHeight : 768,
|
|
898
|
+
isMobile: a > 0 && a < 768,
|
|
899
|
+
reducedTransparency: typeof matchMedia == "function" && matchMedia("(prefers-reduced-transparency: reduce)")?.matches === !0
|
|
900
|
+
};
|
|
901
|
+
return Object.freeze(e ? {
|
|
902
|
+
...o,
|
|
903
|
+
...e
|
|
904
|
+
} : o);
|
|
905
|
+
}
|
|
906
|
+
function He() {
|
|
907
|
+
return Object.freeze({ ...K });
|
|
908
|
+
}
|
|
909
|
+
function Ue(e) {
|
|
910
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Adaptive motion config must be an object");
|
|
911
|
+
if (e.intensity !== void 0 && (typeof e.intensity != "number" || !Number.isFinite(e.intensity) || e.intensity <= 0 || e.intensity > 2)) throw RangeError(`intensity must be a finite number > 0 and <= 2, received ${String(e.intensity)}`);
|
|
912
|
+
if (e.lowPowerIntensity !== void 0 && (typeof e.lowPowerIntensity != "number" || !Number.isFinite(e.lowPowerIntensity) || e.lowPowerIntensity <= 0 || e.lowPowerIntensity > 2)) throw RangeError(`lowPowerIntensity must be a finite number > 0 and <= 2, received ${String(e.lowPowerIntensity)}`);
|
|
913
|
+
if (e.mobileIntensity !== void 0 && (typeof e.mobileIntensity != "number" || !Number.isFinite(e.mobileIntensity) || e.mobileIntensity <= 0 || e.mobileIntensity > 2)) throw RangeError(`mobileIntensity must be a finite number > 0 and <= 2, received ${String(e.mobileIntensity)}`);
|
|
914
|
+
if (e.reducedMotion !== void 0 && e.reducedMotion !== "respect" && e.reducedMotion !== "ignore") throw TypeError("reducedMotion must be \"respect\" or \"ignore\"");
|
|
915
|
+
if (e.enabled !== void 0 && typeof e.enabled != "boolean") throw TypeError("enabled must be a boolean");
|
|
916
|
+
K = {
|
|
917
|
+
...K,
|
|
918
|
+
...e
|
|
919
|
+
}, Y();
|
|
920
|
+
}
|
|
921
|
+
function We() {
|
|
922
|
+
K = { ...Le }, Y();
|
|
923
|
+
}
|
|
924
|
+
function Ge(e) {
|
|
925
|
+
Ue({ enabled: e });
|
|
926
|
+
}
|
|
927
|
+
function Ke(e = !0) {
|
|
928
|
+
Ue({ enabled: e });
|
|
929
|
+
}
|
|
930
|
+
function qe() {
|
|
931
|
+
Ue({ enabled: !1 });
|
|
932
|
+
}
|
|
933
|
+
function Je() {
|
|
934
|
+
return K.enabled ?? !0;
|
|
935
|
+
}
|
|
936
|
+
function Ye(e) {
|
|
937
|
+
e !== void 0 && Fe(e);
|
|
938
|
+
let t = Ve(), n = K.enabled ?? !0, r = e?.reducedMotion === void 0 ? K.reducedMotion !== "ignore" && t.reducedMotion : e.reducedMotion, i = 1;
|
|
939
|
+
return n && (e?.intensity === void 0 ? e?.lowPower ?? K.conditions?.lowPower ?? t.lowPower ? i = K.lowPowerIntensity ?? .6 : t.isMobile && K.mobileIntensity !== void 0 ? i = K.mobileIntensity : K.intensity !== void 0 && (i = K.intensity) : i = e.intensity), Object.freeze({
|
|
940
|
+
enabled: n,
|
|
941
|
+
context: t,
|
|
942
|
+
config: Object.freeze({ ...K }),
|
|
943
|
+
effectiveIntensity: i,
|
|
944
|
+
isReducedMotion: r
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
function Xe(e) {
|
|
948
|
+
if (typeof e != "function") throw TypeError("Adaptive motion listener must be a function");
|
|
949
|
+
return q.add(e), ze(), () => {
|
|
950
|
+
q.delete(e), Be();
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
function Ze(e, t) {
|
|
954
|
+
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Animation options must be an object");
|
|
955
|
+
let n = Ye(t);
|
|
956
|
+
if (!n.enabled && !t) return {
|
|
957
|
+
...e,
|
|
958
|
+
...n.isReducedMotion ? { respectReducedMotion: !0 } : {}
|
|
959
|
+
};
|
|
960
|
+
let r = n.effectiveIntensity, i = { ...e };
|
|
961
|
+
if (typeof e.duration == "number" && e.duration > 0 && r !== 1 && (i.duration = Math.round(e.duration / r)), e.propertyDuration && typeof e.propertyDuration == "object" && r !== 1) {
|
|
962
|
+
let t = {};
|
|
963
|
+
for (let [n, i] of Object.entries(e.propertyDuration)) t[n] = typeof i == "number" && i > 0 ? Math.round(i / r) : i;
|
|
964
|
+
i.propertyDuration = t;
|
|
965
|
+
}
|
|
966
|
+
return n.isReducedMotion && (i.respectReducedMotion = !0), i;
|
|
967
|
+
}
|
|
968
|
+
// src/core/transform.ts
|
|
969
|
+
var X = /* @__PURE__ */ new WeakMap();
|
|
970
|
+
function Qe(e) {
|
|
971
|
+
let t = e.style.transform ?? "", n = typeof e.style.getPropertyPriority == "function" ? e.style.getPropertyPriority("transform") : "", r = t, i = "";
|
|
972
|
+
if (r === "" && typeof getComputedStyle == "function") {
|
|
973
|
+
let t = getComputedStyle(e).transform;
|
|
974
|
+
t && t !== "none" && (r = t, i = t);
|
|
975
|
+
}
|
|
976
|
+
return {
|
|
977
|
+
original: t,
|
|
978
|
+
originalPriority: n,
|
|
979
|
+
base: r,
|
|
980
|
+
computedBase: i,
|
|
981
|
+
layers: /* @__PURE__ */ new Map()
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
function $e(e, t) {
|
|
985
|
+
let n = [t.base, ...t.layers.values()].filter((e) => e !== "");
|
|
986
|
+
n.length === 0 ? typeof e.style.removeProperty == "function" ? e.style.removeProperty("transform") : delete e.style.transform : typeof e.style.setProperty == "function" ? e.style.setProperty("transform", n.join(" "), t.originalPriority) : e.style.transform = n.join(" ");
|
|
987
|
+
}
|
|
988
|
+
function et(e, t, n) {
|
|
989
|
+
let r = X.get(e);
|
|
990
|
+
r || (r = Qe(e), X.set(e, r)), r.layers.set(t, n), $e(e, r);
|
|
991
|
+
}
|
|
992
|
+
function tt(e) {
|
|
993
|
+
let t = X.get(e);
|
|
994
|
+
if (t) return {
|
|
995
|
+
value: t.original === "" ? null : t.original,
|
|
996
|
+
priority: t.originalPriority
|
|
997
|
+
};
|
|
998
|
+
let n = typeof e.style.getPropertyValue == "function" ? e.style.getPropertyValue("transform") : e.style.transform ?? "", r = typeof e.style.getPropertyPriority == "function" ? e.style.getPropertyPriority("transform") : "";
|
|
999
|
+
return {
|
|
1000
|
+
value: n === "" ? null : n,
|
|
1001
|
+
priority: r
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
function nt(e, t, n = "") {
|
|
1005
|
+
let r = X.get(e);
|
|
1006
|
+
r ? (r.original = t ?? "", r.originalPriority = n, r.base = t ?? r.computedBase, $e(e, r)) : t === null ? typeof e.style.removeProperty == "function" ? e.style.removeProperty("transform") : delete e.style.transform : typeof e.style.setProperty == "function" ? e.style.setProperty("transform", t, n) : e.style.transform = t;
|
|
1007
|
+
}
|
|
1008
|
+
function rt(e, t) {
|
|
1009
|
+
let n = X.get(e);
|
|
1010
|
+
n?.layers.delete(t) && (n.layers.size > 0 ? $e(e, n) : (X.delete(e), n.original === "" ? typeof e.style.removeProperty == "function" ? e.style.removeProperty("transform") : delete e.style.transform : typeof e.style.setProperty == "function" ? e.style.setProperty("transform", n.original, n.originalPriority) : e.style.transform = n.original));
|
|
1011
|
+
}
|
|
1012
|
+
var it = /* @__PURE__ */ new WeakMap();
|
|
1013
|
+
function at(e, t) {
|
|
1014
|
+
return {
|
|
1015
|
+
value: e.style.getPropertyValue(t),
|
|
1016
|
+
priority: e.style.getPropertyPriority(t)
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
function ot(e, t, n) {
|
|
1020
|
+
n.value === "" ? e.style.removeProperty(t) : e.style.setProperty(t, n.value, n.priority);
|
|
1021
|
+
}
|
|
1022
|
+
function st(e) {
|
|
1023
|
+
let t = it.get(e);
|
|
1024
|
+
if (t) {
|
|
1025
|
+
t.count++;
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
let n = at(e, "position"), r = at(e, "isolation"), i = typeof getComputedStyle == "function" ? getComputedStyle(e) : void 0, a = (i?.position ?? (n.value || "static")) === "static", o = (i?.isolation ?? r.value) !== "isolate";
|
|
1029
|
+
a && e.style.setProperty("position", "relative"), o && e.style.setProperty("isolation", "isolate"), it.set(e, {
|
|
1030
|
+
count: 1,
|
|
1031
|
+
position: n,
|
|
1032
|
+
isolation: r,
|
|
1033
|
+
restorePosition: a,
|
|
1034
|
+
restoreIsolation: o
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
function ct(e) {
|
|
1038
|
+
let t = it.get(e);
|
|
1039
|
+
t && (t.count--, !(t.count > 0) && (it.delete(e), t.restorePosition && ot(e, "position", t.position), t.restoreIsolation && ot(e, "isolation", t.isolation)));
|
|
1040
|
+
}
|
|
1041
|
+
// src/core/animate.ts
|
|
1042
|
+
var lt = /(?<![\w#.])(?<!\w-)-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi, ut = "([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?%?)", dt = RegExp(`^(rgb|rgba)\\(\\s*${ut}\\s*,\\s*${ut}\\s*,\\s*${ut}(?:\\s*,\\s*${ut})?\\s*\\)$`, "i"), ft = 1e3, Z = /* @__PURE__ */ new WeakMap(), pt = 0, mt = /* @__PURE__ */ new Set(/* @__PURE__ */ "clipRule.fillOpacity.fillRule.floodColor.floodOpacity.fontSize.fontWeight.letterSpacing.lightingColor.markerEnd.markerMid.markerStart.paintOrder.shapeRendering.stopColor.stopOpacity.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.textAnchor.transformOrigin.vectorEffect".split("."));
|
|
1043
|
+
function ht(e, t) {
|
|
1044
|
+
return $(e) && mt.has(t) ? kt(t) : t;
|
|
1045
|
+
}
|
|
1046
|
+
function gt(e, t) {
|
|
1047
|
+
if ($(e)) return {
|
|
1048
|
+
value: e.getAttribute(t),
|
|
1049
|
+
priority: ""
|
|
1050
|
+
};
|
|
1051
|
+
let n = kt(t);
|
|
1052
|
+
return n === "transform" ? tt(e) : {
|
|
1053
|
+
value: typeof e.style.getPropertyValue == "function" ? e.style.getPropertyValue(n) || null : e.style[n] || null,
|
|
1054
|
+
priority: typeof e.style.getPropertyPriority == "function" ? e.style.getPropertyPriority(n) : ""
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function _t(e, t, n, r) {
|
|
1058
|
+
if ($(e)) {
|
|
1059
|
+
n === null ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
let i = kt(t);
|
|
1063
|
+
i === "transform" ? nt(e, n, r) : n === null ? e.style.removeProperty(i) : e.style.setProperty(i, n, r);
|
|
1064
|
+
}
|
|
1065
|
+
function vt(e, t) {
|
|
1066
|
+
t = ht(e, t);
|
|
1067
|
+
let n = Z.get(e);
|
|
1068
|
+
n || (n = /* @__PURE__ */ new Map(), Z.set(e, n));
|
|
1069
|
+
let r = n.get(t);
|
|
1070
|
+
return r || (r = {
|
|
1071
|
+
...gt(e, t),
|
|
1072
|
+
order: -1,
|
|
1073
|
+
layers: /* @__PURE__ */ new Map()
|
|
1074
|
+
}, n.set(t, r)), r;
|
|
1075
|
+
}
|
|
1076
|
+
function yt(e, t, n) {
|
|
1077
|
+
let r;
|
|
1078
|
+
for (let e of n.layers.values()) e.order > n.order && (!r || e.order > r.order) && (r = e);
|
|
1079
|
+
r ? _t(e, t, r.value, "") : _t(e, t, n.value, n.priority);
|
|
1080
|
+
}
|
|
1081
|
+
function bt(e, t, n, r, i) {
|
|
1082
|
+
t = ht(e, t);
|
|
1083
|
+
let a = vt(e, t);
|
|
1084
|
+
a.layers.set(n, {
|
|
1085
|
+
order: r,
|
|
1086
|
+
value: i
|
|
1087
|
+
}), yt(e, t, a);
|
|
1088
|
+
}
|
|
1089
|
+
function xt(e, t, n, r, i) {
|
|
1090
|
+
t = ht(e, t);
|
|
1091
|
+
let a = Z.get(e)?.get(t), o = a?.layers.get(n);
|
|
1092
|
+
if (a && o && (a.layers.delete(n), i && o.order >= a.order && (a.value = o.value, a.priority = "", a.order = r), yt(e, t, a), a.layers.size === 0)) {
|
|
1093
|
+
let n = Z.get(e);
|
|
1094
|
+
n?.delete(t), n?.size === 0 && Z.delete(e);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
function St(e) {
|
|
1098
|
+
let t = [], n = [], r = 0;
|
|
1099
|
+
for (let i of e.matchAll(lt)) t.push(e.slice(r, i.index)), n.push(Number(i[0])), r = i.index + i[0].length;
|
|
1100
|
+
return t.push(e.slice(r)), {
|
|
1101
|
+
parts: t,
|
|
1102
|
+
numbers: n
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
function Q(e) {
|
|
1106
|
+
let t = e * 1e6;
|
|
1107
|
+
return String(Number.isFinite(t) ? Math.round(t) / 1e6 : e);
|
|
1108
|
+
}
|
|
1109
|
+
function Ct(e) {
|
|
1110
|
+
let t = /^#(?:([\da-f])([\da-f])([\da-f])|([\da-f]{2})([\da-f]{2})([\da-f]{2}))$/i.exec(e);
|
|
1111
|
+
if (t) {
|
|
1112
|
+
let e = (t[1] === void 0 ? [
|
|
1113
|
+
t[4],
|
|
1114
|
+
t[5],
|
|
1115
|
+
t[6]
|
|
1116
|
+
] : [
|
|
1117
|
+
t[1] + t[1],
|
|
1118
|
+
t[2] + t[2],
|
|
1119
|
+
t[3] + t[3]
|
|
1120
|
+
]).map((e) => Number.parseInt(e, 16));
|
|
1121
|
+
return {
|
|
1122
|
+
channels: [
|
|
1123
|
+
e[0],
|
|
1124
|
+
e[1],
|
|
1125
|
+
e[2],
|
|
1126
|
+
1
|
|
1127
|
+
],
|
|
1128
|
+
hasAlpha: !1,
|
|
1129
|
+
channelsAsPercent: !1
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
let n = dt.exec(e);
|
|
1133
|
+
if (!n) return null;
|
|
1134
|
+
let r = n[1]?.toLowerCase(), i = [
|
|
1135
|
+
n[2],
|
|
1136
|
+
n[3],
|
|
1137
|
+
n[4]
|
|
1138
|
+
], a = n[5];
|
|
1139
|
+
if (r === "rgba" && a === void 0) return null;
|
|
1140
|
+
let o = i.every((e) => e?.endsWith("%")), s = i.map((e) => {
|
|
1141
|
+
if (e === void 0) return NaN;
|
|
1142
|
+
let t = e.endsWith("%"), n = Number(t ? e.slice(0, -1) : e);
|
|
1143
|
+
return Math.min(255, Math.max(0, t ? n * 2.55 : n));
|
|
1144
|
+
}), c = a === void 0 ? 1 : Number(a.endsWith("%") ? a.slice(0, -1) : a) / (a.endsWith("%") ? 100 : 1), l = Math.min(1, Math.max(0, c));
|
|
1145
|
+
return [...s, l].every(Number.isFinite) ? {
|
|
1146
|
+
channels: [
|
|
1147
|
+
s[0],
|
|
1148
|
+
s[1],
|
|
1149
|
+
s[2],
|
|
1150
|
+
l
|
|
1151
|
+
],
|
|
1152
|
+
hasAlpha: a !== void 0,
|
|
1153
|
+
channelsAsPercent: o
|
|
1154
|
+
} : null;
|
|
1155
|
+
}
|
|
1156
|
+
var wt = {
|
|
1157
|
+
translate: [1, 2],
|
|
1158
|
+
scale: [1, 2],
|
|
1159
|
+
rotate: [1, 3],
|
|
1160
|
+
skewX: [1],
|
|
1161
|
+
skewY: [1],
|
|
1162
|
+
matrix: [6]
|
|
1163
|
+
}, Tt = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?$/i;
|
|
1164
|
+
function Et(e) {
|
|
1165
|
+
let t = [], n = /\s*,?\s*([A-Za-z]+)\s*\(([^()]*)\)/y, r = 0;
|
|
1166
|
+
for (; r < e.length && e.slice(r).trim() !== "";) {
|
|
1167
|
+
n.lastIndex = r;
|
|
1168
|
+
let i = n.exec(e);
|
|
1169
|
+
if (!i || t.length === 0 && i[0].trimStart().startsWith(",")) return null;
|
|
1170
|
+
let a = i[1], o = wt[a];
|
|
1171
|
+
if (!o) return null;
|
|
1172
|
+
let s = i[2].trim(), c = s === "" ? [] : s.split(/\s*,\s*|\s+/);
|
|
1173
|
+
if (!o.includes(c.length) || !c.every((e) => Tt.test(e))) return null;
|
|
1174
|
+
let l = c.map(Number);
|
|
1175
|
+
if (!l.every(Number.isFinite)) return null;
|
|
1176
|
+
a === "translate" && l.length === 1 && l.push(0), a === "scale" && l.length === 1 && l.push(l[0]), a === "rotate" && l.length === 1 && l.push(0, 0), t.push({
|
|
1177
|
+
name: a,
|
|
1178
|
+
params: l
|
|
1179
|
+
}), r = n.lastIndex;
|
|
1180
|
+
}
|
|
1181
|
+
return t.length > 0 ? t : null;
|
|
1182
|
+
}
|
|
1183
|
+
function Dt(e, t) {
|
|
1184
|
+
let n = Et(e), r = Et(t);
|
|
1185
|
+
return n !== null && r !== null && n.length === r.length && n.every((e, t) => e.name === r[t].name) ? (i) => {
|
|
1186
|
+
if (i === 0) return e;
|
|
1187
|
+
if (i === 1) return t;
|
|
1188
|
+
let a = n.map((e, t) => {
|
|
1189
|
+
let n = r[t].params, a = e.params.map((e, t) => e + (n[t] - e) * i);
|
|
1190
|
+
if (!a.every(Number.isFinite)) return null;
|
|
1191
|
+
let o = e.name === "rotate" && a[1] === 0 && a[2] === 0 ? a.slice(0, 1) : a;
|
|
1192
|
+
return `${e.name}(${o.map(Q).join(" ")})`;
|
|
1193
|
+
});
|
|
1194
|
+
return a.includes(null) ? i >= 1 ? t : e : a.join(" ");
|
|
1195
|
+
} : (n) => n >= 1 ? t : e;
|
|
1196
|
+
}
|
|
1197
|
+
function Ot(e, t) {
|
|
1198
|
+
let n = St(e), r = St(t), i = n.numbers.length > 0 && n.numbers.length === r.numbers.length && n.numbers.every(Number.isFinite) && r.numbers.every(Number.isFinite) && n.parts.every((e, t) => e === r.parts[t]), a = Ct(e), o = Ct(t), s = (e) => /^\s*(?:#|rgba?\s*\()/i.test(e);
|
|
1199
|
+
if ((s(e) || s(t)) && !(a && o && i)) {
|
|
1200
|
+
if (!a || !o) return (n) => n >= 1 ? t : e;
|
|
1201
|
+
let n = a.hasAlpha || o.hasAlpha, r = a.channelsAsPercent && o.channelsAsPercent;
|
|
1202
|
+
return (i) => {
|
|
1203
|
+
if (i === 0) return e;
|
|
1204
|
+
if (i === 1) return t;
|
|
1205
|
+
let s = a.channels.map((e, t) => {
|
|
1206
|
+
let n = e + (o.channels[t] - e) * i;
|
|
1207
|
+
return t < 3 && r ? n / 2.55 : n;
|
|
1208
|
+
});
|
|
1209
|
+
if (!s.every(Number.isFinite)) return i >= 1 ? t : e;
|
|
1210
|
+
let [c, l, u, d] = s, f = r ? `${Q(c)}%, ${Q(l)}%, ${Q(u)}%` : `${Q(c)}, ${Q(l)}, ${Q(u)}`;
|
|
1211
|
+
return n ? `rgba(${f}, ${Q(d)})` : `rgb(${f})`;
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
return i ? (i) => {
|
|
1215
|
+
if (i === 0) return e;
|
|
1216
|
+
if (i === 1) return t;
|
|
1217
|
+
let a = n.parts[0], o = [];
|
|
1218
|
+
return n.numbers.forEach((e, t) => {
|
|
1219
|
+
let n = r.numbers[t];
|
|
1220
|
+
o.push(e + (n - e) * i);
|
|
1221
|
+
}), o.every(Number.isFinite) ? (o.forEach((e, t) => {
|
|
1222
|
+
a += Q(e) + n.parts[t + 1];
|
|
1223
|
+
}), a) : i >= 1 ? t : e;
|
|
1224
|
+
} : (n) => n >= 1 ? t : e;
|
|
1225
|
+
}
|
|
1226
|
+
function kt(e) {
|
|
1227
|
+
if (e.startsWith("--")) return e;
|
|
1228
|
+
let t = e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
1229
|
+
return t.startsWith("ms-") ? `-${t}` : t;
|
|
1230
|
+
}
|
|
1231
|
+
function At(e, t) {
|
|
1232
|
+
if (typeof t == "number" && Number.isFinite(t)) return String(t);
|
|
1233
|
+
if (typeof t == "string" && t.trim() !== "") return t.trim();
|
|
1234
|
+
throw TypeError(`Invalid value for "${e}": expected a finite number or non-empty string, received ${String(t)}`);
|
|
1235
|
+
}
|
|
1236
|
+
function jt(e, t, n, r, i, a, o, s = !1) {
|
|
1237
|
+
let c = Object.entries(e);
|
|
1238
|
+
if (c.length === 0) throw TypeError("animate() requires at least one property to animate");
|
|
1239
|
+
if (n !== void 0 && (typeof n != "object" || !n || Array.isArray(n))) throw TypeError("propertyKeyframeOffsets must be an object keyed by property name");
|
|
1240
|
+
let l = new Set(c.map(([e]) => e));
|
|
1241
|
+
for (let e of Object.keys(n ?? {})) if (!l.has(e)) throw TypeError(`propertyKeyframeOffsets["${e}"] does not match an animated property`);
|
|
1242
|
+
let u = c.map(([e, c]) => {
|
|
1243
|
+
if (!Array.isArray(c) || c.length < 2) throw TypeError(`Property "${e}" must contain at least two keyframe values`);
|
|
1244
|
+
let l = c.map((t) => At(e, t)), u = n?.[e] ?? l.map((e, t) => t / (l.length - 1));
|
|
1245
|
+
if (!Array.isArray(u) || u.length !== l.length) throw TypeError(`propertyKeyframeOffsets["${e}"] must contain one offset for each of its ${l.length} keyframes`);
|
|
1246
|
+
u.forEach((t, n) => {
|
|
1247
|
+
if (typeof t != "number" || !Number.isFinite(t) || t < 0 || t > 1) throw RangeError(`propertyKeyframeOffsets["${e}"][${n}] must be a finite number between 0 and 1`);
|
|
1248
|
+
if (n > 0 && t <= u[n - 1]) throw RangeError(`propertyKeyframeOffsets["${e}"] must be strictly increasing`);
|
|
1249
|
+
});
|
|
1250
|
+
let d = s && e === "transform" ? Dt : Ot, f = l.slice(0, -1).map((e, t) => d(e, l[t + 1])), p = f.length, m = i?.[e] ?? 0, h = a?.[e] ?? o;
|
|
1251
|
+
Mt(`propertyDelay["${e}"]`, m), Mt(`propertyDuration["${e}"]`, h);
|
|
1252
|
+
let g = m + h;
|
|
1253
|
+
if (!Number.isFinite(g)) throw RangeError(`propertyDelay["${e}"] + propertyDuration["${e}"] must be finite`);
|
|
1254
|
+
return {
|
|
1255
|
+
name: e,
|
|
1256
|
+
from: l[0],
|
|
1257
|
+
easing: t?.[e] === void 0 ? r : S(t[e]),
|
|
1258
|
+
delay: m,
|
|
1259
|
+
duration: h,
|
|
1260
|
+
valueAt: (e) => {
|
|
1261
|
+
let t = u[0], n = u[p];
|
|
1262
|
+
if (e < t) {
|
|
1263
|
+
if (t > 0) return f[0](0);
|
|
1264
|
+
let n = u[1];
|
|
1265
|
+
return f[0](e / n);
|
|
1266
|
+
}
|
|
1267
|
+
if (e > n) {
|
|
1268
|
+
if (n < 1) return f[p - 1](1);
|
|
1269
|
+
let t = u[p - 1];
|
|
1270
|
+
return f[p - 1]((e - t) / (n - t));
|
|
1271
|
+
}
|
|
1272
|
+
if (e === t) return f[0](0);
|
|
1273
|
+
if (e === n) return f[p - 1](1);
|
|
1274
|
+
let r = 0;
|
|
1275
|
+
for (; r < p - 1 && e > u[r + 1];) r += 1;
|
|
1276
|
+
let i = u[r], a = u[r + 1], o = (e - i) / (a - i);
|
|
1277
|
+
return f[r](o);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
});
|
|
1281
|
+
return {
|
|
1282
|
+
animations: u,
|
|
1283
|
+
duration: u.reduce((e, t) => Math.max(e, t.delay + t.duration), 0)
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
function Mt(e, t) {
|
|
1287
|
+
if (typeof t != "number" || !Number.isFinite(t) || t < 0) throw RangeError(`${e} must be a finite number >= 0, received ${String(t)}`);
|
|
1288
|
+
}
|
|
1289
|
+
function Nt(e, t) {
|
|
1290
|
+
if (t !== void 0) {
|
|
1291
|
+
if (typeof t != "object" || !t || Array.isArray(t)) throw TypeError(`${e} must be an object keyed by property name`);
|
|
1292
|
+
for (let [n, r] of Object.entries(t)) Mt(`${e}["${n}"]`, r);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function Pt(e) {
|
|
1296
|
+
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
1297
|
+
}
|
|
1298
|
+
function $(e) {
|
|
1299
|
+
return typeof SVGElement < "u" && e instanceof SVGElement;
|
|
1300
|
+
}
|
|
1301
|
+
function Ft(e) {
|
|
1302
|
+
return Pt(e) || $(e);
|
|
1303
|
+
}
|
|
1304
|
+
function It(e, t) {
|
|
1305
|
+
if (typeof e != "string") {
|
|
1306
|
+
if (!Pt(e) && (!t || !$(e))) throw TypeError("animate() target must be an HTMLElement, SVGElement, or a CSS selector string");
|
|
1307
|
+
return [e];
|
|
1308
|
+
}
|
|
1309
|
+
if (typeof document > "u") throw Error(`Cannot resolve selector "${e}": document is not available`);
|
|
1310
|
+
let n;
|
|
1311
|
+
try {
|
|
1312
|
+
n = document.querySelectorAll(e);
|
|
1313
|
+
} catch (t) {
|
|
1314
|
+
throw SyntaxError(`Invalid CSS selector "${e}"`, { cause: t });
|
|
1315
|
+
}
|
|
1316
|
+
return t ? Array.from(n).filter(Ft) : Array.from(n).filter(Pt);
|
|
1317
|
+
}
|
|
1318
|
+
function Lt(e) {
|
|
1319
|
+
return It(e, !1).filter(Pt);
|
|
1320
|
+
}
|
|
1321
|
+
function Rt(e, t, n = {}) {
|
|
1322
|
+
let { respectReducedMotion: r = !0, propertyEasing: i, propertyKeyframeOffsets: a, propertyDelay: o, propertyDuration: s, fill: c, ...l } = n.adaptive ? Ze(n, typeof n.adaptive == "object" ? n.adaptive : void 0) : n;
|
|
1323
|
+
if (c !== void 0 && ![
|
|
1324
|
+
"none",
|
|
1325
|
+
"forwards",
|
|
1326
|
+
"backwards",
|
|
1327
|
+
"both"
|
|
1328
|
+
].includes(c)) throw TypeError(`fill must be "none", "forwards", "backwards", or "both", received ${String(c)}`);
|
|
1329
|
+
let u = l.onUpdate, d = S(l.easing), f = l.duration ?? ft;
|
|
1330
|
+
(o !== void 0 || s !== void 0) && (Mt("duration", f), Nt("propertyDelay", o), Nt("propertyDuration", s));
|
|
1331
|
+
let p = It(e, !0), { animations: m, duration: h } = jt(t, i, a, d, o, s, f, p.length > 0 && p.every($)), g = {
|
|
1332
|
+
...l,
|
|
1333
|
+
duration: o === void 0 && s === void 0 ? l.duration : h
|
|
1334
|
+
};
|
|
1335
|
+
if (p.length === 0) {
|
|
1336
|
+
let e = se({
|
|
1337
|
+
...g,
|
|
1338
|
+
onStart: void 0,
|
|
1339
|
+
onUpdate: void 0,
|
|
1340
|
+
onComplete: void 0,
|
|
1341
|
+
onCancel: void 0
|
|
1342
|
+
});
|
|
1343
|
+
return e.cancel(), e;
|
|
1344
|
+
}
|
|
1345
|
+
let _ = {}, v = ++pt, y = !1, b = (e) => {
|
|
1346
|
+
if (!y) {
|
|
1347
|
+
y = !0;
|
|
1348
|
+
for (let t of m) for (let n of p) xt(n, t.name, _, v, e);
|
|
1349
|
+
}
|
|
1350
|
+
}, x = (e) => {
|
|
1351
|
+
for (let t of m) {
|
|
1352
|
+
let n = e(t);
|
|
1353
|
+
if (n !== void 0) for (let e of p) n === null ? xt(e, t.name, _, v, !1) : bt(e, t.name, _, v, n);
|
|
1354
|
+
}
|
|
1355
|
+
}, C = r && w(), T = se({
|
|
1356
|
+
...g,
|
|
1357
|
+
easing: (e) => e,
|
|
1358
|
+
respectReducedMotion: r,
|
|
1359
|
+
...C ? {
|
|
1360
|
+
duration: 0,
|
|
1361
|
+
delay: 0
|
|
1362
|
+
} : {},
|
|
1363
|
+
onStart: () => {
|
|
1364
|
+
try {
|
|
1365
|
+
l.onStart?.();
|
|
1366
|
+
} catch (e) {
|
|
1367
|
+
throw b(c === void 0), e;
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
onUpdate: (e) => {
|
|
1371
|
+
try {
|
|
1372
|
+
let t = C ? e : d(e);
|
|
1373
|
+
x((t) => {
|
|
1374
|
+
let n = e * h, r = t.delay, i = t.delay + t.duration, a = !C && n < r, o = !C && n > i;
|
|
1375
|
+
if (c !== void 0 && a && c !== "backwards" && c !== "both" || c !== void 0 && o && c !== "forwards" && c !== "both") return null;
|
|
1376
|
+
if (a) return t.from;
|
|
1377
|
+
if (o) return t.valueAt(1);
|
|
1378
|
+
let s = C ? 1 : t.duration === 0 ? h === 0 ? e : Number(n >= t.delay) : Math.min(1, Math.max(0, (n - t.delay) / t.duration)), l = C ? s : t.easing(s);
|
|
1379
|
+
return Number.isFinite(l) ? t.valueAt(l) : void 0;
|
|
1380
|
+
}), u?.(t);
|
|
1381
|
+
} catch (e) {
|
|
1382
|
+
throw b(c === void 0), e;
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
onComplete: () => {
|
|
1386
|
+
b(c === void 0 || c === "forwards" || c === "both"), l.onComplete?.();
|
|
1387
|
+
},
|
|
1388
|
+
onCancel: () => {
|
|
1389
|
+
b(c === void 0), l.onCancel?.();
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
return C || c !== void 0 && c !== "backwards" && c !== "both" || x((e) => e.from), T;
|
|
1393
|
+
}
|
|
1394
|
+
export { y as $, Ae as A, a as B, Ee as C, G as D, De as E, Te as F, c as G, i as H, se as I, d as J, f as K, ae as L, Se as M, we as N, ke as O, be as P, p as Q, T as R, de as S, Oe as T, u as U, s as V, n as W, l as X, r as Y, x as Z, Ie as _, ct as a, Xe as b, je as c, qe as d, t as et, Ke as f, We as g, Je as h, st as i, xe as j, ye as k, Ze as l, Ye as m, Lt as n, b as nt, rt as o, He as p, o as q, kt as r, S as rt, et as s, Rt as t, v as tt, Ve as u, Ue as v, Ce as w, U as x, Ge as y, w as z };
|