@adartem/adlib-attributes 0.1.7 → 0.1.8
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/attributes.js +30 -30
- package/attributes.js.map +1 -1
- package/dist/{chunk-IEGIKJKW.js → chunk-5M74UMX2.js} +9 -5
- package/dist/chunk-5M74UMX2.js.map +7 -0
- package/dist/{chunk-NS2GB4WB.js → chunk-UIV7OVTN.js} +2 -2
- package/dist/{chunk-M2KO765Q.js → chunk-XUPOHV3Q.js} +2 -2
- package/dist/{dist-RQZGUXDL.js → dist-3BLHGYNR.js} +3 -3
- package/dist/{dist-H4ILPDRU.js → dist-3EOSRL3F.js} +2 -2
- package/dist/{dist-D2X7FLMD.js → dist-5DVLAJX5.js} +2 -2
- package/dist/{dist-ALT6N2V6.js → dist-5UUESGNG.js} +2 -2
- package/dist/{dist-RAOZ6VUA.js → dist-DJUTU32K.js} +2 -2
- package/dist/{dist-KU26ZFEG.js → dist-DN5N4ST4.js} +2 -2
- package/dist/{dist-D2J4YZM6.js → dist-EAHK557K.js} +2 -2
- package/dist/{dist-XTGERRGU.js → dist-EMS7RS72.js} +2 -2
- package/dist/{dist-KDCRSMGT.js → dist-EOXPLOSM.js} +2 -2
- package/dist/{dist-4EIQOOMJ.js → dist-GQELAMZW.js} +2 -2
- package/dist/{dist-UFMW7V6T.js → dist-HUIPJXH7.js} +3 -3
- package/dist/{dist-YAVVMJ7W.js → dist-IE7YTDEI.js} +2 -2
- package/dist/{dist-QPNIGMZA.js → dist-IVRPGD7K.js} +2 -2
- package/dist/{dist-V7I3FQX7.js → dist-IZE4BFP6.js} +2 -2
- package/dist/{dist-KF5AKQ52.js → dist-NGUFAZCM.js} +2 -2
- package/dist/{dist-IDJRFWAH.js → dist-NO72HDAS.js} +2 -2
- package/dist/{dist-DOOWCYTM.js → dist-OVX6MUFU.js} +2 -2
- package/dist/{dist-T4V65O5X.js → dist-Q6DJ7QAM.js} +2 -2
- package/dist/{dist-46N2ZXQQ.js → dist-QCYMONV3.js} +2 -2
- package/dist/{dist-YGJKGMK6.js → dist-QURXL6SQ.js} +2 -2
- package/dist/{dist-GQHJZHTH.js → dist-SECMRLIE.js} +2 -2
- package/dist/{dist-MBFKX56S.js → dist-UDAN4UWT.js} +3 -3
- package/dist/{dist-7GSHUMRU.js → dist-V4UG63VI.js} +2 -2
- package/dist/{dist-M6QCD7TL.js → dist-VMECMESW.js} +4 -4
- package/dist/{dist-BXD5YEF3.js → dist-VPOLJT37.js} +3 -3
- package/dist/{dist-NOIPAOTU.js → dist-VTPYNBIM.js} +2 -2
- package/dist/{dist-6YSNCGWO.js → dist-X423DKFG.js} +3 -3
- package/dist/{dist-GLBAV2CS.js → dist-ZDRNCFPI.js} +2 -2
- package/package.json +8 -8
- package/dist/chunk-IEGIKJKW.js.map +0 -7
- /package/dist/{chunk-NS2GB4WB.js.map → chunk-UIV7OVTN.js.map} +0 -0
- /package/dist/{chunk-M2KO765Q.js.map → chunk-XUPOHV3Q.js.map} +0 -0
- /package/dist/{dist-RQZGUXDL.js.map → dist-3BLHGYNR.js.map} +0 -0
- /package/dist/{dist-H4ILPDRU.js.map → dist-3EOSRL3F.js.map} +0 -0
- /package/dist/{dist-D2X7FLMD.js.map → dist-5DVLAJX5.js.map} +0 -0
- /package/dist/{dist-ALT6N2V6.js.map → dist-5UUESGNG.js.map} +0 -0
- /package/dist/{dist-RAOZ6VUA.js.map → dist-DJUTU32K.js.map} +0 -0
- /package/dist/{dist-KU26ZFEG.js.map → dist-DN5N4ST4.js.map} +0 -0
- /package/dist/{dist-D2J4YZM6.js.map → dist-EAHK557K.js.map} +0 -0
- /package/dist/{dist-XTGERRGU.js.map → dist-EMS7RS72.js.map} +0 -0
- /package/dist/{dist-KDCRSMGT.js.map → dist-EOXPLOSM.js.map} +0 -0
- /package/dist/{dist-4EIQOOMJ.js.map → dist-GQELAMZW.js.map} +0 -0
- /package/dist/{dist-UFMW7V6T.js.map → dist-HUIPJXH7.js.map} +0 -0
- /package/dist/{dist-YAVVMJ7W.js.map → dist-IE7YTDEI.js.map} +0 -0
- /package/dist/{dist-QPNIGMZA.js.map → dist-IVRPGD7K.js.map} +0 -0
- /package/dist/{dist-V7I3FQX7.js.map → dist-IZE4BFP6.js.map} +0 -0
- /package/dist/{dist-KF5AKQ52.js.map → dist-NGUFAZCM.js.map} +0 -0
- /package/dist/{dist-IDJRFWAH.js.map → dist-NO72HDAS.js.map} +0 -0
- /package/dist/{dist-DOOWCYTM.js.map → dist-OVX6MUFU.js.map} +0 -0
- /package/dist/{dist-T4V65O5X.js.map → dist-Q6DJ7QAM.js.map} +0 -0
- /package/dist/{dist-46N2ZXQQ.js.map → dist-QCYMONV3.js.map} +0 -0
- /package/dist/{dist-YGJKGMK6.js.map → dist-QURXL6SQ.js.map} +0 -0
- /package/dist/{dist-GQHJZHTH.js.map → dist-SECMRLIE.js.map} +0 -0
- /package/dist/{dist-MBFKX56S.js.map → dist-UDAN4UWT.js.map} +0 -0
- /package/dist/{dist-7GSHUMRU.js.map → dist-V4UG63VI.js.map} +0 -0
- /package/dist/{dist-M6QCD7TL.js.map → dist-VMECMESW.js.map} +0 -0
- /package/dist/{dist-BXD5YEF3.js.map → dist-VPOLJT37.js.map} +0 -0
- /package/dist/{dist-NOIPAOTU.js.map → dist-VTPYNBIM.js.map} +0 -0
- /package/dist/{dist-6YSNCGWO.js.map → dist-X423DKFG.js.map} +0 -0
- /package/dist/{dist-GLBAV2CS.js.map → dist-ZDRNCFPI.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../bin/live-reload.js", "../../../node_modules/framer-motion/dist/es/dom.mjs", "../../../node_modules/motion-dom/dist/es/index.mjs", "../../../node_modules/motion-utils/dist/es/index.mjs", "../../../node_modules/motion-utils/src/array.ts", "../../../node_modules/motion-utils/src/clamp.ts", "../../../node_modules/motion-utils/src/format-error-message.ts", "../../../node_modules/motion-utils/src/errors.ts", "../../../node_modules/motion-utils/src/global-config.ts", "../../../node_modules/motion-utils/src/is-numerical-string.ts", "../../../node_modules/motion-utils/src/is-object.ts", "../../../node_modules/motion-utils/src/is-zero-value-string.ts", "../../../node_modules/motion-utils/src/memo.ts", "../../../node_modules/motion-utils/src/noop.ts", "../../../node_modules/motion-utils/src/pipe.ts", "../../../node_modules/motion-utils/src/progress.ts", "../../../node_modules/motion-utils/src/subscription-manager.ts", "../../../node_modules/motion-utils/src/time-conversion.ts", "../../../node_modules/motion-utils/src/velocity-per-second.ts", "../../../node_modules/motion-utils/src/warn-once.ts", "../../../node_modules/motion-utils/src/wrap.ts", "../../../node_modules/motion-utils/src/easing/cubic-bezier.ts", "../../../node_modules/motion-utils/src/easing/modifiers/mirror.ts", "../../../node_modules/motion-utils/src/easing/modifiers/reverse.ts", "../../../node_modules/motion-utils/src/easing/back.ts", "../../../node_modules/motion-utils/src/easing/anticipate.ts", "../../../node_modules/motion-utils/src/easing/circ.ts", "../../../node_modules/motion-utils/src/easing/ease.ts", "../../../node_modules/motion-utils/src/easing/utils/is-easing-array.ts", "../../../node_modules/motion-utils/src/easing/utils/get-easing-for-segment.ts", "../../../node_modules/motion-utils/src/easing/utils/is-bezier-definition.ts", "../../../node_modules/motion-utils/src/easing/utils/map.ts", "../../../node_modules/motion-dom/src/frameloop/order.ts", "../../../node_modules/motion-dom/src/stats/buffer.ts", "../../../node_modules/motion-dom/src/frameloop/render-step.ts", "../../../node_modules/motion-dom/src/frameloop/batcher.ts", "../../../node_modules/motion-dom/src/frameloop/frame.ts", "../../../node_modules/motion-dom/src/frameloop/sync-time.ts", "../../../node_modules/motion-dom/src/stats/animation-count.ts", "../../../node_modules/motion-dom/src/animation/utils/is-css-variable.ts", "../../../node_modules/motion-dom/src/value/types/numbers/index.ts", "../../../node_modules/motion-dom/src/value/types/utils/sanitize.ts", "../../../node_modules/motion-dom/src/value/types/utils/float-regex.ts", "../../../node_modules/motion-dom/src/value/types/utils/is-nullish.ts", "../../../node_modules/motion-dom/src/value/types/utils/single-color-regex.ts", "../../../node_modules/motion-dom/src/value/types/color/utils.ts", "../../../node_modules/motion-dom/src/value/types/color/rgba.ts", "../../../node_modules/motion-dom/src/value/types/color/hex.ts", "../../../node_modules/motion-dom/src/value/types/numbers/units.ts", "../../../node_modules/motion-dom/src/value/types/color/hsla.ts", "../../../node_modules/motion-dom/src/value/types/color/index.ts", "../../../node_modules/motion-dom/src/value/types/utils/color-regex.ts", "../../../node_modules/motion-dom/src/value/types/complex/index.ts", "../../../node_modules/motion-dom/src/value/types/color/hsla-to-rgba.ts", "../../../node_modules/motion-dom/src/utils/mix/immediate.ts", "../../../node_modules/motion-dom/src/utils/mix/number.ts", "../../../node_modules/motion-dom/src/utils/mix/color.ts", "../../../node_modules/motion-dom/src/utils/mix/visibility.ts", "../../../node_modules/motion-dom/src/utils/mix/complex.ts", "../../../node_modules/motion-dom/src/utils/mix/index.ts", "../../../node_modules/motion-dom/src/animation/drivers/frame.ts", "../../../node_modules/motion-dom/src/animation/waapi/utils/linear.ts", "../../../node_modules/motion-dom/src/animation/generators/utils/calc-duration.ts", "../../../node_modules/motion-dom/src/animation/generators/utils/create-generator-easing.ts", "../../../node_modules/motion-dom/src/animation/generators/utils/velocity.ts", "../../../node_modules/motion-dom/src/animation/generators/spring/defaults.ts", "../../../node_modules/motion-dom/src/animation/generators/spring/find.ts", "../../../node_modules/motion-dom/src/animation/generators/spring/index.ts", "../../../node_modules/motion-dom/src/animation/generators/inertia.ts", "../../../node_modules/motion-dom/src/utils/interpolate.ts", "../../../node_modules/motion-dom/src/animation/keyframes/offsets/fill.ts", "../../../node_modules/motion-dom/src/animation/keyframes/offsets/default.ts", "../../../node_modules/motion-dom/src/animation/keyframes/offsets/time.ts", "../../../node_modules/motion-dom/src/animation/generators/keyframes.ts", "../../../node_modules/motion-dom/src/animation/keyframes/get-final.ts", "../../../node_modules/motion-dom/src/animation/utils/replace-transition-type.ts", "../../../node_modules/motion-dom/src/animation/utils/WithPromise.ts", "../../../node_modules/motion-dom/src/animation/JSAnimation.ts", "../../../node_modules/motion-dom/src/animation/keyframes/utils/fill-wildcards.ts", "../../../node_modules/motion-dom/src/render/dom/parse-transform.ts", "../../../node_modules/motion-dom/src/render/utils/keys-transform.ts", "../../../node_modules/motion-dom/src/animation/keyframes/utils/unit-conversion.ts", "../../../node_modules/motion-dom/src/animation/keyframes/KeyframesResolver.ts", "../../../node_modules/motion-dom/src/render/dom/is-css-var.ts", "../../../node_modules/motion-dom/src/render/dom/style-set.ts", "../../../node_modules/motion-dom/src/utils/supports/scroll-timeline.ts", "../../../node_modules/motion-dom/src/utils/supports/flags.ts", "../../../node_modules/motion-dom/src/utils/supports/memo.ts", "../../../node_modules/motion-dom/src/utils/supports/linear-easing.ts", "../../../node_modules/motion-dom/src/animation/waapi/easing/cubic-bezier.ts", "../../../node_modules/motion-dom/src/animation/waapi/easing/supported.ts", "../../../node_modules/motion-dom/src/animation/waapi/easing/map-easing.ts", "../../../node_modules/motion-dom/src/animation/waapi/start-waapi-animation.ts", "../../../node_modules/motion-dom/src/animation/generators/utils/is-generator.ts", "../../../node_modules/motion-dom/src/animation/waapi/utils/apply-generator.ts", "../../../node_modules/motion-dom/src/animation/NativeAnimation.ts", "../../../node_modules/motion-dom/src/animation/waapi/utils/unsupported-easing.ts", "../../../node_modules/motion-dom/src/animation/NativeAnimationExtended.ts", "../../../node_modules/motion-dom/src/animation/utils/is-animatable.ts", "../../../node_modules/motion-dom/src/animation/utils/can-animate.ts", "../../../node_modules/motion-dom/src/animation/utils/make-animation-instant.ts", "../../../node_modules/motion-dom/src/animation/waapi/supports/waapi.ts", "../../../node_modules/motion-dom/src/animation/AsyncMotionValueAnimation.ts", "../../../node_modules/motion-dom/src/animation/GroupAnimation.ts", "../../../node_modules/motion-dom/src/animation/GroupAnimationWithThen.ts", "../../../node_modules/motion-dom/src/animation/utils/css-variables-conversion.ts", "../../../node_modules/motion-dom/src/animation/utils/default-transitions.ts", "../../../node_modules/motion-dom/src/animation/utils/get-final-keyframe.ts", "../../../node_modules/motion-dom/src/animation/utils/get-value-transition.ts", "../../../node_modules/motion-dom/src/animation/utils/is-transition-defined.ts", "../../../node_modules/motion-dom/src/animation/interfaces/motion-value.ts", "../../../node_modules/motion-dom/src/render/utils/resolve-variants.ts", "../../../node_modules/motion-dom/src/render/utils/resolve-dynamic-variants.ts", "../../../node_modules/motion-dom/src/render/utils/keys-position.ts", "../../../node_modules/motion-dom/src/value/index.ts", "../../../node_modules/motion-dom/src/render/utils/is-keyframes-target.ts", "../../../node_modules/motion-dom/src/render/utils/setters.ts", "../../../node_modules/motion-dom/src/value/utils/is-motion-value.ts", "../../../node_modules/motion-dom/src/value/will-change/is.ts", "../../../node_modules/motion-dom/src/value/will-change/add-will-change.ts", "../../../node_modules/motion-dom/src/render/dom/utils/camel-to-dash.ts", "../../../node_modules/motion-dom/src/animation/optimized-appear/data-id.ts", "../../../node_modules/motion-dom/src/animation/optimized-appear/get-appear-id.ts", "../../../node_modules/motion-dom/src/animation/interfaces/visual-element-target.ts", "../../../node_modules/motion-dom/src/value/types/auto.ts", "../../../node_modules/motion-dom/src/value/types/test.ts", "../../../node_modules/motion-dom/src/value/types/dimensions.ts", "../../../node_modules/motion-dom/src/animation/keyframes/utils/is-none.ts", "../../../node_modules/motion-dom/src/value/types/complex/filter.ts", "../../../node_modules/motion-dom/src/value/types/int.ts", "../../../node_modules/motion-dom/src/value/types/maps/transform.ts", "../../../node_modules/motion-dom/src/value/types/maps/number.ts", "../../../node_modules/motion-dom/src/value/types/maps/defaults.ts", "../../../node_modules/motion-dom/src/value/types/utils/animatable-none.ts", "../../../node_modules/motion-dom/src/animation/keyframes/utils/make-none-animatable.ts", "../../../node_modules/motion-dom/src/animation/keyframes/DOMKeyframesResolver.ts", "../../../node_modules/motion-dom/src/utils/resolve-elements.ts", "../../../node_modules/motion-dom/src/value/types/utils/get-as-type.ts", "../../../node_modules/motion-dom/src/frameloop/microtask.ts", "../../../node_modules/motion-dom/src/utils/is-svg-element.ts", "../../../node_modules/motion-dom/src/utils/is-svg-svg-element.ts", "../../../node_modules/motion-dom/src/utils/stagger.ts", "../../../node_modules/motion-dom/src/value/types/utils/find.ts", "../../../node_modules/motion-dom/src/projection/geometry/models.ts", "../../../node_modules/motion-dom/src/render/utils/reduced-motion/state.ts", "../../../node_modules/motion-dom/src/render/utils/reduced-motion/index.ts", "../../../node_modules/motion-dom/src/render/store.ts", "../../../node_modules/motion-dom/src/render/utils/is-animation-controls.ts", "../../../node_modules/motion-dom/src/render/utils/is-variant-label.ts", "../../../node_modules/motion-dom/src/render/utils/variant-props.ts", "../../../node_modules/motion-dom/src/render/utils/is-controlling-variants.ts", "../../../node_modules/motion-dom/src/render/utils/motion-values.ts", "../../../node_modules/motion-dom/src/render/VisualElement.ts", "../../../node_modules/motion-dom/src/render/dom/DOMVisualElement.ts", "../../../node_modules/motion-dom/src/projection/geometry/conversion.ts", "../../../node_modules/motion-dom/src/projection/utils/measure.ts", "../../../node_modules/motion-dom/src/render/html/utils/build-transform.ts", "../../../node_modules/motion-dom/src/render/html/utils/build-styles.ts", "../../../node_modules/motion-dom/src/render/html/utils/render.ts", "../../../node_modules/motion-dom/src/projection/styles/scale-border-radius.ts", "../../../node_modules/motion-dom/src/projection/styles/scale-box-shadow.ts", "../../../node_modules/motion-dom/src/projection/styles/scale-correction.ts", "../../../node_modules/motion-dom/src/render/utils/is-forced-motion-value.ts", "../../../node_modules/motion-dom/src/render/html/utils/scrape-motion-values.ts", "../../../node_modules/motion-dom/src/render/html/HTMLVisualElement.ts", "../../../node_modules/motion-dom/src/render/object/ObjectVisualElement.ts", "../../../node_modules/motion-dom/src/render/svg/utils/path.ts", "../../../node_modules/motion-dom/src/render/svg/utils/build-attrs.ts", "../../../node_modules/motion-dom/src/render/svg/utils/camel-case-attrs.ts", "../../../node_modules/motion-dom/src/render/svg/utils/is-svg-tag.ts", "../../../node_modules/motion-dom/src/render/svg/utils/render.ts", "../../../node_modules/motion-dom/src/render/svg/utils/scrape-motion-values.ts", "../../../node_modules/motion-dom/src/render/svg/SVGVisualElement.ts", "../../../node_modules/motion-dom/src/animation/animate/single-value.ts", "../../../node_modules/framer-motion/src/animation/utils/is-dom-keyframes.ts", "../../../node_modules/framer-motion/src/animation/animate/resolve-subjects.ts", "../../../node_modules/framer-motion/src/animation/sequence/utils/calc-repeat-duration.ts", "../../../node_modules/framer-motion/src/animation/sequence/utils/calc-time.ts", "../../../node_modules/framer-motion/src/animation/sequence/utils/edit.ts", "../../../node_modules/framer-motion/src/animation/sequence/utils/normalize-times.ts", "../../../node_modules/framer-motion/src/animation/sequence/utils/sort.ts", "../../../node_modules/framer-motion/src/animation/sequence/create.ts", "../../../node_modules/framer-motion/src/animation/utils/create-visual-element.ts", "../../../node_modules/framer-motion/src/animation/animate/subject.ts", "../../../node_modules/framer-motion/src/animation/animate/sequence.ts", "../../../node_modules/framer-motion/src/animation/animate/index.ts", "../../adlib-utils/src/animations/factory.ts", "../../adlib-utils/src/animations/index.ts", "../../adlib-utils/src/helpers/a11y.ts", "../../adlib-utils/src/helpers/cleanup.ts", "../../adlib-utils/src/constants/webflow.ts", "../../adlib-utils/src/helpers/guards.ts", "../../adlib-utils/src/helpers/dom.ts", "../../adlib-utils/src/helpers/css.ts", "../../adlib-utils/src/helpers/dates.ts", "../../adlib-utils/src/helpers/defineModule.ts", "../../adlib-utils/src/helpers/delegation.ts", "../../adlib-utils/src/helpers/events.ts", "../../adlib-utils/src/constants/a11y.ts", "../../adlib-utils/src/constants/attributes.ts", "../../adlib-utils/src/constants/keyboard.ts", "../../adlib-utils/src/helpers/webflow.ts", "../../adlib-utils/src/helpers/fetch.ts", "../../adlib-utils/src/helpers/forms.ts", "../../adlib-utils/src/helpers/numbers.ts", "../../adlib-utils/src/helpers/options.ts", "../../adlib-utils/src/helpers/selectors.ts", "../../adlib-utils/src/helpers/strings.ts", "../../adlib-utils/src/helpers/wait.ts", "../../adlib-utils/src/components/Interaction.ts", "../../adlib-utils/src/components/Renderer.ts"],
|
|
4
|
+
"sourcesContent": ["const LOCAL_HOSTS = new Set(['localhost', '127.0.0.1', '::1']);\n\nif (LOCAL_HOSTS.has(window.location.hostname)) {\n new EventSource(`http://localhost:${SERVE_PORT}/esbuild`).addEventListener('change', () =>\n location.reload(),\n );\n}\n", "export * from 'motion-dom';\nexport { delayInSeconds as delay } from 'motion-dom';\nexport * from 'motion-utils';\nexport { animate, createScopedAnimate } from './animation/animate/index.mjs';\nexport { animateMini } from './animation/animators/waapi/animate-style.mjs';\nexport { scroll } from './render/dom/scroll/index.mjs';\nexport { scrollInfo } from './render/dom/scroll/track.mjs';\nexport { inView } from './render/dom/viewport/index.mjs';\nexport { distance, distance2D } from './utils/distance.mjs';\n//# sourceMappingURL=dom.mjs.map\n", "export { AsyncMotionValueAnimation } from './animation/AsyncMotionValueAnimation.mjs';\nexport { GroupAnimation } from './animation/GroupAnimation.mjs';\nexport { GroupAnimationWithThen } from './animation/GroupAnimationWithThen.mjs';\nexport { JSAnimation, animateValue } from './animation/JSAnimation.mjs';\nexport { NativeAnimation } from './animation/NativeAnimation.mjs';\nexport { NativeAnimationExtended } from './animation/NativeAnimationExtended.mjs';\nexport { NativeAnimationWrapper } from './animation/NativeAnimationWrapper.mjs';\nexport { animationMapKey, getAnimationMap } from './animation/utils/active-animations.mjs';\nexport { calcChildStagger } from './animation/utils/calc-child-stagger.mjs';\nexport { getVariableValue, parseCSSVariable } from './animation/utils/css-variables-conversion.mjs';\nexport { getDefaultTransition } from './animation/utils/default-transitions.mjs';\nexport { getFinalKeyframe } from './animation/utils/get-final-keyframe.mjs';\nexport { getValueTransition } from './animation/utils/get-value-transition.mjs';\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken } from './animation/utils/is-css-variable.mjs';\nexport { isTransitionDefined } from './animation/utils/is-transition-defined.mjs';\nexport { makeAnimationInstant } from './animation/utils/make-animation-instant.mjs';\nexport { animateMotionValue } from './animation/interfaces/motion-value.mjs';\nexport { animateVisualElement } from './animation/interfaces/visual-element.mjs';\nexport { animateTarget } from './animation/interfaces/visual-element-target.mjs';\nexport { animateVariant } from './animation/interfaces/visual-element-variant.mjs';\nexport { optimizedAppearDataAttribute, optimizedAppearDataId } from './animation/optimized-appear/data-id.mjs';\nexport { getOptimisedAppearId } from './animation/optimized-appear/get-appear-id.mjs';\nexport { inertia } from './animation/generators/inertia.mjs';\nexport { defaultEasing, keyframes } from './animation/generators/keyframes.mjs';\nexport { spring } from './animation/generators/spring/index.mjs';\nexport { calcGeneratorDuration, maxGeneratorDuration } from './animation/generators/utils/calc-duration.mjs';\nexport { createGeneratorEasing } from './animation/generators/utils/create-generator-easing.mjs';\nexport { isGenerator } from './animation/generators/utils/is-generator.mjs';\nexport { DOMKeyframesResolver } from './animation/keyframes/DOMKeyframesResolver.mjs';\nexport { KeyframeResolver, flushKeyframeResolvers } from './animation/keyframes/KeyframesResolver.mjs';\nexport { defaultOffset } from './animation/keyframes/offsets/default.mjs';\nexport { fillOffset } from './animation/keyframes/offsets/fill.mjs';\nexport { convertOffsetToTimes } from './animation/keyframes/offsets/time.mjs';\nexport { applyPxDefaults } from './animation/keyframes/utils/apply-px-defaults.mjs';\nexport { fillWildcards } from './animation/keyframes/utils/fill-wildcards.mjs';\nexport { cubicBezierAsString } from './animation/waapi/easing/cubic-bezier.mjs';\nexport { isWaapiSupportedEasing } from './animation/waapi/easing/is-supported.mjs';\nexport { mapEasingToNativeEasing } from './animation/waapi/easing/map-easing.mjs';\nexport { supportedWaapiEasing } from './animation/waapi/easing/supported.mjs';\nexport { startWaapiAnimation } from './animation/waapi/start-waapi-animation.mjs';\nexport { supportsPartialKeyframes } from './animation/waapi/supports/partial-keyframes.mjs';\nexport { supportsBrowserAnimation } from './animation/waapi/supports/waapi.mjs';\nexport { acceleratedValues } from './animation/waapi/utils/accelerated-values.mjs';\nexport { applyGeneratorOptions } from './animation/waapi/utils/apply-generator.mjs';\nexport { generateLinearEasing } from './animation/waapi/utils/linear.mjs';\nexport { addAttrValue, attrEffect } from './effects/attr/index.mjs';\nexport { propEffect } from './effects/prop/index.mjs';\nexport { addStyleValue, styleEffect } from './effects/style/index.mjs';\nexport { svgEffect } from './effects/svg/index.mjs';\nexport { createRenderBatcher } from './frameloop/batcher.mjs';\nexport { cancelMicrotask, microtask } from './frameloop/microtask.mjs';\nexport { time } from './frameloop/sync-time.mjs';\nexport { isDragActive, isDragging } from './gestures/drag/state/is-active.mjs';\nexport { setDragLock } from './gestures/drag/state/set-active.mjs';\nexport { hover } from './gestures/hover.mjs';\nexport { press } from './gestures/press/index.mjs';\nexport { isElementKeyboardAccessible } from './gestures/press/utils/is-keyboard-accessible.mjs';\nexport { isNodeOrChild } from './gestures/utils/is-node-or-child.mjs';\nexport { isPrimaryPointer } from './gestures/utils/is-primary-pointer.mjs';\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue } from './render/dom/parse-transform.mjs';\nexport { getComputedStyle } from './render/dom/style-computed.mjs';\nexport { setStyle } from './render/dom/style-set.mjs';\nexport { isKeyframesTarget } from './render/utils/is-keyframes-target.mjs';\nexport { positionalKeys } from './render/utils/keys-position.mjs';\nexport { transformPropOrder, transformProps } from './render/utils/keys-transform.mjs';\nexport { resize } from './resize/index.mjs';\nexport { observeTimeline } from './scroll/observe.mjs';\nexport { recordStats } from './stats/index.mjs';\nexport { activeAnimations } from './stats/animation-count.mjs';\nexport { statsBuffer } from './stats/buffer.mjs';\nexport { interpolate } from './utils/interpolate.mjs';\nexport { isHTMLElement } from './utils/is-html-element.mjs';\nexport { isSVGElement } from './utils/is-svg-element.mjs';\nexport { isSVGSVGElement } from './utils/is-svg-svg-element.mjs';\nexport { mix } from './utils/mix/index.mjs';\nexport { mixColor, mixLinearColor } from './utils/mix/color.mjs';\nexport { getMixer, mixArray, mixComplex, mixObject } from './utils/mix/complex.mjs';\nexport { mixImmediate } from './utils/mix/immediate.mjs';\nexport { mixNumber } from './utils/mix/number.mjs';\nexport { invisibleValues, mixVisibility } from './utils/mix/visibility.mjs';\nexport { resolveElements } from './utils/resolve-elements.mjs';\nexport { getOriginIndex, stagger } from './utils/stagger.mjs';\nexport { supportsFlags } from './utils/supports/flags.mjs';\nexport { supportsLinearEasing } from './utils/supports/linear-easing.mjs';\nexport { supportsScrollTimeline } from './utils/supports/scroll-timeline.mjs';\nexport { transform } from './utils/transform.mjs';\nexport { MotionValue, collectMotionValues, motionValue } from './value/index.mjs';\nexport { attachFollow, followValue } from './value/follow-value.mjs';\nexport { mapValue } from './value/map-value.mjs';\nexport { attachSpring, springValue } from './value/spring-value.mjs';\nexport { transformValue } from './value/transform-value.mjs';\nexport { color } from './value/types/color/index.mjs';\nexport { hex } from './value/types/color/hex.mjs';\nexport { hsla } from './value/types/color/hsla.mjs';\nexport { hslaToRgba } from './value/types/color/hsla-to-rgba.mjs';\nexport { rgbUnit, rgba } from './value/types/color/rgba.mjs';\nexport { analyseComplexValue, complex } from './value/types/complex/index.mjs';\nexport { dimensionValueTypes, findDimensionValueType } from './value/types/dimensions.mjs';\nexport { defaultValueTypes, getDefaultValueType } from './value/types/maps/defaults.mjs';\nexport { numberValueTypes } from './value/types/maps/number.mjs';\nexport { transformValueTypes } from './value/types/maps/transform.mjs';\nexport { alpha, number, scale } from './value/types/numbers/index.mjs';\nexport { degrees, percent, progressPercentage, px, vh, vw } from './value/types/numbers/units.mjs';\nexport { testValueType } from './value/types/test.mjs';\nexport { getAnimatableNone } from './value/types/utils/animatable-none.mjs';\nexport { findValueType } from './value/types/utils/find.mjs';\nexport { getValueAsType } from './value/types/utils/get-as-type.mjs';\nexport { isMotionValue } from './value/utils/is-motion-value.mjs';\nexport { addValueToWillChange } from './value/will-change/add-will-change.mjs';\nexport { isWillChangeMotionValue } from './value/will-change/is.mjs';\nexport { ViewTransitionBuilder, animateView } from './view/index.mjs';\nexport { getViewAnimationLayerInfo } from './view/utils/get-layer-info.mjs';\nexport { getViewAnimations } from './view/utils/get-view-animations.mjs';\nexport { DOMVisualElement } from './render/dom/DOMVisualElement.mjs';\nexport { Feature } from './render/Feature.mjs';\nexport { HTMLVisualElement } from './render/html/HTMLVisualElement.mjs';\nexport { ObjectVisualElement } from './render/object/ObjectVisualElement.mjs';\nexport { visualElementStore } from './render/store.mjs';\nexport { SVGVisualElement } from './render/svg/SVGVisualElement.mjs';\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions } from './render/VisualElement.mjs';\nexport { checkVariantsDidChange, createAnimationState } from './render/utils/animation-state.mjs';\nexport { getVariantContext } from './render/utils/get-variant-context.mjs';\nexport { isAnimationControls } from './render/utils/is-animation-controls.mjs';\nexport { isControllingVariants, isVariantNode } from './render/utils/is-controlling-variants.mjs';\nexport { isForcedMotionValue } from './render/utils/is-forced-motion-value.mjs';\nexport { isVariantLabel } from './render/utils/is-variant-label.mjs';\nexport { updateMotionValuesFromProps } from './render/utils/motion-values.mjs';\nexport { resolveVariant } from './render/utils/resolve-dynamic-variants.mjs';\nexport { resolveVariantFromProps } from './render/utils/resolve-variants.mjs';\nexport { setTarget } from './render/utils/setters.mjs';\nexport { variantPriorityOrder, variantProps } from './render/utils/variant-props.mjs';\nexport { initPrefersReducedMotion } from './render/utils/reduced-motion/index.mjs';\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints } from './projection/geometry/conversion.mjs';\nexport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from './projection/geometry/copy.mjs';\nexport { applyAxisDelta, applyBoxDelta, applyPointDelta, applyTreeDeltas, scalePoint, transformAxis, transformBox, translateAxis } from './projection/geometry/delta-apply.mjs';\nexport { calcAxisDelta, calcBoxDelta, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, isNear } from './projection/geometry/delta-calc.mjs';\nexport { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta } from './projection/geometry/delta-remove.mjs';\nexport { createAxis, createAxisDelta, createBox, createDelta } from './projection/geometry/models.mjs';\nexport { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero } from './projection/geometry/utils.mjs';\nexport { eachAxis } from './projection/utils/each-axis.mjs';\nexport { has2DTranslate, hasScale, hasTransform } from './projection/utils/has-transform.mjs';\nexport { measurePageBox, measureViewportBox } from './projection/utils/measure.mjs';\nexport { correctBorderRadius, pixelsToPercent } from './projection/styles/scale-border-radius.mjs';\nexport { correctBoxShadow } from './projection/styles/scale-box-shadow.mjs';\nexport { buildProjectionTransform } from './projection/styles/transform.mjs';\nexport { mixValues } from './projection/animation/mix-values.mjs';\nexport { animateSingleValue } from './animation/animate/single-value.mjs';\nexport { addDomEvent } from './events/add-dom-event.mjs';\nexport { compareByDepth } from './projection/utils/compare-by-depth.mjs';\nexport { FlatTree } from './projection/utils/flat-tree.mjs';\nexport { delay, delayInSeconds } from './utils/delay.mjs';\nexport { resolveMotionValue } from './value/utils/resolve-motion-value.mjs';\nexport { cleanDirtyNodes, createProjectionNode, propagateDirtyNodes } from './projection/node/create-projection-node.mjs';\nexport { DocumentProjectionNode } from './projection/node/DocumentProjectionNode.mjs';\nexport { nodeGroup } from './projection/node/group.mjs';\nexport { HTMLProjectionNode, rootProjectionNode } from './projection/node/HTMLProjectionNode.mjs';\nexport { globalProjectionState } from './projection/node/state.mjs';\nexport { NodeStack } from './projection/shared/stack.mjs';\nexport { camelToDash } from './render/dom/utils/camel-to-dash.mjs';\nexport { buildHTMLStyles } from './render/html/utils/build-styles.mjs';\nexport { buildTransform } from './render/html/utils/build-transform.mjs';\nexport { renderHTML } from './render/html/utils/render.mjs';\nexport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from './render/html/utils/scrape-motion-values.mjs';\nexport { buildSVGAttrs } from './render/svg/utils/build-attrs.mjs';\nexport { camelCaseAttributes } from './render/svg/utils/camel-case-attrs.mjs';\nexport { isSVGTag } from './render/svg/utils/is-svg-tag.mjs';\nexport { buildSVGPath } from './render/svg/utils/path.mjs';\nexport { renderSVG } from './render/svg/utils/render.mjs';\nexport { scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps } from './render/svg/utils/scrape-motion-values.mjs';\nexport { LayoutAnimationBuilder, parseAnimateLayoutArgs } from './layout/LayoutAnimationBuilder.mjs';\nexport { cancelSync, sync } from './frameloop/index-legacy.mjs';\nexport { addScaleCorrector, scaleCorrectors } from './projection/styles/scale-correction.mjs';\nexport { hasReducedMotionListener, prefersReducedMotion } from './render/utils/reduced-motion/state.mjs';\nexport { cancelFrame, frame, frameData, frameSteps } from './frameloop/frame.mjs';\n//# sourceMappingURL=index.mjs.map\n", "export { addUniqueItem, moveItem, removeItem } from './array.mjs';\nexport { clamp } from './clamp.mjs';\nexport { invariant, warning } from './errors.mjs';\nexport { MotionGlobalConfig } from './global-config.mjs';\nexport { isNumericalString } from './is-numerical-string.mjs';\nexport { isObject } from './is-object.mjs';\nexport { isZeroValueString } from './is-zero-value-string.mjs';\nexport { memo } from './memo.mjs';\nexport { noop } from './noop.mjs';\nexport { pipe } from './pipe.mjs';\nexport { progress } from './progress.mjs';\nexport { SubscriptionManager } from './subscription-manager.mjs';\nexport { millisecondsToSeconds, secondsToMilliseconds } from './time-conversion.mjs';\nexport { velocityPerSecond } from './velocity-per-second.mjs';\nexport { hasWarned, warnOnce } from './warn-once.mjs';\nexport { wrap } from './wrap.mjs';\nexport { anticipate } from './easing/anticipate.mjs';\nexport { backIn, backInOut, backOut } from './easing/back.mjs';\nexport { circIn, circInOut, circOut } from './easing/circ.mjs';\nexport { cubicBezier } from './easing/cubic-bezier.mjs';\nexport { easeIn, easeInOut, easeOut } from './easing/ease.mjs';\nexport { mirrorEasing } from './easing/modifiers/mirror.mjs';\nexport { reverseEasing } from './easing/modifiers/reverse.mjs';\nexport { steps } from './easing/steps.mjs';\nexport { getEasingForSegment } from './easing/utils/get-easing-for-segment.mjs';\nexport { isBezierDefinition } from './easing/utils/is-bezier-definition.mjs';\nexport { isEasingArray } from './easing/utils/is-easing-array.mjs';\nexport { easingDefinitionToFunction } from './easing/utils/map.mjs';\n//# sourceMappingURL=index.mjs.map\n", "export function addUniqueItem<T>(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem<T>(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem<T>([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n", "export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n", "export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n", "import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n", "export const MotionGlobalConfig: {\n skipAnimations?: boolean\n instantAnimations?: boolean\n useManualTiming?: boolean\n WillChange?: any\n mix?: <T>(a: T, b: T) => (p: number) => T\n} = {}\n", "/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n", "export function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null\n}\n", "/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nexport const isZeroValueString = (v: string) => /^0[^.\\s]+$/u.test(v)\n", "/*#__NO_SIDE_EFFECTS__*/\nexport function memo<T extends any>(callback: () => T) {\n let result: T | undefined\n\n return () => {\n if (result === undefined) result = callback()\n return result\n }\n}\n", "/*#__NO_SIDE_EFFECTS__*/\nexport const noop = <T>(any: T): T => any\n", "/**\n * Pipe\n * Compose other transformers to run linearily\n * pipe(min(20), max(40))\n * @param {...functions} transformers\n * @return {function}\n */\nconst combineFunctions = (a: Function, b: Function) => (v: any) => b(a(v))\nexport const pipe = (...transformers: Function[]) =>\n transformers.reduce(combineFunctions)\n", "/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n", "import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager<Handler extends GenericHandler> {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters<Handler>[0],\n b?: Parameters<Handler>[1],\n c?: Parameters<Handler>[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n", "/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const secondsToMilliseconds = (seconds: number) => seconds * 1000\n\n/*#__NO_SIDE_EFFECTS__*/\nexport const millisecondsToSeconds = (milliseconds: number) =>\n milliseconds / 1000\n", "/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nexport function velocityPerSecond(velocity: number, frameDuration: number) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0\n}\n", "import { formatErrorMessage } from \"./format-error-message\"\n\nconst warned = new Set<string>()\n\nexport function hasWarned(message: string) {\n return warned.has(message)\n}\n\nexport function warnOnce(\n condition: boolean,\n message: string,\n errorCode?: string\n) {\n if (condition || warned.has(message)) return\n\n console.warn(formatErrorMessage(message, errorCode))\n warned.add(message)\n}\n", "export const wrap = (min: number, max: number, v: number) => {\n const rangeSize = max - min\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min\n}\n", "/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n", "// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n", "// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n", "import { cubicBezier } from \"./cubic-bezier\"\nimport { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\n\nexport const backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99)\nexport const backIn = /*@__PURE__*/ reverseEasing(backOut)\nexport const backInOut = /*@__PURE__*/ mirrorEasing(backIn)\n", "import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n", "import { mirrorEasing } from \"./modifiers/mirror\"\nimport { reverseEasing } from \"./modifiers/reverse\"\nimport { EasingFunction } from \"./types\"\n\nexport const circIn: EasingFunction = (p) => 1 - Math.sin(Math.acos(p))\nexport const circOut = reverseEasing(circIn)\nexport const circInOut = mirrorEasing(circIn)\n", "import { cubicBezier } from \"./cubic-bezier\"\n\nexport const easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1)\nexport const easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1)\nexport const easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1)\n", "import { Easing } from \"../types\"\n\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n", "import { wrap } from \"../../wrap\"\nimport { Easing } from \"../types\"\nimport { isEasingArray } from \"./is-easing-array\"\n\nexport function getEasingForSegment(\n easing: Easing | Easing[],\n i: number\n): Easing {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing\n}\n", "import { BezierDefinition, Easing } from \"../types\"\n\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n", "import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n", "import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n", "import type { StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: {\n nodes: number\n calculatedTargetDeltas: number\n calculatedProjections: number\n }) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n", "import { statsBuffer } from \"../stats/buffer\"\nimport { StepNames } from \"./order\"\nimport { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(\n runNextFrame: () => void,\n stepName?: StepNames\n): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set<Process>()\n let nextFrame = new Set<Process>()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet<Process>()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n let numCalls = 0\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n numCalls++\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n if (!queue.has(callback)) queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n ;[thisFrame, nextFrame] = [nextFrame, thisFrame]\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls)\n }\n numCalls = 0\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n", "import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(\n flagRunNextFrame,\n allowKeepAlive ? key : undefined\n )\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n", "import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n", "import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n", "export const activeAnimations = {\n layout: 0,\n mainThread: 0,\n waapi: 0,\n}\n", "import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n <T extends string>(token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith<CSSVariableName>(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith<CSSVariableToken>(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n", "import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n", "// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n", "export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n", "export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n", "export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n", "import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n <V extends RGBA | HSLA>(aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n", "import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor<RGBA>(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n", "import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n", "import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n", "import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor<HSLA>(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n", "import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n", "export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n", "import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array<keyof ValueIndexes>\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array<keyof ValueIndexes> = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n const { split, types } = analyseComplexValue(source)\n\n const numSections = split.length\n return (v: Array<CSSVariableToken | Color | number | string>) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const parsed = parseComplexValue(v)\n const transformer = createTransformer(v)\n return transformer(parsed.map(convertNumbersToZero))\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n", "import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n", "export function mixImmediate<T>(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n", "/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n", "import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n", "export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n", "import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array<number | RGBA | HSLA | string>\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer<T>(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n", "import { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\n\nexport function mix<T>(from: T, to: T): Mixer<T>\nexport function mix(from: number, to: number, p: number): number\nexport function mix<T>(from: T, to: T, p?: T): Mixer<T> | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer<T>\n}\n", "import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n", "import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n", "import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator<unknown>\n): number {\n let duration = 0\n const timeStep = 50\n let state = generator.next(duration)\n while (!state.done && duration < maxGeneratorDuration) {\n duration += timeStep\n state = generator.next(duration)\n }\n\n return duration >= maxGeneratorDuration ? Infinity : duration\n}\n", "import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n", "import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function calcGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n", "export const springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n velocity: 0.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n maxDamping: 1,\n}\n", "import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport { SpringOptions } from \"../../types\"\nimport { springDefaults } from \"./defaults\"\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\n\ntype Resolver = (num: number) => number\n\nconst safeMin = 0.001\n\nexport function findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: Resolver\n let derivative: Resolver\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: Resolver,\n derivative: Resolver,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\nexport function calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n", "import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../../types\"\nimport { generateLinearEasing } from \"../../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"../utils/calc-duration\"\nimport { createGeneratorEasing } from \"../utils/create-generator-easing\"\nimport { calcGeneratorVelocity } from \"../utils/velocity\"\nimport { springDefaults } from \"./defaults\"\nimport { calcAngularFreq, findSpring } from \"./find\"\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring(options)\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions<number>\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator<number> {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions<number>)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState<number> = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t: number) => {\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0\n\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current)\n }\n\n const isBelowVelocityThreshold =\n Math.abs(currentVelocity) <= restSpeed!\n const isBelowDisplacementThreshold =\n Math.abs(target - current) <= restDelta!\n\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n", "import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { calcGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions<number>): KeyframeGenerator<number> {\n const origin = keyframes[0]\n\n const state: AnimationState<number> = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator<number> | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n", "import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions<T> {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory<T>\n}\n\nfunction createMixers<T>(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory<T>\n) {\n const mixers: Array<Mixer<T>> = []\n const mixerFactory: MixerFactory<T> =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer<T>\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate<T>(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions<T> = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n", "import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n", "import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n", "export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n", "import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes<T extends AnyResolvedKeyframe>({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions<T>): KeyframeGenerator<T> {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState<T> = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate<T>(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n", "import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe<T>(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n", "import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n", "export class WithPromise {\n protected _finished: Promise<void>\n\n resolve: VoidFunction\n\n constructor() {\n this.updateFinished()\n }\n\n get finished() {\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = new Promise<void>((resolve) => {\n this.resolve = resolve\n })\n }\n\n protected notifyFinished() {\n this.resolve()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n", "import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { activeAnimations } from \"../stats/animation-count\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation<T extends number | string>\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator<T>\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions<T>\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer<T> | undefined\n\n private mirroredGenerator: KeyframeGenerator<T> | undefined\n\n constructor(options: ValueAnimationOptions<T>) {\n super()\n activeAnimations.mainThread++\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed)\n\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n this.driver?.start(false)\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n this.updateTime(time.now())\n const hasChanged = this.playbackSpeed !== newSpeed\n this.playbackSpeed = newSpeed\n\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n activeAnimations.mainThread--\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState<T> {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue<T extends number | string>(\n options: ValueAnimationOptions<T>\n) {\n return new JSAnimation(options)\n}\n", "import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n", "import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n", "/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set(transformPropOrder))()\n", "import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial<CSSStyleDeclaration>\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue<AnyResolvedKeyframe> | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) =>\n x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) =>\n y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n", "import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T | null>\n\nexport type ResolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T>\n\nconst toResolve = new Set<KeyframeResolver>()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved<T extends AnyResolvedKeyframe> = (\n resolvedKeyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver<T extends AnyResolvedKeyframe = any> {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>\n\n private motionValue?: MotionValue<T>\n private onComplete: OnKeyframesResolved<T>\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n onComplete: OnKeyframesResolved<T>,\n name?: string,\n motionValue?: MotionValue<T>,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes<T>,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n", "export const isCSSVar = (name: string) => name.startsWith(\"--\")\n", "import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n", "import { memo } from \"motion-utils\"\nimport { ProgressTimeline } from \"../..\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nexport const supportsScrollTimeline = /* @__PURE__ */ memo(\n () => window.ScrollTimeline !== undefined\n)\n", "/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record<string, boolean | undefined> = {}\n", "import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports<T extends any>(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n", "import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n", "import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n", "import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n", "import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n", "import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n", "import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n", "import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n", "import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions<V extends AnyResolvedKeyframe = number>\n extends DOMValueAnimationOptions<V> {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n } else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe)\n }\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n return noop<void>\n } else {\n return observe(this)\n }\n }\n}\n", "import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n", "import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended<T extends AnyResolvedKeyframe> =\n NativeAnimationOptions & ValueAnimationOptions<T> & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation<T> {\n options: NativeAnimationOptionsExtended<T>\n\n constructor(options: NativeAnimationOptionsExtended<T>) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n if (options.startTime !== undefined) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n sampleAnimation.sample(sampleTime).value,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n", "import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n", "import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes<any>) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes<any>,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n", "import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n", "import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set<string>([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation<T extends AnyResolvedKeyframe>(\n options: ValueAnimationOptionsWithRenderContext<T>\n) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } =\n options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n", "import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes<T extends AnyResolvedKeyframe> = Omit<\n ValueAnimationOptions<T>,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions<T>) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes<T> = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes<T>,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n : new JSAnimation(resolvedOptions)\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n", "import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array<AcceptedAnimations | undefined>) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accomadate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n", "import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n", "import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n", "import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial<ValueAnimationOptions> = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial<ValueAnimationOptions> => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial<ValueAnimationOptions> => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n", "import type { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe<T>(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const index =\n repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n", "export function getValueTransition(transition: any, key: string) {\n return (\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n )\n}\n", "import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({\n when,\n delay: _delay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n repeat,\n repeatType,\n repeatDelay,\n from,\n elapsed,\n ...transition\n}: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }) {\n return !!Object.keys(transition).length\n}\n", "import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../utils/get-final-keyframe\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n <V extends AnyResolvedKeyframe>(\n name: string,\n value: MotionValue<V>,\n target: V | UnresolvedKeyframes<V>,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement<any>,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe<V>(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n", "import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n", "import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n", "import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n", "import { SubscriptionManager, velocityPerSecond, warnOnce } from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber<T> = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks<V> {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue<V = any> {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect<V>\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set<MotionValue> | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber<V>): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager<any>\n } = {}\n\n on<EventName extends keyof MotionValueEventCallbacks<V>>(\n eventName: EventName,\n callback: MotionValueEventCallbacks<V>[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect<V>, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise<void>((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue<V>(init: V, options?: MotionValueOptions) {\n return new MotionValue<V>(init, options)\n}\n", "import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n", "import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n", "import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n", "import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n", "import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n", "export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n", "import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n", "import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n", "import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition = visualElement.getDefaultTransition(),\n transitionEnd,\n ...target\n } = targetAndTransition\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n })\n }\n\n return animations\n}\n", "import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n", "import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n", "import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n", "import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n", "import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n", "import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n", "import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n", "import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n", "import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n", "import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (defaultValueType !== filter) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n", "import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n", "import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver<T> {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n onComplete: OnKeyframesResolved<T>,\n name?: string,\n motionValue?: MotionValue<T>,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n", "export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf<Element>\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope<T = any> {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf<Element>\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n", "import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n", "import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n", "import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n", "import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n", "import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin = \"first\" | \"last\" | \"center\" | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease }: StaggerOptions = {}\n): DynamicOption<number> {\n return (i: number, total: number) => {\n const fromIndex =\n typeof from === \"number\" ? from : getOriginIndex(from, total)\n const distance = Math.abs(fromIndex - i)\n let delay = duration * distance\n\n if (ease) {\n const maxDelay = total * duration\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n", "import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n", "import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n", "interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n", "import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n", "import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap<any, VisualElement>()\n", "import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n", "/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n", "import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n", "import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n", "import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record<string, any>\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n", "import { Box } from \"motion-utils\"\nimport {\n isNumericalString,\n isZeroValueString,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { complex } from \"../value/types/complex\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport {\n initPrefersReducedMotion,\n hasReducedMotionListener,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { visualElementStore } from \"./store\"\nimport {\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n PresenceContextProps,\n ReducedMotionConfig,\n FeatureDefinitions,\n MotionConfigContextProps,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\nimport { Feature } from \"./Feature\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial<FeatureDefinitions> = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(definitions: Partial<FeatureDefinitions>) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial<FeatureDefinitions> {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial<MotionConfigContextProps>\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set<VisualElement>()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set<VisualElement>\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set<VisualElement>\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map<string, MotionValue>()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature<Instance>\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map<string, VoidFunction>()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager<any>\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions<Instance, RenderState>,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (typeof window !== \"undefined\" && (window as any).MotionCheckAppearSync) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(this, key, value)\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n if (value.owner) value.stop()\n })\n }\n\n sortNodePosition(other: VisualElement<Instance>) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n", "import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement<Instance, State, Options> {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue<any> | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n", "import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n", "import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n", "import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n", "import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n", "import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n", "import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n", "import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n", "import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n", "import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n", "import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n", "import type { Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial<MotionConfigContextProps>\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n", "import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n", "import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n", "import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record<string, any>\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform\n delete attrs.transform\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n", "/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n", "export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n", "import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n", "import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n", "import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue<any> | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n", "import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue<V extends AnyResolvedKeyframe>(\n value: MotionValue<V> | V,\n keyframes: V | UnresolvedValueKeyframe<V>[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n", "import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n", "import {\n AnimationScope,\n DOMKeyframesDefinition,\n SelectorCache,\n resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects<O extends {}>(\n subject:\n | string\n | Element\n | Element[]\n | NodeListOf<Element>\n | O\n | O[]\n | null\n | undefined,\n keyframes: DOMKeyframesDefinition | ObjectTarget<O>,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n) {\n if (subject == null) {\n return []\n }\n\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache)\n } else if (subject instanceof NodeList) {\n return Array.from(subject)\n } else if (Array.isArray(subject)) {\n return subject.filter((s) => s != null)\n } else {\n return [subject]\n }\n}\n", "export function calculateRepeatDuration(\n duration: number,\n repeat: number,\n _repeatDelay: number\n): number {\n return duration * (repeat + 1)\n}\n", "import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n current: number,\n next: SequenceTime,\n prev: number,\n labels: Map<string, number>\n): number {\n if (typeof next === \"number\") {\n return next\n } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next))\n } else if (next === \"<\") {\n return prev\n } else if (next.startsWith(\"<\")) {\n return Math.max(0, prev + parseFloat(next.slice(1)))\n } else {\n return labels.get(next) ?? current\n }\n}\n", "import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n sequence: ValueSequence,\n startTime: number,\n endTime: number\n): void {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i]\n\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe)\n\n // If we remove this item we have to push the pointer back one\n i--\n }\n }\n}\n\nexport function addKeyframes(\n sequence: ValueSequence,\n keyframes: UnresolvedValueKeyframe[],\n easing: Easing | Easing[],\n offset: number[],\n startTime: number,\n endTime: number\n): void {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime)\n\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n })\n }\n}\n", "/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nexport function normalizeTimes(times: number[], repeat: number): void {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1)\n }\n}\n", "import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n a: AbsoluteKeyframe,\n b: AbsoluteKeyframe\n): number {\n if (a.at === b.at) {\n if (a.value === null) return 1\n if (b.value === null) return -1\n return 0\n } else {\n return a.at - b.at\n }\n}\n", "import {\n AnimationScope,\n createGeneratorEasing,\n defaultOffset,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n fillOffset,\n GeneratorFactory,\n isGenerator,\n isMotionValue,\n Transition,\n UnresolvedValueKeyframe,\n type AnyResolvedKeyframe,\n type MotionValue,\n} from \"motion-dom\"\nimport {\n Easing,\n getEasingForSegment,\n invariant,\n progress,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n AnimationSequence,\n At,\n ResolvedAnimationDefinitions,\n SequenceMap,\n SequenceOptions,\n ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n sequence: AnimationSequence,\n { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n scope?: AnimationScope,\n generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n const defaultDuration = defaultTransition.duration || 0.3\n const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n const sequences = new Map<Element | MotionValue, SequenceMap>()\n const elementCache = {}\n const timeLabels = new Map<string, number>()\n\n let prevTime = 0\n let currentTime = 0\n let totalDuration = 0\n\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i]\n\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime)\n continue\n } else if (!Array.isArray(segment)) {\n timeLabels.set(\n segment.name,\n calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n )\n continue\n }\n\n let [subject, keyframes, transition = {}] = segment\n\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(\n currentTime,\n transition.at,\n prevTime,\n timeLabels\n )\n }\n\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0\n\n const resolveValueSequence = (\n valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n valueTransition: Transition | DynamicAnimationOptions,\n valueSequence: ValueSequence,\n elementIndex = 0,\n numSubjects = 0\n ) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n const {\n delay = 0,\n times = defaultOffset(valueKeyframesAsList),\n type = defaultTransition.type || \"keyframes\",\n repeat,\n repeatType,\n repeatDelay = 0,\n ...remainingTransition\n } = valueTransition\n let { ease = defaultTransition.ease || \"easeOut\", duration } =\n valueTransition\n\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay =\n typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay\n\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length\n const createGenerator = isGenerator(type)\n ? type\n : generators?.[type || \"keyframes\"]\n\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100\n if (\n numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)\n ) {\n const delta =\n valueKeyframesAsList[1] - valueKeyframesAsList[0]\n absoluteDelta = Math.abs(delta)\n }\n\n const springTransition = {\n ...defaultTransition,\n ...remainingTransition,\n }\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration)\n }\n\n const springEasing = createGeneratorEasing(\n springTransition,\n absoluteDelta,\n createGenerator\n )\n\n ease = springEasing.ease\n duration = springEasing.duration\n }\n\n duration ??= defaultDuration\n\n const startTime = currentTime + calculatedDelay\n\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1\n }\n\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length\n remainder > 0 && fillOffset(times, remainder)\n\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null)\n\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(\n repeat < MAX_REPEAT,\n \"Repeat count too high, must be less than 20\",\n \"repeat-count-high\"\n )\n\n duration = calculateRepeatDuration(\n duration,\n repeat,\n repeatDelay\n )\n\n const originalKeyframes = [...valueKeyframesAsList]\n const originalTimes = [...times]\n ease = Array.isArray(ease) ? [...ease] : [ease]\n const originalEase = [...ease]\n\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes)\n\n for (\n let keyframeIndex = 0;\n keyframeIndex < originalKeyframes.length;\n keyframeIndex++\n ) {\n times.push(\n originalTimes[keyframeIndex] + (repeatIndex + 1)\n )\n ease.push(\n keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(\n originalEase,\n keyframeIndex - 1\n )\n )\n }\n }\n\n normalizeTimes(times, repeat)\n }\n\n const targetTime = startTime + duration\n\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(\n valueSequence,\n valueKeyframesAsList,\n ease as Easing | Easing[],\n times,\n startTime,\n targetTime\n )\n\n maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n totalDuration = Math.max(targetTime, totalDuration)\n }\n\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences)\n resolveValueSequence(\n keyframes as AnyResolvedKeyframe,\n transition,\n getValueSequence(\"default\", subjectSequence)\n )\n } else {\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope,\n elementCache\n )\n\n const numSubjects = subjects.length\n\n /**\n * For every element in this segment, process the defined values.\n */\n for (\n let subjectIndex = 0;\n subjectIndex < numSubjects;\n subjectIndex++\n ) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes as DOMKeyframesDefinition\n transition = transition as DynamicAnimationOptions\n\n const thisSubject = subjects[subjectIndex]\n const subjectSequence = getSubjectSequence(\n thisSubject,\n sequences\n )\n\n for (const key in keyframes) {\n resolveValueSequence(\n keyframes[\n key as keyof typeof keyframes\n ] as UnresolvedValueKeyframe,\n getValueTransition(transition, key),\n getValueSequence(key, subjectSequence),\n subjectIndex,\n numSubjects\n )\n }\n }\n }\n\n prevTime = currentTime\n currentTime += maxDuration\n }\n\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key]\n\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime)\n\n const keyframes: UnresolvedValueKeyframe[] = []\n const valueOffset: number[] = []\n const valueEasing: Easing[] = []\n\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i]\n keyframes.push(value)\n valueOffset.push(progress(0, totalDuration, at))\n valueEasing.push(easing || \"easeOut\")\n }\n\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0)\n keyframes.unshift(keyframes[0])\n valueEasing.unshift(defaultSegmentEasing)\n }\n\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1)\n keyframes.push(null)\n }\n\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n })\n }\n\n const definition = animationDefinitions.get(element)!\n\n definition.keyframes[key] = keyframes\n\n /**\n * Exclude `type` from defaultTransition since springs have been\n * converted to duration-based easing functions in resolveValueSequence.\n * Including `type: \"spring\"` would cause JSAnimation to error when\n * the merged keyframes array has more than 2 keyframes.\n */\n const { type: _type, ...remainingDefaultTransition } =\n defaultTransition\n definition.transition[key] = {\n ...remainingDefaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n }\n }\n })\n\n return animationDefinitions\n}\n\nfunction getSubjectSequence<O extends {}>(\n subject: Element | MotionValue | O,\n sequences: Map<Element | MotionValue | O, SequenceMap>\n): SequenceMap {\n !sequences.has(subject) && sequences.set(subject, {})\n return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n if (!sequences[name]) sequences[name] = []\n return sequences[name]\n}\n\nfunction keyframesAsList(\n keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n transition: DynamicAnimationOptions & At,\n key: string\n): DynamicAnimationOptions {\n return transition && transition[key as keyof typeof transition]\n ? {\n ...transition,\n ...(transition[key as keyof typeof transition] as Transition),\n }\n : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n", "import {\n HTMLVisualElement,\n isSVGElement,\n isSVGSVGElement,\n ObjectVisualElement,\n SVGVisualElement,\n visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n }\n const node =\n isSVGElement(element) && !isSVGSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options)\n\n node.mount(element as any)\n\n visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n }\n const node = new ObjectVisualElement(options)\n\n node.mount(subject)\n\n visualElementStore.set(subject, node)\n}\n", "import {\n animateTarget,\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n AnyResolvedKeyframe,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n isMotionValue,\n MotionValue,\n TargetAndTransition,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n createDOMVisualElement,\n createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue<any> | any\n\nfunction isSingleValue(\n subject: unknown,\n keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n return (\n isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n value: string | MotionValue<string>,\n keyframes: string | UnresolvedValueKeyframe<string>[],\n options?: ValueAnimationTransition<string>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n value: number | MotionValue<number>,\n keyframes: number | UnresolvedValueKeyframe<number>[],\n options?: ValueAnimationTransition<number>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject<O extends Object>(\n object: O | O[],\n keyframes: ObjectTarget<O>,\n options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject<O extends Object>(\n subject:\n | MotionValue<number>\n | MotionValue<string>\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n keyframes:\n | number\n | string\n | UnresolvedValueKeyframe<number>[]\n | UnresolvedValueKeyframe<string>[]\n | DOMKeyframesDefinition\n | ObjectTarget<O>,\n options?:\n | ValueAnimationTransition<number>\n | ValueAnimationTransition<string>\n | DynamicAnimationOptions,\n scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n if (isSingleValue(subject, keyframes)) {\n animations.push(\n animateSingleValue(\n subject,\n isDOMKeyframes(keyframes)\n ? (keyframes as any).default || keyframes\n : keyframes,\n options ? (options as any).default || options : options\n )\n )\n } else {\n // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n if (subject == null) {\n return animations\n }\n\n const subjects = resolveSubjects(\n subject,\n keyframes as DOMKeyframesDefinition,\n scope\n )\n\n const numSubjects = subjects.length\n\n invariant(\n Boolean(numSubjects),\n \"No valid elements provided.\",\n \"no-valid-elements\"\n )\n\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i]\n\n const createVisualElement =\n thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement\n\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject as any)\n }\n\n const visualElement = visualElementStore.get(thisSubject)!\n const transition = { ...options }\n\n /**\n * Resolve stagger function if provided.\n */\n if (\n \"delay\" in transition &&\n typeof transition.delay === \"function\"\n ) {\n transition.delay = transition.delay(i, numSubjects)\n }\n\n animations.push(\n ...animateTarget(\n visualElement,\n { ...(keyframes as {}), transition } as TargetAndTransition,\n {}\n )\n )\n }\n }\n\n return animations\n}\n", "import {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n sequence: AnimationSequence,\n options?: SequenceOptions,\n scope?: AnimationScope\n) {\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationDefinitions = createAnimationsFromSequence(\n sequence,\n options,\n scope,\n { spring }\n )\n\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition))\n })\n\n return animations\n}\n", "import type {\n AnimationPlaybackControlsWithThen,\n AnimationScope,\n DOMKeyframesDefinition,\n AnimationOptions as DynamicAnimationOptions,\n ElementOrSelector,\n MotionValue,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n AnimationSequence,\n ObjectTarget,\n SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n return Array.isArray(value) && value.some(Array.isArray)\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(scope?: AnimationScope) {\n /**\n * Animate a sequence\n */\n function scopedAnimate(\n sequence: AnimationSequence,\n options?: SequenceOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a string\n */\n function scopedAnimate(\n value: string | MotionValue<string>,\n keyframes: string | UnresolvedValueKeyframe<string>[],\n options?: ValueAnimationTransition<string>\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a number\n */\n function scopedAnimate(\n value: number | MotionValue<number>,\n keyframes: number | UnresolvedValueKeyframe<number>[],\n options?: ValueAnimationTransition<number>\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate a generic motion value\n */\n function scopedAnimate<V extends string | number>(\n value: V | MotionValue<V>,\n keyframes: V | UnresolvedValueKeyframe<V>[],\n options?: ValueAnimationTransition<V>\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an Element\n */\n function scopedAnimate(\n element: ElementOrSelector,\n keyframes: DOMKeyframesDefinition,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Animate an object\n */\n function scopedAnimate<O extends {}>(\n object: O | O[],\n keyframes: ObjectTarget<O>,\n options?: DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen\n /**\n * Implementation\n */\n function scopedAnimate<O extends {}>(\n subjectOrSequence:\n | AnimationSequence\n | MotionValue<number>\n | MotionValue<string>\n | number\n | string\n | ElementOrSelector\n | O\n | O[],\n optionsOrKeyframes?:\n | SequenceOptions\n | number\n | string\n | UnresolvedValueKeyframe<number>[]\n | UnresolvedValueKeyframe<string>[]\n | DOMKeyframesDefinition\n | ObjectTarget<O>,\n options?:\n | ValueAnimationTransition<number>\n | ValueAnimationTransition<string>\n | DynamicAnimationOptions\n ): AnimationPlaybackControlsWithThen {\n let animations: AnimationPlaybackControlsWithThen[] = []\n let animationOnComplete: VoidFunction | undefined\n\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(\n subjectOrSequence,\n optionsOrKeyframes as SequenceOptions,\n scope\n )\n } else {\n // Extract top-level onComplete so it doesn't get applied per-value\n const { onComplete, ...rest } = options || {}\n if (typeof onComplete === \"function\") {\n animationOnComplete = onComplete as VoidFunction\n }\n animations = animateSubject(\n subjectOrSequence as ElementOrSelector,\n optionsOrKeyframes as DOMKeyframesDefinition,\n rest as DynamicAnimationOptions,\n scope\n )\n }\n\n const animation = new GroupAnimationWithThen(animations)\n\n if (animationOnComplete) {\n animation.finished.then(animationOnComplete)\n }\n\n if (scope) {\n scope.animations.push(animation)\n animation.finished.then(() => {\n removeItem(scope.animations, animation)\n })\n }\n\n return animation\n }\n\n return scopedAnimate\n}\n\nexport const animate = createScopedAnimate()\n", "import { animate, stagger as staggerDelay } from 'motion';\nimport type { AnimationOptions, DOMKeyframesDefinition } from 'motion-dom';\n\nimport type { AnimationFunctions, AnimationProps } from './types';\n\n/**\n * Creates a new Animation.\n * @param props The animaiton props.\n * @returns A new `in` and `out` Animation functions.\n */\nexport const createAnimation = ({\n initialStyles,\n keyframes,\n}: AnimationProps): AnimationFunctions => {\n const animateElements = animate as (\n elements: Element | Element[],\n keyframes: DOMKeyframesDefinition,\n options?: AnimationOptions,\n ) => { finished: Promise<void> };\n const reverseKeyframes = (frames: DOMKeyframesDefinition): DOMKeyframesDefinition =>\n Object.fromEntries(\n Object.entries(frames).map(([property, value]) => [\n property,\n Array.isArray(value) ? [...value].reverse() : value,\n ]),\n ) as DOMKeyframesDefinition;\n\n /**\n * Prepares the {@link animateIn} elements by setting the initial styles and rendering them to the DOM.\n * @param elements The elements to prepare.\n * @param options.target If defined, the element will be appended to the target.\n * @param options.insertAfter A child of the target. If defined, the element will be appended right after this anchor element.\n */\n const prepareIn: AnimationFunctions['prepareIn'] = (elements, options = {}) => {\n const { target, insertAfter, display = '' } = options;\n\n if (!Array.isArray(elements)) elements = [elements];\n\n for (const element of elements) {\n element.style.display = display;\n Object.assign(element.style, initialStyles);\n\n if (target && insertAfter !== undefined) {\n if (insertAfter) target.insertBefore(element, insertAfter.nextSibling);\n else target.prepend(element);\n } else if (target) target.appendChild(element);\n }\n };\n\n /**\n * In animation.\n * @param elements The elements to animate.\n * @param options.target If defined, the element will be appended to the target.\n * @param options.insertAfter A child of the target. If defined, the element will be appended right after this anchor element.\n * @param options.prepared Defines if the animation has been prepared beforehand, useful to avoid performing double preparation.\n * @param options.stagger If defined, the animation will be staggered using this time value.\n * @param options.animationOptions The main options of the animation. Reference: {@link [Motion One](https://motion.dev/dom/animate#options)}.\n * @returns An awaitable promise.\n */\n const animateIn: AnimationFunctions['animateIn'] = async (elements, options = {}) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { prepared, stagger, display, duration, ...animationOptions } = options;\n\n const durationInSeconds = duration ? duration / 1000 : undefined;\n\n if (!prepared) prepareIn(elements, options);\n\n const targets = Array.isArray(elements) ? elements : [elements];\n\n const { finished } = animateElements(targets, keyframes, {\n ...animationOptions,\n delay: stagger ? staggerDelay(stagger / 1000) : undefined,\n duration: durationInSeconds,\n });\n\n return await finished;\n };\n\n /**\n * Out animation.\n * @param elements The elements to animate.\n * @param options.remove If defined, the element will be removed from the DOM after the animation ends.\n * @param options.stagger If defined, the animation will be staggered using this time value.\n * @param options.animationOptions The main options of the animation. Reference: {@link [Motion One](https://motion.dev/dom/animate#options)}.\n * @returns An awaitable promise.\n */\n const animateOut: AnimationFunctions['animateOut'] = async (elements, options = {}) => {\n const {\n remove,\n stagger,\n target,\n insertAfter,\n display = 'none',\n duration,\n ...animationOptions\n } = options;\n\n const durationInSeconds = duration ? duration / 1000 : undefined;\n\n const targets = Array.isArray(elements) ? elements : [elements];\n\n const filteredTargets = targets.filter((element) => document.body.contains(element));\n\n if (!filteredTargets.length) return;\n\n const { finished } = animateElements(filteredTargets, reverseKeyframes(keyframes), {\n ...animationOptions,\n duration: durationInSeconds,\n delay: stagger ? staggerDelay(stagger / 1000) : undefined,\n });\n\n await finished;\n\n for (const element of filteredTargets) {\n if (target && insertAfter !== undefined) {\n if (insertAfter) target.insertBefore(element, insertAfter.nextSibling);\n else target.prepend(element);\n } else if (target) target.appendChild(element);\n\n if (remove) element.remove();\n else element.style.display = display;\n }\n };\n\n return { prepareIn, animateIn, animateOut };\n};\n", "import { createAnimation } from './factory';\nimport type { AnimationsObject } from './types';\n\nexport * from './types';\n\n// Constants\nexport const easings = ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out'] as const;\n\n/**\n * Contains all animation functions.\n */\nexport const animations: AnimationsObject = {\n /**\n * Fade\n */\n fade: createAnimation({ keyframes: { opacity: [0, 1] }, initialStyles: { opacity: '0' } }),\n\n /**\n * Slide Up\n */\n 'slide-up': createAnimation({\n keyframes: { y: [100, 0], opacity: [0, 1] },\n initialStyles: { transform: 'translateY(100px)', opacity: '0' },\n }),\n\n /**\n * Slide Down\n */\n 'slide-down': createAnimation({\n keyframes: { y: [-100, 0], opacity: [0, 1] },\n initialStyles: { transform: 'translateY(-100px)', opacity: '0' },\n }),\n\n /**\n * Slide Right\n */\n 'slide-right': createAnimation({\n keyframes: { x: [-100, 0], opacity: [0, 1] },\n initialStyles: { transform: 'translateX(-100px)', opacity: '0' },\n }),\n\n /**\n * Slide Left\n */\n 'slide-left': createAnimation({\n keyframes: { x: [100, 0], opacity: [0, 1] },\n initialStyles: { transform: 'translateX(100px)', opacity: '0' },\n }),\n\n /**\n * Grow\n */\n grow: createAnimation({\n keyframes: { scale: [0, 1], opacity: [0, 1] },\n initialStyles: { transform: 'scale(0)', opacity: '0' },\n }),\n\n /**\n * Shrink\n */\n shrink: createAnimation({\n keyframes: { scale: [1.25, 1], opacity: [0, 1] },\n initialStyles: { transform: 'scale(1.25)', opacity: '0' },\n }),\n\n /**\n * Spin\n */\n spin: createAnimation({\n keyframes: { rotate: [900, 0], opacity: [0, 1] },\n initialStyles: { transform: 'rotate(900deg)', opacity: '0' },\n }),\n} as const;\n", "export type EnsureButtonLikeOptions = {\n /**\n * If true, do not overwrite role/tabindex if already present.\n * Default: true\n */\n preserveExisting?: boolean;\n};\n\nfunction isNaturallyInteractive(el: Element): boolean {\n const tag = el.tagName.toLowerCase();\n\n if (\n tag === 'button' ||\n tag === 'a' ||\n tag === 'input' ||\n tag === 'select' ||\n tag === 'textarea'\n ) {\n return true;\n }\n\n // Contenteditable acts as interactive (focusable)\n const ce = (el as HTMLElement).getAttribute?.('contenteditable');\n if (ce && ce !== 'false') return true;\n\n return false;\n}\n\nexport function ensureButtonLike(el: Element, options: EnsureButtonLikeOptions = {}): void {\n const preserveExisting = options.preserveExisting ?? true;\n\n // If already interactive, do nothing\n if (isNaturallyInteractive(el)) return;\n\n const ht = el as HTMLElement;\n\n // role=button\n if (!preserveExisting || !ht.hasAttribute('role')) {\n ht.setAttribute('role', 'button');\n }\n\n // tabindex=0 to make it focusable\n if (!preserveExisting || !ht.hasAttribute('tabindex')) {\n ht.setAttribute('tabindex', '0');\n }\n\n // Optional: aria-disabled if disabled attribute exists (best-effort)\n // Do not force it; modules can manage disabled semantics separately.\n}\n\nexport function isActivationKey(e: KeyboardEvent): boolean {\n // Don’t hijack modified keys\n if (e.altKey || e.ctrlKey || e.metaKey) return false;\n\n // \"Enter\" triggers activation\n if (e.key === 'Enter') return true;\n\n // Space triggers activation in button-like patterns\n // Browser differences: e.key can be \" \" or \"Spacebar\" (legacy)\n if (e.key === ' ' || e.key === 'Spacebar') return true;\n\n return false;\n}\n", "export type CleanupFn = () => void;\n\nexport type CleanupBag = {\n add: (fn: CleanupFn) => void;\n run: () => void;\n isDone: () => boolean;\n};\n\nexport function createCleanupBag(): CleanupBag {\n const fns: CleanupFn[] = [];\n let done = false;\n\n return {\n add(fn) {\n if (done) {\n // If already destroyed, run immediately to avoid leaks.\n try {\n fn();\n } catch {\n /* best-effort */\n }\n return;\n }\n fns.push(fn);\n },\n\n run() {\n if (done) return;\n done = true;\n\n // Run in reverse order (LIFO) – typical resource cleanup convention\n for (let i = fns.length - 1; i >= 0; i--) {\n const fn = fns[i];\n try {\n fn();\n } catch {\n // best-effort cleanup: never throw\n }\n }\n fns.length = 0;\n },\n\n isDone() {\n return done;\n },\n };\n}\n\n/**\n * Wrap a destroy function to make it idempotent and best-effort.\n */\nexport function makeIdempotentDestroy(fn: CleanupFn): CleanupFn {\n let called = false;\n return () => {\n if (called) return;\n called = true;\n try {\n fn();\n } catch {\n // best-effort\n }\n };\n}\n", "import type { WebflowBreakpoint } from '../types';\n\nexport const WEBFLOW_ASSETS_CDN_ORIGIN = 'https://cdn.prod.website-files.com';\n\nexport const CURRENT_CSS_CLASS = 'w--current';\n\nexport const RICH_TEXT_BLOCK_CSS_CLASS = 'w-richtext';\n\nexport const HTML_EMBED_CSS_CLASS = 'w-embed';\n\nexport const SLIDER_CSS_CLASSES = {\n slider: 'w-slider',\n slide: 'w-slide',\n sliderMask: 'w-slider-mask',\n sliderNav: 'w-slider-nav',\n sliderDot: 'w-slider-dot',\n activeSliderDot: 'w-active',\n} as const;\n\nexport const TABS_CSS_CLASSES = {\n tabs: 'w-tabs',\n tabsContent: 'w-tab-content',\n tabPane: 'w-tab-pane',\n tabsMenu: 'w-tab-menu',\n tabLink: 'w-tab-link',\n activeTab: 'w--tab-active',\n} as const;\n\nexport const NAVBAR_CSS_CLASSES = {\n navMenu: 'w-nav-menu',\n} as const;\n\nexport const CMS_CSS_CLASSES = {\n wrapper: 'w-dyn-list',\n list: 'w-dyn-items',\n item: 'w-dyn-item',\n paginationWrapper: 'w-pagination-wrapper',\n paginationNext: 'w-pagination-next',\n paginationPrevious: 'w-pagination-previous',\n pageCount: 'w-page-count',\n emptyState: 'w-dyn-empty',\n} as const;\n\nexport const FORM_CSS_CLASSES = {\n formBlock: 'w-form',\n checkboxField: 'w-checkbox',\n checkboxInput: 'w-checkbox-input',\n radioField: 'w-radio',\n radioInput: 'w-radio-input',\n checkboxOrRadioLabel: 'w-form-label',\n checkboxOrRadioFocus: 'w--redirected-focus',\n checkboxOrRadioChecked: 'w--redirected-checked',\n successMessage: 'w-form-done',\n errorMessage: 'w-form-fail',\n} as const;\n\nexport const DROPDOWN_CSS_CLASSES = {\n dropdown: 'w-dropdown',\n dropdownToggle: 'w-dropdown-toggle',\n dropdownList: 'w-dropdown-list',\n} as const;\n\nexport const COMMERCE_CSS_CLASSES = {\n addToCartForm: 'w-commerce-commerceaddtocartform',\n} as const;\n\nexport const LIGHTBOX_CSS_CLASSES = {\n trigger: 'w-lightbox',\n} as const;\n\nexport const WEBFLOW_BREAKPOINTS: Map<WebflowBreakpoint, string> = new Map([\n ['tiny', '(max-width: 479px)'],\n ['small', '(max-width: 767px)'],\n ['medium', '(max-width: 991px)'],\n ['main', '(min-width: 992px)'],\n]);\n", "import type { Entry, FormField } from '../types';\nimport type {\n ActivationResult,\n GuardContext,\n GuardEvalResult,\n GuardParseResult,\n GuardRegistry,\n ModuleKey,\n} from '../types/guards';\n\nfunction isReservedAttr(name: string) {\n return name.startsWith('data-adlib-');\n}\n\nfunction normalizeModuleKey(moduleKey: string): string {\n return moduleKey.startsWith('ad-') ? moduleKey : `ad-${moduleKey}`;\n}\n\n/**\n * Disabled contract:\n * - module scoped: data-<key>-disabled / <key>-disabled\n * - optional global: data-ad-disabled\n */\nexport function isDisabled(\n el: Element,\n moduleKey: string,\n opts?: { includeGlobal?: boolean },\n): boolean {\n const mk = normalizeModuleKey(moduleKey);\n\n const dataScoped = `data-${mk}-disabled`;\n const shortScoped = `${mk}-disabled`;\n\n if (!isReservedAttr(dataScoped) && el.hasAttribute(dataScoped)) return true;\n if (!isReservedAttr(shortScoped) && el.hasAttribute(shortScoped)) return true;\n\n if (opts?.includeGlobal) {\n const global = `data-ad-disabled`;\n if (!isReservedAttr(global) && el.hasAttribute(global)) return true;\n }\n\n return false;\n}\n\n/**\n * Guards contract:\n * - module scoped: data-<key>-guards / <key>-guards\n * - optional global: data-ad-guards\n * Value format: space-separated guard names (e.g. \"loggedIn canEdit\")\n */\nexport function parseGuards(\n el: Element,\n moduleKey: string,\n opts?: { includeGlobal?: boolean },\n): GuardParseResult {\n const mk = normalizeModuleKey(moduleKey);\n\n const read = (name: string): string | null => {\n if (isReservedAttr(name)) return null;\n return el.getAttribute(name);\n };\n\n const names: string[] = [];\n\n const v1 = read(`data-${mk}-guards`);\n const v3 = read(`${mk}-guards`);\n\n if (v1) names.push(...v1.split(/\\s+/).filter(Boolean));\n\n // global fallback opt-in\n if (opts?.includeGlobal) {\n const v2 = read(`data-ad-guards`);\n if (v2) names.push(...v2.split(/\\s+/).filter(Boolean));\n }\n\n if (v3) names.push(...v3.split(/\\s+/).filter(Boolean));\n\n // dedupe stable\n const out = Array.from(new Set(names));\n return { guards: out };\n}\n\nexport function evaluateGuards(\n el: Element,\n guards: string[],\n registry: GuardRegistry,\n ctx: GuardContext = {},\n): GuardEvalResult {\n for (const g of guards) {\n const fn = registry[g];\n if (!fn) {\n // Unknown guard names are treated as failed (safer default).\n return { ok: false, failedGuard: g, reason: 'guard-failed' };\n }\n const ok = !!fn(el, ctx);\n if (!ok) return { ok: false, failedGuard: g, reason: 'guard-failed' };\n }\n return { ok: true };\n}\n\n/**\n * Enforces normative order: disabled → guards → options → action.\n * Important: action is only called if disabled/guards pass.\n */\nexport async function runActivationPipeline<TOptions>(args: {\n el: Element;\n moduleKey: ModuleKey | string;\n ctx?: GuardContext;\n includeGlobal?: boolean;\n\n guardsRegistry?: GuardRegistry;\n\n readOptions: () => TOptions | Promise<TOptions>;\n action: (options: TOptions) => void | Promise<void>;\n}): Promise<ActivationResult<TOptions>> {\n const { el, moduleKey, includeGlobal } = args;\n\n // 1) disabled\n if (isDisabled(el, moduleKey, { includeGlobal })) {\n return { ok: false, reason: 'disabled' };\n }\n\n // 2) guards\n const parsed = parseGuards(el, moduleKey, { includeGlobal });\n if (parsed.guards.length > 0) {\n const reg = args.guardsRegistry ?? {};\n const evalRes = evaluateGuards(el, parsed.guards, reg, args.ctx ?? {});\n if (!evalRes.ok) {\n return { ok: false, reason: 'guard-failed', failedGuard: evalRes.failedGuard };\n }\n }\n\n // 3) options\n const options = await args.readOptions();\n\n // 4) action\n await args.action(options);\n\n return { ok: true, options };\n}\n\nexport const isString = (value: unknown): value is string => typeof value === 'string';\nexport const isNumber = (value: unknown): value is number => typeof value === 'number';\nexport const isBoolean = (value: unknown): value is boolean => typeof value === 'boolean';\nexport const isUndefined = (value: unknown): value is undefined => value === undefined;\nexport const isDate = (value: unknown): value is Date => value instanceof Date;\n\n/**\n * It literally does nothing.\n */\nexport const noop = () => {\n // No operation.\n};\n\n/**\n * Makes sure a value is not `null` or `undefined`.\n * Useful for type safety when filtering empty elements from an array. Check out the example for more in-depth explanation.\n * @param value The value to type-check.\n * @example ```typescript\n * const items = [1, null, 4, undefined, 8];\n *\n * const filteredItemsError: number[] = items.filter((item) => value !== undefined && value !== null); // Type '(number | null | undefined)[]' is not assignable to type 'number[]'.\n *\n * const filteredItemsSuccess: number[] = items.filter(isNotEmpty); // Success!\n * ```\n */\nexport const isNotEmpty = <T>(value: T | null | undefined): value is T =>\n value !== undefined && value !== null;\n\n/**\n * Check if a key is included in a readonly array\n * @param key\n * @param source readonly array of strings\n * @returns True/false\n */\nexport const isKeyOf = <T extends string>(\n key: string | null | undefined,\n source: readonly T[],\n): key is (typeof source)[number] => !!key && source.includes(<T>key);\n\n/**\n * Gets the keys of an object with inferred typing.\n * @param object\n * @returns\n */\nexport const getObjectKeys = <T extends Record<string, unknown>>(object: T): (keyof T)[] =>\n Object.keys(object) as (keyof T)[];\n\n/**\n * Gets type safe `Object.entries()`.\n * @param object\n */\nexport const getObjectEntries = <T extends Readonly<Record<string, unknown>>>(\n object: T,\n): Entry<T>[] => Object.entries(object) as Entry<T>[];\n\n/**\n * @returns `true` if the target is an instance of Element type.\n * @param target\n */\nexport const isElement = (target: unknown): target is Element => target instanceof Element;\n\n/**\n * @returns `true` if the target is an instance of HTMLElement type.\n * @param target\n */\nexport const isHTMLElement = (target: unknown): target is HTMLElement =>\n target instanceof HTMLElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLVideoElement type.\n * @param target\n */\nexport const isHTMLVideoElement = (target: unknown): target is HTMLVideoElement =>\n target instanceof HTMLVideoElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLInputElement type.\n * @param target\n */\nexport const isHTMLInputElement = (target: unknown): target is HTMLInputElement =>\n target instanceof HTMLInputElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLSelectElement type.\n * @param target\n */\nexport const isHTMLSelectElement = (target: unknown): target is HTMLSelectElement =>\n target instanceof HTMLSelectElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLTextAreaElement type.\n * @param target\n */\nexport const isHTMLTextAreaElement = (target: unknown): target is HTMLTextAreaElement =>\n target instanceof HTMLTextAreaElement;\n\n/**\n * Checks if an element is a form field element\n * @param element\n */\nexport const isFormField = (element: Element | EventTarget | null): element is FormField =>\n isHTMLInputElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element);\n\n/**\n * Checks if an element is a form element\n * @param target\n */\nexport const isHTMLFormElement = (target: unknown): target is HTMLFormElement =>\n target instanceof HTMLFormElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLAnchorElement type.\n * @param target\n */\nexport const isHTMLAnchorElement = (target: unknown): target is HTMLAnchorElement =>\n target instanceof HTMLAnchorElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLOptionElement type.\n * @param target\n */\nexport const isHTMLOptionElement = (target: unknown): target is HTMLOptionElement =>\n target instanceof HTMLOptionElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLImageElement type.\n * @param target\n */\nexport const isHTMLImageElement = (target: unknown): target is HTMLImageElement =>\n target instanceof HTMLImageElement;\n\n/**\n * @returns `true` if the target is an instance of HTMLButtonElement type.\n * @param target\n */\nexport const isHTMLButtonElement = (target: unknown): target is HTMLButtonElement =>\n target instanceof HTMLButtonElement;\n\n/**\n * @returns `true` if the target is an instance of File type.\n * @param target\n */\nexport const isFile = (target: unknown): target is File => target instanceof File;\n", "import { isHTMLElement } from './guards';\n\n/**\n * Ensures that an element has a unique ID.\n * If the element already has a unique ID, that one is preserved.\n * @param element\n * @returns Returns the unique ID assigned to the element.\n */\nexport const ensureUniqueId = (element: Element) => {\n if (!element.id || document.getElementById(element.id) !== element) {\n const id = crypto.randomUUID();\n element.id = id;\n return id;\n }\n\n return element.id;\n};\n\n/**\n * Checks if an element is visible\n * @param element\n */\nexport const isVisible = (element: HTMLElement): boolean =>\n !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length);\n\n/**\n * Clone a node that has the same type as the original one\n * @param node\n */\nexport const cloneNode = <T extends Node>(node: T, deep = true): T => <T>node.cloneNode(deep);\n\n/**\n * Finds the first child text node of an element\n * @param element The element to search into.\n */\nexport const findTextNode = (element: HTMLElement): ChildNode | undefined => {\n let textNode: ChildNode | undefined;\n\n for (const node of element.childNodes) {\n if (isHTMLElement(node) && node.childNodes.length) textNode = findTextNode(node);\n else if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) textNode = node;\n\n if (textNode) break;\n }\n\n return textNode;\n};\n\n/**\n * @returns The first hidden parent element, or the element itself (if hidden).\n * If the element is already visible, the function returns `undefined`.\n *\n * @param element The reference element.\n */\nexport const getHiddenParent = (element: HTMLElement): HTMLElement | undefined => {\n if (isVisible(element)) return;\n\n let previousElement = element;\n\n const checkParent = ({ parentElement }: HTMLElement) => {\n if (!parentElement) return;\n\n if (isVisible(parentElement)) return;\n\n previousElement = parentElement;\n checkParent(parentElement);\n };\n\n checkParent(element);\n\n return previousElement;\n};\n\n/**\n * Check if an element is scrollable\n * @param element\n * @returns True or false\n */\nexport const isScrollable = (element: Element): boolean => {\n const { overflow } = getComputedStyle(element);\n return overflow === 'auto' || overflow === 'scroll';\n};\n", "import { WEBFLOW_ASSETS_CDN_ORIGIN } from '../constants/webflow';\nimport { cloneNode } from './dom';\n\nlet currentPageStylesheets: Set<string> | undefined;\n\nconst attachedExternalStylesheets = new Set<string>();\n\n/**\n * Retrieves the stylesheets linked in the current page that are hosted on the Webflow Assets CDN.\n * @returns A set of stylesheet URLs.\n */\nconst getCurrentPageStylesheets = () => {\n if (currentPageStylesheets) return currentPageStylesheets;\n\n const stylesheets = document.querySelectorAll<HTMLLinkElement>('link[rel=\"stylesheet\"]');\n currentPageStylesheets = new Set<string>();\n\n for (const stylesheet of stylesheets) {\n const { href } = stylesheet;\n\n try {\n const { origin } = new URL(href);\n if (origin !== WEBFLOW_ASSETS_CDN_ORIGIN) continue;\n\n currentPageStylesheets.add(href);\n } catch {\n continue;\n }\n }\n\n return currentPageStylesheets;\n};\n\n/**\n * Attaches external stylesheets from the current page to the document head.\n * @param page\n * @returns\n */\nexport const attachExternalStylesheets = (page: Document) => {\n const currentPageStylesheets = getCurrentPageStylesheets();\n const externalStylesheetElements = [\n ...page.documentElement.querySelectorAll<HTMLLinkElement>('link[rel=\"stylesheet\"]'),\n ];\n\n return Promise.all(\n externalStylesheetElements.map((stylesheet) => {\n const { href } = stylesheet;\n\n try {\n const { origin } = new URL(href);\n if (origin !== WEBFLOW_ASSETS_CDN_ORIGIN) return;\n if (currentPageStylesheets.has(href)) return;\n if (attachedExternalStylesheets.has(href)) return;\n\n attachedExternalStylesheets.add(href);\n\n return new Promise((resolve) => {\n const clone = cloneNode(stylesheet);\n\n // Load styles\n clone.addEventListener('load', () => resolve(undefined), { once: true });\n\n document.head.append(clone);\n\n // Max 10s timeout\n window.setTimeout(() => resolve(undefined), 10000);\n });\n } catch {\n return;\n }\n }),\n );\n};\n", "import { isDate } from './guards';\n\n/**\n * Converts a string to a `Date`.\n * @param value\n * @returns The `Date` object, if the conversion is successful.\n */\nexport const normalizeDate = (value: string | number | Date) => {\n if (isDate(value)) return value;\n if (value === '') return;\n\n const date = new Date(value);\n\n if (!isNaN(date.getTime())) {\n return date;\n }\n};\n", "import type { AdLibModuleDefinition } from '../types/modules';\n\nexport function defineModule(def: AdLibModuleDefinition): AdLibModuleDefinition {\n return def;\n}\n", "export type DelegationHandler<E extends Event = Event> = (args: { event: E; el: Element }) => void;\n\nexport type DelegationEventMap = {\n click: MouseEvent;\n keydown: KeyboardEvent;\n input: Event;\n change: Event;\n submit: SubmitEvent;\n focusin: FocusEvent;\n focusout: FocusEvent;\n};\n\nexport type DelegationMap = Partial<{\n [K in keyof DelegationEventMap]: DelegationHandler<DelegationEventMap[K]>;\n}>;\n\nexport type CreateDelegationOptions = {\n /**\n * Root element to attach listeners on (defaults to document)\n */\n root?: Document | Element;\n\n /**\n * Use capture phase (default false)\n */\n capture?: boolean;\n};\n\n/**\n * Standardized event delegation:\n * - One listener on root per event type\n * - Routes to closest(selector)\n * - Returns cleanup()\n */\nexport function createDelegation(\n selector: string,\n handlers: DelegationMap,\n options: CreateDelegationOptions = {},\n) {\n const root: Document | Element | null =\n options.root ?? (typeof document !== 'undefined' ? document : null);\n const capture = options.capture ?? false;\n\n if (!root || typeof root.addEventListener !== 'function') {\n // SSR-safe: no-op cleanup\n return () => {};\n }\n\n const cleanups: Array<() => void> = [];\n\n const add = <K extends keyof DelegationMap>(type: K, handler: DelegationMap[K]) => {\n if (!handler) return;\n\n const listener: EventListener = (event) => {\n const delegatedEvent = event as DelegationEventMap[K];\n const { target } = delegatedEvent;\n if (!(target instanceof Element) || typeof target.closest !== 'function') return;\n\n const el = target.closest(selector);\n if (!el) return;\n\n // Ensure the matched element is within root if root is Element (not Document)\n if (root instanceof Element && !root.contains(el)) return;\n\n handler({ event: delegatedEvent, el });\n };\n\n root.addEventListener(type as string, listener, capture);\n cleanups.push(() => root.removeEventListener(type as string, listener, capture));\n };\n\n add('click', handlers.click);\n add('keydown', handlers.keydown);\n add('input', handlers.input);\n add('change', handlers.change);\n add('submit', handlers.submit);\n add('focusin', handlers.focusin);\n add('focusout', handlers.focusout);\n\n return () => {\n for (let i = cleanups.length - 1; i >= 0; i--) {\n try {\n cleanups[i]();\n } catch {\n /* best-effort */\n }\n }\n cleanups.length = 0;\n };\n}\n", "import { noop } from './guards';\n\n/**\n * Adds an event listener to an element.\n * @returns A callback to remove the event listener from the element.\n *\n * @param target\n * @param type\n * @param listener\n * @param options\n */\nexport function addListener<\n TargetInterface extends EventTarget,\n Type extends TargetInterface extends Window\n ? keyof WindowEventMap | string\n : TargetInterface extends Document\n ? keyof DocumentEventMap | string\n : TargetInterface extends HTMLElement\n ? keyof HTMLElementEventMap | string\n : keyof ElementEventMap | string,\n Listener extends Type extends keyof WindowEventMap\n ? (this: Document, ev: WindowEventMap[Type]) => unknown\n : Type extends keyof DocumentEventMap\n ? (this: Document, ev: DocumentEventMap[Type]) => unknown\n : Type extends keyof HTMLElementEventMap\n ? (this: HTMLElement, ev: HTMLElementEventMap[Type]) => unknown\n : Type extends keyof ElementEventMap\n ? (this: Element, ev: ElementEventMap[Type]) => unknown\n : EventListenerOrEventListenerObject,\n>(\n target: TargetInterface | TargetInterface[] | Set<TargetInterface> | null | undefined,\n type: Type,\n listener: Listener,\n options?: boolean | AddEventListenerOptions,\n): () => void {\n if (!target) return noop;\n\n const targets = Array.isArray(target) ? target : target instanceof Set ? [...target] : [target];\n\n targets.forEach((target) => target.addEventListener(type, listener, options));\n\n return () => targets.forEach((target) => target.removeEventListener(type, listener, options));\n}\n\ntype AllowedEvent = keyof DocumentEventMap | 'w-close';\n\n/**\n * Dispatches a custom event that bubbles from the target.\n * @param target The element where the event will originate.\n * @param events The event name or an array of event names.\n * @returns True if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n */\nexport const simulateEvent = (\n target: EventTarget,\n events: AllowedEvent | Array<AllowedEvent>,\n): boolean => {\n if (!Array.isArray(events)) events = [events];\n\n const eventsSuccess = events.map((event) =>\n target.dispatchEvent(new Event(event, { bubbles: true })),\n );\n\n return eventsSuccess.every((success) => success);\n};\n", "export const ARIA_ROLE_KEY = 'role';\nexport const ARIA_ROLE_VALUES = {\n slider: 'slider',\n listbox: 'listbox',\n option: 'option',\n columnheader: 'columnheader',\n link: 'link',\n marquee: 'marquee',\n button: 'button',\n radiogroup: 'radiogroup',\n dialog: 'dialog',\n};\nexport const TABINDEX_KEY = 'tabindex';\nexport const ARIA_LABEL_KEY = 'aria-label';\nexport const ARIA_LABELLEDBY_KEY = 'aria-labelledby';\nexport const ARIA_VALUENOW_KEY = 'aria-valuenow';\nexport const ARIA_VALUEMIN_KEY = 'aria-valuemin';\nexport const ARIA_VALUEMAX_KEY = 'aria-valuemax';\nexport const ARIA_SELECTED_KEY = 'aria-selected';\nexport const ARIA_HASPOPUP_KEY = 'aria-haspopup';\nexport const ARIA_MULTISELECTABLE_KEY = 'aria-multiselectable';\nexport const ARIA_EXPANDED_KEY = 'aria-expanded';\nexport const ARIA_CURRENT_KEY = 'aria-current';\nexport const ARIA_ACTIVEDESCENDANT_KEY = 'aria-activedescendant';\nexport const ARIA_PRESSED_KEY = 'aria-pressed';\nexport const ARIA_CONTROLS_KEY = 'aria-controls';\nexport const ARIA_OWNS_KEY = 'aria-owns';\nexport const ARIA_ROLEDESCRIPTION_KEY = 'aria-roledescription';\nexport const ARIA_DESCRIPTION_KEY = 'aria-description';\nexport const ARIA_HIDDEN_KEY = 'aria-hidden';\nexport const AUTOCOMPLETE_KEY = 'autocomplete';\nexport const AUTOCAPITALIZE_KEY = 'autocapitalize';\nexport const ARIA_AUTOCOMPLETE_KEY = 'aria-autocomplete';\nexport const ROLE_KEY = 'role';\nexport const REQUIRED_KEY = 'required';\nexport const NAME_KEY = 'name';\nexport const ARIA_SETSIZE_KEY = 'aria-setsize';\nexport const ARIA_POSINSET_KEY = 'aria-posinset';\nexport const ID_KEY = 'id';\nexport const ARIA_MODAL_KEY = 'aria-modal';\nexport const ARIA_MODAL_VALUES = {\n true: 'true',\n};\n\nexport const ARIA_SORT_KEY = 'aria-sort';\nexport const ARIA_SORT_VALUES = {\n ascending: 'ascending',\n descending: 'descending',\n};\nexport const CONTENT_EDITABLE_KEY = 'contenteditable';\n", "export const ACCORDION_ATTRIBUTE = 'accordion';\n\nexport const AUTO_VIDEO_ATTRIBUTE = 'autovideo';\n\nexport const CODE_HIGHLIGHT_ATTRIBUTE = 'codehighlight';\n\nexport const COMBO_BOX_ATTRIBUTE = 'combobox';\n\nexport const INJECT_ATTRIBUTE = 'inject';\n\nexport const COPY_CLIP_ATTRIBUTE = 'copyclip';\n\nexport const DISPLAY_VALUES_ATTRIBUTE = 'displayvalues';\n\nexport const DOCS_ATTRIBUTE = 'docs';\n\nexport const FAV_CUSTOM_ATTRIBUTE = 'favcustom';\n\nexport const FORM_SUBMIT_ATTRIBUTE = 'formsubmit';\n\nexport const INPUT_ACTIVE_ATTRIBUTE = 'inputactive';\n\nexport const INPUT_COUNTER_ATTRIBUTE = 'inputcounter';\n\nexport const MIRROR_CLICK_ATTRIBUTE = 'mirrorclick';\n\nexport const MIRROR_INPUT_ATTRIBUTE = 'mirrorinput';\n\nexport const MODAL_ATTRIBUTE = 'modal';\n\nexport const NUMBER_COUNT_ATTRIBUTE = 'numbercount';\n\nexport const LIST_ATTRIBUTE = 'list';\n\nexport const QUERY_PARAM_ATTRIBUTE = 'queryparam';\n\nexport const RANGE_SLIDER_ATTRIBUTE = 'rangeslider';\n\nexport const SCROLL_DISABLE_ATTRIBUTE = 'scrolldisable';\n\nexport const SELECT_CUSTOM_ATTRIBUTE = 'selectcustom';\n\nexport const SLIDER_DOTS_ATTRIBUTE = 'sliderdots';\n\nexport const SMART_LIGHTBOX_ATTRIBUTE = 'smartlightbox';\n\nexport const SOCIAL_SHARE_ATTRIBUTE = 'socialshare';\n\nexport const STAR_RATING_ATTRIBUTE = 'starrating';\n\nexport const TOC_ATTRIBUTE = 'toc';\n\nexport const READ_TIME_ATTRIBUTE = 'readtime';\n\nexport const REMOVE_QUERY_ATTRIBUTE = 'removequery';\n\nexport const VIDEO_HLS_ATTRIBUTE = 'videohls';\n", "export const SPACE_KEY = ' ';\nexport const ENTER_KEY = 'Enter';\nexport const ESCAPE_KEY = 'Escape';\nexport const TAB_KEY = 'Tab';\nexport const CLICK = 'click';\nexport const BACKSPACE_KEY = 'Backspace';\nexport const ARROW_UP_KEY = 'ArrowUp';\nexport const ARROW_DOWN_KEY = 'ArrowDown';\nexport const ARROW_RIGHT_KEY = 'ArrowRight';\nexport const ARROW_LEFT_KEY = 'ArrowLeft';\n", "import { WEBFLOW_BREAKPOINTS } from '../constants';\nimport type { DropdownToggle, WebflowBreakpoint, WebflowModule } from '../types';\nimport { simulateEvent } from './events';\n\n/**\n * @returns The Webflow Site ID of the website.\n * @param page The page to get the site ID from. Defaults to the current page.\n */\nexport const getSiteId = (page = document): string | null =>\n page.documentElement.getAttribute('data-wf-site');\n\n/**\n * Extracts the publish date of a Webflow site\n * @returns A Date object, if found.\n * @param page The page to get the publish date from. Defaults to the current page.\n */\nexport const getPublishDate = (page = document): Date | undefined => {\n const publishDatePrefix = 'Last Published:';\n\n for (const node of page.childNodes) {\n if (node.nodeType === Node.COMMENT_NODE && node.textContent?.includes(publishDatePrefix)) {\n const publishDateValue = node.textContent.trim().split(publishDatePrefix)[1];\n if (publishDateValue) return new Date(publishDateValue);\n }\n }\n};\n\n/**\n * Restarts the Webflow JS library.\n *\n * @param modules An array of {@link WebflowModule} to restart. If passed, only those modules will be restarted instead of the whole `Webflow` instance.\n *\n * @returns An awaitable promise that is fulfilled when the library has been correctly reinitialized.\n */\nexport const restartWebflow = async (modules?: WebflowModule[]): Promise<unknown> => {\n const { Webflow } = window;\n if (!Webflow || !('destroy' in Webflow) || !('ready' in Webflow) || !('require' in Webflow))\n return;\n\n if (modules && !modules.length) return;\n\n // Global\n if (!modules) {\n Webflow.destroy();\n Webflow.ready();\n }\n\n // IX2\n if (!modules || modules.includes('ix2')) {\n const ix2 = Webflow.require('ix2');\n\n if (ix2) {\n const { store, actions } = ix2;\n const { eventState } = store.getState().ixSession;\n const stateEntries = Object.entries(eventState);\n\n if (!modules) ix2.destroy();\n\n ix2.init();\n\n await Promise.all(\n stateEntries.map((state) => store.dispatch(actions.eventStateChanged(...state))),\n );\n }\n }\n\n // Commerce\n if (!modules || modules.includes('commerce')) {\n const commerce = Webflow.require('commerce');\n const siteId = getSiteId();\n\n if (commerce && siteId) {\n commerce.destroy();\n commerce.init({ siteId, apiUrl: 'https://render.webflow.com' });\n }\n }\n\n // Lightbox\n if (modules?.includes('lightbox')) Webflow.require('lightbox')?.ready();\n\n // Slider\n if (modules?.includes('slider')) {\n const slider = Webflow.require('slider');\n\n if (slider) {\n slider.redraw();\n slider.ready();\n }\n }\n\n // Tabs\n if (modules?.includes('tabs')) Webflow.require('tabs')?.redraw();\n\n return new Promise((resolve) => Webflow.push(() => resolve(undefined)));\n};\n\n/**\n * Checks the current breakpoint based on the window media.\n *\n * @returns A {@link WebflowBreakpoint} string.\n */\nexport const getCurrentBreakpoint = (): WebflowBreakpoint => {\n for (const [breakpoint, mediaQuery] of WEBFLOW_BREAKPOINTS) {\n if (window.matchMedia(mediaQuery).matches) {\n return breakpoint;\n }\n }\n\n return 'main';\n};\n\n/**\n * Closes a Webflow dropdown.\n * @param dropdownToggle A {@link DropdownToggle} element.\n * @param focusToggle Defaults to `true`.\n */\nexport const closeDropdown = (dropdownToggle: DropdownToggle, focusToggle = true) => {\n if (focusToggle) dropdownToggle.focus();\n\n simulateEvent(dropdownToggle, 'w-close');\n};\n", "import { cloneNode } from './dom';\nimport { getPublishDate, getSiteId } from './webflow';\n\nconst DB_OBJECT_STORE_NAME = 'pages';\n\nconst cache = new Map<string, Promise<Document | null>>();\n\ntype Options = {\n /**\n * Whether to cache fetched documents. Defaults to `true`.\n */\n cache?: boolean;\n\n /**\n * Whether to cache external documents.\n * If set to true, it will follow a [stale-while-revalidate](https://web.dev/stale-while-revalidate/) strategy.\n */\n cacheExternal?: boolean;\n\n /**\n * Defines a manual database name for the IndexedDB instance.\n * If not provided, it will use the site ID or the current page's site ID.\n */\n cacheKey?: string;\n\n /**\n * Defines a manual version for the IndexedDB instance.\n * If not provided, it will use the publish date of the current page or `1` as default.\n */\n cacheVersion?: number;\n};\n\n/**\n * Fetches and parses an external page.\n * Stores the page response in an {@link IDBDatabase} if the page belongs to the same site.\n *\n * @param source The URL of the page.\n * @param options Optional {@link Options}\n *\n * @returns The page's {@link Document} if successful, `null` otherwise.\n */\nexport const fetchPage = (\n source: string | URL,\n options: Options = {},\n): Promise<Document | null> | null => {\n let url;\n\n try {\n url = new URL(source, window.location.origin);\n } catch {\n return null;\n }\n\n const conclude = (page: Document | null) => (page ? cloneNode(page) : null);\n\n // If the same page is being fetched simultaneously, return it from the memory cache.\n const cached = cache.get(url.href);\n if (cached) {\n return cached.then(conclude);\n }\n\n const promise = createPromise(url, options);\n cache.set(url.href, promise);\n\n return promise.then(conclude);\n};\n\n/**\n * Creates a promise that fetches a page and stores it in an IndexedDB.\n * @param url\n * @param options\n * @returns A promise that resolves to the page's {@link Document} or `null` if the fetch fails.\n */\nconst createPromise = async (\n url: URL,\n { cache = true, cacheExternal, cacheKey, cacheVersion }: Options,\n): Promise<Document | null> => {\n try {\n // Try to create a DB instance.\n const siteId = getSiteId();\n const publishDate = getPublishDate();\n\n const dbName = siteId || cacheKey;\n const dbVersion = publishDate?.getTime() ?? cacheVersion ?? 1;\n const db = dbName ? await createCacheDB(dbName, dbVersion) : null;\n\n // If no caching enabled or no DB created, fetch the page and store it in the memory cache.\n if (!cache || !db) {\n const result = await fetchAndParsePage(url);\n if (!result) return null;\n\n const { page } = result;\n return page;\n }\n\n // If the page is in the DB, return it from there.\n const rawPageFromDB = await getRawPageFromDB(db, url);\n if (rawPageFromDB) {\n const page = parseRawPage(rawPageFromDB);\n\n // Cached external documents are considered stale,\n // so in the background we refetch the page and store it to the DB again.\n if (cacheExternal && !isPageSameSite(page, siteId)) {\n fetchAndCachePageInDB(db, url, siteId, cacheExternal);\n }\n\n return page;\n }\n\n // If the page is not in the DB, fetch it and store it in the DB.\n const page = await fetchAndCachePageInDB(db, url, siteId, cacheExternal);\n return page;\n } catch {\n return null;\n }\n};\n\n/**\n * Fetches a page and parses it into a {@link Document}.\n * @param url The URL of the page.\n * @returns The page's {@link Document} and raw HTML text.\n */\nconst fetchAndParsePage = async (url: URL) => {\n const response = await fetch(url, { headers: { 'X-Webflow-App-ID': 'adartem' } });\n const rawPage = await response.text();\n const page = parseRawPage(rawPage);\n\n return { page, rawPage };\n};\n\n/**\n * Fetches a page and stores it in a {@link IDBDatabase}.\n * @param db The DB instance.\n * @param url The URL of the page.\n * @param siteId The current site ID.\n * @param cacheExternal Whether to cache external documents.\n * @returns The page's {@link Document}.\n */\nconst fetchAndCachePageInDB = async (\n db: IDBDatabase,\n url: URL,\n siteId: string | null,\n cacheExternal?: boolean,\n) => {\n const result = await fetchAndParsePage(url);\n if (!result) return null;\n\n const { page, rawPage } = result;\n const isSameSite = isPageSameSite(page, siteId);\n\n // If it can't be cached, just return the page.\n if (!isSameSite && !cacheExternal) return page;\n\n // Otherwise store it in the DB\n await storeRawPageInDB(db, url, rawPage);\n\n // If the page belongs to the same site, we can remove it from the memory cache as it's already in the DB.\n // If the page is external, we want to keep it in memory to avoid refetching it, as in every request is considered stale.\n if (isSameSite) {\n cache.delete(url.href);\n }\n\n return page;\n};\n\n/**\n * Checks if a fetched page document is from the same Webflow site as the current page.\n * @param page The fetched page document.\n * @param siteId The current site ID.\n */\nconst isPageSameSite = (page: Document, siteId: string | null) => {\n if (!siteId) return false;\n\n const pageSiteId = getSiteId(page);\n return pageSiteId && pageSiteId === siteId;\n};\n\n/**\n * Parses a raw page's HTML text into a {@link Document}.\n * @param rawPage\n */\nconst parseRawPage = (rawPage: string) => new DOMParser().parseFromString(rawPage, 'text/html');\n\n/**\n * Creates a DB instance.\n * @param dbName The DB name.\n * @param dbVersion The DB version.\n * @returns An {@link IDBDatabase} instance.\n */\nconst createCacheDB = (dbName: string, dbVersion: number) => {\n return new Promise<IDBDatabase | null>((resolve) => {\n try {\n const dbOpenRequest = window.indexedDB.open(dbName, dbVersion);\n\n dbOpenRequest.onblocked = () => {\n resolve(null);\n };\n\n dbOpenRequest.onupgradeneeded = () => {\n const db = dbOpenRequest.result;\n\n if (db.objectStoreNames.contains(DB_OBJECT_STORE_NAME)) {\n db.deleteObjectStore(DB_OBJECT_STORE_NAME);\n }\n\n db.createObjectStore(DB_OBJECT_STORE_NAME);\n };\n\n dbOpenRequest.onerror = () => resolve(null);\n dbOpenRequest.onsuccess = () => {\n const db = dbOpenRequest.result;\n\n db.onversionchange = () => db.close();\n\n resolve(db);\n };\n } catch {\n resolve(null);\n }\n });\n};\n\n/**\n * Gets a page from the DB.\n * @param db\n * @param url\n */\nconst getRawPageFromDB = async (db: IDBDatabase, url: URL) => {\n return new Promise<string | null>((resolve) => {\n const transaction = db.transaction(DB_OBJECT_STORE_NAME);\n const objectStore = transaction.objectStore(DB_OBJECT_STORE_NAME);\n const request = objectStore.get(url.href);\n\n request.onerror = () => resolve(null);\n request.onsuccess = () => resolve(request.result);\n });\n};\n\n/**\n * Stores a page in the DB.\n * @param db\n * @param url\n * @param rawPage\n */\nconst storeRawPageInDB = async (db: IDBDatabase, url: URL, rawPage: string) => {\n return new Promise<void>((resolve) => {\n const transaction = db.transaction(DB_OBJECT_STORE_NAME, 'readwrite');\n const objectStore = transaction.objectStore(DB_OBJECT_STORE_NAME);\n const request = objectStore.put(rawPage, url.href);\n\n request.onerror = () => resolve();\n request.onsuccess = () => resolve();\n });\n};\n", "import { FORM_CSS_CLASSES } from '../constants';\nimport type { FormField, FormFieldType } from '../types';\nimport { simulateEvent } from './events';\nimport { isBoolean, isHTMLInputElement, isHTMLSelectElement, isNotEmpty } from './guards';\n\n/**\n * Gets the value of a given form field.\n * @param formField A {@link FormField} element.\n * @param customValueAttribute Optional custom value attribute used to identify checkboxes and radios.\n */\nexport const getFormFieldValue = (\n formField: FormField,\n customValueAttribute?: string,\n): string | string[] => {\n const type = formField.type as FormFieldType;\n\n let value: string | string[];\n\n switch (type) {\n // Checkbox\n case 'checkbox': {\n // Group\n const groupCheckboxes = getCheckboxGroup(\n formField.name,\n formField.form,\n customValueAttribute,\n );\n if (groupCheckboxes?.length) {\n value = [];\n\n for (const checkbox of groupCheckboxes) {\n const checkboxValue = customValueAttribute\n ? (checkbox.getAttribute(customValueAttribute) ?? checkbox.value)\n : checkbox.value;\n\n if (!checkboxValue || !checkbox.checked) continue;\n\n value.push(checkboxValue);\n }\n\n break;\n }\n\n // Single\n const { checked } = formField as HTMLInputElement;\n value = checked ? 'true' : '';\n\n break;\n }\n\n // Radio\n case 'radio': {\n const checkedRadio = formField.form?.querySelector<HTMLInputElement>(\n `input[name=\"${formField.name}\"][type=\"radio\"]:checked`,\n );\n\n value = checkedRadio\n ? customValueAttribute\n ? (checkedRadio.getAttribute(customValueAttribute) ?? checkedRadio.value)\n : checkedRadio.value\n : '';\n\n break;\n }\n\n // Select multiple\n case 'select-multiple': {\n value = [...(formField as HTMLSelectElement).selectedOptions]\n .map((option) => option.value)\n .filter(Boolean);\n\n break;\n }\n\n // Dates\n case 'date':\n case 'month':\n case 'week':\n case 'time': {\n const { valueAsDate, value: _value } = formField as HTMLInputElement;\n value = valueAsDate ? valueAsDate.toISOString() : _value;\n\n break;\n }\n\n // Default - Text\n default: {\n value = formField.value;\n }\n }\n\n return value;\n};\n\n/**\n * Sets a value to a FormField element and emits `click`, `input` and `change` Events.\n *\n * @param element The FormField to update.\n * @param value `boolean` for Checkboxes and Radios, `string` for the rest.\n */\nexport const setFormFieldValue = (\n formField: FormField,\n value: string | boolean | string[],\n customValueAttribute?: string,\n): void => {\n const type = formField.type as FormFieldType;\n\n switch (type) {\n // Checkboxes\n case 'checkbox': {\n if (!isHTMLInputElement(formField)) break;\n\n // Single checkbox\n if (!Array.isArray(value)) {\n const check = isBoolean(value) ? value : value === 'true';\n\n if (check !== formField.checked) {\n formField.checked = check;\n\n simulateEvent(formField, ['click', 'input', 'change']);\n }\n\n break;\n }\n\n const groupCheckboxes = getCheckboxGroup(\n formField.name,\n formField.form,\n customValueAttribute,\n );\n if (!groupCheckboxes?.length) break;\n\n for (const checkbox of groupCheckboxes) {\n const checkboxValue = customValueAttribute\n ? (checkbox.getAttribute(customValueAttribute) ?? checkbox.value)\n : checkbox.value;\n\n const check = value.includes(checkboxValue);\n\n if (check !== checkbox.checked) {\n checkbox.checked = check;\n\n simulateEvent(checkbox, ['click', 'input', 'change']);\n }\n }\n\n break;\n }\n\n // Radios\n case 'radio': {\n if (Array.isArray(value)) break;\n\n const groupRadios = getRadioGroupInputs(formField);\n\n for (const radio of groupRadios) {\n const radioValue = customValueAttribute\n ? (radio.getAttribute(customValueAttribute) ?? radio.value)\n : radio.value;\n\n const check = radioValue === value;\n\n if (check !== radio.checked) {\n radio.checked = check;\n\n simulateEvent(radio, ['click', 'input', 'change']);\n\n if (check) continue;\n\n // When unchecking a custom Webflow radio, we need to manually remove the focus and checked classes\n const customRadio = radio.parentElement?.querySelector(`.${FORM_CSS_CLASSES.radioInput}`);\n if (!customRadio) continue;\n\n customRadio.classList.remove(\n FORM_CSS_CLASSES.checkboxOrRadioFocus,\n FORM_CSS_CLASSES.checkboxOrRadioChecked,\n );\n }\n }\n\n break;\n }\n\n // Select-multiple\n case 'select-multiple': {\n if (!Array.isArray(value) || !isHTMLSelectElement(formField)) break;\n\n for (const option of formField.options) {\n const select = value.includes(option.value);\n\n if (select !== option.selected) {\n option.selected = select;\n\n simulateEvent(option, ['input', 'change']);\n }\n }\n\n break;\n }\n\n // Other\n default: {\n if (Array.isArray(value)) break;\n\n if (formField.value !== value) {\n formField.value = value.toString();\n\n simulateEvent(formField, ['input', 'change']);\n }\n }\n }\n};\n\n/**\n * Retrieves all radio inputs that belong to the same group.\n * @param radio A radio input element that belongs to the group.\n * @param form The form element that contains the radio inputs. If not provided, it will be inferred from the radio input.\n * @returns An array of radio inputs.\n */\nexport const getRadioGroupInputs = (radio: FormField): HTMLInputElement[] => {\n if (!radio.form) return [];\n\n return [\n ...radio.form.querySelectorAll<HTMLInputElement>(\n `input[name=\"${radio.name}\"][type=\"${radio.type}\"]`,\n ),\n ];\n};\n\n/**\n * @returns All the checkboxes in a group.\n * @param name The name of the group.\n * @param form The form element containing the group.\n * @param customValueAttribute Optional custom value attribute used to identify checkboxes.\n */\nexport const getCheckboxGroup = (\n name: string,\n form: HTMLFormElement | null,\n customValueAttribute?: string,\n) => {\n const groupSelector = [\n `input[name=\"${name}\"][type=\"checkbox\"][value]`,\n customValueAttribute && `input[name=\"${name}\"][type=\"checkbox\"][${customValueAttribute}]`,\n ]\n .filter(isNotEmpty)\n .join(',');\n\n const groupCheckboxes = form?.querySelectorAll<HTMLInputElement>(groupSelector);\n return groupCheckboxes;\n};\n\n/**\n * Gets the wrapper element for a given form field.\n * @param formField The FormField element to get the wrapper for.\n * @returns The closest wrapper element or the formField itself if no wrapper is found.\n */\nexport const getFormFieldWrapper = (formField: FormField) => {\n const wrapper = formField.closest<HTMLElement>(\n `.${FORM_CSS_CLASSES.checkboxField}, .${FORM_CSS_CLASSES.radioField}, label`,\n );\n return wrapper || formField;\n};\n", "import { isDate, isNumber } from './guards';\n\n/**\n * Converts a value to a number, removing any invalid symbols like `$` or `,`.\n * @param value\n * @returns The valid number value.\n */\nexport const normalizeNumber = (value: string | number | Date) => {\n if (isNumber(value)) return value;\n if (isDate(value)) return value.getTime();\n if (!value) return;\n\n return parseFloat(value.replace(/[^0-9.-]+/g, ''));\n};\n\n/**\n * Parses a numeric Attribute string.\n * @param rawValue The raw string. Example: \"20\", \"-25.3\"...\n * @param fallback A value to fall back to when the parsed value is not valid.\n */\nexport function parseNumericAttribute(\n rawValue: string | number | null | undefined,\n fallback: number,\n): number;\nexport function parseNumericAttribute(\n rawValue: string | number | null | undefined,\n fallback?: number | null,\n): number | null;\nexport function parseNumericAttribute(\n rawValue: string | number | null | undefined,\n fallback?: number | null,\n): number | null {\n if (!rawValue) return fallback ?? null;\n\n const value = Number(rawValue);\n\n if (!isNaN(value)) return value;\n if (fallback) return fallback;\n return null;\n}\n\n/**\n * Calculates the amount of decimals that a float number has.\n * @param value A number.\n */\nexport const getDecimalPrecision = (value: number) => {\n if (!isFinite(value)) return 0;\n\n let exponential = 1;\n let precision = 0;\n\n while (Math.round(value * exponential) / exponential !== value) {\n exponential *= 10;\n precision += 1;\n }\n return precision;\n};\n\n/**\n * Ensures a decimal precision on a number.\n * @param value The number to handle.\n * @param precision The amount of decimals.\n */\nconst setDecimalPrecision = (value: number, precision: number) => {\n const pow = Math.pow(10, precision);\n\n return Math.round(value * pow) / pow;\n};\n\n/**\n * Adjusts a numeric value to a step factor.\n * @param value The numeric value to adjust.\n * @param step The increment step.\n * @param precision The step's decimal precision. If not provided, it will be calculated.\n * @param minRange A minimum range value, used for offsetting.\n * @returns The adjusted value.\n */\nexport const adjustValueToStep = (\n value: number,\n step: number,\n precision?: number,\n minRange = 0,\n) => {\n precision ??= getDecimalPrecision(step);\n\n const offset = minRange > 1 ? minRange % step : 0;\n\n const remainder = value % step;\n const floor = offset + value - remainder;\n\n if (remainder > step / 2) return setDecimalPrecision(floor + step, precision);\n\n return setDecimalPrecision(floor, precision);\n};\n", "import type {\n OptionSchemaItem,\n OptionsSchema,\n OptionsValueMap,\n OptionValueForSchema,\n ReadOptionsConfig,\n} from '../types/options';\n\nfunction isReserved(name: string): boolean {\n return name.startsWith('data-adlib-');\n}\n\nfunction kebab(s: string): string {\n return s.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);\n}\n\nfunction attrNames(moduleKey: string, name: string) {\n const n = kebab(name);\n\n // IMPORTANT: moduleKey can be \"ad-foo\" (preferred) or legacy short key \"foo\"\n const mk = moduleKey.startsWith('ad-') ? moduleKey : `ad-${moduleKey}`;\n\n return {\n // 1) data-<moduleKey>-<name> (canonical)\n dataScoped: `data-${mk}-${n}`,\n // 2) data-ad-<name> (global fallback)\n dataGlobal: `data-ad-${n}`,\n // 3) <moduleKey>-<name> (short attrs)\n shortScoped: `${mk}-${n}`,\n };\n}\n\nfunction readRaw(el: Element, name: string): string | null {\n if (isReserved(name)) return null;\n return el.getAttribute(name);\n}\n\nfunction parseValue<T extends OptionSchemaItem>(\n raw: string | null,\n schema: T,\n): OptionValueForSchema<T> | undefined {\n if (raw === null) return undefined;\n\n switch (schema.type) {\n case 'string':\n return raw as OptionValueForSchema<T>;\n\n case 'boolean':\n // presence-only: <... data-x> => \"\" => true\n if (raw === '' || raw.toLowerCase() === 'true') return true as OptionValueForSchema<T>;\n if (raw.toLowerCase() === 'false') return false as OptionValueForSchema<T>;\n return true as OptionValueForSchema<T>;\n\n case 'number': {\n const n = Number(raw);\n return (Number.isFinite(n) ? n : undefined) as OptionValueForSchema<T>;\n }\n\n case 'enum':\n return (schema.values.includes(raw) ? raw : undefined) as OptionValueForSchema<T>;\n }\n}\n\nexport function readOption<T extends OptionSchemaItem>(\n el: Element,\n moduleKey: string,\n name: string,\n schema: T,\n config?: ReadOptionsConfig,\n): OptionValueForSchema<T> {\n const { dataScoped, dataGlobal, shortScoped } = attrNames(moduleKey, name);\n\n // 1) module-scoped canonical\n const v1 = parseValue(readRaw(el, dataScoped), schema);\n if (v1 !== undefined) return v1;\n\n // 2) global fallback opt-in\n if (config?.includeGlobal) {\n const v2 = parseValue(readRaw(el, dataGlobal), schema);\n if (v2 !== undefined) return v2;\n }\n\n // 3) short scoped\n const v3 = parseValue(readRaw(el, shortScoped), schema);\n if (v3 !== undefined) return v3;\n\n // 4) default\n return schema.default as OptionValueForSchema<T>;\n}\n\nexport function readOptionsFromAttributes<T extends OptionsSchema>(\n el: Element,\n moduleKey: string,\n schema: T,\n config?: ReadOptionsConfig,\n): OptionsValueMap<T> {\n const out = {} as OptionsValueMap<T>;\n\n for (const [name, item] of Object.entries(schema) as [keyof T, T[keyof T]][]) {\n out[name] = readOption(el, moduleKey, name as string, item, config);\n }\n\n return out;\n}\n", "import type {\n AttributeElements,\n AttributeKey,\n AttributeSettings,\n InstanceOptions,\n LooseString,\n QueryOptions,\n SelectorScope,\n} from '../types';\n\n/**\n * @returns Selector helpers for the defined Attribute Elements and Settings.\n * @param attributeKey\n * @param elements\n * @param settings\n */\nexport const generateSelectors = <\n ElementsDefinition extends AttributeElements,\n SettingsDefinition extends AttributeSettings,\n>(\n attributeKey: AttributeKey,\n elements: ElementsDefinition,\n settings: SettingsDefinition,\n) => {\n const normalizedAttributeKey = attributeKey.startsWith('ad-')\n ? attributeKey.slice(3)\n : attributeKey;\n const ATTRIBUTE_NAME = `ad-${normalizedAttributeKey}`;\n const DATA_ATTRIBUTE_NAME = `data-ad-${normalizedAttributeKey}`;\n const ELEMENT_ATTRIBUTE_NAME = `ad-${normalizedAttributeKey}-element`;\n const DATA_ELEMENT_ATTRIBUTE_NAME = `data-ad-${normalizedAttributeKey}-element`;\n const INSTANCE_ATTRIBUTE_NAME = `ad-${normalizedAttributeKey}-instance`;\n const DATA_INSTANCE_ATTRIBUTE_NAME = `data-ad-${normalizedAttributeKey}-instance`;\n\n const buildIsSelector = (selectors: string[]) => {\n if (selectors.length === 1) return selectors[0];\n\n return `:is(${selectors.join(',')})`;\n };\n\n const getInstancePresenceSelector = () =>\n buildIsSelector([`[${INSTANCE_ATTRIBUTE_NAME}]`, `[${DATA_INSTANCE_ATTRIBUTE_NAME}]`]);\n\n const getPresenceSelector = (options: InstanceOptions = {}) => {\n const baseSelector = buildIsSelector([`[${ATTRIBUTE_NAME} i]`, `[${DATA_ATTRIBUTE_NAME} i]`]);\n return appendInstanceScope(baseSelector, options);\n };\n\n /**\n * Constructs the attribute name for a setting.\n * @param settingKey\n */\n const getSettingAttributeName = (settingKey: keyof SettingsDefinition) => {\n const { key } = settings[settingKey];\n\n return `ad-${normalizedAttributeKey}-${key}`;\n };\n\n const getSettingAttributeNames = (settingKey: keyof SettingsDefinition) => {\n const { key } = settings[settingKey];\n\n return {\n short: `ad-${normalizedAttributeKey}-${key}`,\n data: `data-ad-${normalizedAttributeKey}-${key}`,\n };\n };\n\n /**\n * @returns A valid CSS selector for a setting.\n * @param settingKey The key of the setting.\n * @param valueKey [Optional] The key of the setting value.\n * @param explicitValue [Optional] An explicit value to use instead of a predefined setting value.\n */\n const getSettingSelector = <SettingKey extends keyof SettingsDefinition>(\n settingKey: SettingKey,\n valueOrOptions?:\n | LooseString<NonNullable<SettingsDefinition[SettingKey]['values']>[number]>\n | InstanceOptions,\n options?: InstanceOptions,\n ) => {\n const { short, data } = getSettingAttributeNames(settingKey);\n const value = typeof valueOrOptions === 'object' ? undefined : valueOrOptions;\n const resolvedOptions =\n typeof valueOrOptions === 'object' ? (valueOrOptions as InstanceOptions) : options;\n\n // With setting value\n if (value) {\n const baseSelector = buildIsSelector([`[${short}=\"${value}\" i]`, `[${data}=\"${value}\" i]`]);\n return appendInstanceScope(baseSelector, resolvedOptions);\n }\n\n // No setting value\n const baseSelector = buildIsSelector([`[${short}]`, `[${data}]`]);\n return appendInstanceScope(baseSelector, resolvedOptions);\n };\n\n const appendInstanceScope = (selector: string, { instance }: InstanceOptions = {}) => {\n if (instance === undefined) {\n return selector;\n }\n\n if (instance === null) {\n const instancePresenceSelector = getInstancePresenceSelector();\n return `${selector}:not(${instancePresenceSelector})`;\n }\n\n const instanceSelector = getInstanceSelector(instance);\n return `${selector}${instanceSelector}, ${instanceSelector} ${selector}`;\n };\n\n /**\n * @returns A valid CSS selector for an element.\n * @param elementKey The key of the element.\n * @param params.instance The index of the element instance.\n * If `null`, it will select all elements without an instance.\n * If `undefined`, it will select all elements.\n */\n const getElementSelector = (\n elementKey?: ElementsDefinition[number],\n { instance }: InstanceOptions = {},\n ) => {\n if (!elementKey) {\n const baseSelector = buildIsSelector([\n `[${ELEMENT_ATTRIBUTE_NAME}]`,\n `[${DATA_ELEMENT_ATTRIBUTE_NAME}]`,\n ]);\n return appendInstanceScope(baseSelector, { instance });\n }\n\n const baseSelector = buildIsSelector([\n `[${ELEMENT_ATTRIBUTE_NAME}=\"${elementKey}\" i]`,\n `[${DATA_ELEMENT_ATTRIBUTE_NAME}=\"${elementKey}\" i]`,\n ]);\n\n return appendInstanceScope(baseSelector, { instance });\n };\n\n /**\n * @returns A valid CSS selector for an element instance.\n * @param instance The instance identifier.\n */\n const getInstanceSelector = (instance: string) => {\n return buildIsSelector([\n `[${INSTANCE_ATTRIBUTE_NAME}=\"${instance}\" i]`,\n `[${DATA_INSTANCE_ATTRIBUTE_NAME}=\"${instance}\" i]`,\n ]);\n };\n\n const getInstanceRoot = (instance: string, scope?: SelectorScope | null) => {\n const target = scope ?? document;\n const selector = getInstanceSelector(instance);\n\n if (scope && scope instanceof Element) {\n const closest = scope.closest(selector);\n if (closest) return closest;\n }\n\n return target.querySelector(selector);\n };\n\n /**\n * @returns The first element that matches the selector.\n * @param elementKey The key of the element.\n * @param params.instance The index of the element instance.\n * @param params.scope The scope to query the element from. Defaults to `document`.\n */\n const queryElement = <E extends Element = HTMLElement>(\n elementKey?: ElementsDefinition[number],\n { instance, scope }: QueryOptions = {},\n ) => {\n const selector = getElementSelector(elementKey);\n const target = scope ?? document;\n\n if (instance === undefined || instance === null) {\n const scopedSelector = getElementSelector(elementKey, { instance });\n return target.querySelector<E>(scopedSelector);\n }\n\n const instanceRoot = getInstanceRoot(instance, scope);\n if (!instanceRoot) return null;\n\n if (instanceRoot.matches(selector)) {\n return instanceRoot as E;\n }\n\n return instanceRoot.querySelector<E>(selector);\n };\n\n /**\n * @returns All elements that match the selector.\n * @param elementKey The key of the element.\n * @param params.instance The index of the element instance.\n * @param params.scope The scope to query the element from. Defaults to `document`.\n */\n const queryAllElements = <E extends Element = HTMLElement>(\n elementKey?: ElementsDefinition[number],\n { instance, scope }: QueryOptions = {},\n ) => {\n const selector = getElementSelector(elementKey);\n const target = scope ?? document;\n\n if (instance === undefined || instance === null) {\n const scopedSelector = getElementSelector(elementKey, { instance });\n return [...target.querySelectorAll<E>(scopedSelector)];\n }\n\n const instanceRoot = getInstanceRoot(instance, scope);\n if (!instanceRoot) return [];\n\n const matchesRoot = instanceRoot.matches(selector) ? [instanceRoot as E] : [];\n\n return [...matchesRoot, ...instanceRoot.querySelectorAll<E>(selector)];\n };\n\n /**\n * @returns The instance index of an element.\n * @param element The element to get the instance index from.\n */\n const getInstance = (element: Element) => {\n const instanceHolder = element.closest(getInstancePresenceSelector());\n if (!instanceHolder) return null;\n\n return (\n instanceHolder.getAttribute(DATA_INSTANCE_ATTRIBUTE_NAME) ??\n instanceHolder.getAttribute(INSTANCE_ATTRIBUTE_NAME)\n );\n };\n\n /**\n * @returns The first ancestor that matches the selector.\n * @param elementKey The key of the element.\n * @param params.instance The index of the element instance.\n */\n const getClosestElement = <E extends Element = HTMLElement>(\n element: Element,\n elementKey?: ElementsDefinition[number],\n { instance }: { instance?: string | null } = {},\n ) => {\n const selector = getElementSelector(elementKey, { instance });\n\n return element.closest<E>(selector);\n };\n\n /**\n * @returns The value of an attribute. It will check, in order:\n * - The element itself.\n * - The closest ancestor that has the attribute.\n * - The script tags.\n *\n * @param element The element to get the attribute value from, or its closest ancestor that has the attribute. If `null`, it will check the script tags.\n * @param settingKey The attribute key.\n * @param filterInvalid Whether to filter out invalid values. Defaults to `false`.\n */\n const getAttribute = <\n SettingKey extends keyof SettingsDefinition,\n FilterInvalid extends boolean = false,\n SettingValues = SettingsDefinition[SettingKey]['values'],\n SettingDefaultValue = SettingsDefinition[SettingKey]['defaultValue'],\n SettingValueIsNumeric = SettingsDefinition[SettingKey]['isNumeric'],\n SettingValue = SettingValueIsNumeric extends true\n ? number\n : SettingValues extends Array<string>\n ? FilterInvalid extends true\n ? SettingValues[number]\n : string\n : string,\n >(\n element: Element | null,\n settingKey: SettingKey,\n { filterInvalid }: { filterInvalid?: FilterInvalid } = {},\n ): SettingDefaultValue extends string ? SettingValue : SettingValue | undefined => {\n const { short, data } = getSettingAttributeNames(settingKey);\n const selector = getSettingSelector(settingKey);\n\n const settingElement = element?.closest(selector);\n\n // Check the element\n let rawValue = settingElement?.getAttribute(data) ?? settingElement?.getAttribute(short);\n\n // Check the script tags\n if (!rawValue) {\n const scripts = window.AdLibAttributes?.scripts ?? [];\n\n for (const script of scripts) {\n rawValue = script.getAttribute(data) ?? script.getAttribute(short);\n\n if (rawValue) break;\n }\n }\n\n // Fall back to the default value, if available\n const { values = [], defaultValue, isNumeric } = settings[settingKey];\n\n rawValue ??= defaultValue;\n\n // @ts-expect-error Returning undefined is valid\n if (!rawValue) return;\n\n // Parse numeric values\n if (isNumeric) {\n let parsedValue = Number(rawValue);\n\n if (isNaN(parsedValue) && defaultValue) {\n parsedValue = Number(defaultValue);\n }\n\n if (!isNaN(parsedValue)) {\n return parsedValue as SettingValue;\n }\n }\n\n // @ts-expect-error Returning undefined is valid\n if (filterInvalid && values.length && !values.includes(rawValue)) return;\n\n const value = rawValue as SettingValue;\n return value;\n };\n\n /**\n * @returns Whether an element has a specific attribute value.\n * @param element\n * @param settingKey\n * @param valueKey\n */\n const hasAttributeValue = <SettingKey extends keyof SettingsDefinition>(\n element: Element,\n settingKey: SettingKey,\n value: NonNullable<SettingsDefinition[SettingKey]['values']>[number],\n ) => {\n return getAttribute(element, settingKey) === value;\n };\n\n return {\n getClosestElement,\n getElementSelector,\n getPresenceSelector,\n getSettingSelector,\n getInstanceSelector,\n getSettingAttributeName,\n queryElement,\n queryAllElements,\n getInstance,\n getAttribute,\n hasAttributeValue,\n };\n};\n", "/**\n * Convert a string of comma separated values to an array of values.\n *\n * @param string Comma separated string.\n * @param filterEmpty Defines if empty values should be filtered out of the returned array. Defaults to `true`.\n */\nexport const extractCommaSeparatedValues = (\n string: string | null | undefined,\n filterEmpty = true,\n): string[] => {\n if (!string) return [];\n\n const items = string.split(',').reduce<string[]>((accumulatedValue, currentValue) => {\n const value = currentValue.trim();\n\n if (!filterEmpty || value) accumulatedValue.push(value);\n\n return accumulatedValue;\n }, []);\n\n return items;\n};\n", "import type { AdLibAttributeKey } from '../types';\n\n/**\n * @returns Awaitable promise for waiting X time.\n * @param time\n */\nexport const wait = (time: number): Promise<unknown> =>\n new Promise((resolve) => setTimeout(resolve, time));\n\n/**\n * Waits for the defined Attribute to be fully loaded.\n * @param key The Attribute key.\n */\nexport const waitAttributeLoaded = (key: AdLibAttributeKey) =>\n window.AdLibAttributes.modules[key]?.loading;\n\n/**\n * @returns A promise that resolves once Webflow has fully loaded.\n */\nexport const waitWebflowReady = async () => {\n return new Promise((resolve) => {\n window.Webflow ||= [];\n window.Webflow.push(resolve);\n });\n};\n\n/**\n * @returns A promise that resolves once the DOM is ready.\n */\nexport const waitDOMReady = async () => {\n return new Promise((resolve) => {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', resolve);\n } else {\n resolve(undefined);\n }\n });\n};\n", "import { simulateEvent } from '../helpers';\nimport { wait } from '../helpers/wait';\n\n// Types\nexport interface InteractionParams {\n /**\n * The element that has a Webflow Ix2 Click interaction binded to it.\n */\n element: HTMLElement | string;\n\n /**\n * The duration of the interaction.\n * If a single number is passed, it will be used for both first and second interactions.\n * If an object is passed, you can specify the duration for each interaction.\n */\n duration?: number | Partial<Interaction['duration']>;\n}\n\nexport class Interaction {\n private readonly element: HTMLElement;\n private active = false;\n private running = false;\n private runningPromise?: Promise<unknown>;\n\n public readonly duration: {\n first: number;\n second: number;\n };\n\n /**\n * Acts as the controller for a Webflow Interaction.\n * It accepts an element that will be clicked when required (firing a Mouse Click interaction).\n * @param element Element that has the Mouse Click interaction.\n * @param duration Optionally, the duration can be explicitly set so the trigger methods will return an awaitable Promise.\n */\n constructor({ element, duration }: InteractionParams) {\n this.element =\n typeof element === 'string' ? document.querySelector<HTMLElement>(element)! : element;\n\n this.duration = {\n first: typeof duration === 'number' ? duration : (duration?.first ?? 0),\n second: typeof duration === 'number' ? duration : (duration?.second ?? 0),\n };\n }\n\n /**\n * Trigger the interaction\n * @param click Perform first or second click\n * @returns True if the interaction was fired\n */\n public async trigger(click?: 'first' | 'second'): Promise<boolean> {\n if ((click === 'first' && this.active) || (click === 'second' && !this.active)) return false;\n if (!click) click = this.active ? 'second' : 'first';\n\n simulateEvent(this.element, 'click');\n\n this.running = true;\n this.runningPromise = wait(this.duration[click]);\n await this.runningPromise;\n this.running = false;\n\n this.active = click === 'first';\n return true;\n }\n\n /**\n * @returns If the interaction is active\n */\n public isActive = (): boolean => this.active;\n\n /**\n * @returns If the interaction is running\n */\n public isRunning = (): boolean => this.running;\n\n /**\n * @returns A promise that fulfills when the current running interaction has finished\n */\n public untilFinished = (): Promise<unknown> | undefined => this.runningPromise;\n}\n", "/**\n * A render controller for an element.\n * It allows to render and remove the element from the DOM.\n */\nexport class Renderer {\n #rendered = true;\n #anchor = new Comment();\n\n /**\n * Creates a render controller instance for an element.\n * @param element The element to control.\n */\n constructor(public readonly element: Element) {}\n\n /**\n * Renders the element using the anchor as a reference.\n */\n render() {\n if (this.#rendered) return;\n\n this.#anchor.after(this.element);\n this.#anchor.remove();\n\n this.#rendered = true;\n }\n\n /**\n * Removes the element from the DOM and replaces it with the anchor.\n */\n remove() {\n if (!this.#rendered) return;\n\n this.element.after(this.#anchor);\n this.element.remove();\n\n this.#rendered = false;\n }\n\n /**\n * Updates the element's rendering state.\n * @param shouldRender Whether the element should be rendered or not.\n */\n update(shouldRender: boolean) {\n if (shouldRender) this.render();\n else this.remove();\n }\n\n /**\n * Destroys the render controller.\n * @param forceRender Whether to force the element to be rendered after destroying the controller.\n */\n destroy = (forceRender = true) => {\n if (forceRender) {\n this.render();\n }\n\n this.#anchor.remove();\n };\n}\n"],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,KAAe,YACnB,IAAI,QAAS9K,OAAY;AAC1B,WAAS,eAAe,YAC1B,SAAS,iBAAiB,oBAAoBA,CAAO,IAErDA,EAAQ,MAAS;AAErB,CAAC;AClBI,IAAM+K,KAAN,MAAkB;EAiBvB,YAAY,EAAE,SAAAtB,GAAS,UAAAuB,EAAS,GAAsB;AAftD,SAAQ,SAAS;AACjB,SAAQ,UAAU;AA+ClB,SAAO,WAAW,MAAe,KAAK;AAKtC,SAAO,YAAY,MAAe,KAAK;AAKvC,SAAO,gBAAgB,MAAoC,KAAK;AA1C9D,SAAK,UACH,OAAOvB,KAAY,WAAW,SAAS,cAA2BA,CAAO,IAAKA,GAEhF,KAAK,WAAW,EACd,OAAO,OAAOuB,KAAa,WAAWA,IAAYA,GAAU,SAAS,GACrE,QAAQ,OAAOA,KAAa,WAAWA,IAAYA,GAAU,UAAU,EACzE;EACF;EAOA,MAAa,QAAQC,GAA8C;AACjE,WAAKA,MAAU,WAAW,KAAK,UAAYA,MAAU,YAAY,CAAC,KAAK,SAAgB,SAClFA,MAAOA,IAAQ,KAAK,SAAS,WAAW,UAE7CzK,EAAc,KAAK,SAAS,OAAO,GAEnC,KAAK,UAAU,MACf,KAAK,iBAAiBkK,GAAK,KAAK,SAASO,CAAK,CAAC,GAC/C,MAAM,KAAK,gBACX,KAAK,UAAU,OAEf,KAAK,SAASA,MAAU,SACjB;EACT;AAgBF;AC/EA,IAAAC;AAAA,IAAAC;AAKEC,IAAA,oBAAA,WACAC,IAAA,oBAAA;",
|
|
6
|
+
"names": ["to", "ease", "frameData", "process", "alpha", "alpha", "alphaType", "alpha", "alphaType", "q", "alpha", "to", "progress", "to", "color", "mixNumber", "mixNumberImmediate", "to", "mixNumberImmediate", "scale", "progress", "undampedFreq", "progress", "keyframes", "spring", "createSpring", "ease", "ease", "keyframes", "percent", "motionValue", "keyframesGenerator", "keyframes", "progress", "now", "keyframes", "motionValue", "keyframes", "ease", "keyframes", "motionValue", "keyframes", "motionValue", "keyframes", "motionValue", "KeyframeResolver", "DefaultKeyframeResolver", "time", "keyframes", "isNotNull", "getFinalKeyframe", "keyframes", "getFinalKeyframe", "number", "getAnimatableNone", "getAnimatableNone", "motionValue", "ease", "now", "checkIsControllingVariants", "checkIsVariantNode", "getAnimatableNone", "getComputedStyle", "isSVGTag", "scrapeMotionValuesFromProps", "scrapeHTMLMotionValuesFromProps", "scrapeMotionValuesFromProps", "keyframes", "motionValue", "createMotionValue", "keyframes", "keyframes", "keyframes", "keyframes", "ease", "getValueTransition", "at", "keyframes", "keyframes", "createAnimation", "initialStyles", "keyframes", "animateElements", "animate", "reverseKeyframes", "frames", "property", "value", "prepareIn", "elements", "options", "target", "insertAfter", "display", "element", "prepared", "stagger", "duration", "animationOptions", "durationInSeconds", "targets", "finished", "staggerDelay", "remove", "filteredTargets", "animations", "createAnimation", "isNaturallyInteractive", "el", "tag", "ce", "ensureButtonLike", "options", "preserveExisting", "ht", "isActivationKey", "createCleanupBag", "fns", "done", "fn", "i", "makeIdempotentDestroy", "called", "WEBFLOW_ASSETS_CDN_ORIGIN", "CURRENT_CSS_CLASS", "RICH_TEXT_BLOCK_CSS_CLASS", "SLIDER_CSS_CLASSES", "TABS_CSS_CLASSES", "NAVBAR_CSS_CLASSES", "CMS_CSS_CLASSES", "FORM_CSS_CLASSES", "DROPDOWN_CSS_CLASSES", "WEBFLOW_BREAKPOINTS", "isReservedAttr", "name", "normalizeModuleKey", "moduleKey", "isDisabled", "el", "opts", "mk", "dataScoped", "shortScoped", "global", "parseGuards", "read", "names", "v1", "v3", "v2", "evaluateGuards", "guards", "registry", "ctx", "g", "fn", "runActivationPipeline", "args", "includeGlobal", "parsed", "reg", "evalRes", "options", "isString", "value", "isNumber", "isBoolean", "isDate", "value", "noop", "isNotEmpty", "isKeyOf", "key", "source", "isElement", "target", "isHTMLElement", "isHTMLVideoElement", "isHTMLInputElement", "isHTMLSelectElement", "isHTMLTextAreaElement", "isFormField", "element", "isHTMLFormElement", "isHTMLAnchorElement", "isHTMLOptionElement", "isHTMLImageElement", "ensureUniqueId", "element", "id", "isVisible", "cloneNode", "node", "deep", "findTextNode", "textNode", "isHTMLElement", "getHiddenParent", "previousElement", "checkParent", "parentElement", "isScrollable", "overflow", "currentPageStylesheets", "attachedExternalStylesheets", "getCurrentPageStylesheets", "stylesheets", "stylesheet", "href", "origin", "WEBFLOW_ASSETS_CDN_ORIGIN", "attachExternalStylesheets", "page", "externalStylesheetElements", "resolve", "clone", "normalizeDate", "value", "isDate", "date", "defineModule", "def", "createDelegation", "selector", "handlers", "options", "root", "capture", "cleanups", "add", "type", "handler", "listener", "event", "delegatedEvent", "target", "el", "i", "addListener", "noop", "targets", "simulateEvent", "events", "success", "ARIA_ROLE_KEY", "ARIA_ROLE_VALUES", "TABINDEX_KEY", "ARIA_LABEL_KEY", "ARIA_LABELLEDBY_KEY", "ARIA_VALUENOW_KEY", "ARIA_VALUEMIN_KEY", "ARIA_VALUEMAX_KEY", "ARIA_SELECTED_KEY", "ARIA_HASPOPUP_KEY", "ARIA_MULTISELECTABLE_KEY", "ARIA_EXPANDED_KEY", "ARIA_CURRENT_KEY", "ARIA_ACTIVEDESCENDANT_KEY", "ARIA_PRESSED_KEY", "ARIA_CONTROLS_KEY", "ARIA_OWNS_KEY", "ARIA_ROLEDESCRIPTION_KEY", "ARIA_DESCRIPTION_KEY", "ARIA_HIDDEN_KEY", "AUTOCOMPLETE_KEY", "ARIA_AUTOCOMPLETE_KEY", "ROLE_KEY", "REQUIRED_KEY", "NAME_KEY", "ARIA_SETSIZE_KEY", "ARIA_POSINSET_KEY", "ID_KEY", "ARIA_MODAL_KEY", "ARIA_MODAL_VALUES", "ARIA_SORT_KEY", "ARIA_SORT_VALUES", "attributes_exports", "__export", "ACCORDION_ATTRIBUTE", "AUTO_VIDEO_ATTRIBUTE", "CODE_HIGHLIGHT_ATTRIBUTE", "COMBO_BOX_ATTRIBUTE", "COPY_CLIP_ATTRIBUTE", "DISPLAY_VALUES_ATTRIBUTE", "DOCS_ATTRIBUTE", "FAV_CUSTOM_ATTRIBUTE", "FORM_SUBMIT_ATTRIBUTE", "INJECT_ATTRIBUTE", "INPUT_ACTIVE_ATTRIBUTE", "INPUT_COUNTER_ATTRIBUTE", "LIST_ATTRIBUTE", "MIRROR_CLICK_ATTRIBUTE", "MIRROR_INPUT_ATTRIBUTE", "MODAL_ATTRIBUTE", "NUMBER_COUNT_ATTRIBUTE", "QUERY_PARAM_ATTRIBUTE", "RANGE_SLIDER_ATTRIBUTE", "READ_TIME_ATTRIBUTE", "REMOVE_QUERY_ATTRIBUTE", "SCROLL_DISABLE_ATTRIBUTE", "SELECT_CUSTOM_ATTRIBUTE", "SLIDER_DOTS_ATTRIBUTE", "SMART_LIGHTBOX_ATTRIBUTE", "SOCIAL_SHARE_ATTRIBUTE", "STAR_RATING_ATTRIBUTE", "TOC_ATTRIBUTE", "VIDEO_HLS_ATTRIBUTE", "SPACE_KEY", "ENTER_KEY", "ESCAPE_KEY", "TAB_KEY", "CLICK", "BACKSPACE_KEY", "ARROW_UP_KEY", "ARROW_DOWN_KEY", "ARROW_RIGHT_KEY", "ARROW_LEFT_KEY", "getSiteId", "page", "getPublishDate", "publishDatePrefix", "node", "publishDateValue", "restartWebflow", "modules", "Webflow", "ix2", "store", "actions", "eventState", "stateEntries", "state", "commerce", "siteId", "slider", "resolve", "getCurrentBreakpoint", "breakpoint", "mediaQuery", "WEBFLOW_BREAKPOINTS", "closeDropdown", "dropdownToggle", "focusToggle", "simulateEvent", "DB_OBJECT_STORE_NAME", "cache", "fetchPage", "source", "options", "url", "conclude", "cloneNode", "cached", "promise", "createPromise", "cacheExternal", "cacheKey", "cacheVersion", "publishDate", "dbName", "dbVersion", "db", "createCacheDB", "result", "fetchAndParsePage", "rawPageFromDB", "getRawPageFromDB", "parseRawPage", "isPageSameSite", "fetchAndCachePageInDB", "rawPage", "isSameSite", "storeRawPageInDB", "pageSiteId", "dbOpenRequest", "request", "getFormFieldValue", "formField", "customValueAttribute", "type", "value", "groupCheckboxes", "getCheckboxGroup", "checkbox", "checkboxValue", "checked", "checkedRadio", "option", "valueAsDate", "_value", "setFormFieldValue", "isHTMLInputElement", "check", "isBoolean", "groupRadios", "getRadioGroupInputs", "radio", "customRadio", "FORM_CSS_CLASSES", "isHTMLSelectElement", "select", "name", "form", "groupSelector", "isNotEmpty", "getFormFieldWrapper", "normalizeNumber", "isNumber", "isDate", "parseNumericAttribute", "rawValue", "fallback", "getDecimalPrecision", "exponential", "precision", "setDecimalPrecision", "pow", "adjustValueToStep", "step", "minRange", "offset", "remainder", "floor", "isReserved", "kebab", "s", "m", "attrNames", "moduleKey", "mk", "readRaw", "el", "parseValue", "raw", "schema", "readOption", "config", "dataScoped", "dataGlobal", "shortScoped", "v1", "v2", "v3", "readOptionsFromAttributes", "out", "item", "generateSelectors", "attributeKey", "elements", "settings", "normalizedAttributeKey", "ATTRIBUTE_NAME", "DATA_ATTRIBUTE_NAME", "ELEMENT_ATTRIBUTE_NAME", "DATA_ELEMENT_ATTRIBUTE_NAME", "INSTANCE_ATTRIBUTE_NAME", "DATA_INSTANCE_ATTRIBUTE_NAME", "buildIsSelector", "selectors", "getInstancePresenceSelector", "getPresenceSelector", "baseSelector", "appendInstanceScope", "getSettingAttributeName", "settingKey", "key", "getSettingAttributeNames", "getSettingSelector", "valueOrOptions", "short", "data", "resolvedOptions", "selector", "instance", "instancePresenceSelector", "instanceSelector", "getInstanceSelector", "getElementSelector", "elementKey", "getInstanceRoot", "scope", "target", "closest", "queryElement", "scopedSelector", "instanceRoot", "queryAllElements", "getInstance", "element", "instanceHolder", "getClosestElement", "getAttribute", "filterInvalid", "settingElement", "scripts", "script", "values", "defaultValue", "isNumeric", "parsedValue", "extractCommaSeparatedValues", "string", "filterEmpty", "accumulatedValue", "currentValue", "wait", "time", "waitAttributeLoaded", "waitWebflowReady", "waitDOMReady", "Interaction", "duration", "click", "_rendered", "_anchor", "_rendered", "_anchor"]
|
|
7
|
+
}
|