{"version":3,"file":"size-rollup-m-dom-animation.js","sources":["../../motion-utils/dist/es/clamp.mjs","../../motion-utils/dist/es/global-config.mjs","../../motion-utils/dist/es/is-numerical-string.mjs","../../motion-utils/dist/es/is-zero-value-string.mjs","../../motion-utils/dist/es/memo.mjs","../../motion-utils/dist/es/noop.mjs","../../motion-utils/dist/es/pipe.mjs","../../motion-utils/dist/es/progress.mjs","../../motion-utils/dist/es/subscription-manager.mjs","../../motion-utils/dist/es/array.mjs","../../motion-utils/dist/es/time-conversion.mjs","../../motion-utils/dist/es/velocity-per-second.mjs","../../motion-utils/dist/es/easing/cubic-bezier.mjs","../../motion-utils/dist/es/easing/modifiers/mirror.mjs","../../motion-utils/dist/es/easing/modifiers/reverse.mjs","../../motion-utils/dist/es/easing/back.mjs","../../motion-utils/dist/es/easing/anticipate.mjs","../../motion-utils/dist/es/easing/circ.mjs","../../motion-utils/dist/es/easing/ease.mjs","../../motion-utils/dist/es/easing/utils/is-bezier-definition.mjs","../../motion-utils/dist/es/easing/utils/map.mjs","../lib/context/LayoutGroupContext.js","../lib/context/LazyContext.js","../lib/context/MotionConfigContext.js","../lib/context/MotionContext/index.js","../../motion-dom/dist/es/frameloop/frame-data.mjs","../../motion-dom/dist/es/frameloop/sync-time.mjs","../../motion-dom/dist/es/value/types/utils/sanitize.mjs","../../motion-dom/dist/es/animation/utils/is-css-variable.mjs","../../motion-dom/dist/es/value/types/numbers/index.mjs","../../motion-dom/dist/es/value/types/utils/float-regex.mjs","../../motion-dom/dist/es/value/types/utils/single-color-regex.mjs","../../motion-dom/dist/es/value/types/color/utils.mjs","../../motion-dom/dist/es/value/types/utils/is-nullish.mjs","../../motion-dom/dist/es/value/types/color/rgba.mjs","../../motion-dom/dist/es/value/types/color/hex.mjs","../../motion-dom/dist/es/value/types/numbers/units.mjs","../../motion-dom/dist/es/value/types/color/hsla.mjs","../../motion-dom/dist/es/value/types/color/index.mjs","../../motion-dom/dist/es/value/types/complex/index.mjs","../../motion-dom/dist/es/value/types/utils/color-regex.mjs","../../motion-dom/dist/es/value/types/color/hsla-to-rgba.mjs","../../motion-dom/dist/es/utils/mix/immediate.mjs","../../motion-dom/dist/es/utils/mix/number.mjs","../../motion-dom/dist/es/utils/mix/color.mjs","../../motion-dom/dist/es/utils/mix/visibility.mjs","../../motion-dom/dist/es/utils/mix/complex.mjs","../../motion-dom/dist/es/utils/mix/index.mjs","../../motion-dom/dist/es/frameloop/order.mjs","../../motion-dom/dist/es/frameloop/batcher.mjs","../../motion-dom/dist/es/frameloop/render-step.mjs","../../motion-dom/dist/es/frameloop/frame.mjs","../../motion-dom/dist/es/animation/drivers/frame.mjs","../../motion-dom/dist/es/animation/waapi/utils/linear.mjs","../../motion-dom/dist/es/animation/generators/utils/calc-duration.mjs","../../motion-dom/dist/es/animation/generators/spring.mjs","../../motion-dom/dist/es/animation/generators/inertia.mjs","../../motion-dom/dist/es/utils/interpolate.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/default.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/fill.mjs","../../motion-dom/dist/es/animation/generators/keyframes.mjs","../../motion-utils/dist/es/easing/utils/is-easing-array.mjs","../../motion-dom/dist/es/animation/keyframes/offsets/time.mjs","../../motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs","../../motion-dom/dist/es/animation/generators/utils/velocity.mjs","../../motion-dom/dist/es/animation/keyframes/get-final.mjs","../../motion-dom/dist/es/animation/utils/replace-transition-type.mjs","../../motion-dom/dist/es/animation/utils/resolve-start-time.mjs","../../motion-dom/dist/es/animation/utils/notify-inspector.mjs","../../motion-dom/dist/es/animation/utils/WithPromise.mjs","../../motion-dom/dist/es/animation/JSAnimation.mjs","../../motion-dom/dist/es/value/types/complex/filter.mjs","../../motion-dom/dist/es/value/types/complex/mask.mjs","../../motion-dom/dist/es/value/types/int.mjs","../../motion-dom/dist/es/value/types/maps/number.mjs","../../motion-dom/dist/es/value/types/maps/transform.mjs","../../motion-dom/dist/es/value/types/maps/defaults.mjs","../../motion-dom/dist/es/value/types/utils/animatable-none.mjs","../../motion-dom/dist/es/render/dom/parse-transform.mjs","../../motion-dom/dist/es/render/utils/keys-transform.mjs","../../motion-dom/dist/es/animation/keyframes/utils/unit-conversion.mjs","../../motion-dom/dist/es/animation/keyframes/KeyframesResolver.mjs","../../motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs","../../motion-dom/dist/es/render/dom/style-set.mjs","../../motion-dom/dist/es/render/dom/is-css-var.mjs","../../motion-dom/dist/es/utils/supports/flags.mjs","../../motion-dom/dist/es/utils/supports/memo.mjs","../../motion-dom/dist/es/utils/supports/scroll-timeline.mjs","../../motion-dom/dist/es/utils/supports/linear-easing.mjs","../../motion-dom/dist/es/animation/waapi/easing/cubic-bezier.mjs","../../motion-dom/dist/es/animation/waapi/easing/supported.mjs","../../motion-dom/dist/es/animation/waapi/easing/map-easing.mjs","../../motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs","../../motion-dom/dist/es/animation/generators/utils/is-generator.mjs","../../motion-dom/dist/es/animation/NativeAnimation.mjs","../../motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs","../../motion-dom/dist/es/animation/waapi/utils/unsupported-easing.mjs","../../motion-dom/dist/es/animation/NativeAnimationExtended.mjs","../../motion-dom/dist/es/animation/utils/is-animatable.mjs","../../motion-dom/dist/es/animation/utils/make-animation-instant.mjs","../../motion-dom/dist/es/animation/waapi/utils/accelerated-values.mjs","../../motion-dom/dist/es/animation/waapi/utils/is-browser-color.mjs","../../motion-dom/dist/es/animation/waapi/supports/waapi.mjs","../../motion-dom/dist/es/value/types/utils/get-as-type.mjs","../../motion-dom/dist/es/render/html/utils/build-transform.mjs","../../motion-dom/dist/es/animation/waapi/transforms/groups.mjs","../../motion-dom/dist/es/animation/waapi/transforms/TransformAnimation.mjs","../../motion-dom/dist/es/animation/AsyncMotionValueAnimation.mjs","../../motion-dom/dist/es/animation/utils/can-animate.mjs","../../motion-dom/dist/es/animation/utils/calc-child-stagger.mjs","../../motion-dom/dist/es/value/index.mjs","../../motion-dom/dist/es/animation/utils/resolve-transition.mjs","../../motion-dom/dist/es/animation/utils/get-value-transition.mjs","../../motion-dom/dist/es/animation/utils/default-transitions.mjs","../../motion-dom/dist/es/animation/utils/is-transition-defined.mjs","../../motion-dom/dist/es/animation/interfaces/motion-value.mjs","../../motion-dom/dist/es/animation/utils/css-variables-conversion.mjs","../../motion-dom/dist/es/render/utils/resolve-variants.mjs","../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.mjs","../../motion-dom/dist/es/render/utils/keys-position.mjs","../../motion-dom/dist/es/render/utils/setters.mjs","../../motion-dom/dist/es/render/utils/is-keyframes-target.mjs","../../motion-dom/dist/es/value/utils/is-motion-value.mjs","../../motion-dom/dist/es/value/will-change/add-will-change.mjs","../../motion-dom/dist/es/value/will-change/is.mjs","../../motion-dom/dist/es/render/dom/utils/camel-to-dash.mjs","../../motion-dom/dist/es/animation/optimized-appear/data-id.mjs","../../motion-dom/dist/es/animation/optimized-appear/get-appear-id.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-target.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element-variant.mjs","../../motion-dom/dist/es/value/types/auto.mjs","../../motion-dom/dist/es/value/types/dimensions.mjs","../../motion-dom/dist/es/value/types/test.mjs","../../motion-dom/dist/es/animation/keyframes/utils/is-none.mjs","../../motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.mjs","../../motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.mjs","../../motion-dom/dist/es/render/html/utils/build-styles.mjs","../../motion-dom/dist/es/render/svg/utils/path.mjs","../../motion-dom/dist/es/render/svg/utils/build-attrs.mjs","../../motion-dom/dist/es/frameloop/microtask.mjs","../../motion-dom/dist/es/gestures/drag/state/is-active.mjs","../../motion-dom/dist/es/gestures/utils/setup.mjs","../../motion-dom/dist/es/utils/resolve-elements.mjs","../../motion-dom/dist/es/gestures/hover.mjs","../../motion-dom/dist/es/gestures/utils/is-node-or-child.mjs","../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.mjs","../../motion-dom/dist/es/gestures/press/utils/state.mjs","../../motion-dom/dist/es/gestures/press/utils/keyboard.mjs","../../motion-dom/dist/es/gestures/press/index.mjs","../../motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs","../../motion-dom/dist/es/utils/is-html-element.mjs","../../motion-utils/dist/es/is-object.mjs","../../motion-dom/dist/es/projection/geometry/models.mjs","../../motion-dom/dist/es/render/store.mjs","../../motion-dom/dist/es/render/utils/is-animation-controls.mjs","../../motion-dom/dist/es/render/utils/is-variant-label.mjs","../../motion-dom/dist/es/render/utils/variant-props.mjs","../../motion-dom/dist/es/render/utils/is-controlling-variants.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/state.mjs","../../motion-dom/dist/es/render/utils/reduced-motion/index.mjs","../../motion-dom/dist/es/render/VisualElement.mjs","../../motion-dom/dist/es/render/utils/motion-values.mjs","../../motion-dom/dist/es/render/dom/DOMVisualElement.mjs","../../motion-dom/dist/es/render/Feature.mjs","../../motion-dom/dist/es/render/html/utils/render.mjs","../../motion-dom/dist/es/projection/styles/scale-correction.mjs","../../motion-dom/dist/es/render/utils/is-forced-motion-value.mjs","../../motion-dom/dist/es/render/html/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/html/HTMLVisualElement.mjs","../../motion-dom/dist/es/projection/utils/measure.mjs","../../motion-dom/dist/es/projection/geometry/conversion.mjs","../../motion-dom/dist/es/render/svg/utils/camel-case-attrs.mjs","../../motion-dom/dist/es/render/svg/utils/is-svg-tag.mjs","../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.mjs","../../motion-dom/dist/es/render/svg/SVGVisualElement.mjs","../../motion-dom/dist/es/render/svg/utils/render.mjs","../../motion-dom/dist/es/render/utils/shallow-compare.mjs","../../motion-dom/dist/es/render/utils/animation-state.mjs","../../motion-dom/dist/es/animation/interfaces/visual-element.mjs","../../motion-dom/dist/es/events/add-dom-event.mjs","../../motion-dom/dist/es/value/utils/resolve-motion-value.mjs","../lib/context/MotionContext/create.js","../lib/context/MotionContext/utils.js","../lib/render/html/utils/create-render-state.js","../lib/render/html/use-props.js","../lib/render/svg/utils/create-render-state.js","../lib/render/svg/use-props.js","../lib/motion/utils/valid-prop.js","../lib/render/dom/utils/filter-props.js","../lib/render/svg/lowercase-elements.js","../lib/render/dom/utils/is-svg-component.js","../lib/render/dom/use-render.js","../lib/context/PresenceContext.js","../lib/motion/utils/use-visual-state.js","../lib/utils/use-constant.js","../lib/render/html/use-html-visual-state.js","../lib/render/svg/use-svg-visual-state.js","../lib/motion/features/definitions.js","../lib/motion/features/load-features.js","../lib/motion/utils/symbol.js","../lib/motion/utils/use-motion-ref.js","../lib/context/SwitchLayoutGroupContext.js","../lib/utils/is-ref-object.js","../lib/utils/is-browser.js","../lib/utils/use-isomorphic-effect.js","../lib/motion/utils/use-visual-element.js","../lib/motion/index.js","../lib/render/components/m/create.js","../lib/render/components/m/elements.js","../lib/render/components/m/size.js","../lib/components/LazyMotion/index.js","../lib/motion/features/animation/exit.js","../lib/motion/features/animations.js","../lib/motion/features/animation/index.js","../lib/events/event-info.js","../lib/gestures/hover.js","../lib/gestures/press.js","../lib/motion/features/viewport/observers.js","../lib/motion/features/viewport/index.js","../lib/motion/features/gestures.js","../lib/render/dom/features-animation.js","../lib/render/dom/create-visual-element.js","../lib/gestures/focus.js"],"sourcesContent":["const clamp = (min, max, v) => {\n if (v > max)\n return max;\n if (v < min)\n return min;\n return v;\n};\n\nexport { clamp };\n//# sourceMappingURL=clamp.mjs.map\n","const MotionGlobalConfig = {};\n\nexport { MotionGlobalConfig };\n//# sourceMappingURL=global-config.mjs.map\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nconst isNumericalString = (v) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v);\n\nexport { isNumericalString };\n//# sourceMappingURL=is-numerical-string.mjs.map\n","/**\n * Check if the value is a zero value string like \"0px\" or \"0%\"\n */\nconst isZeroValueString = (v) => /^0[^.\\s]+$/u.test(v);\n\nexport { isZeroValueString };\n//# sourceMappingURL=is-zero-value-string.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nfunction memo(callback) {\n let result;\n return () => {\n if (result === undefined)\n result = callback();\n return result;\n };\n}\n\nexport { memo };\n//# sourceMappingURL=memo.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst noop = (any) => any;\n\nexport { noop };\n//# sourceMappingURL=noop.mjs.map\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 pipe = (...transformers) => transformers.reduce((a, b) => (v) => b(a(v)));\n\nexport { pipe };\n//# sourceMappingURL=pipe.mjs.map\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/*#__NO_SIDE_EFFECTS__*/\nconst progress = (from, to, value) => {\n const range = to - from;\n return range ? (value - from) / range : 1;\n};\n\nexport { progress };\n//# sourceMappingURL=progress.mjs.map\n","import { addUniqueItem, removeItem } from './array.mjs';\n\nclass SubscriptionManager {\n constructor() {\n this.subscriptions = [];\n }\n add(handler) {\n addUniqueItem(this.subscriptions, handler);\n return () => this.remove(handler);\n }\n remove(handler) {\n removeItem(this.subscriptions, handler);\n }\n notify(a, b, c) {\n const numSubscriptions = this.subscriptions.length;\n if (!numSubscriptions)\n return;\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 }\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 getSize() {\n return this.subscriptions.length;\n }\n clear() {\n this.subscriptions.length = 0;\n }\n}\n\nexport { SubscriptionManager };\n//# sourceMappingURL=subscription-manager.mjs.map\n","function addUniqueItem(arr, item) {\n if (arr.indexOf(item) === -1)\n arr.push(item);\n}\nfunction removeItem(arr, item) {\n const index = arr.indexOf(item);\n if (index > -1)\n arr.splice(index, 1);\n}\n// Adapted from array-move\nfunction moveItem([...arr], fromIndex, toIndex) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;\n const [item] = arr.splice(fromIndex, 1);\n arr.splice(endIndex, 0, item);\n }\n return arr;\n}\n\nexport { addUniqueItem, moveItem, removeItem };\n//# sourceMappingURL=array.mjs.map\n","/**\n * Converts seconds to milliseconds\n *\n * @param seconds - Time in seconds.\n * @return milliseconds - Converted time in milliseconds.\n */\n/*#__NO_SIDE_EFFECTS__*/\nconst secondsToMilliseconds = (seconds) => seconds * 1000;\n/*#__NO_SIDE_EFFECTS__*/\nconst millisecondsToSeconds = (milliseconds) => milliseconds / 1000;\n\nexport { millisecondsToSeconds, secondsToMilliseconds };\n//# sourceMappingURL=time-conversion.mjs.map\n","/*\n Convert velocity into velocity per second\n*/\n/*#__NO_SIDE_EFFECTS__*/\nconst velocityPerSecond = (velocity, frameDuration) => frameDuration ? velocity * (1000 / frameDuration) : 0;\n\nexport { velocityPerSecond };\n//# sourceMappingURL=velocity-per-second.mjs.map\n","import { noop } from '../noop.mjs';\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 t is found for a given x with Newton-Raphson, safeguarded by a bisection\n bracket: whenever a Newton step would leave the bracket (near flat parts\n of the curve), it bisects instead. This converges to full precision in\n ~5 iterations on typical curves, so output is smooth rather than snapped\n to a fixed bisection grid. The slope is estimated with a forward\n difference, and the lookup table is omitted, to save bytes.\n\n x = 0 and x = 1 return exactly 0 and 1. x outside [0, 1] starts outside\n the bracket, so it bisects towards the nearer end and saturates to within\n ~1e-12 of 0 or 1.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\n// Bernstein form, so it is exactly 0 at t = 0 and exactly 1 at t = 1.\nconst calcBezier = (t, a1, a2) => t * (3 * (1 - t) * ((1 - t) * a1 + t * a2) + t * t);\n/*#__NO_SIDE_EFFECTS__*/\nfunction cubicBezier(mX1, mY1, mX2, mY2) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2)\n return noop;\n return (x) => {\n let lowerBound = 0;\n let upperBound = 1;\n let t = x;\n for (let i = 0;; i++) {\n // If t is outside the bracket, because x is out of range or a\n // Newton step overshot where the slope is ~0, bisect instead.\n if (!(t >= lowerBound && t <= upperBound)) {\n t = (lowerBound + upperBound) / 2;\n }\n const currentX = calcBezier(t, mX1, mX2) - x;\n if (currentX * currentX < 1e-28 || i === 40)\n break;\n currentX > 0 ? (upperBound = t) : (lowerBound = t);\n // Newton-Raphson step, with dx/dt from a forward difference\n t -=\n (currentX * 1e-7) /\n (calcBezier(t + 1e-7, mX1, mX2) - x - currentX);\n }\n return calcBezier(t, mY1, mY2);\n };\n}\n\nexport { cubicBezier };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n// the second half of the animation. Turns easeIn into easeInOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\n\nexport { mirrorEasing };\n//# sourceMappingURL=mirror.mjs.map\n","// Accepts an easing function and returns a new one that outputs reversed values.\n// Turns easeIn into easeOut.\n/*#__NO_SIDE_EFFECTS__*/\nconst reverseEasing = (easing) => (p) => 1 - easing(1 - p);\n\nexport { reverseEasing };\n//# sourceMappingURL=reverse.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\nimport { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst backOut = /*@__PURE__*/ cubicBezier(0.33, 1.53, 0.69, 0.99);\nconst backIn = /*@__PURE__*/ reverseEasing(backOut);\nconst backInOut = /*@__PURE__*/ mirrorEasing(backIn);\n\nexport { backIn, backInOut, backOut };\n//# sourceMappingURL=back.mjs.map\n","import { backIn } from './back.mjs';\n\nconst anticipate = (p) => p >= 1\n ? 1\n : (p *= 2) < 1\n ? 0.5 * backIn(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n\nexport { anticipate };\n//# sourceMappingURL=anticipate.mjs.map\n","import { mirrorEasing } from './modifiers/mirror.mjs';\nimport { reverseEasing } from './modifiers/reverse.mjs';\n\nconst circIn = (p) => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circIn);\n\nexport { circIn, circInOut, circOut };\n//# sourceMappingURL=circ.mjs.map\n","import { cubicBezier } from './cubic-bezier.mjs';\n\nconst easeIn = /*@__PURE__*/ cubicBezier(0.42, 0, 1, 1);\nconst easeOut = /*@__PURE__*/ cubicBezier(0, 0, 0.58, 1);\nconst easeInOut = /*@__PURE__*/ cubicBezier(0.42, 0, 0.58, 1);\n\nexport { easeIn, easeInOut, easeOut };\n//# sourceMappingURL=ease.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === \"number\";\n\nexport { isBezierDefinition };\n//# sourceMappingURL=is-bezier-definition.mjs.map\n","import { invariant } from '../../errors.mjs';\nimport { noop } from '../../noop.mjs';\nimport { anticipate } from '../anticipate.mjs';\nimport { backOut, backInOut, backIn } from '../back.mjs';\nimport { circOut, circInOut, circIn } from '../circ.mjs';\nimport { cubicBezier } from '../cubic-bezier.mjs';\nimport { easeOut, easeInOut, easeIn } from '../ease.mjs';\nimport { isBezierDefinition } from './is-bezier-definition.mjs';\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};\nconst isValidEasing = (easing) => {\n return typeof easing === \"string\";\n};\nconst easingDefinitionToFunction = (definition) => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`, \"cubic-bezier-length\");\n const [x1, y1, x2, y2] = definition;\n return cubicBezier(x1, y1, x2, y2);\n }\n else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(easingLookup[definition] !== undefined, `Invalid easing type '${definition}'`, \"invalid-easing-type\");\n return easingLookup[definition];\n }\n return definition;\n};\n\nexport { easingDefinitionToFunction };\n//# sourceMappingURL=map.mjs.map\n","\"use client\";\nimport { createContext } from \"react\";\nexport const LayoutGroupContext = createContext({});\n//# sourceMappingURL=LayoutGroupContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const LazyContext = createContext({ strict: false });\n//# sourceMappingURL=LazyContext.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n//# sourceMappingURL=MotionConfigContext.js.map","\"use client\";\nimport { createContext } from \"react\";\nexport const MotionContext = /* @__PURE__ */ createContext({});\n//# sourceMappingURL=index.js.map","/**\n * The frameloop's state, kept apart from the frameloop itself so that\n * reading it doesn't bundle the scheduler.\n */\nconst frameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n};\n\nexport { frameData };\n//# sourceMappingURL=frame-data.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { frameData } from './frame-data.mjs';\n\nlet now;\nfunction clearTime() {\n now = undefined;\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 */\nconst time = {\n now: () => {\n if (now === undefined) {\n time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now());\n }\n return now;\n },\n set: (newTime) => {\n now = newTime;\n queueMicrotask(clearTime);\n },\n};\n\nexport { time };\n//# sourceMappingURL=sync-time.mjs.map\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nconst sanitize = (v) => Math.round(v * 100000) / 100000;\n\nexport { sanitize };\n//# sourceMappingURL=sanitize.mjs.map\n","const checkStringStartsWith = (token) => (key) => typeof key === \"string\" && key.startsWith(token);\nconst isCSSVariableName = \n/*@__PURE__*/ checkStringStartsWith(\"--\");\nconst startsAsVariableToken = \n/*@__PURE__*/ checkStringStartsWith(\"var(--\");\nconst isCSSVariableToken = (value) => {\n const startsWithToken = startsAsVariableToken(value);\n if (!startsWithToken)\n return false;\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};\nconst singleCssVariableRegex = /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu;\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 */\nfunction containsCSSVariable(value) {\n if (typeof value !== \"string\")\n return false;\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\");\n}\n\nexport { containsCSSVariable, isCSSVariableName, isCSSVariableToken };\n//# sourceMappingURL=is-css-variable.mjs.map\n","import { clamp } from 'motion-utils';\n\nconst number = {\n test: (v) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = {\n ...number,\n transform: (v) => clamp(0, 1, v),\n};\nconst scale = {\n ...number,\n default: 1,\n};\n\nexport { alpha, number, scale };\n//# sourceMappingURL=index.mjs.map\n","const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu;\n\nexport { floatRegex };\n//# sourceMappingURL=float-regex.mjs.map\n","const singleColorRegex = /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu;\n\nexport { singleColorRegex };\n//# sourceMappingURL=single-color-regex.mjs.map\n","import { floatRegex } from '../utils/float-regex.mjs';\nimport { isNullish } from '../utils/is-nullish.mjs';\nimport { singleColorRegex } from '../utils/single-color-regex.mjs';\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 */\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (typeof v !== \"string\")\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n//# sourceMappingURL=utils.mjs.map\n","function isNullish(v) {\n return v == null;\n}\n\nexport { isNullish };\n//# sourceMappingURL=is-nullish.mjs.map\n","import { clamp } from 'motion-utils';\nimport { number, alpha } from '../numbers/index.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst clampRgbUnit = (v) => clamp(0, 255, v);\nconst rgbUnit = {\n ...number,\n transform: (v) => Math.round(clampRgbUnit(v)),\n};\nconst rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\",\n};\n\nexport { rgbUnit, rgba };\n//# sourceMappingURL=rgba.mjs.map\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = \"\";\n let g = \"\";\n let b = \"\";\n let a = \"\";\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 // Or we have 3 characters, ie #F00\n }\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 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}\nconst hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n//# sourceMappingURL=hex.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit) => ({\n test: (v) => typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = /*@__PURE__*/ createUnitType(\"deg\");\nconst percent = /*@__PURE__*/ createUnitType(\"%\");\nconst px = /*@__PURE__*/ createUnitType(\"px\");\nconst vh = /*@__PURE__*/ createUnitType(\"vh\");\nconst vw = /*@__PURE__*/ createUnitType(\"vw\");\nconst progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v) => percent.parse(v) / 100,\n transform: (v) => percent.transform(v * 100),\n}))();\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n//# sourceMappingURL=units.mjs.map\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\nimport { splitColor, isColorString } from './utils.mjs';\n\nconst hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return (\"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alpha.transform(alpha$1)) +\n \")\");\n },\n};\n\nexport { hsla };\n//# sourceMappingURL=hsla.mjs.map\n","import { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n getAnimatableNone: (v) => {\n const parsed = color.parse(v);\n parsed.alpha = 0;\n return color.transform(parsed);\n },\n};\n\nexport { color };\n//# sourceMappingURL=index.mjs.map\n","import { color } from '../color/index.mjs';\nimport { colorRegex } from '../utils/color-regex.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\nimport { sanitize } from '../utils/sanitize.mjs';\n\n/**\n * Non-global copies of the token regexes so test() can use .test()\n * (no match array, stops at the first token) without lastIndex state.\n */\nconst hasFloat = /*@__PURE__*/ new RegExp(floatRegex.source);\nconst hasColor = /*@__PURE__*/ new RegExp(colorRegex.source, \"i\");\nfunction test(v) {\n return (isNaN(v) &&\n typeof v === \"string\" &&\n (hasFloat.test(v) || hasColor.test(v)));\n}\nconst NUMBER_TOKEN = \"number\";\nconst COLOR_TOKEN = \"color\";\nconst VAR_TOKEN = \"var\";\nconst VAR_FUNCTION_TOKEN = \"var(\";\nconst SPLIT_TOKEN = \"${}\";\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`.\n// The lookahead skips digits in function names, like the 3 in matrix3d(.\nconst complexRegex = /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+)(?![a-z]*\\()/giu;\n/**\n * Whether analyseComplexValue(value) would find any values, without\n * tokenising the string. CSS variables are resolved before this is\n * used, so it's enough to look for a number or a color.\n */\nfunction hasComplexValues(value) {\n const asString = value.toString();\n return hasFloat.test(asString) || hasColor.test(asString);\n}\nfunction analyseComplexValue(value) {\n const originalValue = value.toString();\n const values = [];\n const indexes = {\n color: [],\n number: [],\n var: [],\n };\n const types = [];\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 }\n else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i);\n types.push(VAR_TOKEN);\n values.push(parsedValue);\n }\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 return { values, split, indexes, types };\n}\nfunction parseComplexValue(v) {\n return analyseComplexValue(v).values;\n}\nfunction buildTransformer({ split, types }) {\n const numSections = split.length;\n return (v) => {\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]);\n }\n else if (type === COLOR_TOKEN) {\n output += color.transform(v[i]);\n }\n else {\n output += v[i];\n }\n }\n }\n return output;\n };\n}\nfunction createTransformer(source) {\n return buildTransformer(analyseComplexValue(source));\n}\nconst convertNumbersToZero = (v) => typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v;\n/**\n * Convert a parsed value to its zero equivalent, but preserve numbers\n * that act as divisors in CSS calc() expressions.\n *\n * analyseComplexValue extracts numbers from CSS strings and puts the\n * surrounding text into a `split` template array. For example:\n * \"calc(var(--gap) / 5)\" → values: [var(--gap), 5]\n * split: [\"calc(\", \" / \", \")\"]\n *\n * When building a zero-equivalent for animation, naively zeroing all\n * numbers turns the divisor into 0 → \"calc(var(--gap) / 0)\" → NaN.\n * We detect this by checking whether the text preceding a number\n * (split[i]) ends with \"/\" — the CSS calc division operator.\n */\nconst convertToZero = (value, splitBefore) => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0;\n }\n return convertNumbersToZero(value);\n};\nfunction getAnimatableNone(v) {\n const info = analyseComplexValue(v);\n const transformer = buildTransformer(info);\n return transformer(info.values.map((value, i) => convertToZero(value, info.split[i])));\n}\nconst complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n};\n\nexport { analyseComplexValue, complex, hasComplexValues };\n//# sourceMappingURL=index.mjs.map\n","const colorRegex = /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu;\n\nexport { colorRegex };\n//# sourceMappingURL=color-regex.mjs.map\n","// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\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\nexport { hslaToRgba };\n//# sourceMappingURL=hsla-to-rgba.mjs.map\n","function mixImmediate(a, b) {\n return (p) => (p > 0 ? b : a);\n}\n\nexport { mixImmediate };\n//# sourceMappingURL=immediate.mjs.map\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*/\nconst mixNumber = (from, to, progress) => {\n return from + (to - from) * progress;\n};\n\nexport { mixNumber };\n//# sourceMappingURL=number.mjs.map\n","import { warning } from 'motion-utils';\nimport { hex } from '../../value/types/color/hex.mjs';\nimport { hsla } from '../../value/types/color/hsla.mjs';\nimport { hslaToRgba } from '../../value/types/color/hsla-to-rgba.mjs';\nimport { rgba } from '../../value/types/color/rgba.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber } from './number.mjs';\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const expo = v * (to * to - fromExpo) + fromExpo;\n return expo < 0 ? 0 : Math.sqrt(expo);\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nfunction asRGBA(color) {\n const type = getColorType(color);\n if (!type) {\n warning(false, `'${color}' is not an animatable color. Use the equivalent color code instead.`, \"color-not-animatable\");\n return false;\n }\n let model = type.parse(color);\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model);\n }\n return model;\n}\nconst mixColor = (from, to) => {\n const fromRGBA = asRGBA(from);\n const toRGBA = asRGBA(to);\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to);\n }\n const blended = { ...fromRGBA };\n return (v) => {\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\nexport { mixColor, mixLinearColor };\n//# sourceMappingURL=color.mjs.map\n","const invisibleValues = new Set([\"none\", \"hidden\"]);\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 */\nfunction mixVisibility(origin, target) {\n if (invisibleValues.has(origin)) {\n return (p) => (p <= 0 ? origin : target);\n }\n else {\n return (p) => (p >= 1 ? target : origin);\n }\n}\n\nexport { invisibleValues, mixVisibility };\n//# sourceMappingURL=visibility.mjs.map\n","import { pipe, warning } from 'motion-utils';\nimport { isCSSVariableToken } from '../../animation/utils/is-css-variable.mjs';\nimport { color } from '../../value/types/color/index.mjs';\nimport { complex, analyseComplexValue } from '../../value/types/complex/index.mjs';\nimport { mixColor } from './color.mjs';\nimport { mixImmediate } from './immediate.mjs';\nimport { mixNumber as mixNumber$1 } from './number.mjs';\nimport { invisibleValues, mixVisibility } from './visibility.mjs';\n\nfunction mixNumber(a, b) {\n return (p) => mixNumber$1(a, b, p);\n}\nfunction getMixer(a) {\n if (typeof a === \"number\") {\n return mixNumber;\n }\n else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex;\n }\n else if (Array.isArray(a)) {\n return mixArray;\n }\n else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject;\n }\n return mixImmediate;\n}\nfunction mixArray(a, b) {\n const output = [...a];\n const numValues = output.length;\n const blendValue = a.map((v, i) => getMixer(v)(v, b[i]));\n return (p) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p);\n }\n return output;\n };\n}\nfunction mixObject(a, b) {\n const output = { ...a, ...b };\n const blendValue = {};\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(a[key], b[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n}\nfunction matchOrder(origin, target) {\n const orderedOrigin = [];\n const pointers = { color: 0, var: 0, number: 0 };\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 orderedOrigin[i] = originValue;\n pointers[type]++;\n }\n return orderedOrigin;\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyseComplexValue(origin);\n const targetStats = analyseComplexValue(target);\n const canInterpolate = 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 if (canInterpolate) {\n if ((invisibleValues.has(origin) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target) &&\n !originStats.values.length)) {\n return mixVisibility(origin, target);\n }\n return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template);\n }\n else {\n warning(true, `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.`, \"complex-values-different\");\n return mixImmediate(origin, target);\n }\n};\n\nexport { getMixer, mixArray, mixComplex, mixObject };\n//# sourceMappingURL=complex.mjs.map\n","import { sanitize } from '../../value/types/utils/sanitize.mjs';\nimport { getMixer } from './complex.mjs';\nimport { mixNumber } from './number.mjs';\n\n/**\n * A single number with an optional unit, e.g. \"50%\", \"-10px\", \".5em\".\n * Exponents don't match, so they fall through to the complex mixer.\n */\nconst unitValue = /^(-?(?:\\d+(?:\\.\\d*)?|\\.\\d+))([a-z%]*)$/iu;\n/**\n * Most CSS values Motion mixes are a single number with a unit. Mixing\n * these directly produces the same output as the complex mixer\n * (\"25%\", \"0.33333px\") without tokenising both strings.\n */\nfunction mixUnit(from, to) {\n const a = unitValue.exec(from);\n if (!a)\n return;\n const b = unitValue.exec(to);\n if (!b || a[2] !== b[2])\n return;\n const unit = a[2];\n const origin = parseFloat(a[1]);\n const target = parseFloat(b[1]);\n return (p) => sanitize(mixNumber(origin, target, p)) + unit;\n}\nfunction mix(from, to, p) {\n if (typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\") {\n return mixNumber(from, to, p);\n }\n if (typeof from === \"string\" && typeof to === \"string\") {\n const mixer = mixUnit(from, to);\n if (mixer)\n return mixer;\n }\n const mixer = getMixer(from);\n return mixer(from, to);\n}\n\nexport { mix };\n//# sourceMappingURL=index.mjs.map\n","const stepsOrder = [\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];\n\nexport { stepsOrder };\n//# sourceMappingURL=order.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { stepsOrder } from './order.mjs';\nimport { createRenderStep } from './render-step.mjs';\n\nconst maxElapsed = 40;\nfunction createRenderBatcher(scheduleNextBatch, allowKeepAlive, state = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n}) {\n let runNextFrame = false;\n let useDefaultElapsed = true;\n const flagRunNextFrame = () => (runNextFrame = true);\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame);\n return acc;\n }, {});\n const { setup, read, resolveKeyframes, preUpdate, update, preRender, render, postRender, } = steps;\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming;\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now();\n runNextFrame = false;\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);\n }\n state.timestamp = timestamp;\n state.isProcessing = true;\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 state.isProcessing = false;\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false;\n scheduleNextBatch(processBatch);\n }\n };\n const wake = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch);\n }\n };\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n wake();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n }, {});\n const cancel = (process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process);\n }\n };\n return { schedule, cancel, state, steps };\n}\n\nexport { createRenderBatcher };\n//# sourceMappingURL=batcher.mjs.map\n","function createRenderStep(runNextFrame) {\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();\n let nextFrame = new Set();\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 let flushNextFrame = false;\n /**\n * A set of processes which were marked keepAlive when scheduled.\n * A keepAlive process is always also held by a frame queue until\n * it's cancelled, so a Set has the same lifetime semantics as a\n * WeakSet here while being considerably faster to query every frame.\n */\n const toKeepAlive = new Set();\n let latestFrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n };\n function triggerCallback(callback) {\n if (toKeepAlive.has(callback)) {\n nextFrame.add(callback);\n runNextFrame();\n }\n callback(latestFrameData);\n }\n const 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 if (keepAlive)\n toKeepAlive.add(callback);\n queue.add(callback);\n return callback;\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 * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData;\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 isProcessing = true;\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame;\n thisFrame = nextFrame;\n nextFrame = prevFrame;\n // Execute this frame\n thisFrame.forEach(triggerCallback);\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 isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n//# sourceMappingURL=render-step.mjs.map\n","import { noop } from 'motion-utils';\nimport { createRenderBatcher } from './batcher.mjs';\nimport { frameData } from './frame-data.mjs';\n\nconst { schedule: frame, cancel: cancelFrame, steps: frameSteps, } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop, true, frameData);\n\nexport { cancelFrame, frame, frameSteps };\n//# sourceMappingURL=frame.mjs.map\n","import { time } from '../../frameloop/sync-time.mjs';\nimport { frameData } from '../../frameloop/frame-data.mjs';\nimport { cancelFrame, frame } from '../../frameloop/frame.mjs';\n\nconst frameloopDriver = (update) => {\n const passTimestamp = ({ timestamp }) => update(timestamp);\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\nexport { frameloopDriver };\n//# sourceMappingURL=frame.mjs.map\n","const generateLinearEasing = (easing, duration, // as milliseconds\nresolution = 10 // as milliseconds\n) => {\n let points = \"\";\n const numPoints = Math.max(Math.round(duration / resolution), 2);\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \";\n }\n return `linear(${points.substring(0, points.length - 2)})`;\n};\n\nexport { generateLinearEasing };\n//# sourceMappingURL=linear.mjs.map\n","/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxGeneratorDuration = 20000;\nfunction calcGeneratorDuration(generator, timeStep = 50, maxDuration = maxGeneratorDuration, keyframes) {\n let duration = 0;\n let state = generator.next(duration);\n keyframes?.push(state.value);\n while (!state.done && duration < maxDuration) {\n duration += timeStep;\n state = generator.next(duration);\n keyframes?.push(state.value);\n }\n return duration >= maxDuration ? Infinity : duration;\n}\n\nexport { calcGeneratorDuration, maxGeneratorDuration };\n//# sourceMappingURL=calc-duration.mjs.map\n","import { millisecondsToSeconds, secondsToMilliseconds, warning, clamp } from 'motion-utils';\nimport { generateLinearEasing } from '../waapi/utils/linear.mjs';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';\nimport { createGeneratorEasing } from './utils/create-generator-easing.mjs';\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\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 // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n};\n/**\n * Maps bounce to a damping ratio as SwiftUI does: 0 is critically damped, and\n * it approaches undamped towards 1 and infinitely overdamped towards -1. Both\n * ends are limited so the spring still moves and settles.\n */\nconst bounceToDampingRatio = (bounce) => bounce < 0\n ? 1 / Math.max(1 + bounce, springDefaults.minDamping)\n : Math.max(1 - bounce, springDefaults.minDamping);\n/**\n * Scales an overdamped spring's undamped frequency so that, at its defining\n * time, it has as far left to go as the critically damped spring that's\n * criticalFreqTime radians in by then. A negative bounce then changes the\n * shape of the curve, not when it arrives. 1 at a damping ratio of 1, so\n * there's no jump at a bounce of 0.\n *\n * Solved by Newton on the remaining distance (times fast - slow), which is\n * convex from criticalFreqTime onwards. criticalFreqTime is always below the\n * answer, so it converges from below without overshooting.\n */\nfunction overdampedFreqScale(dampingRatio, criticalFreqTime) {\n if (!(dampingRatio > 1))\n return 1;\n const root = Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = dampingRatio - root;\n const fast = dampingRatio + root;\n const target = 2 * root * Math.exp(-criticalFreqTime) * (1 + criticalFreqTime);\n return (approximateRoot((freqTime) => fast * Math.exp(-slow * freqTime) -\n slow * Math.exp(-fast * freqTime) -\n target, (freqTime) => Math.exp(-fast * freqTime) - Math.exp(-slow * freqTime), criticalFreqTime) / criticalFreqTime);\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\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/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001;\n/**\n * Assumes zero initial velocity and the default mass: time-defined springs\n * ignore inherited velocity and only resolve without valid physics. Returns\n * NaN physics when the root search doesn't converge.\n */\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\", \"spring-duration-limit\");\n const dampingRatio = bounceToDampingRatio(bounce);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (exponentialDecay / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const e = dampingRatio *\n dampingRatio *\n undampedFreq *\n undampedFreq *\n duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(undampedFreq * undampedFreq, dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * -e * f) / g;\n };\n }\n else {\n /**\n * Critically-damped spring. Overdamped springs reuse this root,\n * scaled below.\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = undampedFreq * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = -undampedFreq * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const criticalFreq = approximateRoot(envelope, derivative, initialGuess);\n const undampedFreq = criticalFreq *\n overdampedFreqScale(dampingRatio, criticalFreq * duration);\n const stiffness = undampedFreq * undampedFreq;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(stiffness),\n duration: secondsToMilliseconds(duration),\n };\n}\n/**\n * Spring physics must be finite. stiffness and mass are also divisors so must\n * be positive, whereas a damping of 0 is a valid, perpetually oscillating\n * spring. Relational rather than Number.isFinite so numeric strings still\n * coerce.\n */\nconst isValidPhysics = (value, canBeZero) => (canBeZero ? value >= 0 : value > 0) && value < Infinity;\n/**\n * Returns value if it's usable spring physics, otherwise undefined so callers\n * fall back to the default. An explicit `undefined`, e.g. from a forwarded\n * optional prop, must fall back too. Invalid physics would otherwise resolve\n * to NaN spring values that never report done.\n */\nfunction resolvePhysics(value, canBeZero) {\n if (isValidPhysics(value, canBeZero))\n return value;\n if (process.env.NODE_ENV !== \"production\") {\n warning(value === undefined, \"Spring stiffness and mass must be positive, damping 0 or greater\", \"spring-invalid-physics\");\n }\n return undefined;\n}\nfunction getSpringOptions(options) {\n /**\n * Resolve physics before choosing between physics- and duration-based\n * resolution, so an invalid stiffness doesn't also silently discard a\n * valid duration/bounce.\n */\n const validStiffness = resolvePhysics(options.stiffness);\n const validDamping = resolvePhysics(options.damping, true);\n const validMass = resolvePhysics(options.mass);\n const springOptions = {\n ...options,\n stiffness: validStiffness ?? springDefaults.stiffness,\n damping: validDamping ?? springDefaults.damping,\n mass: validMass ?? springDefaults.mass,\n isResolvedFromDuration: false,\n // stiffness/damping/mass overrides duration/bounce\n isTimeDefined: (validStiffness ?? validDamping ?? validMass) === undefined &&\n (options.duration !== undefined || options.bounce !== undefined),\n };\n if (springOptions.isTimeDefined) {\n if (options.visualDuration) {\n const dampingRatio = bounceToDampingRatio(options.bounce || 0);\n const root = ((2 * Math.PI) / (options.visualDuration * 1.2)) *\n overdampedFreqScale(dampingRatio, (2 * Math.PI) / 1.2);\n springOptions.stiffness = root * root;\n springOptions.damping =\n 2 * dampingRatio * Math.sqrt(springOptions.stiffness);\n }\n else {\n Object.assign(springOptions, findSpring(springOptions));\n springOptions.isResolvedFromDuration = true;\n }\n /**\n * Time options can degenerate: a NaN bounce gives a NaN damping, an\n * infinite visualDuration a 0 stiffness, and findSpring NaN for both\n * when it doesn't converge. Replace the two together, so the\n * relationship duration resolution establishes between them is never\n * left half-overwritten.\n */\n if (!isValidPhysics(springOptions.stiffness) ||\n !isValidPhysics(springOptions.damping, true)) {\n springOptions.stiffness = springDefaults.stiffness;\n springOptions.damping = springDefaults.damping;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\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 = { done: false, value: origin };\n const { stiffness, damping, mass, duration, isResolvedFromDuration, isTimeDefined, } = getSpringOptions({ ...options });\n /**\n * Time-defined springs ignore inherited velocity. Velocity from\n * interrupted animations causes massive oscillation on small-range\n * animations.\n */\n const inheritVelocity = (velocity) => isTimeDefined ? 0 : -millisecondsToSeconds(velocity);\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n const decay = dampingRatio * undampedAngularFreq;\n /**\n * Everything that changes when the spring is retargeted: written by\n * retarget() and update(), read by the resolvers. Grouped on one object,\n * like the coefficients (c) below. Writing doubles to object fields\n * measured marginally faster than to captured let variables in optimised\n * code; neither allocates, so this is a grouping choice, not a GC one.\n */\n const s = {\n target,\n delta: target - origin,\n velocity: inheritVelocity(options.velocity || 0) || 0,\n restSpeed: 0,\n restDelta: 0,\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 empirically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const setRestThresholds = () => {\n const isGranularScale = Math.abs(s.delta) < 5;\n s.restSpeed =\n options.restSpeed ||\n (isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n s.restDelta =\n options.restDelta ||\n (isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n };\n setRestThresholds();\n let resolveSpring;\n let resolveVelocity;\n /**\n * Derives the coefficients that depend on origin, target and initial\n * velocity. Called once now and again whenever the spring is retargeted.\n */\n let update;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n /**\n * A is the position coefficient, sinC/cosC the coefficients of the\n * analytical derivative (px/ms). The exp/sin/cos terms depend only\n * on t, so they're memoized by t independently of the target: a\n * spring retargeted every frame samples the same t each frame and\n * skips the transcendentals entirely.\n */\n const c = { A: 0, sinC: 0, cosC: 0, t: -1, env: 0, sin: 0, cos: 0 };\n update = () => {\n c.A = (s.velocity + decay * s.delta) / angularFreq;\n c.sinC = decay * c.A + s.delta * angularFreq;\n c.cosC = decay * s.delta - c.A * angularFreq;\n };\n const sample = (t) => {\n if (t !== c.t) {\n c.t = t;\n c.env = Math.exp(-decay * t);\n c.sin = Math.sin(angularFreq * t);\n c.cos = Math.cos(angularFreq * t);\n }\n };\n // Underdamped spring\n resolveSpring = (t) => {\n sample(t);\n return s.target - c.env * (c.A * c.sin + s.delta * c.cos);\n };\n resolveVelocity = (t) => {\n sample(t);\n return c.env * (c.sinC * c.sin + c.cosC * c.cos);\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => s.target -\n Math.exp(-undampedAngularFreq * t) *\n (s.delta + (s.velocity + undampedAngularFreq * s.delta) * t);\n // Analytical derivative of critically damped spring (px/ms)\n const c = { C: 0 };\n update = () => {\n c.C = s.velocity + undampedAngularFreq * s.delta;\n };\n resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * c.C * t - s.velocity);\n }\n else {\n /**\n * Overdamped spring: the sum of a slow and a fast decaying\n * exponential, so no term can overflow however heavily it's damped.\n */\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n const slow = decay - dampedAngularFreq;\n const fast = decay + dampedAngularFreq;\n /**\n * Physics-defined springs keep a non-physical limit: once\n * dampedAngularFreq * t passes 300, both terms decay at the damping\n * rate. Heavily overdamped drag springs (dragElastic: 0,\n * dragTransition) rely on this to settle almost at once rather than\n * creep at stiffness / damping. Negative bounce needs the exact\n * curve, so time-defined springs are exempt.\n */\n const limit = isTimeDefined ? Infinity : 300 / dampedAngularFreq;\n const decayAt = (rate, t) => Math.exp(t > limit ? -rate * limit - decay * (t - limit) : -rate * t);\n const c = { S: 0, F: 0 };\n update = () => {\n const P = (s.velocity + decay * s.delta) / dampedAngularFreq;\n c.S = (s.delta + P) / 2;\n c.F = (s.delta - P) / 2;\n };\n resolveSpring = (t) => s.target - c.S * decayAt(slow, t) - c.F * decayAt(fast, t);\n // Analytical derivative of overdamped spring (px/ms)\n resolveVelocity = (t) => slow * c.S * decayAt(slow, t) + fast * c.F * decayAt(fast, t);\n }\n update();\n const calculatedDuration = isResolvedFromDuration ? duration || null : null;\n const generator = {\n calculatedDuration,\n /**\n * Aim the spring at a new target from its current position and\n * velocity, reusing the resolved physics and closures.\n */\n retarget: (keyframes, newVelocity) => {\n s.target = keyframes[keyframes.length - 1];\n s.delta = s.target - keyframes[0];\n s.velocity = inheritVelocity(newVelocity);\n // Default thresholds depend on the scale of the new delta\n if (!(options.restSpeed && options.restDelta))\n setRestThresholds();\n // Invalidate any duration lazily cached by JSAnimation\n generator.calculatedDuration = calculatedDuration;\n state.done = false;\n update();\n },\n velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(resolveVelocity(t));\n state.done =\n Math.abs(currentVelocity) <= s.restSpeed &&\n Math.abs(s.target - current) <= s.restDelta;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? s.target : current;\n return state;\n },\n toString: () => {\n const easingDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(easingDuration * progress).value, easingDuration, 30);\n return easingDuration + \"ms \" + easing;\n },\n toTransition: () => { },\n };\n return generator;\n}\nspring.applyToOptions = (options) => {\n const generatorOptions = createGeneratorEasing(options, 100, spring);\n options.ease = generatorOptions.ease;\n options.duration = secondsToMilliseconds(generatorOptions.duration);\n options.type = \"keyframes\";\n return options;\n};\n\nexport { spring };\n//# sourceMappingURL=spring.mjs.map\n","import { spring } from './spring.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => v < min || v > max;\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\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)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : target + delta;\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;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n /**\n * The friction curve is target + calcDelta(t), so its exact\n * derivative is -calcDelta(t) / timeConstant in units/ms,\n * converted here to the units/second expected by spring.\n */\n velocity: (-calcDelta(t) / timeConstant) * 1000,\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\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$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\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$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n//# sourceMappingURL=inertia.mjs.map\n","import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';\nimport { mix } from './mix/index.mjs';\n\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\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 */\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, \"Both input and output ranges must be the same length\", \"range-length\");\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)\n return () => output[0];\n if (inputLength === 2 && output[0] === output[1])\n return () => output[1];\n const isZeroDeltaRange = input[0] === input[1];\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 const mixers = createMixers(output, ease, mixer);\n const numMixers = mixers.length;\n const interpolator = (v) => {\n if (isZeroDeltaRange && v < input[0])\n return output[0];\n let i = 0;\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1])\n break;\n }\n }\n const progressInRange = progress(input[i], input[i + 1], v);\n return mixers[i](progressInRange);\n };\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n//# sourceMappingURL=interpolate.mjs.map\n","import { fillOffset } from './fill.mjs';\n\nfunction defaultOffset(arr) {\n const offset = [0];\n fillOffset(offset, arr.length - 1);\n return offset;\n}\n\nexport { defaultOffset };\n//# sourceMappingURL=default.mjs.map\n","import { progress } from 'motion-utils';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction fillOffset(offset, remaining) {\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\nexport { fillOffset };\n//# sourceMappingURL=fill.mjs.map\n","import { easeInOut, isEasingArray, easingDefinitionToFunction, MotionGlobalConfig, clamp } from 'motion-utils';\nimport { interpolate } from '../../utils/interpolate.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { defaultOffset } from '../keyframes/offsets/default.mjs';\nimport { convertOffsetToTimes } from '../keyframes/offsets/time.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction keyframes({ duration = 300, keyframes: keyframeValues, times, ease = \"easeInOut\", }) {\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) || easeInOut;\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 = {\n done: false,\n value: keyframeValues[0],\n };\n /**\n * Fast setup path for two keyframes one easing.\n */\n if (keyframeValues.length === 2 &&\n !Array.isArray(easingFunctions) &&\n (!times ||\n times.length !== 2 ||\n (times[0] === 0 && times[1] === 1))) {\n const [origin, target] = keyframeValues;\n const mixer = origin === target\n ? undefined\n : (MotionGlobalConfig.mix || mix)(origin, target);\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mixer\n ? mixer(easingFunctions(duration > 0 ? clamp(0, 1, t / duration) : 1))\n : target;\n state.done = t >= duration;\n return state;\n },\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), duration);\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n });\n return {\n calculatedDuration: duration,\n next: (t) => {\n state.value = mapTimeToKeyframe(t);\n state.done = t >= duration;\n return state;\n },\n };\n}\n\nexport { defaultEasing, keyframes };\n//# sourceMappingURL=keyframes.mjs.map\n","/*#__NO_SIDE_EFFECTS__*/\nconst isEasingArray = (ease) => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\";\n};\n\nexport { isEasingArray };\n//# sourceMappingURL=is-easing-array.mjs.map\n","function convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\n\nexport { convertOffsetToTimes };\n//# sourceMappingURL=time.mjs.map\n","import { millisecondsToSeconds } from 'motion-utils';\nimport { calcGeneratorDuration, maxGeneratorDuration } from './calc-duration.mjs';\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nfunction createGeneratorEasing(options, scale = 100, createGenerator) {\n /**\n * The easing is generated over 0 - scale, but velocity is in the\n * value's own units, so scale it to match. Otherwise an interrupted\n * spring hands off the wrong speed, or direction. Keyframes with\n * units (colours, filters, mixed units) give NaN, which is falsy,\n * so their velocity passes through unscaled.\n */\n const { keyframes: k, velocity: v } = options;\n const delta = k && k[k.length - 1] - k[0];\n const generator = createGenerator({\n ...options,\n velocity: v && delta ? (v * scale) / delta : v,\n keyframes: [0, scale],\n });\n const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n return {\n type: \"keyframes\",\n ease: (progress) => {\n return generator.next(duration * progress).value / scale;\n },\n duration: millisecondsToSeconds(duration),\n };\n}\n\nexport { createGeneratorEasing };\n//# sourceMappingURL=create-generator-easing.mjs.map\n","import { velocityPerSecond } from 'motion-utils';\n\nconst velocitySampleDuration = 5; // ms\nfunction getGeneratorVelocity(resolveValue, t, current) {\n const prevT = Math.max(t - velocitySampleDuration, 0);\n return velocityPerSecond(current - resolveValue(prevT), t - prevT);\n}\n/**\n * A generator's velocity at time t in units/second: analytical where the\n * generator provides it (springs), otherwise by finite difference. Before\n * the animation has started this is its initial velocity.\n */\nfunction calcGeneratorVelocity(generator, t, initialVelocity = 0) {\n if (t <= 0)\n return initialVelocity;\n return generator.velocity\n ? generator.velocity(t)\n : getGeneratorVelocity((s) => generator.next(s).value, t, generator.next(t).value);\n}\n\nexport { calcGeneratorVelocity, getGeneratorVelocity };\n//# sourceMappingURL=velocity.mjs.map\n","const isNotNull = (value) => value !== null;\nfunction getFinalKeyframe(keyframes, { repeat, repeatType = \"loop\" }, finalKeyframe, speed = 1) {\n const resolvedKeyframes = keyframes.filter(isNotNull);\n const useFirstKeyframe = speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1);\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1;\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe;\n}\n\nexport { getFinalKeyframe };\n//# sourceMappingURL=get-final.mjs.map\n","import { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring.mjs';\n\nconst transitionTypeMap = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nfunction replaceTransitionType(transition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type];\n }\n}\n\nexport { replaceTransitionType };\n//# sourceMappingURL=replace-transition-type.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\n\n/**\n * If an animation's keyframes resolve, or its first frame renders, more than\n * this long after its start time, it starts from then instead. While we prefer\n * to \"start\" an animation as soon as it's triggered, this avoids a visual jump\n * into it after main thread work.\n *\n * Manual timing steps frames by however long it likes, so never lags.\n */\nconst MAX_START_DELAY = 40;\nconst resolveStartTime = (startTime, now) => now - startTime > MAX_START_DELAY && !MotionGlobalConfig.useManualTiming\n ? now\n : startTime;\n\nexport { resolveStartTime };\n//# sourceMappingURL=resolve-start-time.mjs.map\n","import { frameData } from '../../frameloop/frame-data.mjs';\nimport { time } from '../../frameloop/sync-time.mjs';\n\nfunction baseRecord(kind, animation) {\n return {\n kind,\n animation,\n timestamp: time.now(),\n frameTimestamp: frameData.timestamp,\n frameIsProcessing: frameData.isProcessing,\n };\n}\n/**\n * Notify an optional inspector without adding a public Motion API.\n *\n * The record is a raw firehose: the live animation handle, the concrete\n * animation's internal options object untouched (timing fields in\n * internal milliseconds, name/keyframes/element/motionValue still\n * attached), a timestamp and the raw frameloop state at notify time.\n * All interpretation belongs to the consumer behind\n * globalThis.__MOTION_INSPECT__.\n */\nfunction notifyAnimationStart(animation, options, transition) {\n const notify = globalThis.__MOTION_INSPECT__;\n if (!notify)\n return;\n try {\n notify({\n ...baseRecord(\"animation-start\", animation),\n options: transition ? { ...options, ...transition } : options,\n });\n }\n catch { }\n}\n/**\n * Layout animations drive a projection node's progress rather than a\n * property, so the record forwards the live node itself: it carries the\n * DOM instance, the layout options (layoutId) and the progress handle.\n * Fired inside the frame.update that starts the animation, so nodes\n * animating in the same layout commit share frameTimestamp.\n */\nfunction notifyLayoutAnimationStart(animation, node) {\n const notify = globalThis.__MOTION_INSPECT__;\n if (!notify)\n return;\n try {\n notify({\n ...baseRecord(\"layout-animation-start\", animation),\n node,\n });\n }\n catch { }\n}\n\nexport { notifyAnimationStart, notifyLayoutAnimationStart };\n//# sourceMappingURL=notify-inspector.mjs.map\n","class WithPromise {\n constructor() {\n this.isResolved = false;\n }\n get finished() {\n if (!this._finished) {\n this._finished = this.isResolved\n ? Promise.resolve()\n : new Promise((resolve) => {\n this._resolve = resolve;\n });\n }\n return this._finished;\n }\n updateFinished() {\n this._finished = this._resolve = undefined;\n this.isResolved = false;\n }\n notifyFinished() {\n this.isResolved = true;\n this._resolve?.();\n }\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve, onReject) {\n return this.finished.then(onResolve, onReject);\n }\n}\n\nexport { WithPromise };\n//# sourceMappingURL=WithPromise.mjs.map\n","import { invariant, pipe, clamp, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { mix } from '../utils/mix/index.mjs';\nimport { frameloopDriver } from './drivers/frame.mjs';\nimport { inertia } from './generators/inertia.mjs';\nimport { keyframes } from './generators/keyframes.mjs';\nimport { calcGeneratorDuration } from './generators/utils/calc-duration.mjs';\nimport { calcGeneratorVelocity } from './generators/utils/velocity.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\n\nconst percentToProgress = (percent) => percent / 100;\nconst round = (value) => Math.round(value * 10000) / 10000;\nclass JSAnimation extends WithPromise {\n constructor(options) {\n super();\n this.state = \"idle\";\n this.startTime = null;\n this.isStopped = false;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n this.delayState = {\n done: false,\n value: undefined,\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 this.stop = () => {\n const { motionValue } = this.options;\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now());\n }\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n this.options.onStop?.();\n };\n this.options = options;\n this.initAnimation();\n this.play();\n if (options.autoplay === false)\n this.pause();\n notifyAnimationStart(this, this.options);\n }\n initAnimation() {\n const { options } = this;\n replaceTransitionType(options);\n const { type = keyframes, repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = options;\n let { keyframes: keyframes$1 } = options;\n const generatorFactory = type || keyframes;\n if (process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframes) {\n invariant(keyframes$1.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`, \"spring-two-frames\");\n }\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n this.mixKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory(keyframes$1 === options.keyframes\n ? options\n : { ...options, keyframes: keyframes$1 });\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$1].reverse(),\n velocity: -velocity,\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 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 updateTime(timestamp) {\n const animationTime = Math.round(timestamp - this.startTime) * this.playbackSpeed;\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\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 tick(timestamp, sample = false) {\n const { generator, totalDuration, calculatedDuration } = this;\n if (this.startTime === null)\n return generator.next(0);\n const { delay = 0, keyframes, type, onUpdate, finalKeyframe, } = this.options;\n if (this.startTime === this.pendingStartTime) {\n this.startTime = resolveStartTime(this.startTime, timestamp);\n }\n this.pendingStartTime = undefined;\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 }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n if (sample) {\n this.currentTime = timestamp;\n }\n else {\n this.updateTime(timestamp);\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1);\n const isInDelayPhase = this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\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 const state = this.generate(this.currentTime, isInDelayPhase);\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n /**\n * This animation's time, including delay, at a timestamp.\n */\n at(timestamp) {\n return (this.holdTime ??\n round((timestamp - this.startTime) * this.playbackSpeed));\n }\n /**\n * The value at a timestamp, without changing this animation's state.\n * If resolved, it ends at the last resolved keyframe, which is in the\n * same unit as the others, rather than at finalKeyframe.\n */\n sampleAt(timestamp, resolved) {\n const { options, totalDuration } = this;\n const t = this.at(timestamp) - (options.delay || 0);\n return t >= totalDuration && options.type !== inertia\n ? getFinalKeyframe(options.keyframes, options, resolved ? undefined : options.finalKeyframe)\n : this.generate(Math.max(t, 0), t < 0).value;\n }\n /**\n * The generator's state `currentTime` ms after the delay, without\n * changing the animation's own state.\n */\n generate(currentTime, isInDelayPhase) {\n const { generator, totalDuration, mixKeyframes, mirroredGenerator, resolvedDuration, } = this;\n const { keyframes, repeat, repeatType, repeatDelay } = this.options;\n let elapsed = currentTime;\n let frameGenerator = generator;\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 = Math.min(currentTime, totalDuration) / resolvedDuration;\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 * 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 * 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 iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\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 }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\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 let state;\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0];\n state = this.delayState;\n }\n else {\n state = frameGenerator.next(elapsed);\n }\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value);\n }\n return state;\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, reject) {\n return this.finished.then(resolve, reject);\n }\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration);\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed;\n }\n if (this.driver) {\n this.driver.start(false);\n }\n else {\n this.startTime = 0;\n this.state = \"paused\";\n this.holdTime = newTime;\n this.tick(newTime);\n }\n }\n /**\n * Returns the generator's velocity at the current time in units/second.\n * Uses the analytical derivative when available (springs), avoiding\n * the MotionValue's frame-dependent velocity estimation.\n */\n getGeneratorVelocity() {\n return calcGeneratorVelocity(this.generator, this.currentTime, this.options.velocity);\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n if (hasChanged && this.driver) {\n this.updateTime(time.now());\n }\n this.playbackSpeed = newSpeed;\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n this.options.onPlay?.();\n const now = this.driver.now();\n if (this.state === \"finished\") {\n this.updateFinished();\n this.startTime = now;\n }\n else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime / (this.playbackSpeed || 1);\n }\n else if (!this.startTime) {\n this.startTime = startTime ?? (this.pendingStartTime = now);\n }\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration;\n }\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n this.state = \"paused\";\n this.updateTime(time.now());\n this.holdTime = this.currentTime;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.notifyFinished();\n this.teardown();\n this.state = \"finished\";\n this.options.onComplete?.();\n }\n cancel() {\n this.holdTime = null;\n this.startTime = 0;\n this.tick(0);\n this.teardown();\n this.options.onCancel?.();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.startTime = this.holdTime = null;\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(sampleTime) {\n this.startTime = 0;\n return this.tick(sampleTime, true);\n }\n attachTimeline(timeline) {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n this.initAnimation();\n }\n this.driver?.stop();\n return timeline.observe(this);\n }\n}\n// Legacy function support\nfunction animateValue(options) {\n return new JSAnimation(options);\n}\n\nexport { JSAnimation, animateValue, round };\n//# sourceMappingURL=JSAnimation.mjs.map\n","import { complex } from './index.mjs';\nimport { floatRegex } from '../utils/float-regex.mjs';\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"]);\nfunction applyDefaultFilter(v) {\n const [name, value] = v.slice(0, -1).split(\"(\");\n if (name === \"drop-shadow\")\n return v;\n const [number] = value.match(floatRegex) || [];\n if (!number)\n return v;\n const unit = value.replace(number, \"\");\n let defaultValue = maxDefaults.has(name) ? 1 : 0;\n if (number !== value)\n defaultValue *= 100;\n return name + \"(\" + defaultValue + unit + \")\";\n}\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu;\nconst filter = {\n ...complex,\n getAnimatableNone: (v) => {\n const functions = v.match(functionRegex);\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v;\n },\n};\n\nexport { filter };\n//# sourceMappingURL=filter.mjs.map\n","import { complex } from './index.mjs';\n\nconst mask = {\n ...complex,\n getAnimatableNone: (v) => {\n const parsed = complex.parse(v);\n const transformer = complex.createTransformer(v);\n return transformer(parsed.map((v) => typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v));\n },\n};\n\nexport { mask };\n//# sourceMappingURL=mask.mjs.map\n","import { number } from './numbers/index.mjs';\n\nconst int = {\n ...number,\n transform: Math.round,\n};\n\nexport { int };\n//# sourceMappingURL=int.mjs.map\n","import { int } from '../int.mjs';\nimport { alpha } from '../numbers/index.mjs';\nimport { px } from '../numbers/units.mjs';\nimport { transformValueTypes } from './transform.mjs';\n\nconst numberValueTypes = {\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 // 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 // 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 // Typography\n fontSize: px,\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n ...transformValueTypes,\n zIndex: int,\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n};\n\nexport { numberValueTypes };\n//# sourceMappingURL=number.mjs.map\n","import { alpha, scale } from '../numbers/index.mjs';\nimport { px, progressPercentage, degrees } from '../numbers/units.mjs';\n\nconst transformValueTypes = {\n rotate: degrees,\n /**\n * Internal channel for `transition.path` orientToPath. Composed onto\n * `rotate` at the transform-build sites so the user's `rotate` is\n * never read or overwritten. Not part of `transformPropOrder`.\n */\n pathRotation: 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\nexport { transformValueTypes };\n//# sourceMappingURL=transform.mjs.map\n","import { color } from '../color/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { numberValueTypes } from './number.mjs';\n\n/**\n * A map of default value types for common values\n */\nconst defaultValueTypes = {\n ...numberValueTypes,\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n};\n/**\n * Gets the default ValueType for the provided value key\n */\nconst getDefaultValueType = (key) => defaultValueTypes[key];\n\nexport { defaultValueTypes, getDefaultValueType };\n//# sourceMappingURL=defaults.mjs.map\n","import { complex } from '../complex/index.mjs';\nimport { filter } from '../complex/filter.mjs';\nimport { mask } from '../complex/mask.mjs';\nimport { getDefaultValueType } from '../maps/defaults.mjs';\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask]);\nfunction getAnimatableNone(key, value) {\n let defaultValueType = getDefaultValueType(key);\n if (!customTypes.has(defaultValueType))\n 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\nexport { getAnimatableNone };\n//# sourceMappingURL=animatable-none.mjs.map\n","const radToDeg = (rad) => (rad * 180) / Math.PI;\nconst rotate = (v) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]));\n return rebaseAngle(angle);\n};\nconst matrix2dParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scaleZ: () => 1,\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};\nconst rebaseAngle = (angle) => {\n angle = angle % 360;\n if (angle < 0)\n angle += 360;\n return angle;\n};\nconst rotateZ = rotate;\nconst scaleX = (v) => Math.hypot(v[0], v[1]);\nconst scaleY = (v) => Math.hypot(v[4], v[5]);\nconst matrix3dParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scaleZ: (v) => Math.hypot(v[8], v[9], v[10]),\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};\nfunction defaultTransformValue(name) {\n return name.includes(\"scale\") ? 1 : 0;\n}\nfunction parseValueFromTransform(transform, name) {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name);\n }\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u);\n let parsers;\n let match;\n if (matrix3dMatch) {\n parsers = matrix3dParsers;\n match = matrix3dMatch;\n }\n else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u);\n parsers = matrix2dParsers;\n match = matrix2dMatch;\n }\n if (!match) {\n return defaultTransformValue(name);\n }\n const valueParser = parsers[name];\n const values = match[1].split(\",\").map(convertTransformToNumber);\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser];\n}\nconst readTransformValue = (instance, name) => {\n const { transform = \"none\" } = getComputedStyle(instance);\n return parseValueFromTransform(transform, name);\n};\nfunction convertTransformToNumber(value) {\n return parseFloat(value.trim());\n}\n\nexport { defaultTransformValue, parseValueFromTransform, readTransformValue };\n//# sourceMappingURL=parse-transform.mjs.map\n","/**\n * Generate a list of every possible transform key.\n */\nconst transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"scaleZ\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n];\n/**\n * A quick lookup for transform props.\n *\n * `pathRotation` is a transform for routing purposes (skipped from raw\n * style application, wired to the transform composite, flags transform\n * dirty) but is intentionally NOT in `transformPropOrder` — it is\n * composed onto `rotate` at the build sites, not serialized in its own\n * slot, and must stay out of the order-array consumers (parse-transform,\n * unit-conversion, keys-position).\n */\nconst transformProps = /*@__PURE__*/ (() => new Set([...transformPropOrder, \"pathRotation\"]))();\n\nexport { transformPropOrder, transformProps };\n//# sourceMappingURL=keys-transform.mjs.map\n","import { parseValueFromTransform } from '../../../render/dom/parse-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { number } from '../../../value/types/numbers/index.mjs';\nimport { px } from '../../../value/types/numbers/units.mjs';\n\nconst isNumOrPxType = (v) => v === number || v === px;\nconst transformKeys = new Set([\"x\", \"y\", \"z\"]);\nconst nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));\n/**\n * Reset any bounding box-changing transforms so the element can be\n * measured. Returns the values to restore. Values already at their\n * default don't change the box, so they're left alone: an element with\n * only `rotate: 0` doesn't need to be re-rendered before measuring.\n */\nfunction removeNonTranslationalTransform(visualElement) {\n const removedTransforms = [];\n nonTranslationalTransformKeys.forEach((key) => {\n const value = visualElement.getValue(key);\n if (value !== undefined) {\n const current = value.get();\n const reset = key.startsWith(\"scale\") ? 1 : 0;\n if (current === reset)\n return;\n removedTransforms.push([key, current]);\n value.set(reset);\n }\n });\n return removedTransforms;\n}\n/**\n * Values that can only be measured from the bounding box. Elements with\n * these values need bounding box-changing transforms removed first.\n */\nconst boxDependentValues = new Set([\"bottom\", \"right\"]);\n/**\n * Computed width/height is already in pixels and unaffected by\n * transforms. It's \"auto\" for elements without a layout box (e.g. inline),\n * in which case we fall back to measuring the bounding box.\n */\nfunction measureDimension(computed, measureBox, axis, paddingStart, paddingEnd, boxSizing) {\n const px = parseFloat(computed);\n if (!isNaN(px))\n return px;\n const { min, max } = measureBox()[axis];\n const size = max - min;\n return boxSizing === \"border-box\"\n ? size\n : size - parseFloat(paddingStart) - parseFloat(paddingEnd);\n}\nconst positionalValues = {\n // Dimensions\n width: ({ width, paddingLeft = \"0\", paddingRight = \"0\", boxSizing }, measureBox) => measureDimension(width, measureBox, \"x\", paddingLeft, paddingRight, boxSizing),\n height: ({ height, paddingTop = \"0\", paddingBottom = \"0\", boxSizing }, measureBox) => measureDimension(height, measureBox, \"y\", paddingTop, paddingBottom, boxSizing),\n top: ({ top }) => parseFloat(top),\n left: ({ left }) => parseFloat(left),\n bottom: ({ top }, measureBox) => {\n const { y } = measureBox();\n return parseFloat(top) + (y.max - y.min);\n },\n right: ({ left }, measureBox) => {\n const { x } = measureBox();\n return parseFloat(left) + (x.max - x.min);\n },\n // Transform\n x: ({ transform }) => parseValueFromTransform(transform, \"x\"),\n y: ({ transform }) => parseValueFromTransform(transform, \"y\"),\n};\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x;\npositionalValues.translateY = positionalValues.y;\n\nexport { boxDependentValues, isNumOrPxType, positionalValues, removeNonTranslationalTransform };\n//# sourceMappingURL=unit-conversion.mjs.map\n","import { isNumericalString, isZeroValueString } from 'motion-utils';\nimport { complex } from '../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../value/types/utils/animatable-none.mjs';\nimport { fillWildcards } from './utils/fill-wildcards.mjs';\nimport { boxDependentValues, removeNonTranslationalTransform } from './utils/unit-conversion.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst toResolve = new Set();\nlet isScheduled = false;\nlet anyNeedsMeasurement = false;\nlet isForced = false;\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = [];\n const elementsToMeasure = new Set();\n const elementsToUntransform = new Set();\n toResolve.forEach((resolver) => {\n if (!resolver.needsMeasurement)\n return;\n resolversToMeasure.push(resolver);\n elementsToMeasure.add(resolver.element);\n if (boxDependentValues.has(resolver.name)) {\n elementsToUntransform.add(resolver.element);\n }\n });\n const transformsToRestore = new Map();\n /**\n * Write pass\n * Values measured from the bounding box need bounding box-changing\n * transforms removed first. Values read from computed style don't.\n */\n elementsToUntransform.forEach((element) => {\n const removedTransforms = removeNonTranslationalTransform(element);\n if (!removedTransforms.length)\n return;\n transformsToRestore.set(element, removedTransforms);\n element.render();\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState());\n // Write\n elementsToMeasure.forEach((element) => {\n element.render();\n const restore = transformsToRestore.get(element);\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value);\n });\n }\n });\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState());\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY);\n }\n });\n }\n anyNeedsMeasurement = false;\n isScheduled = false;\n toResolve.forEach((resolver) => resolver.complete(isForced));\n toResolve.clear();\n}\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes();\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true;\n }\n });\n}\nfunction flushKeyframeResolvers() {\n isForced = true;\n readAllKeyframes();\n measureAllKeyframes();\n isForced = false;\n}\n/**\n * Normalise a value read from the subject into an animation origin: a\n * number read as a string (\"0\", \"200\") becomes a number, and a value\n * that isn't animatable (e.g. \"none\") but whose target is becomes an\n * animatable zero in the shape of the target.\n */\nfunction readOrigin(value, name, target) {\n if (typeof value === \"string\") {\n if (isNumericalString(value) || isZeroValueString(value)) {\n return parseFloat(value);\n }\n else if (!complex.test(value) && complex.test(target)) {\n return getAnimatableNone(name, target);\n }\n }\n return value ?? undefined;\n}\nclass KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element, isAsync = false) {\n this.state = \"pending\";\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 this.isAsync = false;\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n this.needsMeasurement = false;\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 scheduleResolve() {\n this.state = \"scheduled\";\n if (this.isAsync) {\n toResolve.add(this);\n if (!isScheduled) {\n isScheduled = true;\n frame.read(readAllKeyframes);\n frame.resolveKeyframes(measureAllKeyframes);\n }\n }\n else {\n this.readKeyframes();\n this.complete();\n }\n }\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this;\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 // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue;\n }\n else if (element && name) {\n const valueAsRead = readOrigin(element.readValue(name, finalKeyframe), name, finalKeyframe);\n if (valueAsRead !== undefined) {\n unresolvedKeyframes[0] = valueAsRead;\n }\n }\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe;\n }\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0]);\n }\n }\n fillWildcards(unresolvedKeyframes);\n }\n setFinalKeyframe() { }\n measureInitialState() { }\n renderEndStyles() { }\n measureEndState() { }\n complete(isForcedComplete = false) {\n this.state = \"complete\";\n this.onComplete(this.unresolvedKeyframes, this.finalKeyframe, isForcedComplete);\n toResolve.delete(this);\n }\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this);\n this.state = \"pending\";\n }\n }\n resume() {\n if (this.state === \"pending\")\n this.scheduleResolve();\n }\n}\n\nexport { KeyframeResolver, flushKeyframeResolvers };\n//# sourceMappingURL=KeyframesResolver.mjs.map\n","function fillWildcards(keyframes) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ?? (keyframes[i] = keyframes[i - 1]);\n }\n}\n\nexport { fillWildcards };\n//# sourceMappingURL=fill-wildcards.mjs.map\n","import { isCSSVar } from './is-css-var.mjs';\n\nfunction setStyle(element, name, value) {\n isCSSVar(name)\n ? element.style.setProperty(name, value)\n : (element.style[name] = value);\n}\n\nexport { setStyle };\n//# sourceMappingURL=style-set.mjs.map\n","const isCSSVar = (name) => name.startsWith(\"--\");\n\nexport { isCSSVar };\n//# sourceMappingURL=is-css-var.mjs.map\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nconst supportsFlags = {};\n\nexport { supportsFlags };\n//# sourceMappingURL=flags.mjs.map\n","import { memo } from 'motion-utils';\nimport { supportsFlags } from './flags.mjs';\n\nfunction memoSupports(callback, supportsFlag) {\n const memoized = memo(callback);\n return () => supportsFlags[supportsFlag] ?? memoized();\n}\n\nexport { memoSupports };\n//# sourceMappingURL=memo.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsScrollTimeline = /* @__PURE__ */ memoSupports(() => window.ScrollTimeline !== undefined, \"scrollTimeline\");\nconst supportsViewTimeline = /* @__PURE__ */ memoSupports(() => window.ViewTimeline !== undefined, \"viewTimeline\");\n\nexport { supportsScrollTimeline, supportsViewTimeline };\n//# sourceMappingURL=scroll-timeline.mjs.map\n","import { memoSupports } from './memo.mjs';\n\nconst supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" });\n }\n catch (e) {\n return false;\n }\n return true;\n}, \"linearEasing\");\n\nexport { supportsLinearEasing };\n//# sourceMappingURL=linear-easing.mjs.map\n","const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;\n\nexport { cubicBezierAsString };\n//# sourceMappingURL=cubic-bezier.mjs.map\n","import { cubicBezierAsString } from './cubic-bezier.mjs';\n\nconst 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\nexport { supportedWaapiEasing };\n//# sourceMappingURL=supported.mjs.map\n","import { isBezierDefinition } from 'motion-utils';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { generateLinearEasing } from '../utils/linear.mjs';\nimport { cubicBezierAsString } from './cubic-bezier.mjs';\nimport { supportedWaapiEasing } from './supported.mjs';\n\nfunction mapEasingToNativeEasing(easing, duration) {\n if (!easing) {\n return undefined;\n }\n else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\";\n }\n else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing);\n }\n else if (Array.isArray(easing)) {\n return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||\n supportedWaapiEasing.easeOut);\n }\n else {\n return supportedWaapiEasing[easing];\n }\n}\n\nexport { mapEasingToNativeEasing };\n//# sourceMappingURL=map-easing.mjs.map\n","import { mapEasingToNativeEasing } from './easing/map-easing.mjs';\n\nfunction startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = \"loop\", ease = \"easeOut\", times, } = {}, pseudoElement = undefined) {\n const keyframeOptions = {\n [valueName]: keyframes,\n };\n if (times)\n keyframeOptions.offset = times;\n const easing = mapEasingToNativeEasing(ease, duration);\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing))\n keyframeOptions.easing = easing;\n const options = {\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 if (pseudoElement)\n options.pseudoElement = pseudoElement;\n return element.animate(keyframeOptions, options);\n}\n\nexport { startWaapiAnimation };\n//# sourceMappingURL=start-waapi-animation.mjs.map\n","function isGenerator(type) {\n return typeof type === \"function\" && \"applyToOptions\" in type;\n}\n\nexport { isGenerator };\n//# sourceMappingURL=is-generator.mjs.map\n","import { invariant, millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { supportsScrollTimeline } from '../utils/supports/scroll-timeline.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { notifyAnimationStart } from './utils/notify-inspector.mjs';\nimport { startWaapiAnimation } from './waapi/start-waapi-animation.mjs';\nimport { applyGeneratorOptions } from './waapi/utils/apply-generator.mjs';\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nclass NativeAnimation extends WithPromise {\n constructor(options) {\n super();\n this.finishedTime = null;\n this.isStopped = false;\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 this.manualStartTime = null;\n if (!options)\n return;\n const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;\n this.isPseudoElement = Boolean(pseudoElement);\n this.allowFlatten = allowFlatten;\n this.options = options;\n invariant(typeof options.type !== \"string\", `Mini animate() doesn't support \"type\" as a string.`, \"mini-spring\");\n const transition = applyGeneratorOptions(options);\n this.animation = startWaapiAnimation(element, name, keyframes, transition, pseudoElement);\n if (transition.autoplay === false) {\n this.animation.pause();\n }\n this.animation.onfinish = () => {\n this.finishedTime = this.time;\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(keyframes, this.options, finalKeyframe, this.speed);\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe);\n }\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 * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe);\n this.animation.cancel();\n }\n onComplete?.();\n this.notifyFinished();\n };\n notifyAnimationStart(this, options, transition);\n }\n play() {\n if (this.isStopped)\n return;\n this.manualStartTime = null;\n this.animation.play();\n if (this.state === \"finished\") {\n this.updateFinished();\n }\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.finish?.();\n }\n cancel() {\n try {\n this.animation.cancel();\n }\n catch (e) { }\n }\n stop() {\n if (this.isStopped)\n return;\n this.isStopped = true;\n const { state } = this;\n if (state === \"idle\" || state === \"finished\") {\n return;\n }\n if (this.updateMotionValue) {\n this.updateMotionValue();\n }\n else {\n this.commitStyles();\n }\n if (!this.isPseudoElement)\n this.cancel();\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 commitStyles() {\n const element = this.options?.element;\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.();\n }\n }\n get duration() {\n const duration = this.animation.effect?.getComputedTiming?.().duration || 0;\n return millisecondsToSeconds(Number(duration));\n }\n get iterationDuration() {\n const { delay = 0 } = this.options || {};\n return this.duration + millisecondsToSeconds(delay);\n }\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0);\n }\n set time(newTime) {\n const wasFinished = this.finishedTime !== null;\n this.manualStartTime = null;\n this.finishedTime = null;\n this.animation.currentTime = secondsToMilliseconds(newTime);\n if (wasFinished) {\n this.animation.pause();\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 set speed(newSpeed) {\n // Allow backwards playback after finishing\n if (newSpeed < 0)\n this.finishedTime = null;\n this.animation.playbackRate = newSpeed;\n }\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState;\n }\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime);\n }\n set startTime(newStartTime) {\n this.manualStartTime = this.animation.startTime = newStartTime;\n }\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, onAttach, observe, }) {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" });\n }\n this.animation.onfinish = null;\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline;\n onAttach?.(this.animation);\n return noop;\n }\n else {\n return observe(this);\n }\n }\n}\n\nexport { NativeAnimation };\n//# sourceMappingURL=NativeAnimation.mjs.map\n","import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { isGenerator } from '../../generators/utils/is-generator.mjs';\n\nfunction applyGeneratorOptions({ type, ...options }) {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions(options);\n }\n else {\n options.duration ?? (options.duration = 300);\n options.ease ?? (options.ease = \"easeOut\");\n }\n return options;\n}\n\nexport { applyGeneratorOptions };\n//# sourceMappingURL=apply-generator.mjs.map\n","import { circInOut, backInOut, anticipate } from 'motion-utils';\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nfunction replaceStringEasing(transition) {\n if (typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)) {\n transition.ease = unsupportedEasingFunctions[transition.ease];\n }\n}\n\nexport { replaceStringEasing };\n//# sourceMappingURL=unsupported-easing.mjs.map\n","import { clamp } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { setStyle } from '../render/dom/style-set.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { NativeAnimation } from './NativeAnimation.mjs';\nimport { replaceTransitionType } from './utils/replace-transition-type.mjs';\nimport { replaceStringEasing } from './waapi/utils/unsupported-easing.mjs';\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\nclass NativeAnimationExtended extends NativeAnimation {\n constructor(options) {\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 * 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 super(options);\n /**\n * Only set startTime when the animation should autoplay.\n * Setting startTime on a paused WAAPI animation unpauses it\n * (per the WAAPI spec), which breaks autoplay: false.\n */\n if (options.startTime !== undefined && options.autoplay !== false) {\n this.startTime = options.startTime;\n }\n this.options = options;\n }\n /**\n * The animation's time now, in ms. Wall-clock rather than WAAPI's\n * currentTime while running, as under CPU load currentTime may not\n * reflect the actual elapsed time, causing incorrect sampling and\n * visual jumps.\n */\n elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000;\n }\n /**\n * The value at a time, from a renderless JS animation.\n */\n sample(sampleTime) {\n if (!this.sampler) {\n const { motionValue, onUpdate, onComplete, onPlay, onStop, element, ...options } = this.options;\n /**\n * Stop it straight away so its driver doesn't run every frame.\n * It can still be sampled.\n */\n this.sampler = new JSAnimation({ ...options, autoplay: false });\n this.sampler.stop();\n }\n return this.sampler.sample(Math.max(0, sampleTime)).value;\n }\n /**\n * The value now, as WAAPI doesn't set the motion value while it runs.\n */\n liveValue() {\n const { state } = this;\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed());\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 * sample a renderless JS animation twice to calculate its current\n * value, \"previous\" value, and therefore allow Motion to calculate\n * velocity for any subsequent animation.\n */\n updateMotionValue(value) {\n const { motionValue, element, name } = this.options;\n if (!motionValue)\n return;\n if (value !== undefined) {\n motionValue.set(value);\n return;\n }\n const { speed } = this;\n const sampleTime = this.elapsed();\n const delta = this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0;\n const current = this.sample(sampleTime);\n /**\n * Write the estimated value to inline style so it persists\n * after cancel(), covering the async gap before the next\n * animation starts.\n */\n if (element && name)\n setStyle(element, name, current);\n motionValue.setWithVelocity(this.sample(sampleTime - delta * Math.sign(speed)), current, delta / Math.abs(speed || 1));\n }\n}\n\nexport { NativeAnimationExtended, sampleDelta };\n//# sourceMappingURL=NativeAnimationExtended.mjs.map\n","import { complex } from '../../value/types/complex/index.mjs';\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 */\nconst isAnimatable = (value, name) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\")\n return false;\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))\n return true;\n if (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 return false;\n};\n\nexport { isAnimatable };\n//# sourceMappingURL=is-animatable.mjs.map\n","function makeAnimationInstant(options) {\n options.duration = 0;\n options.type = \"keyframes\";\n}\n\nexport { makeAnimationInstant };\n//# sourceMappingURL=make-animation-instant.mjs.map\n","/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n]);\n\nexport { acceleratedValues };\n//# sourceMappingURL=accelerated-values.mjs.map\n","const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/;\nfunction hasBrowserOnlyColors(keyframes) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { hasBrowserOnlyColors };\n//# sourceMappingURL=is-browser-color.mjs.map\n","import { memo } from 'motion-utils';\nimport { acceleratedValues } from '../utils/accelerated-values.mjs';\nimport { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n]);\nconst supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, \"animate\"));\nfunction supportsBrowserAnimation(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;\n /**\n * Most values can't be accelerated at all, so check the name before\n * looking at the element or its props.\n */\n if (!name ||\n !(acceleratedValues.has(name) || colorProperties.has(name))) {\n return false;\n }\n const subject = motionValue?.owner?.current;\n /**\n * We use instanceof checks instead of isHTMLElement()/isSVGElement()\n * because we explicitly **don't** want elements in different timing\n * contexts (i.e. popups) to be accelerated, as it's not possible to sync\n * these animations properly with those driven from the main window\n * frameloop.\n */\n if (!(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\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\nexport { supportsBrowserAnimation, supportsWaapi };\n//# sourceMappingURL=waapi.mjs.map\n","/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nconst getValueAsType = (value, type) => {\n return type && typeof value === \"number\"\n ? type.transform(value)\n : value;\n};\n\nexport { getValueAsType };\n//# sourceMappingURL=get-as-type.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n};\nconst numTransforms = transformPropOrder.length;\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 */\nfunction buildTransform(latestValues, transform, transformTemplate) {\n // The transform string we're going to build into.\n let transformString = \"\";\n let transformIsDefault = true;\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];\n const value = latestValues[key];\n if (value === undefined)\n continue;\n let valueIsDefault = true;\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0);\n }\n else {\n const parsed = parseFloat(value);\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0;\n }\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\n if (!valueIsDefault) {\n transformIsDefault = false;\n const transformName = translateAlias[key] || key;\n transformString += `${transformName}(${valueAsType}) `;\n }\n if (transformTemplate) {\n transform[key] = valueAsType;\n }\n }\n }\n // `pathRotation` composes onto `rotate` as a separate additive term so\n // the user's `rotate` is never clobbered. Deliberately not a slot in\n // `transformPropOrder`.\n const pathRotation = latestValues.pathRotation;\n if (pathRotation) {\n transformIsDefault = false;\n transformString += `rotate(${getValueAsType(pathRotation, numberValueTypes.pathRotation)}) `;\n }\n transformString = transformString.trim();\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(transform, transformIsDefault ? \"\" : transformString);\n }\n else if (transformIsDefault) {\n transformString = \"none\";\n }\n return transformString;\n}\n\nexport { buildTransform, translateAlias };\n//# sourceMappingURL=build-transform.mjs.map\n","const transformGroups = new WeakMap();\n\nexport { transformGroups };\n//# sourceMappingURL=groups.mjs.map\n","import { isBezierDefinition, millisecondsToSeconds, clamp, progress } from 'motion-utils';\nimport { frame } from '../../../frameloop/frame.mjs';\nimport { frameData } from '../../../frameloop/frame-data.mjs';\nimport { time } from '../../../frameloop/sync-time.mjs';\nimport { buildTransform, translateAlias } from '../../../render/html/utils/build-transform.mjs';\nimport { transformPropOrder } from '../../../render/utils/keys-transform.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { frameloopDriver } from '../../drivers/frame.mjs';\nimport { keyframes } from '../../generators/keyframes.mjs';\nimport { defaultOffset } from '../../keyframes/offsets/default.mjs';\nimport { JSAnimation, round } from '../../JSAnimation.mjs';\nimport { sampleDelta } from '../../NativeAnimationExtended.mjs';\nimport { cubicBezierAsString } from '../easing/cubic-bezier.mjs';\nimport { supportedWaapiEasing } from '../easing/supported.mjs';\nimport { supportsWaapi } from '../supports/waapi.mjs';\nimport { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';\nimport { transformGroups } from './groups.mjs';\n\n/**\n * Sample at the interruption sampling rate, up to a cap for long\n * animations.\n */\nconst maxSamples = 200;\n/**\n * How far values may stray from the WAAPI animation: as a fraction of\n * each value's change when they share an easing, otherwise in px or deg,\n * or for scale.\n */\nconst easingTolerance = 0.001;\nconst sampleTolerance = 0.1;\nconst scaleTolerance = 0.001;\n/**\n * If an outside write, or a seek the WAAPI animation can't follow,\n * happens again within this window, the group is being driven every\n * frame (scrubbing, drag), which is cheaper on the main thread than\n * rebuilding the WAAPI animation every frame.\n */\nconst churnWindow = 100;\n/**\n * Named easings that are the same cubic-bezier in JS and CSS.\n */\nconst isNativeEasing = (ease) => /^(linear|ease(In|Out|InOut))$/.test(ease);\nconst byTime = (a, b) => a - b;\n/**\n * n + 1 evenly spaced timestamps, from one timestamp to another.\n */\nconst spread = (from, to, n) => {\n const result = [];\n for (let i = 0; i <= n; i++)\n result.push(mixNumber(from, to, i / n));\n return result;\n};\nconst getOwner = (options) => options.motionValue.owner;\nconst getGroup = (element) => transformGroups.get(element);\nconst read = (owner, key) => owner.latestValues ? owner.latestValues[key] : owner.getValue(key)?.get();\n/**\n * Whether this animation should join its element's transform group.\n * Animations that can't be accelerated still join, so the group knows\n * to stay on the main thread while they run. Browsers without linear()\n * easing stay on the main thread.\n */\nconst canGroupTransform = ({ name, motionValue, }) => name &&\n transformPropOrder.includes(name) &&\n motionValue?.owner?.current instanceof HTMLElement &&\n supportsWaapi() &&\n supportsLinearEasing();\nfunction canAccelerateTransform(options) {\n const owner = getOwner(options);\n const { onUpdate, transformTemplate } = owner.getProps();\n return (\n /**\n * A handoff from an optimised appear animation is already running\n * on its own WAAPI animation. onUpdate needs every value, every\n * frame.\n */\n !options.isHandoff &&\n !onUpdate &&\n !options.hasOnUpdate &&\n /**\n * transformTemplate could output anything.\n */\n !transformTemplate &&\n options.type !== \"inertia\" &&\n /**\n * A literal transform, or pathRotation, replaces or adds to the\n * transform we'd build. styleEffect builds its own as \"none\".\n */\n (read(owner, \"transform\") || \"none\") === \"none\" &&\n !read(owner, \"pathRotation\") &&\n /**\n * Layout animations write transform every frame.\n */\n !owner.projection?.isProjecting());\n}\nclass TransformAnimation extends JSAnimation {\n constructor(options) {\n const element = getOwner(options).current;\n const { driver = frameloopDriver } = options;\n let animation;\n /**\n * Before JSAnimation replaces the type with its generator.\n */\n const canAccelerate = canAccelerateTransform(options);\n /**\n * The driver ticks on the main thread only once the group has\n * moved there. Until then, starting or stopping tells the group to\n * update its WAAPI animation.\n */\n options.driver = (update) => {\n const js = driver(update);\n return {\n js,\n now: js.now,\n start: (keepAlive = true) => {\n const group = getGroup(element);\n const isJS = !group || group.isJS;\n /**\n * keepAlive is false when seeking. Seeking the WAAPI\n * animation is free, but if a seek needs a rebuild and\n * keeps happening, the group moves to the main thread.\n */\n isJS\n ? js.start(keepAlive)\n : group.schedule(false, !keepAlive);\n },\n stop: () => {\n js.stop();\n const group = getGroup(element);\n group && !group.isFinishing && group.release(animation);\n },\n };\n };\n super(options);\n animation = this;\n this.canAccelerate = canAccelerate;\n /**\n * stop is bound in JSAnimation, so wrap it rather than override.\n * Before stopping, set the motion value to where the WAAPI\n * animation is now, with velocity, for the next animation to\n * start from.\n */\n const { stop } = this;\n this.stop = () => {\n this.isAccelerated() && this.sync();\n stop();\n };\n }\n get group() {\n return getGroup(getOwner(this.options).current);\n }\n get js() {\n return this.driver?.js;\n }\n get name() {\n return this.options.name;\n }\n /**\n * When this stops moving, or, if it repeats forever, when it starts\n * repeating, and how long each repeat takes. Held (paused, or at\n * speed 0) animations never stop moving.\n */\n timing() {\n const { startTime, speed, totalDuration } = this;\n const { delay = 0, repeatType } = this.options;\n return this.holdTime !== null\n ? [Infinity, 0]\n : totalDuration === Infinity\n ? [\n startTime + delay / speed,\n (this.resolvedDuration * (repeatType === \"loop\" ? 1 : 2)) /\n speed || 1,\n ]\n : [startTime + (delay + totalDuration) / speed, 0];\n }\n /**\n * Whether this is running, or paused, on the compositor.\n */\n isAccelerated() {\n const { group, state } = this;\n return (group?.tracks.has(this) &&\n !group.isJS &&\n this.canAccelerate &&\n (state === \"running\" || state === \"paused\"));\n }\n /**\n * The value now, while this runs on the compositor and so doesn't\n * set its motion value every frame.\n */\n liveValue() {\n return this.isAccelerated() ? this.sampleAt(time.now()) : undefined;\n }\n /**\n * If this is a two-keyframe tween whose easing WAAPI runs exactly,\n * when it starts and stops moving, and that easing.\n */\n tween() {\n const { keyframes: keyframes$1, type, ease, times, repeat, delay = 0 } = this.options;\n const easing = isBezierDefinition(ease)\n ? cubicBezierAsString(ease)\n : isNativeEasing(ease) && supportedWaapiEasing[ease];\n if (easing &&\n !repeat &&\n !times &&\n keyframes$1.length === 2 &&\n type === keyframes &&\n this.holdTime === null) {\n const start = this.startTime + delay / this.speed;\n return [start, start + this.resolvedDuration / this.speed, easing];\n }\n }\n /**\n * The timestamps between two timestamps where this reaches a\n * keyframe or starts a repeat, where it can turn or jump.\n */\n boundaries(from, to) {\n const { startTime, speed, resolvedDuration, options } = this;\n const { delay = 0, repeat = 0, repeatDelay = 0, repeatType, times, keyframes: keyframes$1, type, } = options;\n const offsets = (type || keyframes) === keyframes\n ? times || defaultOffset(keyframes$1)\n : [0, 1];\n const start = startTime + delay / speed;\n const result = [];\n if (this.holdTime !== null || !(resolvedDuration > 0))\n return result;\n for (let i = Math.max(0, Math.floor(((from - start) * speed) / resolvedDuration)); i <= repeat; i++) {\n const iterationStart = start + (i * resolvedDuration) / speed;\n if (iterationStart > to)\n break;\n for (const offset of offsets) {\n const t = iterationStart +\n ((i % 2 && repeatType && repeatType !== \"loop\"\n ? 1 - offset\n : offset) *\n (resolvedDuration - repeatDelay)) /\n speed;\n t > from && t < to && result.push(t);\n }\n }\n return result;\n }\n /**\n * The value at a timestamp, as a number.\n */\n numberAt(timestamp) {\n return parseFloat(this.sampleAt(timestamp, true));\n }\n /**\n * Write the current value, and velocity, to the motion value.\n */\n sync() {\n const now = time.now();\n this.options.motionValue.setWithVelocity(this.sampleAt(now - sampleDelta, true), this.sampleAt(now, true), sampleDelta);\n }\n play() {\n /**\n * A stopped animation (one that was interrupted) can't play again,\n * so it mustn't join the group.\n */\n if (this.isStopped)\n return;\n (this.group || createGroup(getOwner(this.options))).tracks.add(this);\n super.play();\n }\n pause() {\n super.pause();\n if (this.isAccelerated()) {\n this.sync();\n this.group.schedule(false);\n }\n }\n /**\n * JSAnimation finishes on its next tick, which only happens on the\n * main thread, so finish now.\n */\n complete() {\n super.complete();\n const { group } = this;\n group && !group.isJS && this.canAccelerate && this.tick(time.now());\n }\n /**\n * Without a tick to rebase it, a held time still includes the delay,\n * so take it off here, as a JS animation does on its next tick.\n */\n get time() {\n if (this.isAccelerated()) {\n return millisecondsToSeconds(clamp(0, this.totalDuration, this.at(time.now()) - (this.options.delay || 0)));\n }\n return super.time;\n }\n /**\n * A JS animation sets its motion value from a seek on its next tick.\n * This doesn't tick, so set it now, rather than leave it to be set\n * when this next stops.\n */\n set time(newTime) {\n super.time = newTime;\n this.isAccelerated() && this.sync();\n }\n /**\n * Scroll timelines set time every frame, so run these on the main\n * thread.\n */\n attachTimeline(timeline) {\n this.canAccelerate = false;\n this.group?.demote(true);\n return super.attachTimeline(timeline);\n }\n}\nfunction createGroup(owner) {\n const element = owner.current;\n const tracks = new Set();\n const byKey = new Map();\n /**\n * Transforms that aren't animating, as built into the WAAPI animation.\n */\n let statics = {};\n /**\n * The transforms in the WAAPI animation, in order.\n */\n let keys = [];\n let built = new Map();\n let segments = [];\n let needsBuild = false;\n let isScheduled = false;\n let isEnded = false;\n let hasChurned = false;\n let lastChurn = -Infinity;\n const has = (key) => {\n for (const track of tracks)\n if (track.name === key)\n return true;\n };\n /**\n * The transform values at a timestamp or, without one, from the\n * motion values. Animations that don't repeat forever are sampled no\n * earlier than settled, so a loop that starts from an earlier cycle\n * boundary holds them at their end.\n */\n const valuesAt = (timestamp, settled) => {\n const values = {};\n for (const key of timestamp === undefined ? transformPropOrder : keys) {\n const track = byKey.get(key);\n const value = timestamp === undefined\n ? read(owner, key)\n : track\n ? track.sampleAt(settled > timestamp && !track.timing()[1]\n ? settled\n : timestamp)\n : statics[key];\n if (value !== undefined)\n values[key] = value;\n }\n return values;\n };\n /**\n * Build the transform at a timestamp. Unlike buildTransform, every key\n * is written, even at its default, so each keyframe has the same list\n * of functions and the browser interpolates them one by one.\n */\n const compose = (timestamp, settled) => {\n let transform = \"\";\n const values = valuesAt(timestamp, settled);\n for (const key in values) {\n transform +=\n (translateAlias[key] || key) +\n \"(\" +\n getValueAsType(values[key], numberValueTypes[key]) +\n \") \";\n }\n return transform || \"none\";\n };\n /**\n * Write the transform as an inline style, as the renderer would.\n */\n const commit = (values = valuesAt()) => {\n element.style.transform = buildTransform(values, {});\n };\n /**\n * Cancel the WAAPI animations, by default first committing the\n * transform. The renderer writes its own version on its next render.\n */\n const stop = (shouldCommit = true) => {\n shouldCommit && commit();\n segments.forEach(({ animation }) => animation.cancel());\n segments = [];\n };\n const add = (animation, offset, end = Infinity) => {\n const segment = { animation, offset, end };\n animation.startTime = time.now() + offset;\n /**\n * Animations finish when the WAAPI animation reaches their end.\n * Once a loop has taken over, the finished animation isn't needed.\n */\n if (end < Infinity) {\n animation.onfinish = () => {\n segment.isDone = true;\n if (segments.some((s) => s.end === Infinity)) {\n animation.cancel();\n segments = segments.filter((s) => s !== segment);\n }\n group.schedule(false);\n };\n }\n /**\n * Something else cancelled it, so carry on on the main thread.\n */\n animation.oncancel = () => segments.includes(segment) && group.demote();\n segments.push(segment);\n };\n /**\n * Where a value jumps between two timestamps, as when a repeat starts\n * again: the timestamps either side of the jump, or none if it moves\n * there continuously.\n */\n const jumpAt = (value, a, b) => {\n const change = (x, y) => Math.abs(value(y) - value(x));\n const size = change(a, b);\n while (b - a > 0.01) {\n const mid = (a + b) / 2;\n change(a, mid) > change(mid, b) ? (b = mid) : (a = mid);\n }\n return change(a, b) > size / 2 ? [a, b] : [];\n };\n /**\n * If every moving animation follows the same eased progress between\n * two timestamps, the easing that describes it.\n */\n const getEasing = (moving, from, to, bounds) => {\n const samples = Math.min(maxSamples, Math.max(2, Math.ceil((to - from) / sampleDelta)));\n /**\n * Too many keyframes or repeats to follow with this many samples.\n */\n if (bounds.length * 4 > samples)\n return;\n const at = spread(from, to, samples).concat(bounds).sort(byTime);\n const position = (t) => progress(from, to, t);\n let shared;\n let progressAt;\n for (const track of moving) {\n const values = at.map((t) => track.numberAt(t));\n const [first] = values;\n const changes = values.map((value) => value - first);\n const end = changes[changes.length - 1];\n /**\n * A value that ends only a tiny way from where it started, as\n * a round trip does if it's built just after it starts, or\n * from a float residue, ends where it started. Dividing by\n * that tiny range would stretch the easing to values the\n * compositor can't render.\n */\n const range = changes.some((change) => Math.abs(change) * easingTolerance > Math.abs(end))\n ? 0\n : end;\n const progress = changes.map((change) => range ? change / range : change);\n /**\n * A value that doesn't change, like one still in its delay,\n * fits any easing. One that changes but ends where it started\n * fits none.\n */\n if (!range) {\n if (progress.some((p) => !(Math.abs(p) <= easingTolerance))) {\n return;\n }\n }\n else if (!shared) {\n shared = progress;\n progressAt = (t) => (track.numberAt(t) - first) / range;\n }\n else if (progress.some((p, i) => !(Math.abs(p - shared[i]) <= easingTolerance))) {\n return;\n }\n }\n if (!shared ||\n shared.every((p, i) => Math.abs(p - position(at[i])) <= easingTolerance)) {\n return \"linear\";\n }\n /**\n * A repeat that starts again jumps back, which takes two points at\n * the same position.\n */\n const points = [];\n const point = (t, p = progressAt(t)) => points.push(round(p) + \" \" + round(position(t) * 100) + \"%\");\n shared.forEach((p, i) => {\n i &&\n Math.abs(p - shared[i - 1]) > 0.2 &&\n jumpAt(progressAt, at[i - 1], at[i]).forEach((t) => point(t));\n point(at[i], p);\n });\n return \"linear(\" + points + \")\";\n };\n /**\n * Sample timestamps between two timestamps, closer together where the\n * moving animations curve.\n */\n const sample = (moving, from, to, bounds) => {\n const times = [from];\n /**\n * Values that aren't numbers, like calc(), are left to the\n * browser to interpolate.\n */\n const isStraight = (a, b) => moving.every((track) => !(Math.abs(track.numberAt((a + b) / 2) -\n (track.numberAt(a) + track.numberAt(b)) / 2) >\n (track.name.startsWith(\"scale\")\n ? scaleTolerance\n : sampleTolerance)));\n const split = (a, b, depth) => {\n if (b - a < 1 || isStraight(a, b)) {\n times.push(b);\n }\n else if (depth < 4) {\n split(a, (a + b) / 2, depth + 1);\n split((a + b) / 2, b, depth + 1);\n }\n else {\n /**\n * Keyframes either side of a jump, like a repeat starting\n * again, so it doesn't play as a quick sweep.\n */\n for (const track of moving) {\n times.push(...jumpAt((t) => track.numberAt(t), a, b));\n }\n times.push(b);\n }\n };\n /**\n * Split at least every 100ms, and at every keyframe and repeat,\n * either side of where a value can jump.\n */\n const ends = spread(from, to, Math.ceil((to - from) / 100));\n for (const t of bounds)\n ends.push(t, Math.min(t + 0.01, to));\n let start = from;\n for (const end of ends.sort(byTime)) {\n end > start && split(start, end, 0);\n start = end;\n }\n return times.sort(byTime);\n };\n /**\n * If every moving animation is the same tween, started together, as\n * happens for the values of one animate() call or transition, when\n * they move and their native easing.\n */\n const getTween = (moving) => {\n let shared;\n for (const track of moving) {\n const tween = track.tween();\n if (!tween ||\n shared?.some((v, i) => i < 2\n ? Math.abs(tween[i] - v) > 1\n : tween[i] !== v)) {\n return;\n }\n shared = tween;\n }\n return shared;\n };\n /**\n * A WAAPI animation of the composed transform between two timestamps.\n */\n const run = (moving, from, to, options = { fill: \"both\" }, settled, nativeEasing) => {\n const bounds = moving.flatMap((track) => track.boundaries(from, to));\n const easing = nativeEasing || getEasing(moving, from, to, bounds);\n const times = easing ? [from, to] : sample(moving, from, to, bounds);\n const transform = times.map((t) => compose(t, settled));\n let keyframes = { transform };\n if (!easing) {\n keyframes.offset = times.map((t) => progress(from, to, t));\n }\n /**\n * If nothing moves, don't hold a transform, which, even at its\n * default, would make the element a containing block. The empty\n * animation still finishes the animations.\n */\n if (transform.every((t) => t === transform[0])) {\n commit(valuesAt(from, settled));\n keyframes = null;\n }\n return element.animate(keyframes, {\n ...options,\n duration: to - from,\n easing: easing || \"linear\",\n });\n };\n /**\n * Replace the WAAPI animations with ones built from now. Returns\n * undefined if the animations can't be composed.\n */\n const animate = (now) => {\n /**\n * The finite part runs until the last finite animation (or the\n * last delay) ends. Infinitely repeating animations then continue\n * as one looping WAAPI animation, which needs them to share a\n * cycle.\n */\n let end = now;\n let cycle = 0;\n let cycleStart = 0;\n const moving = [];\n const looping = [];\n const ends = new Set();\n byKey.clear();\n built = new Map();\n for (const track of tracks) {\n byKey.set(track.name, track);\n const [trackEnd, trackCycle] = track.timing();\n const isHeld = trackEnd === Infinity;\n built.set(track, [track.at(now), track.speed, isHeld]);\n /**\n * Held animations don't move, so keep their motion values up\n * to date, as a JSAnimation would on a seek.\n */\n if (isHeld) {\n track.sync();\n continue;\n }\n if (track.speed < 0)\n return;\n if (trackCycle) {\n if (cycle) {\n const phase = (trackEnd - cycleStart) / trackCycle;\n if (Math.abs(trackCycle - cycle) > 1 ||\n Math.abs(phase - Math.round(phase)) * cycle > 1) {\n return;\n }\n }\n else {\n cycle = trackCycle;\n cycleStart = trackEnd;\n }\n looping.push(track);\n }\n else {\n ends.add(trackEnd);\n }\n moving.push(track);\n end = Math.max(end, trackEnd);\n }\n statics = {};\n /**\n * Transforms that aren't animating are left out at their default.\n */\n keys = transformPropOrder.filter((key) => {\n if (byKey.has(key))\n return true;\n const value = (statics[key] = read(owner, key));\n return (value !== undefined &&\n parseFloat(value) !==\n (key.startsWith(\"scale\") ? 1 : 0));\n });\n stop(false);\n /**\n * Values that share one tween are one WAAPI animation of it, with\n * two keyframes and its own easing, from when they started.\n */\n const tween = !cycle && getTween(moving);\n try {\n if (tween && tween[1] > now) {\n const [from, to, easing] = tween;\n add(run(moving, from, to, undefined, undefined, easing), from - now, to - from);\n }\n else if (end > now) {\n add(run(moving, now, end), 0, end - now);\n /**\n * Animations that end sooner finish on the events of\n * empty animations that end with them.\n */\n ends.forEach((trackEnd) => trackEnd < end - 1 &&\n add(element.animate(null, {\n duration: trackEnd - now,\n }), 0, trackEnd - now));\n }\n if (cycle) {\n /**\n * Build one cycle from a cycle boundary, so it repeats\n * seamlessly, and start it part way through.\n */\n const from = cycleStart + Math.floor((end - cycleStart) / cycle) * cycle;\n add(run(looping, from, from + cycle, {\n iterations: Infinity,\n iterationStart: (end - from) / cycle,\n /**\n * It must not fill backwards over the finite part\n * that runs before it.\n */\n fill: \"forwards\",\n }, end), end - now);\n }\n }\n catch {\n return;\n }\n /**\n * Everything is held, so hold it with an inline style instead.\n */\n segments.length || stop();\n return true;\n };\n /**\n * If every animation has been paused, played, seeked or sped up\n * together since the WAAPI animation was built, do the same to it.\n * Returns false if it needs rebuilding instead.\n */\n const retime = (now) => {\n let elapsed;\n let rate = 0;\n for (const track of tracks) {\n const state = built.get(track);\n if (!state)\n return false;\n const [builtTime, builtSpeed, wasHeld] = state;\n const trackTime = track.at(now);\n const isHeld = track.timing()[0] === Infinity;\n if (wasHeld) {\n if (isHeld && trackTime === builtTime)\n continue;\n return false;\n }\n const trackElapsed = (trackTime - builtTime) / builtSpeed;\n const trackRate = isHeld ? 0 : track.speed / builtSpeed;\n if (elapsed === undefined) {\n elapsed = trackElapsed;\n rate = trackRate;\n }\n else if (Math.abs(trackElapsed - elapsed) > 1 ||\n trackRate !== rate) {\n return false;\n }\n }\n if (elapsed === undefined)\n return true;\n if (!segments.length)\n return false;\n for (const { offset, end, isDone } of segments) {\n const local = elapsed - offset;\n if (end < Infinity &&\n (isDone ? local < end - 1 : local < 0 || local >= end)) {\n return false;\n }\n }\n for (const { animation, offset, isDone } of segments) {\n if (isDone)\n continue;\n const local = elapsed - offset;\n if (rate) {\n animation.playbackRate = rate;\n animation.startTime = now - local / rate;\n }\n else {\n animation.pause();\n animation.currentTime = local;\n }\n }\n return true;\n };\n /**\n * If no animations are left, write where they got to and cancel the\n * WAAPI animations. Returns whether the group ended.\n */\n const end = () => {\n if (tracks.size)\n return false;\n isEnded = true;\n transformGroups.delete(element);\n group.isJS || stop();\n return true;\n };\n const build = () => {\n const now = time.now();\n /**\n * Finish the animations that have reached their end, which the\n * WAAPI animation has already rendered.\n */\n if (!group.isJS) {\n group.isFinishing = true;\n tracks.forEach((track) => {\n const [trackEnd, trackCycle] = track.timing();\n if (track.state === \"running\" &&\n track.speed > 0 &&\n !trackCycle &&\n trackEnd <= now + 1) {\n track.complete();\n /**\n * From now it's checked for outside writes like any\n * other static transform. If the WAAPI animation never\n * rendered it (it was instant), rebuild with its value.\n */\n statics[track.name] = read(owner, track.name);\n built.has(track) || (needsBuild = true);\n }\n });\n group.isFinishing = false;\n }\n isScheduled = false;\n if (isEnded)\n return;\n tracks.forEach(({ state }, track) => {\n if (state === \"idle\" || state === \"finished\")\n tracks.delete(track);\n });\n if (end())\n return;\n for (const track of tracks) {\n if (!track.canAccelerate)\n return group.demote(true);\n }\n /**\n * Everything that kept the group on the main thread has finished,\n * so move the remaining animations back to the compositor.\n */\n if (group.isJS) {\n group.isJS = false;\n needsBuild = true;\n tracks.forEach((track) => track.js?.stop());\n }\n const shouldBuild = needsBuild;\n const churned = hasChurned;\n needsBuild = hasChurned = false;\n if (shouldBuild || !retime(now)) {\n if (churned) {\n if (now - lastChurn < churnWindow)\n return group.demote();\n lastChurn = now;\n }\n if (!animate(now))\n return group.demote();\n }\n };\n const group = {\n tracks,\n isJS: false,\n isFinishing: false,\n schedule(build_, isChurn) {\n if (isEnded)\n return;\n needsBuild || (needsBuild = build_);\n hasChurned || (hasChurned = !!isChurn);\n /**\n * Build in this frame's render step, so it's in place before\n * anything reads the DOM in postRender, or straight after the\n * current task outside of a frame.\n */\n if (!isScheduled) {\n isScheduled = true;\n frameData.isProcessing\n ? frame.render(build, false, true)\n : queueMicrotask(build);\n }\n },\n /**\n * End the group now, rather than when it next builds, so the\n * element's transform is the caller's again as soon as its last\n * animation is stopped.\n */\n release(track) {\n /**\n * Only drop the stopped animation. Others can be idle because\n * they're part way through play(), and are about to run.\n */\n const { state } = track;\n if (state === \"idle\" || state === \"finished\")\n tracks.delete(track);\n end() || group.schedule(true);\n },\n /**\n * An outside write. Rebuild once, but if it keeps happening, move\n * to the main thread.\n */\n check() {\n if (group.isJS)\n return;\n for (const key in statics) {\n if (read(owner, key) !== statics[key] && !has(key)) {\n return group.schedule(true, true);\n }\n }\n },\n demote(canReturn) {\n if (group.isJS || isEnded)\n return;\n /**\n * Unless only another animation is holding the group on the\n * main thread, these animations stay there until they end.\n */\n tracks.forEach((track) => {\n track.isAccelerated() && track.sync();\n canReturn || (track.canAccelerate = false);\n });\n group.isJS = true;\n built = new Map();\n stop();\n tracks.forEach((track) => track.state === \"running\" && track.js?.start());\n },\n };\n transformGroups.set(element, group);\n return group;\n}\n\nexport { TransformAnimation, canGroupTransform };\n//# sourceMappingURL=TransformAnimation.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { JSAnimation } from './JSAnimation.mjs';\nimport { getFinalKeyframe } from './keyframes/get-final.mjs';\nimport { KeyframeResolver, flushKeyframeResolvers } from './keyframes/KeyframesResolver.mjs';\nimport { NativeAnimationExtended } from './NativeAnimationExtended.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { makeAnimationInstant } from './utils/make-animation-instant.mjs';\nimport { resolveStartTime } from './utils/resolve-start-time.mjs';\nimport { WithPromise } from './utils/WithPromise.mjs';\nimport { supportsBrowserAnimation } from './waapi/supports/waapi.mjs';\nimport { canGroupTransform, TransformAnimation } from './waapi/transforms/TransformAnimation.mjs';\n\nclass AsyncMotionValueAnimation extends WithPromise {\n constructor(options) {\n super();\n /**\n * Bound to support return animation.stop pattern\n */\n this.stop = () => {\n if (this._animation) {\n this._animation.stop();\n this.stopTimeline?.();\n }\n this.keyframeResolver?.cancel();\n };\n this.createdAt = time.now();\n const { keyframes, name, motionValue, element } = options;\n /**\n * animateMotionValue builds a fresh options object per value, so\n * it's completed in place as keyframes resolve rather than copied.\n */\n const optionsWithDefaults = options;\n optionsWithDefaults.autoplay ?? (optionsWithDefaults.autoplay = true);\n optionsWithDefaults.delay ?? (optionsWithDefaults.delay = 0);\n optionsWithDefaults.type ?? (optionsWithDefaults.type = \"keyframes\");\n optionsWithDefaults.repeat ?? (optionsWithDefaults.repeat = 0);\n optionsWithDefaults.repeatDelay ?? (optionsWithDefaults.repeatDelay = 0);\n optionsWithDefaults.repeatType ?? (optionsWithDefaults.repeatType = \"loop\");\n const KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver;\n this.keyframeResolver = new KeyframeResolver$1(keyframes, (resolvedKeyframes, finalKeyframe, forced) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe, optionsWithDefaults, !forced), name, motionValue, element);\n this.keyframeResolver?.scheduleResolve();\n }\n onKeyframesResolved(keyframes, finalKeyframe, options, sync) {\n this.keyframeResolver = undefined;\n const { name, type, velocity, delay, isHandoff, onUpdate } = options;\n this.resolvedAt = time.now();\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true;\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false;\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe));\n }\n keyframes[0] = keyframes[keyframes.length - 1];\n makeAnimationInstant(options);\n options.repeat = 0;\n }\n const { onComplete } = options;\n options.finalKeyframe = finalKeyframe;\n options.keyframes = keyframes;\n /**\n * JSAnimation and NativeAnimation call onComplete exactly when\n * their own `finished` resolves, so this replaces a promise chain\n * per value with a callback.\n */\n options.onComplete = () => {\n onComplete?.();\n this.notifyFinished();\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 * Also skip WAAPI when keyframes aren't animatable, as the resolved\n * values may not be valid CSS and would trigger browser warnings.\n */\n const useWaapi = canAnimateValue && !isHandoff && supportsBrowserAnimation(options);\n /**\n * Independent transforms (x, scale etc) on an HTML element are\n * composed into one WAAPI transform animation per element.\n */\n const isGroupedTransform = !useWaapi && canGroupTransform(options);\n /**\n * Resolve startTime for the animation. A startTime passed in options\n * (an optimised appear handoff syncing to its WAAPI animation) takes\n * precedence.\n *\n * *Ideally*, we would use the createdAt time as t=0 as the following\n * frame would then be the first frame of the animation in progress,\n * which would feel snappier. If keyframes resolved on a later frame,\n * and long after creation, we start from then instead.\n *\n * If they resolved immediately, a JSAnimation picks its own start\n * time and resolves it the same way on its first frame, so every\n * animation started in that moment stays in sync. WAAPI has no frame\n * of ours to do that on.\n */\n if (sync &&\n (useWaapi ||\n isGroupedTransform ||\n this.resolvedAt !== this.createdAt)) {\n options.startTime ?? (options.startTime = resolveStartTime(this.createdAt, this.resolvedAt));\n }\n let animation;\n if (useWaapi) {\n /**\n * The resolver needed the VisualElement, WAAPI needs the DOM\n * element. JSAnimation reads neither, so this is safe to\n * leave in place if we fall back to it.\n */\n options.element = options.motionValue?.owner?.current;\n try {\n animation = new NativeAnimationExtended(options);\n }\n catch {\n animation = new JSAnimation(options);\n }\n }\n else if (isGroupedTransform) {\n animation = new TransformAnimation(options);\n }\n else {\n animation = new JSAnimation(options);\n }\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n this._animation = animation;\n }\n get finished() {\n return this._animation ? this._animation.finished : super.finished;\n }\n then(onResolve, _onReject) {\n return this.finished.finally(onResolve).then(() => { });\n }\n /**\n * The value now, if the animation runs on the compositor.\n */\n liveValue() {\n return this._animation?.liveValue?.();\n }\n get animation() {\n if (!this._animation) {\n this.keyframeResolver?.resume();\n flushKeyframeResolvers();\n }\n return this._animation;\n }\n get duration() {\n return this.animation.duration;\n }\n get iterationDuration() {\n return this.animation.iterationDuration;\n }\n get time() {\n return this.animation.time;\n }\n set time(newTime) {\n this.animation.time = newTime;\n }\n get speed() {\n return this.animation.speed;\n }\n get state() {\n return this.animation.state;\n }\n set speed(newSpeed) {\n this.animation.speed = newSpeed;\n }\n get startTime() {\n return this.animation.startTime;\n }\n attachTimeline(timeline) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline);\n }\n else {\n this.pendingTimeline = timeline;\n }\n return () => this.stop();\n }\n play() {\n this.animation.play();\n }\n pause() {\n this.animation.pause();\n }\n complete() {\n this.animation.complete();\n }\n cancel() {\n if (this._animation) {\n this.animation.cancel();\n }\n this.keyframeResolver?.cancel();\n }\n}\n\nexport { AsyncMotionValueAnimation };\n//# sourceMappingURL=AsyncMotionValueAnimation.mjs.map\n","import { warning } from 'motion-utils';\nimport { isGenerator } from '../generators/utils/is-generator.mjs';\nimport { isAnimatable } from './is-animatable.mjs';\n\nfunction hasKeyframesChanged(keyframes) {\n const current = keyframes[0];\n if (keyframes.length === 1)\n return true;\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current)\n return true;\n }\n}\nfunction canAnimate(keyframes, name, type, velocity) {\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 * 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\")\n return true;\n const targetKeyframe = keyframes[keyframes.length - 1];\n const isOriginAnimatable = isAnimatable(originKeyframe, name);\n const isTargetAnimatable = isAnimatable(targetKeyframe, name);\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n // Only build the message when we're going to warn\n isOriginAnimatable !== isTargetAnimatable &&\n warning(false, `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${isOriginAnimatable ? targetKeyframe : originKeyframe}\" is not an animatable value.`, \"value-not-animatable\");\n return false;\n }\n return (hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity));\n}\n\nexport { canAnimate };\n//# sourceMappingURL=can-animate.mjs.map\n","function calcChildStagger(children, child, delayChildren, staggerChildren = 0, staggerDirection = 1) {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child);\n const numChildren = children.size;\n const maxStaggerDuration = (numChildren - 1) * staggerChildren;\n const delayIsFunction = typeof delayChildren === \"function\";\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren;\n}\n\nexport { calcChildStagger };\n//# sourceMappingURL=calc-child-stagger.mjs.map\n","import { warnOnce, SubscriptionManager, velocityPerSecond } from 'motion-utils';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { frame } from '../frameloop/frame.mjs';\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;\nconst isFloat = (value) => {\n return !isNaN(parseFloat(value));\n};\nconst collectMotionValues = {\n current: undefined,\n};\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nclass MotionValue {\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, options = {}) {\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 this.canTrackVelocity = null;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\n this.updateAndNotify = (v) => {\n const currentTime = time.now();\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 this.prev = this.current;\n this.setCurrent(v);\n // Update update subscribers\n if (this.current !== this.prev) {\n this.notifyChange();\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty();\n }\n }\n }\n };\n this.hasAnimated = false;\n this.setCurrent(init);\n this.owner = options.owner;\n }\n setCurrent(current) {\n this.current = current;\n this.updatedAt = time.now();\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current);\n }\n }\n setPrevFrameValue(prevFrameValue = this.current) {\n this.prevFrameValue = prevFrameValue;\n this.prevUpdatedAt = this.updatedAt;\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 \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) {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`);\n }\n return this.on(\"change\", subscription);\n }\n on(eventName, callback) {\n var _a;\n if (eventName === \"change\")\n return this.onChangeSubscribe(callback);\n return ((_a = this.events)[eventName] || (_a[eventName] = new SubscriptionManager())).add(callback);\n }\n onChangeSubscribe(callback) {\n const { events } = this;\n if (!events.change && !this.changeSubscriber) {\n this.changeSubscriber = callback;\n }\n else {\n if (!events.change) {\n events.change = new SubscriptionManager();\n events.change.add(this.changeSubscriber);\n this.changeSubscriber = undefined;\n }\n events.change.add(callback);\n }\n return () => {\n if (this.changeSubscriber === callback) {\n this.changeSubscriber = undefined;\n }\n else {\n events.change?.remove(callback);\n }\n this.stopIfUnobserved();\n };\n }\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n stopIfUnobserved() {\n frame.read(() => {\n if (!this.changeSubscriber && !this.events.change?.getSize()) {\n this.stop();\n }\n });\n }\n clearListeners() {\n this.changeSubscriber = undefined;\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear();\n }\n }\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect, stopPassiveEffect) {\n this.passiveEffect = passiveEffect;\n this.stopPassiveEffect = stopPassiveEffect;\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) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v);\n }\n else {\n this.passiveEffect(v, this.updateAndNotify);\n }\n }\n setWithVelocity(prev, current, delta) {\n this.set(current);\n this.prev = undefined;\n this.prevFrameValue = prev;\n this.prevUpdatedAt = this.updatedAt - delta;\n }\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(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)\n this.stopPassiveEffect();\n }\n dirty() {\n this.notifyChange();\n }\n notifyChange() {\n const { current, changeSubscriber } = this;\n /**\n * One or the other exists. Subscribing during the direct\n * subscriber's call moves it into a new manager, which must not\n * then be notified for the same change.\n */\n if (changeSubscriber) {\n changeSubscriber(current);\n }\n else {\n this.events.change?.notify(current);\n }\n }\n addDependent(dependent) {\n if (!this.dependents) {\n this.dependents = new Set();\n }\n this.dependents.add(dependent);\n }\n removeDependent(dependent) {\n if (this.dependents) {\n this.dependents.delete(dependent);\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 * A value animating on the compositor isn't updated every frame,\n * so read it from its animation.\n */\n const sampled = this.animation?.liveValue?.();\n return sampled === undefined ? this.current : sampled;\n }\n /**\n * The value as last set. Unlike get(), this doesn't read an animation\n * running on the compositor, which renders the value itself.\n */\n getCurrent() {\n return this.current;\n }\n /**\n * @public\n */\n getPrevious() {\n return this.prev;\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 if (!this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA) {\n return 0;\n }\n const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA);\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(parseFloat(this.current) -\n parseFloat(this.prevFrameValue), delta);\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) {\n this.stop();\n return new Promise((resolve) => {\n this.hasAnimated = true;\n /**\n * Complete synchronously via the callback rather than chaining a\n * second promise per animation. Guard against animations that\n * complete before startAnimation has returned.\n */\n let isComplete = false;\n let animation;\n // eslint-disable-next-line prefer-const -- read by the callback before assignment when completing synchronously\n animation = startAnimation(() => {\n isComplete = true;\n this.events.animationComplete?.notify();\n if (this.animation === animation)\n this.clearAnimation();\n resolve();\n });\n if (!isComplete)\n this.animation = animation;\n this.events.animationStart?.notify();\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 * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation;\n }\n clearAnimation() {\n // Assign rather than delete to keep the object's shape stable\n this.animation = undefined;\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 if (this.stopPassiveEffect) {\n this.stopPassiveEffect();\n }\n }\n}\nfunction motionValue(init, options) {\n return new MotionValue(init, options);\n}\n\nexport { MotionValue, collectMotionValues, motionValue };\n//# sourceMappingURL=index.mjs.map\n","/**\n * If `transition` has `inherit: true`, shallow-merge it with\n * `parentTransition` (child keys win) and strip the `inherit` key.\n * Otherwise return `transition` unchanged.\n */\nfunction resolveTransition(transition, parentTransition) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition;\n return { ...parentTransition, ...rest };\n }\n return transition;\n}\n\nexport { resolveTransition };\n//# sourceMappingURL=resolve-transition.mjs.map\n","import { resolveTransition } from './resolve-transition.mjs';\n\nfunction getValueTransition(transition, key) {\n const valueTransition = transition?.[key] ??\n transition?.[\"default\"] ??\n transition;\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition);\n }\n return valueTransition;\n}\n\nexport { getValueTransition };\n//# sourceMappingURL=get-value-transition.mjs.map\n","import { transformProps } from '../../render/utils/keys-transform.mjs';\n\nconst underDampedSpring = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n};\nconst criticallyDampedSpring = (target) => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n});\nconst keyframesTransition = {\n type: \"keyframes\",\n duration: 0.8,\n};\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n};\nconst getDefaultTransition = (valueKey, { keyframes }) => {\n if (keyframes.length > 2) {\n return keyframesTransition;\n }\n else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring;\n }\n return ease;\n};\n\nexport { getDefaultTransition };\n//# sourceMappingURL=default-transitions.mjs.map\n","const orchestrationKeys = new Set([\n \"when\",\n \"delay\",\n \"delayChildren\",\n \"staggerChildren\",\n \"staggerDirection\",\n \"repeat\",\n \"repeatType\",\n \"repeatDelay\",\n \"from\",\n \"elapsed\",\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 */\nfunction isTransitionDefined(transition) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key))\n return true;\n }\n return false;\n}\n\nexport { isTransitionDefined };\n//# sourceMappingURL=is-transition-defined.mjs.map\n","import { secondsToMilliseconds, MotionGlobalConfig } from 'motion-utils';\nimport { AsyncMotionValueAnimation } from '../AsyncMotionValueAnimation.mjs';\nimport { JSAnimation } from '../JSAnimation.mjs';\nimport { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { makeAnimationInstant } from '../utils/make-animation-instant.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { getFinalKeyframe } from '../keyframes/get-final.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\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 * 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 const options = {\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 hasOnUpdate: !!valueTransition.onUpdate,\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 * 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 && (options.duration = secondsToMilliseconds(options.duration));\n options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay));\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n makeAnimationInstant(options);\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations) {\n shouldSkip = true;\n makeAnimationInstant(options);\n options.delay = 0;\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 * 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(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n return;\n }\n }\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options);\n};\n\nexport { animateMotionValue };\n//# sourceMappingURL=motion-value.mjs.map\n","import { invariant, isNumericalString } from 'motion-utils';\nimport { isCSSVariableToken } from './is-css-variable.mjs';\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 */\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;\nfunction parseCSSVariable(current) {\n const match = splitCSSVariableRegex.exec(current);\n if (!match)\n return [,];\n const [, token1, token2, fallback] = match;\n return [`--${token1 ?? token2}`, fallback];\n}\nconst maxDepth = 4;\nfunction getVariableValue(current, element, depth = 1) {\n invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`, \"max-css-var-depth\");\n const [token, fallback] = parseCSSVariable(current);\n // No CSS variable detected\n if (!token)\n return;\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token);\n if (resolved) {\n const trimmed = resolved.trim();\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;\n }\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback;\n}\n\nexport { getVariableValue, parseCSSVariable };\n//# sourceMappingURL=css-variables-conversion.mjs.map\n","function getValueState(visualElement) {\n const state = [{}, {}];\n visualElement?.values.forEach((value, key) => {\n state[0][key] = value.get();\n state[1][key] = value.getVelocity();\n });\n return state;\n}\nfunction resolveVariantFromProps(props, definition, custom, visualElement) {\n const resolveFunction = (def) => typeof def === \"function\"\n ? def(custom !== undefined ? custom : props.custom, ...getValueState(visualElement))\n : def;\n /**\n * Resolve a function, then a variant label (which the function may have\n * returned), then a function again as the label may point to one. The\n * final function can only return a target object.\n */\n definition = resolveFunction(definition);\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition];\n }\n return resolveFunction(definition);\n}\n\nexport { resolveVariantFromProps };\n//# sourceMappingURL=resolve-variants.mjs.map\n","import { resolveVariantFromProps } from './resolve-variants.mjs';\n\nfunction resolveVariant(visualElement, definition, custom) {\n return resolveVariantFromProps(visualElement.getProps(), definition, custom, visualElement);\n}\n/**\n * Exit variants resolve with AnimatePresence's custom, every other type\n * with the element's own.\n */\nconst getTypeCustom = (visualElement, type) => type === \"exit\" ? visualElement.presenceContext?.custom : undefined;\n\nexport { getTypeCustom, resolveVariant };\n//# sourceMappingURL=resolve-dynamic-variants.mjs.map\n","import { transformPropOrder } from './keys-transform.mjs';\n\nconst positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n]);\n\nexport { positionalKeys };\n//# sourceMappingURL=keys-position.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { resolveVariant } from './resolve-dynamic-variants.mjs';\nimport { isKeyframesTarget } from './is-keyframes-target.mjs';\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(visualElement, key, value) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key).set(value);\n }\n else {\n visualElement.addValue(key, motionValue(value));\n }\n}\nfunction resolveFinalValueInKeyframes(v) {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;\n}\nfunction setTarget(visualElement, definition) {\n const resolved = resolveVariant(visualElement, definition);\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {};\n target = { ...target, ...transitionEnd };\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(target[key]);\n setMotionValue(visualElement, key, value);\n }\n}\n\nexport { setTarget };\n//# sourceMappingURL=setters.mjs.map\n","const isKeyframesTarget = (v) => {\n return Array.isArray(v);\n};\n\nexport { isKeyframesTarget };\n//# sourceMappingURL=is-keyframes-target.mjs.map\n","const isMotionValue = (value) => Boolean(value && value.getVelocity);\n\nexport { isMotionValue };\n//# sourceMappingURL=is-motion-value.mjs.map\n","import { MotionGlobalConfig } from 'motion-utils';\nimport { isWillChangeMotionValue } from './is.mjs';\n\nfunction addValueToWillChange(visualElement, key) {\n const willChange = visualElement.getValue(\"willChange\");\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 }\n else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\");\n visualElement.addValue(\"willChange\", newWillChange);\n newWillChange.add(key);\n }\n}\n\nexport { addValueToWillChange };\n//# sourceMappingURL=add-will-change.mjs.map\n","import { isMotionValue } from '../utils/is-motion-value.mjs';\n\nfunction isWillChangeMotionValue(value) {\n return Boolean(isMotionValue(value) && value.add);\n}\n\nexport { isWillChangeMotionValue };\n//# sourceMappingURL=is.mjs.map\n","function camelToDash(str) {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);\n}\n\nexport { camelToDash };\n//# sourceMappingURL=camel-to-dash.mjs.map\n","import { camelToDash } from '../../render/dom/utils/camel-to-dash.mjs';\n\nconst optimizedAppearDataId = \"framerAppearId\";\nconst optimizedAppearDataAttribute = \"data-\" + camelToDash(optimizedAppearDataId);\n\nexport { optimizedAppearDataAttribute, optimizedAppearDataId };\n//# sourceMappingURL=data-id.mjs.map\n","import { optimizedAppearDataAttribute } from './data-id.mjs';\n\nfunction getOptimisedAppearId(visualElement) {\n return visualElement.props[optimizedAppearDataAttribute];\n}\n\nexport { getOptimisedAppearId };\n//# sourceMappingURL=get-appear-id.mjs.map\n","import { getValueTransition } from '../utils/get-value-transition.mjs';\nimport { resolveTransition } from '../utils/resolve-transition.mjs';\nimport { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\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({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = key in protectedKeys && !needsAnimating[key];\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n let { transition, transitionEnd, ...target } = targetAndTransition;\n const defaultTransition = visualElement.getDefaultTransition();\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition;\n const reduceMotion = transition?.reduceMotion;\n const skipAnimations = transition?.skipAnimations;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type && visualElement.animationState?.getState()[type];\n const path = transition?.path;\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateValues\n ? path.animateValues((key) => visualElement.getValue(key, visualElement.latestValues[key] ?? 0), target, transition, delay, animations)\n : path.animateVisualElement?.(visualElement, target, transition, delay, animations);\n }\n for (const key in target) {\n const value = visualElement.getValue(key, visualElement.latestValues[key] ?? null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n if (skipAnimations)\n valueTransition.skipAnimations = true;\n /**\n * If the value is already at the defined target, skip the animation.\n * We still re-assert the value via frame.update to take precedence\n * over any stale transitionEnd callbacks from previous animations.\n */\n const currentValue = value.get();\n if (currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity) {\n frame.update(() => value.set(valueTarget));\n continue;\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 (isBrowser && window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n const shouldReduceMotion = reduceMotion ?? visualElement.shouldReduceMotion;\n value.start(animateMotionValue(key, value, valueTarget, shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n const applyTransitionEnd = () => frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd);\n }\n else {\n applyTransitionEnd();\n }\n }\n return animations;\n}\n\nexport { animateTarget };\n//# sourceMappingURL=visual-element-target.mjs.map\n","import { resolveVariant, getTypeCustom } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { calcChildStagger } from '../utils/calc-child-stagger.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n const resolved = resolveVariant(visualElement, variant, getTypeCustom(visualElement, options.type));\n const transition = options.transitionOverride ||\n (resolved?.transition ?? (visualElement.getDefaultTransition() || {}));\n const getAnimation = () => Promise.all(resolved ? animateTarget(visualElement, resolved, options) : []);\n const getChildAnimations = (delay = 0) => {\n const { variantChildren } = visualElement;\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n const animations = [];\n variantChildren?.forEach((child) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delay +\n (typeof delayChildren === \"function\"\n ? 0\n : delayChildren) +\n calcChildStagger(variantChildren, child, delayChildren, staggerChildren, staggerDirection),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n };\n /**\n * when: \"beforeChildren\" | \"afterChildren\" runs this element's animation\n * and its children's in sequence.\n */\n const { when } = transition;\n return when\n ? when === \"beforeChildren\"\n ? getAnimation().then(() => getChildAnimations())\n : getChildAnimations().then(getAnimation)\n : Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n}\n\nexport { animateVariant };\n//# sourceMappingURL=visual-element-variant.mjs.map\n","/**\n * ValueType for \"auto\"\n */\nconst auto = {\n test: (v) => v === \"auto\",\n parse: (v) => v,\n};\n\nexport { auto };\n//# sourceMappingURL=auto.mjs.map\n","import { auto } from './auto.mjs';\nimport { number } from './numbers/index.mjs';\nimport { px, percent, degrees, vw, vh } from './numbers/units.mjs';\nimport { testValueType } from './test.mjs';\n\n/**\n * A list of value types commonly used for dimensions\n */\nconst dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto];\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nconst findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));\n\nexport { dimensionValueTypes, findDimensionValueType };\n//# sourceMappingURL=dimensions.mjs.map\n","/**\n * Tests a provided value against a ValueType\n */\nconst testValueType = (v) => (type) => type.test(v);\n\nexport { testValueType };\n//# sourceMappingURL=test.mjs.map\n","import { isZeroValueString } from 'motion-utils';\n\nfunction isNone(value) {\n if (typeof value === \"number\") {\n return value === 0;\n }\n else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value);\n }\n else {\n return true;\n }\n}\n\nexport { isNone };\n//# sourceMappingURL=is-none.mjs.map\n","import { hasComplexValues } from '../../../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../../../value/types/utils/animatable-none.mjs';\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\"]);\nfunction makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) {\n let i = 0;\n let animatableTemplate = undefined;\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i];\n if (typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n hasComplexValues(keyframe)) {\n animatableTemplate = unresolvedKeyframes[i];\n }\n i++;\n }\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n /**\n * A zero-valued template like \"0%\" is already its own\n * animatable none, so there's nothing to derive.\n */\n if (unresolvedKeyframes[noneIndex] === animatableTemplate)\n continue;\n unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);\n }\n }\n}\n\nexport { makeNoneKeyframesAnimatable };\n//# sourceMappingURL=make-none-animatable.mjs.map\n","import { positionalKeys } from '../../render/utils/keys-position.mjs';\nimport { findDimensionValueType } from '../../value/types/dimensions.mjs';\nimport { getVariableValue } from '../utils/css-variables-conversion.mjs';\nimport { containsCSSVariable, isCSSVariableToken } from '../utils/is-css-variable.mjs';\nimport { KeyframeResolver } from './KeyframesResolver.mjs';\nimport { isNone } from './utils/is-none.mjs';\nimport { makeNoneKeyframesAnimatable } from './utils/make-none-animatable.mjs';\nimport { positionalValues, isNumOrPxType } from './utils/unit-conversion.mjs';\n\nclass DOMKeyframesResolver extends KeyframeResolver {\n constructor(unresolvedKeyframes, onComplete, name, motionValue, element) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true);\n }\n /**\n * Keyframes that don't need reading from the DOM, or measuring,\n * resolve straight away rather than in the frame loop's batched read.\n */\n scheduleResolve() {\n if (this.canReadNow()) {\n this.readKeyframes();\n if (!this.needsMeasurement)\n return this.complete();\n }\n super.scheduleResolve();\n }\n canReadNow() {\n const { unresolvedKeyframes, element, motionValue } = this;\n const origin = unresolvedKeyframes[0] ?? motionValue?.get();\n if (!element?.current || origin === undefined)\n return false;\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (containsCSSVariable(i ? unresolvedKeyframes[i] : origin)) {\n return false;\n }\n }\n return true;\n }\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this;\n if (!element || !element.current)\n return;\n super.readKeyframes();\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 if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim();\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current);\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved;\n }\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe;\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 * 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 const [origin, target] = unresolvedKeyframes;\n // Two numbers share a unit, so skip the value type search.\n if (typeof origin === \"number\" && typeof target === \"number\")\n return;\n const originType = findDimensionValueType(origin);\n const targetType = findDimensionValueType(target);\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 if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true;\n return;\n }\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType)\n return;\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);\n }\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 resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this;\n const noneKeyframeIndexes = [];\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])) {\n noneKeyframeIndexes.push(i);\n }\n }\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name);\n }\n }\n measure() {\n const { element, name } = this;\n return positionalValues[name](window.getComputedStyle(element.current), () => element.measureViewportBox());\n }\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this;\n if (!element || !element.current)\n return;\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset;\n }\n this.measuredOrigin = this.measure();\n unresolvedKeyframes[0] = this.measuredOrigin;\n // Set final key frame to measure after next render\n const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];\n if (measureKeyframe !== undefined) {\n this.motionValue?.jump(measureKeyframe, false);\n }\n }\n measureEndState() {\n const { element, unresolvedKeyframes } = this;\n if (!element || !element.current)\n return;\n this.motionValue?.jump(this.measuredOrigin, false);\n const finalKeyframeIndex = unresolvedKeyframes.length - 1;\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex];\n unresolvedKeyframes[finalKeyframeIndex] = this.measure();\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe;\n }\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)\n .set(unsetTransformValue);\n });\n }\n this.resolveNoneKeyframes();\n }\n}\n\nexport { DOMKeyframesResolver };\n//# sourceMappingURL=DOMKeyframesResolver.mjs.map\n","import { getValueAsType } from '../../../value/types/utils/get-as-type.mjs';\nimport { numberValueTypes } from '../../../value/types/maps/number.mjs';\nimport { transformProps } from '../../utils/keys-transform.mjs';\nimport { isCSSVariableName } from '../../../animation/utils/is-css-variable.mjs';\nimport { buildTransform } from './build-transform.mjs';\n\nfunction buildHTMLStyles(state, latestValues, transformTemplate) {\n const { style, vars, transformOrigin } = state;\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false;\n let hasTransformOrigin = false;\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 if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true;\n continue;\n }\n else if (isCSSVariableName(key)) {\n vars[key] = value;\n continue;\n }\n else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key]);\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] =\n valueAsType;\n }\n else {\n style[key] = valueAsType;\n }\n }\n }\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(latestValues, state.transform, 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 * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const { originX = \"50%\", originY = \"50%\", originZ = 0, } = transformOrigin;\n style.transformOrigin = `${originX} ${originY} ${originZ}`;\n }\n}\n\nexport { buildHTMLStyles };\n//# sourceMappingURL=build-styles.mjs.map\n","const dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n};\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\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 */\nfunction buildSVGPath(attrs, length, spacing = 1, offset = 0, useDashCase = true) {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1;\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 // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`;\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`;\n}\n\nexport { buildSVGPath };\n//# sourceMappingURL=path.mjs.map\n","import { buildHTMLStyles } from '../../html/utils/build-styles.mjs';\nimport { buildSVGPath } from './path.mjs';\n\n/**\n * Values rendered via style rather than as attributes. This must include\n * every value WAAPI can accelerate, as WAAPI writes its final value to\n * style, which would otherwise override later attribute writes.\n */\nconst cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n];\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nfunction buildSVGAttrs(state, { attrX, attrY, attrScale, pathLength, pathSpacing = 1, pathOffset = 0, \n// This is object creation, which we try to avoid per-frame.\n...latest }, isSVGTag, transformTemplate, styleProp) {\n buildHTMLStyles(state, latest, transformTemplate);\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 state.attrs = state.style;\n state.style = {};\n const { attrs, style } = state;\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key];\n delete attrs[key];\n }\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\";\n delete attrs.transformOrigin;\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 ?? \"fill-box\";\n delete attrs.transformBox;\n }\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined)\n attrs.x = attrX;\n if (attrY !== undefined)\n attrs.y = attrY;\n if (attrScale !== undefined)\n attrs.scale = attrScale;\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);\n }\n}\n\nexport { buildSVGAttrs, cssStyleProperties };\n//# sourceMappingURL=build-attrs.mjs.map\n","import { createRenderBatcher } from './batcher.mjs';\n\nconst { schedule: microtask, cancel: cancelMicrotask } = \n/* @__PURE__ */ createRenderBatcher(queueMicrotask, false);\n\nexport { cancelMicrotask, microtask };\n//# sourceMappingURL=microtask.mjs.map\n","const isDragging = {\n x: false,\n y: false,\n};\nfunction isDragActive() {\n return isDragging.x || isDragging.y;\n}\n\nexport { isDragActive, isDragging };\n//# sourceMappingURL=is-active.mjs.map\n","import { resolveElements } from '../../utils/resolve-elements.mjs';\n\nfunction setupGesture(elementOrSelector, options) {\n const elements = resolveElements(elementOrSelector);\n const gestureAbortController = new AbortController();\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n };\n const cancel = () => gestureAbortController.abort();\n return [elements, eventOptions, cancel];\n}\n\nexport { setupGesture };\n//# sourceMappingURL=setup.mjs.map\n","function resolveElements(elementOrSelector, scope, selectorCache) {\n if (elementOrSelector == null) {\n return [];\n }\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector];\n }\n else if (typeof elementOrSelector === \"string\") {\n let root = document;\n if (scope) {\n root = scope.current;\n }\n const elements = selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector);\n return elements ? Array.from(elements) : [];\n }\n return Array.from(elementOrSelector).filter((element) => element != null);\n}\n\nexport { resolveElements };\n//# sourceMappingURL=resolve-elements.mjs.map\n","import { isDragActive } from './drag/state/is-active.mjs';\nimport { setupGesture } from './utils/setup.mjs';\n\nfunction isValidHover(event) {\n return !(event.pointerType === \"touch\" || isDragActive());\n}\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerleave\" event listener when the hover ends.\n *\n * @public\n */\nfunction hover(elementOrSelector, onHoverStart, options = {}) {\n const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);\n elements.forEach((element) => {\n let isPressed = false;\n let deferredHoverEnd = false;\n let hoverEndCallback;\n const removePointerLeave = () => {\n element.removeEventListener(\"pointerleave\", onPointerLeave);\n };\n const endHover = (event) => {\n if (hoverEndCallback) {\n hoverEndCallback(event);\n hoverEndCallback = undefined;\n }\n removePointerLeave();\n };\n const onPointerUp = (event) => {\n isPressed = false;\n window.removeEventListener(\"pointerup\", onPointerUp);\n window.removeEventListener(\"pointercancel\", onPointerUp);\n if (deferredHoverEnd) {\n deferredHoverEnd = false;\n endHover(event);\n }\n };\n const onPointerDown = () => {\n isPressed = true;\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions);\n window.addEventListener(\"pointercancel\", onPointerUp, eventOptions);\n };\n const onPointerLeave = (leaveEvent) => {\n if (leaveEvent.pointerType === \"touch\")\n return;\n if (isPressed) {\n deferredHoverEnd = true;\n return;\n }\n endHover(leaveEvent);\n };\n const onPointerEnter = (enterEvent) => {\n if (!isValidHover(enterEvent))\n return;\n deferredHoverEnd = false;\n const onHoverEnd = onHoverStart(element, enterEvent);\n if (typeof onHoverEnd !== \"function\")\n return;\n hoverEndCallback = onHoverEnd;\n element.addEventListener(\"pointerleave\", onPointerLeave, eventOptions);\n };\n element.addEventListener(\"pointerenter\", onPointerEnter, eventOptions);\n element.addEventListener(\"pointerdown\", onPointerDown, eventOptions);\n });\n return cancel;\n}\n\nexport { hover };\n//# sourceMappingURL=hover.mjs.map\n","/**\n * Recursively traverse up the tree to check whether the provided child node\n * is the parent or a descendant of it.\n *\n * @param parent - Element to find\n * @param child - Element to test against parent\n */\nconst isNodeOrChild = (parent, child) => {\n if (!child) {\n return false;\n }\n else if (parent === child) {\n return true;\n }\n else {\n return isNodeOrChild(parent, child.parentElement);\n }\n};\n\nexport { isNodeOrChild };\n//# sourceMappingURL=is-node-or-child.mjs.map\n","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n]);\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nfunction isElementKeyboardAccessible(element) {\n return (keyboardAccessibleElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"]);\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nfunction isElementTextInput(element) {\n return (textInputElements.has(element.tagName) ||\n element.isContentEditable === true);\n}\n\nexport { isElementKeyboardAccessible, isElementTextInput };\n//# sourceMappingURL=is-keyboard-accessible.mjs.map\n","const isPressing = new WeakSet();\n\nexport { isPressing };\n//# sourceMappingURL=state.mjs.map\n","import { isPressing } from './state.mjs';\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback) {\n return (event) => {\n if (event.key !== \"Enter\")\n return;\n callback(event);\n };\n}\nfunction firePointerEvent(target, type) {\n target.dispatchEvent(new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true }));\n}\nconst enableKeyboardPress = (focusEvent, eventOptions) => {\n const element = focusEvent.currentTarget;\n if (!element)\n return;\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element))\n return;\n firePointerEvent(element, \"down\");\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\");\n });\n const handleBlur = () => firePointerEvent(element, \"cancel\");\n element.addEventListener(\"keyup\", handleKeyup, eventOptions);\n element.addEventListener(\"blur\", handleBlur, eventOptions);\n });\n element.addEventListener(\"keydown\", handleKeydown, eventOptions);\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\"blur\", () => element.removeEventListener(\"keydown\", handleKeydown), eventOptions);\n};\n\nexport { enableKeyboardPress };\n//# sourceMappingURL=keyboard.mjs.map\n","import { isHTMLElement } from '../../utils/is-html-element.mjs';\nimport { isDragActive } from '../drag/state/is-active.mjs';\nimport { isNodeOrChild } from '../utils/is-node-or-child.mjs';\nimport { isPrimaryPointer } from '../utils/is-primary-pointer.mjs';\nimport { setupGesture } from '../utils/setup.mjs';\nimport { isElementKeyboardAccessible } from './utils/is-keyboard-accessible.mjs';\nimport { enableKeyboardPress } from './utils/keyboard.mjs';\nimport { isPressing } from './utils/state.mjs';\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event) {\n return isPrimaryPointer(event) && !isDragActive();\n}\nconst claimedPointerDownEvents = new WeakSet();\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nfunction press(targetOrSelector, onPressStart, options = {}) {\n const [targets, eventOptions, cancelEvents] = setupGesture(targetOrSelector, options);\n const startPress = (startEvent) => {\n const target = startEvent.currentTarget;\n if (!isValidPressEvent(startEvent))\n return;\n if (claimedPointerDownEvents.has(startEvent))\n return;\n isPressing.add(target);\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent);\n }\n const onPressEnd = onPressStart(target, startEvent);\n /**\n * End listeners run in the capture phase so a descendant calling\n * stopPropagation() in its own pointerup handler can't prevent the\n * press gesture from ending. This also keeps the gesture-end\n * ordering consistent with the drag gesture. See #2794.\n */\n const endEventOptions = { ...eventOptions, capture: true };\n const onPointerEnd = (endEvent, success) => {\n window.removeEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.removeEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n if (isPressing.has(target)) {\n isPressing.delete(target);\n }\n if (!isValidPressEvent(endEvent)) {\n return;\n }\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success });\n }\n };\n const onPointerUp = (upEvent) => {\n onPointerEnd(upEvent, target === window ||\n target === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target));\n };\n const onPointerCancel = (cancelEvent) => {\n onPointerEnd(cancelEvent, false);\n };\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions);\n window.addEventListener(\"pointercancel\", onPointerCancel, endEventOptions);\n };\n targets.forEach((target) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target;\n pointerDownTarget.addEventListener(\"pointerdown\", startPress, eventOptions);\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) => enableKeyboardPress(event, eventOptions));\n if (!isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")) {\n target.tabIndex = 0;\n }\n }\n });\n return cancelEvents;\n}\n\nexport { press };\n//# sourceMappingURL=index.mjs.map\n","const isPrimaryPointer = (event) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0;\n }\n else {\n /**\n * isPrimary is true for all mice buttons, whereas every touch point\n * is regarded as its own input. So subsequent concurrent touch points\n * will be false.\n *\n * Specifically match against false here as incomplete versions of\n * PointerEvents in very old browser might have it set as undefined.\n */\n return event.isPrimary !== false;\n }\n};\n\nexport { isPrimaryPointer };\n//# sourceMappingURL=is-primary-pointer.mjs.map\n","import { isObject } from 'motion-utils';\n\n/**\n * Checks if an element is an HTML element in a way\n * that works across iframes\n */\nfunction isHTMLElement(element) {\n return (isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element));\n}\n\nexport { isHTMLElement };\n//# sourceMappingURL=is-html-element.mjs.map\n","const isObject = (value) => typeof value === \"object\" && value !== null;\n\nexport { isObject };\n//# sourceMappingURL=is-object.mjs.map\n","const createAxisDelta = () => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n});\nconst createDelta = () => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n});\nconst createAxis = () => ({ min: 0, max: 0 });\nconst createBox = () => ({\n x: createAxis(),\n y: createAxis(),\n});\n\nexport { createAxis, createAxisDelta, createBox, createDelta };\n//# sourceMappingURL=models.mjs.map\n","const visualElementStore = new WeakMap();\n\nexport { visualElementStore };\n//# sourceMappingURL=store.mjs.map\n","function isAnimationControls(v) {\n return (v !== null &&\n typeof v === \"object\" &&\n typeof v.start === \"function\");\n}\n\nexport { isAnimationControls };\n//# sourceMappingURL=is-animation-controls.mjs.map\n","/**\n * Decides if the supplied variable is variant label\n */\nfunction isVariantLabel(v) {\n return typeof v === \"string\" || Array.isArray(v);\n}\n\nexport { isVariantLabel };\n//# sourceMappingURL=is-variant-label.mjs.map\n","const variantPriorityOrder = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n];\nconst variantProps = [\"initial\", ...variantPriorityOrder];\n\nexport { variantPriorityOrder, variantProps };\n//# sourceMappingURL=variant-props.mjs.map\n","import { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { variantProps } from './variant-props.mjs';\n\nfunction isControllingVariants(props) {\n if (isAnimationControls(props.animate))\n return true;\n for (let i = 0; i < variantProps.length; i++) {\n if (isVariantLabel(props[variantProps[i]])) {\n return true;\n }\n }\n return false;\n}\nfunction isVariantNode(props) {\n return Boolean(isControllingVariants(props) || props.variants);\n}\n\nexport { isControllingVariants, isVariantNode };\n//# sourceMappingURL=is-controlling-variants.mjs.map\n","// Does this device prefer reduced motion? Returns `null` server-side.\nconst prefersReducedMotion = { current: null };\nconst hasReducedMotionListener = { current: false };\n\nexport { hasReducedMotionListener, prefersReducedMotion };\n//# sourceMappingURL=state.mjs.map\n","import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction initPrefersReducedMotion() {\n hasReducedMotionListener.current = true;\n if (!isBrowser)\n return;\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\");\n const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences);\n setReducedMotionPreferences();\n }\n else {\n prefersReducedMotion.current = false;\n }\n}\n\nexport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };\n//# sourceMappingURL=index.mjs.map\n","import { warnOnce, secondsToMilliseconds, isNumericalString, isZeroValueString, SubscriptionManager } from 'motion-utils';\nimport { KeyframeResolver } from '../animation/keyframes/KeyframesResolver.mjs';\nimport { NativeAnimation } from '../animation/NativeAnimation.mjs';\nimport { acceleratedValues } from '../animation/waapi/utils/accelerated-values.mjs';\nimport { transformGroups } from '../animation/waapi/transforms/groups.mjs';\nimport { microtask } from '../frameloop/microtask.mjs';\nimport { time } from '../frameloop/sync-time.mjs';\nimport { createBox } from '../projection/geometry/models.mjs';\nimport { motionValue } from '../value/index.mjs';\nimport { complex } from '../value/types/complex/index.mjs';\nimport { getAnimatableNone } from '../value/types/utils/animatable-none.mjs';\nimport { isMotionValue } from '../value/utils/is-motion-value.mjs';\nimport { visualElementStore } from './store.mjs';\nimport { isControllingVariants, isVariantNode } from './utils/is-controlling-variants.mjs';\nimport { transformProps } from './utils/keys-transform.mjs';\nimport { updateMotionValuesFromProps } from './utils/motion-values.mjs';\nimport { initPrefersReducedMotion } from './utils/reduced-motion/index.mjs';\nimport { hasReducedMotionListener, prefersReducedMotion } from './utils/reduced-motion/state.mjs';\nimport { frame, cancelFrame } from '../frameloop/frame.mjs';\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n];\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions = {};\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nfunction setFeatureDefinitions(definitions) {\n featureDefinitions = definitions;\n}\n/**\n * Get the current feature definitions\n */\nfunction getFeatureDefinitions() {\n return featureDefinitions;\n}\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nclass VisualElement {\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(_props, _prevProps, _visualElement) {\n return {};\n }\n constructor({ parent, props, presenceContext, reducedMotionConfig, skipAnimations, blockInitialAnimation, visualState, }, options = {}) {\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n this.current = null;\n /**\n * A set containing references to this VisualElement's children.\n */\n this.children = new Set();\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n this.isVariantNode = false;\n this.isControllingVariants = false;\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 this.shouldReduceMotion = null;\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n this.shouldSkipAnimations = false;\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 this.values = new Map();\n this.KeyframeResolver = KeyframeResolver;\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n this.features = {};\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n this.valueSubscriptions = new Map();\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 this.prevMotionValues = {};\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n this.hasBeenMounted = false;\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n this.events = {};\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 this.propEventSubscriptions = {};\n this.notifyUpdate = () => this.notify(\"Update\", this.latestValues);\n this.render = () => {\n if (!this.current)\n return;\n this.triggerBuild();\n this.renderInstance(this.current, this.renderState, this.props.style, this.projection);\n };\n this.renderScheduledAt = 0.0;\n this.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 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.skipAnimationsConfig = skipAnimations;\n this.options = options;\n this.blockInitialAnimation = Boolean(blockInitialAnimation);\n this.isControllingVariants = isControllingVariants(props);\n this.isVariantNode = isVariantNode(props);\n if (this.isVariantNode) {\n this.variantChildren = new Set();\n }\n this.manuallyAnimateOnMount = Boolean(parent && parent.current);\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 } = this.scrapeMotionValuesFromProps(props, {}, this);\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key];\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key]);\n }\n }\n }\n mount(instance) {\n /**\n * If this element has been mounted before (e.g. after a Suspense\n * unmount/remount), reset motion values to their initial state\n * so animations replay correctly from initial → animate.\n */\n if (this.hasBeenMounted) {\n for (const key in this.initialValues) {\n this.values.get(key)?.jump(this.initialValues[key]);\n this.latestValues[key] = this.initialValues[key];\n }\n }\n this.current = instance;\n visualElementStore.set(instance, this);\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance);\n }\n /**\n * Join the closest variant node above, so its variant changes\n * propagate here, unless inherit={false} cuts the chain.\n */\n if (this.isVariantNode && !this.isControllingVariants) {\n let node = this;\n do\n node = node.props.inherit !== false && node.parent;\n while (node && !node.isVariantNode);\n if (node) {\n const { variantChildren } = node;\n variantChildren.add(this);\n this.removeFromVariantTree = () => variantChildren.delete(this);\n }\n }\n this.values.forEach((value, key) => this.bindToMotionValue(key, value));\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 }\n else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true;\n }\n else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion();\n }\n this.shouldReduceMotion = prefersReducedMotion.current;\n }\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(this.shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false;\n this.parent?.addChild(this);\n this.update(this.props, this.presenceContext);\n this.hasBeenMounted = true;\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 for (const key in this.events) {\n this.events[key].clear();\n }\n for (const key in this.features) {\n const feature = this.features[key];\n if (feature) {\n feature.unmount();\n feature.isMounted = false;\n }\n }\n this.current = null;\n }\n addChild(child) {\n this.children.add(child);\n this.enteringChildren ?? (this.enteringChildren = new Set());\n this.enteringChildren.add(child);\n }\n removeChild(child) {\n this.children.delete(child);\n this.enteringChildren && this.enteringChildren.delete(child);\n }\n bindToMotionValue(key, value) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)();\n }\n if (value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement) {\n const { factory, keyframes, times, ease, duration } = value.accelerate;\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n });\n const cleanup = factory(animation);\n this.valueSubscriptions.set(key, () => {\n cleanup();\n animation.cancel();\n });\n return;\n }\n const valueIsTransform = transformProps.has(key);\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform();\n }\n const removeOnChange = value.on(\"change\", (latestValue) => {\n this.latestValues[key] = latestValue;\n this.props.onUpdate && frame.preRender(this.notifyUpdate);\n if (valueIsTransform) {\n if (this.projection) {\n this.projection.isTransformDirty = true;\n }\n transformGroups.get(this.current)?.check();\n }\n this.scheduleRender();\n });\n let removeSyncCheck;\n if (typeof window !== \"undefined\" &&\n window.MotionCheckAppearSync) {\n removeSyncCheck = window.MotionCheckAppearSync(this, key, value);\n }\n this.valueSubscriptions.set(key, () => {\n removeOnChange();\n if (removeSyncCheck)\n removeSyncCheck();\n // Defer to MotionValue.on(\"change\") auto-stop so React 19 remounts\n // can resubscribe before the animation is cancelled (#3315).\n });\n }\n sortNodePosition(other) {\n /**\n * If either node isn't mounted, or they aren't even of the same type,\n * we can't compare their document order.\n */\n if (!this.current ||\n !other.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type) {\n return 0;\n }\n return this.sortInstanceNodePosition(this.current, other.current);\n }\n updateFeatures() {\n let key = \"animation\";\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key];\n if (!featureDefinition)\n continue;\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition;\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (!this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)) {\n this.features[key] = new FeatureConstructor(this);\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 }\n else {\n feature.mount();\n feature.isMounted = true;\n }\n }\n }\n }\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props);\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 getStaticValue(key) {\n return this.latestValues[key];\n }\n setStaticValue(key, value) {\n this.latestValues[key] = value;\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, presenceContext) {\n const { transformTemplate, onUpdate } = this.props;\n if (props.transformTemplate || transformTemplate) {\n this.scheduleRender();\n }\n /**\n * Transforms on the compositor can't use a new transformTemplate\n * or onUpdate, so move them to the main thread.\n */\n if ((props.transformTemplate && !transformTemplate) ||\n (props.onUpdate && !onUpdate)) {\n transformGroups.get(this.current)?.demote();\n }\n this.prevProps = this.props;\n this.props = props;\n this.prevPresenceContext = this.presenceContext;\n this.presenceContext = presenceContext;\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 const listenerName = (\"on\" + key);\n const listener = props[listenerName];\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key, listener);\n }\n }\n this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this), this.prevMotionValues);\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue();\n }\n }\n getProps() {\n return this.props;\n }\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name) {\n return this.props.variants ? this.props.variants[name] : undefined;\n }\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition;\n }\n getTransformPagePoint() {\n return this.props.transformPagePoint;\n }\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key, value) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key);\n if (value !== existingValue) {\n if (existingValue)\n this.removeValue(key);\n this.bindToMotionValue(key, value);\n this.values.set(key, value);\n /**\n * An animated value with no base value is undefined until the\n * keyframe resolver reads its origin. Rendering it before then\n * writes an invalid placeholder (e.g. points=\"undefined\") that\n * the resolver can read back from the DOM as the origin.\n */\n const latest = value.get();\n if (latest !== undefined)\n this.latestValues[key] = latest;\n }\n }\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key) {\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 * Check whether we have a motion value for this key\n */\n hasValue(key) {\n return this.values.has(key);\n }\n getValue(key, defaultValue) {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key];\n }\n let value = this.values.get(key);\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue ?? this.getDefaultValue?.(key), {\n owner: this,\n });\n this.addValue(key, value);\n }\n return value;\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, target) {\n let value = 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 if (value !== undefined && value !== null) {\n if (typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value);\n }\n else if (\n /**\n * If the value as read isn't animatable (e.g. \"none\") but\n * the target is, derive an animatable none from the target.\n * A value is animatable if it's a number or contains a\n * number or color, which is cheaper to check than trying\n * every value type in turn.\n */\n typeof value !== \"number\" &&\n !complex.test(value) &&\n complex.test(target)) {\n value = getAnimatableNone(key, target);\n }\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value);\n }\n return isMotionValue(value) ? value.get() : value;\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, value) {\n this.baseTarget[key] = value;\n }\n on(eventName, callback) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager();\n }\n return this.events[eventName].add(callback);\n }\n notify(eventName, ...args) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args);\n }\n }\n scheduleRenderMicrotask() {\n microtask.render(this.render);\n }\n}\n\nexport { VisualElement, getFeatureDefinitions, setFeatureDefinitions };\n//# sourceMappingURL=VisualElement.mjs.map\n","import { motionValue } from '../../value/index.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nfunction updateMotionValuesFromProps(element, next, prev) {\n for (const key in next) {\n const nextValue = next[key];\n const prevValue = prev[key];\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 }\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 }\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 if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue);\n }\n else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue);\n }\n }\n else {\n const latestValue = element.getStaticValue(key);\n element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));\n }\n }\n }\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined)\n element.removeValue(key);\n }\n return next;\n}\n\nexport { updateMotionValuesFromProps };\n//# sourceMappingURL=motion-values.mjs.map\n","import { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { DOMKeyframesResolver } from '../../animation/keyframes/DOMKeyframesResolver.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nclass DOMVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.KeyframeResolver = DOMKeyframesResolver;\n }\n sortInstanceNodePosition(a, b) {\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 precedes a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n getBaseTargetFromProps(props, key) {\n const style = props.style;\n return style ? style[key] : undefined;\n }\n removeValueFromRenderState(key, { vars, style }) {\n delete vars[key];\n delete style[key];\n }\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription();\n delete this.childSubscription;\n }\n const { children } = this.props;\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\nexport { DOMVisualElement };\n//# sourceMappingURL=DOMVisualElement.mjs.map\n","/**\n * Feature base class for extending VisualElement functionality.\n * Features are plugins that can be mounted/unmounted to add behavior\n * like gestures, animations, or layout tracking.\n */\nclass Feature {\n constructor(node) {\n this.isMounted = false;\n this.node = node;\n }\n update() { }\n}\n\nexport { Feature };\n//# sourceMappingURL=Feature.mjs.map\n","function renderHTML(element, { style, vars }, styleProp, projection) {\n const elementStyle = element.style;\n let key;\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key] = style[key];\n }\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp);\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]);\n }\n}\n\nexport { renderHTML };\n//# sourceMappingURL=render.mjs.map\n","import { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\n\nconst scaleCorrectors = {};\nfunction addScaleCorrector(correctors) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key];\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true;\n }\n }\n}\n\nexport { addScaleCorrector, scaleCorrectors };\n//# sourceMappingURL=scale-correction.mjs.map\n","import { transformProps } from './keys-transform.mjs';\nimport { scaleCorrectors } from '../../projection/styles/scale-correction.mjs';\nexport { addScaleCorrector } from '../../projection/styles/scale-correction.mjs';\n\nfunction isForcedMotionValue(key, { layout, layoutId }) {\n return (transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\")));\n}\n\nexport { isForcedMotionValue, scaleCorrectors };\n//# sourceMappingURL=is-forced-motion-value.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { isForcedMotionValue } from '../../utils/is-forced-motion-value.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const style = props.style;\n const prevStyle = prevProps?.style;\n const newValues = {};\n if (!style)\n return newValues;\n for (const key in style) {\n if (isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined) {\n newValues[key] = style[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { invariant } from 'motion-utils';\nimport { isCSSVariableName } from '../../animation/utils/is-css-variable.mjs';\nimport { transformProps } from '../utils/keys-transform.mjs';\nimport { defaultTransformValue, readTransformValue } from '../dom/parse-transform.mjs';\nimport { measureViewportBox } from '../../projection/utils/measure.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { buildHTMLStyles } from './utils/build-styles.mjs';\nimport { renderHTML } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nfunction getComputedStyle(element) {\n return window.getComputedStyle(element);\n}\nclass HTMLVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"html\";\n this.renderInstance = renderHTML;\n }\n mount(instance) {\n /**\n * If a custom component forwards its ref to something other than a\n * HTML/SVG element (a class instance, an imperative handle) there's\n * nothing for Motion to style, measure or attach gestures to. #2777\n */\n invariant(Boolean(instance.style), \"motion.create() components must forward their ref to a HTML or SVG element\", \"custom-component-ref\");\n super.mount(instance);\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key);\n }\n else {\n const computedStyle = getComputedStyle(instance);\n const value = (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key]) || 0;\n return typeof value === \"string\" ? value.trim() : value;\n }\n }\n measureInstanceViewportBox(instance, { transformPagePoint }) {\n return measureViewportBox(instance, transformPagePoint);\n }\n build(renderState, latestValues, props) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n}\n\nexport { HTMLVisualElement, getComputedStyle };\n//# sourceMappingURL=HTMLVisualElement.mjs.map\n","import { convertBoundingBoxToBox, transformBoxPoints } from '../geometry/conversion.mjs';\nimport { translateAxis } from '../geometry/delta-apply.mjs';\n\nfunction measureViewportBox(instance, transformPoint) {\n return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint));\n}\nfunction measurePageBox(element, rootProjectionNode, transformPagePoint) {\n const viewportBox = measureViewportBox(element, transformPagePoint);\n const { scroll } = rootProjectionNode;\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x);\n translateAxis(viewportBox.y, scroll.offset.y);\n }\n return viewportBox;\n}\n\nexport { measurePageBox, measureViewportBox };\n//# sourceMappingURL=measure.mjs.map\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 */\nfunction convertBoundingBoxToBox({ top, left, right, bottom, }) {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n };\n}\nfunction convertBoxToBoundingBox({ x, y }) {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min };\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 */\nfunction transformBoxPoints(point, transformPoint) {\n if (!transformPoint)\n return point;\n const topLeft = transformPoint({ x: point.left, y: point.top });\n const bottomRight = transformPoint({ x: point.right, y: point.bottom });\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n}\n\nexport { convertBoundingBoxToBox, convertBoxToBoundingBox, transformBoxPoints };\n//# sourceMappingURL=conversion.mjs.map\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nconst 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\nexport { camelCaseAttributes };\n//# sourceMappingURL=camel-case-attrs.mjs.map\n","const isSVGTag = (tag) => typeof tag === \"string\" && tag.toLowerCase() === \"svg\";\n\nexport { isSVGTag };\n//# sourceMappingURL=is-svg-tag.mjs.map\n","import { isMotionValue } from '../../../value/utils/is-motion-value.mjs';\nimport { transformPropOrder } from '../../utils/keys-transform.mjs';\nimport { scrapeMotionValuesFromProps as scrapeMotionValuesFromProps$1 } from '../../html/utils/scrape-motion-values.mjs';\n\nfunction scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);\n for (const key in props) {\n /**\n * A MotionValue child is rendered as text content by\n * DOMVisualElement, so it mustn't also be written as an attribute.\n */\n if (key !== \"children\" &&\n (isMotionValue(props[key]) ||\n isMotionValue(prevProps[key]))) {\n const targetKey = transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key;\n newValues[targetKey] = props[key];\n }\n }\n return newValues;\n}\n\nexport { scrapeMotionValuesFromProps };\n//# sourceMappingURL=scrape-motion-values.mjs.map\n","import { transformProps } from '../utils/keys-transform.mjs';\nimport { getDefaultValueType } from '../../value/types/maps/defaults.mjs';\nimport { createBox } from '../../projection/geometry/models.mjs';\nimport { DOMVisualElement } from '../dom/DOMVisualElement.mjs';\nimport { defaultTransformValue } from '../dom/parse-transform.mjs';\nimport { camelToDash } from '../dom/utils/camel-to-dash.mjs';\nimport { cssStyleProperties, buildSVGAttrs } from './utils/build-attrs.mjs';\nimport { camelCaseAttributes } from './utils/camel-case-attrs.mjs';\nimport { isSVGTag } from './utils/is-svg-tag.mjs';\nimport { renderSVG } from './utils/render.mjs';\nimport { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.mjs';\n\nclass SVGVisualElement extends DOMVisualElement {\n constructor() {\n super(...arguments);\n this.type = \"svg\";\n this.isSVGTag = false;\n this.measureInstanceViewportBox = createBox;\n }\n getBaseTargetFromProps(props, key) {\n /**\n * An independent transform's base is never an attribute of the same\n * name, e.g. is a position, not a translate. Like HTML it\n * comes from style, falling back to the transform's default.\n */\n return transformProps.has(key)\n ? super.getBaseTargetFromProps(props, key) ??\n defaultTransformValue(key)\n : props[key];\n }\n /**\n * An independent transform's origin is never read from the DOM, so it\n * starts from its latest or default value and renders on mount.\n */\n getDefaultValue(key) {\n return transformProps.has(key)\n ? this.latestValues[key] ?? defaultTransformValue(key)\n : undefined;\n }\n readValueFromInstance(instance, key) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key);\n return defaultType ? defaultType.default || 0 : 0;\n }\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance);\n const value = computedStyle[key];\n if (typeof value === \"string\" && value)\n return value.trim();\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;\n return instance.getAttribute(key);\n }\n scrapeMotionValuesFromProps(props, prevProps, visualElement) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement);\n }\n build(renderState, latestValues, props) {\n buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate, props.style);\n }\n renderInstance(instance, renderState, styleProp, projection) {\n renderSVG(instance, renderState, styleProp, projection);\n }\n mount(instance) {\n this.isSVGTag = isSVGTag(instance.tagName);\n super.mount(instance);\n }\n}\n\nexport { SVGVisualElement };\n//# sourceMappingURL=SVGVisualElement.mjs.map\n","import { camelToDash } from '../../dom/utils/camel-to-dash.mjs';\nimport { renderHTML } from '../../html/utils/render.mjs';\nimport { camelCaseAttributes } from './camel-case-attrs.mjs';\n\nfunction renderSVG(element, renderState, _styleProp, projection) {\n renderHTML(element, renderState, undefined, projection);\n for (const key in renderState.attrs) {\n element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);\n }\n}\n\nexport { renderSVG };\n//# sourceMappingURL=render.mjs.map\n","function shallowCompare(next, prev) {\n if (!Array.isArray(prev))\n return false;\n const prevLength = prev.length;\n if (prevLength !== next.length)\n return false;\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i])\n return false;\n }\n return true;\n}\n\nexport { shallowCompare };\n//# sourceMappingURL=shallow-compare.mjs.map\n","import { animateVisualElement } from '../../animation/interfaces/visual-element.mjs';\nimport { calcChildStagger } from '../../animation/utils/calc-child-stagger.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { isAnimationControls } from './is-animation-controls.mjs';\nimport { isVariantLabel } from './is-variant-label.mjs';\nimport { resolveVariant, getTypeCustom } from './resolve-dynamic-variants.mjs';\nimport { shallowCompare } from './shallow-compare.mjs';\nimport { variantPriorityOrder } from './variant-props.mjs';\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse();\n/**\n * Diffs the element's animation props (one layer per AnimationType, highest\n * priority wins each value) against the previous call and starts animations\n * for what changed.\n *\n * Uses `any` type for visualElement to avoid circular dependencies. It reads\n * props, parent, presenceContext, variantChildren, enteringChildren,\n * manuallyAnimateOnMount, blockInitialAnimation, getValue(),\n * getBaseTargetFromProps(), baseTarget and initialValues.\n */\nfunction createAnimationState(visualElement) {\n let animate = (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));\n let state = createState();\n let isInitialRender = true;\n /**\n * After a reset (StrictMode, Suspense, AnimatePresence re-entry) the next\n * animateChanges() mounts again, but initial={false} no longer applies.\n */\n let wasReset = false;\n function animateChanges(changedActiveType) {\n const { props, parent, manuallyAnimateOnMount } = visualElement;\n const isMounting = isInitialRender || wasReset;\n const animations = [];\n /**\n * Values removed from a type. A lower-priority type that defines\n * them animates them back, otherwise they fall back to a base target.\n */\n const removedKeys = new Set();\n /**\n * Values claimed by active, higher-priority types.\n */\n let encounteredKeys = {};\n /**\n * Once a type has been deactivated, lower-priority variant labels\n * re-animate so variant children animate back too.\n */\n let removedVariantIndex = Infinity;\n /**\n * Variant labels are inherited from the closest variant-controlling\n * ancestor, unless an element on the way has inherit={false}.\n */\n let source = visualElement;\n do\n source = source.props.inherit !== false && source.parent;\n while (source && !source.isControllingVariants);\n reversePriorityOrder.forEach((type, i) => {\n const typeState = state[type];\n const ownProp = props[type];\n const inheritedProp = source && source.props[type];\n const prop = ownProp !== undefined\n ? ownProp\n : isVariantLabel(inheritedProp) || inheritedProp === false\n ? inheritedProp\n : undefined;\n const propIsVariant = isVariantLabel(prop);\n const activeDelta = type === changedActiveType ? typeState.isActive : null;\n if (activeDelta === false)\n removedVariantIndex = i;\n /**\n * Inherited labels are animated by the parent through\n * variantChildren, unless this element mounted after its parent.\n */\n const isInherited = propIsVariant &&\n ownProp === undefined &&\n !(isMounting && manuallyAnimateOnMount);\n typeState.protectedKeys = { ...encounteredKeys };\n if ((!typeState.isActive && activeDelta === null) ||\n (!prop && !typeState.prevProp) ||\n isAnimationControls(prop) ||\n typeof prop === \"boolean\") {\n return;\n }\n /**\n * Don't re-resolve a running exit: a changed custom would start\n * new value animations that stop the originals, leaving the exit\n * promise unresolved and the element stuck in the DOM.\n */\n if (type === \"exit\" && typeState.isActive && activeDelta !== true) {\n encounteredKeys = {\n ...encounteredKeys,\n ...typeState.prevResolvedValues,\n };\n return;\n }\n const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);\n let shouldAnimateType = variantDidChange ||\n (propIsVariant &&\n ((activeDelta && !isInherited) || i > removedVariantIndex));\n let handledRemovedValues = false;\n const definitionList = Array.isArray(prop) ? prop : [prop];\n let resolvedValues = {};\n if (activeDelta !== false) {\n for (const definition of definitionList) {\n const { transition, transitionEnd, ...target } = resolveVariant(visualElement, definition, getTypeCustom(visualElement, type)) || {};\n resolvedValues = {\n ...resolvedValues,\n ...target,\n ...transitionEnd,\n };\n }\n }\n const { prevResolvedValues } = typeState;\n for (const key in { ...prevResolvedValues, ...resolvedValues }) {\n if (key in encounteredKeys)\n continue;\n const next = resolvedValues[key];\n const prev = prevResolvedValues[key];\n /**\n * Keyframes compare by value, but replay whenever the\n * variant label changed.\n */\n const valueHasChanged = Array.isArray(next) && Array.isArray(prev)\n ? !shallowCompare(next, prev) || variantDidChange\n : next !== prev;\n if (valueHasChanged &&\n (next === undefined || next === null)) {\n removedKeys.add(key);\n }\n else if (valueHasChanged ||\n (next !== undefined && removedKeys.has(key))) {\n shouldAnimateType = true;\n if (removedKeys.delete(key))\n handledRemovedValues = true;\n typeState.needsAnimating[key] = true;\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = false;\n }\n else {\n typeState.protectedKeys[key] = true;\n }\n }\n typeState.prevProp = prop;\n typeState.prevResolvedValues = resolvedValues;\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues };\n }\n if (shouldAnimateType &&\n (!(isInherited && variantDidChange) || handledRemovedValues)) {\n for (const animation of definitionList) {\n const options = { type };\n /**\n * Elements that mount into an already-mounted parent\n * animate themselves, staggered by the parent variant's\n * delayChildren.\n */\n if (typeof animation === \"string\" &&\n isMounting &&\n manuallyAnimateOnMount &&\n parent?.enteringChildren) {\n const delayChildren = resolveVariant(parent, animation)\n ?.transition?.delayChildren;\n options.delay = calcChildStagger(parent.enteringChildren, visualElement, delayChildren);\n }\n animations.push({ animation, options });\n }\n }\n });\n /**\n * Removed values that no lower-priority type defines animate back to\n * initial, then style, then the value as first read. If initial no\n * longer defines a value it once did, it stays where it is.\n */\n if (removedKeys.size) {\n const { initial } = props;\n const fallbackAnimation = {};\n const resolvedInitial = typeof initial !== \"boolean\" &&\n resolveVariant(visualElement, Array.isArray(initial) ? initial[0] : initial, visualElement.presenceContext?.custom);\n if (resolvedInitial && resolvedInitial.transition) {\n fallbackAnimation.transition = resolvedInitial.transition;\n }\n removedKeys.forEach((key) => {\n const motionValue = visualElement.getValue(key);\n if (motionValue)\n motionValue.liveStyle = true;\n const fromInitial = resolvedInitial && !Array.isArray(initial)\n ? resolvedInitial[key]\n : undefined;\n const fromProps = visualElement.getBaseTargetFromProps(props, key);\n fallbackAnimation[key] =\n (fromInitial !== undefined\n ? fromInitial\n : fromProps !== undefined && !isMotionValue(fromProps)\n ? fromProps\n : visualElement.initialValues[key] === undefined\n ? visualElement.baseTarget[key]\n : undefined) ?? null;\n /**\n * If it stays where it is, that's now its base. Otherwise a\n * later removal (like a gesture ending) would also stay,\n * leaving the value stuck. Stop first so accelerated\n * animations sync the value they reached. In practice initial\n * only changes like this with Fast Refresh, so this is\n * dev-only (#3787).\n */\n if (process.env.NODE_ENV !== \"production\" &&\n fallbackAnimation[key] === null &&\n visualElement.initialValues[key] !== undefined) {\n delete visualElement.initialValues[key];\n motionValue?.stop();\n visualElement.baseTarget[key] = motionValue?.get();\n }\n });\n animations.push({ animation: fallbackAnimation });\n }\n const blockAnimation = (isMounting && visualElement.blockInitialAnimation) ||\n (isInitialRender &&\n !manuallyAnimateOnMount &&\n (props.initial === false || props.initial === props.animate));\n isInitialRender = wasReset = false;\n return !blockAnimation && animations.length\n ? animate(animations)\n : Promise.resolve();\n }\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type, isActive) {\n if (state[type].isActive === isActive)\n return Promise.resolve();\n visualElement.variantChildren?.forEach((child) => child.animationState?.setActive(type, isActive));\n state[type].isActive = isActive;\n const animations = animateChanges(type);\n for (const key in state) {\n state[key].protectedKeys = {};\n }\n return animations;\n }\n return {\n animateChanges,\n setActive,\n /**\n * Allows tests to inject a mocked animate function.\n * @internal\n */\n setAnimateFunction: (makeAnimator) => {\n animate = makeAnimator(visualElement);\n },\n getState: () => state,\n reset: () => {\n state = createState();\n wasReset = true;\n },\n };\n}\nfunction checkVariantsDidChange(prev, next) {\n if (typeof next === \"string\") {\n return next !== prev;\n }\n else if (Array.isArray(next)) {\n return !shallowCompare(next, prev);\n }\n return false;\n}\nfunction createState() {\n const state = {};\n for (const type of variantPriorityOrder) {\n state[type] = {\n isActive: type === \"animate\",\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n };\n }\n return state;\n}\n\nexport { checkVariantsDidChange, createAnimationState };\n//# sourceMappingURL=animation-state.mjs.map\n","import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n const animation = Array.isArray(definition)\n ? Promise.all(definition.map((variant) => animateVariant(visualElement, variant, options)))\n : typeof definition === \"string\"\n ? animateVariant(visualElement, definition, options)\n : Promise.all(animateTarget(visualElement, resolveVariant(visualElement, definition, options.custom), options));\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n//# sourceMappingURL=visual-element.mjs.map\n","function addDomEvent(target, eventName, handler, options = { passive: true }) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n}\n\nexport { addDomEvent };\n//# sourceMappingURL=add-dom-event.mjs.map\n","import { isMotionValue } from './is-motion-value.mjs';\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nfunction resolveMotionValue(value) {\n return isMotionValue(value) ? value.get() : value;\n}\n\nexport { resolveMotionValue };\n//# sourceMappingURL=resolve-motion-value.mjs.map\n","\"use client\";\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \".\";\nimport { getCurrentTreeVariants } from \"./utils\";\nexport function useCreateMotionContext(props) {\n const { initial, animate } = getCurrentTreeVariants(props, useContext(MotionContext));\n return useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]);\n}\nfunction variantLabelsAsDependency(prop) {\n return Array.isArray(prop) ? prop.join(\" \") : prop;\n}\n//# sourceMappingURL=create.js.map","import { isControllingVariants, isVariantLabel } from \"motion-dom\";\nexport function getCurrentTreeVariants(props, context) {\n if (isControllingVariants(props)) {\n const { initial, animate } = props;\n return {\n initial: initial === false || isVariantLabel(initial)\n ? initial\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n };\n }\n return props.inherit !== false ? context : {};\n}\n//# sourceMappingURL=utils.js.map","export const createHtmlRenderState = () => ({\n style: {},\n transform: {},\n transformOrigin: {},\n vars: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildHTMLStyles, isForcedMotionValue, isMotionValue } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport function copyRawValuesOnly(target, source, props) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key];\n }\n }\n}\nfunction useInitialMotionValues({ transformTemplate }, visualState) {\n return useMemo(() => {\n const state = createHtmlRenderState();\n buildHTMLStyles(state, visualState, transformTemplate);\n return Object.assign({}, state.vars, state.style);\n }, [visualState]);\n}\nfunction useStyle(props, visualState) {\n const styleProp = props.style || {};\n const style = {};\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp, props);\n Object.assign(style, useInitialMotionValues(props, visualState));\n return style;\n}\nexport function useHTMLProps(props, visualState) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps = {};\n const style = useStyle(props, visualState);\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false;\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\";\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`;\n }\n if (props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)) {\n htmlProps.tabIndex = 0;\n }\n htmlProps.style = style;\n return htmlProps;\n}\n//# sourceMappingURL=use-props.js.map","import { createHtmlRenderState } from \"../../html/utils/create-render-state\";\nexport const createSvgRenderState = () => ({\n ...createHtmlRenderState(),\n attrs: {},\n});\n//# sourceMappingURL=create-render-state.js.map","\"use client\";\nimport { buildSVGAttrs, isSVGTag } from \"motion-dom\";\nimport { useMemo } from \"react\";\nimport { copyRawValuesOnly } from \"../html/use-props\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport function useSVGProps(props, visualState, _isStatic, Component) {\n const visualProps = useMemo(() => {\n const state = createSvgRenderState();\n buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate, props.style);\n return {\n ...state.attrs,\n style: { ...state.style },\n };\n }, [visualState]);\n if (props.style) {\n const rawStyles = {};\n copyRawValuesOnly(rawStyles, props.style, props);\n visualProps.style = { ...rawStyles, ...visualProps.style };\n }\n return visualProps;\n}\n//# sourceMappingURL=use-props.js.map","/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"propagate\",\n \"ignoreStrict\",\n \"viewport\",\n]);\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key) {\n return (key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key));\n}\n//# sourceMappingURL=valid-prop.js.map","import { isMotionValue } from \"motion-dom\";\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\";\nfunction shouldForward(key, isValidProp) {\n return key.startsWith(\"on\")\n ? !isValidMotionProp(key)\n : isValidProp?.(key) ?? !isValidMotionProp(key);\n}\nexport function filterProps(props, isDom, forwardMotionProps, isValidProp) {\n const filteredProps = {};\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\")\n continue;\n if (isMotionValue(props[key]))\n continue;\n if (shouldForward(key, isValidProp) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\"] &&\n key.startsWith(\"onDrag\"))) {\n filteredProps[key] =\n props[key];\n }\n }\n return filteredProps;\n}\n//# sourceMappingURL=filter-props.js.map","/**\n * We keep these listed separately as we use the lowercase tag names as part\n * of the runtime bundle to detect SVG components\n */\nexport const lowercaseSVGElements = [\n \"animate\",\n \"circle\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"g\",\n \"image\",\n \"line\",\n \"filter\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"rect\",\n \"stop\",\n \"switch\",\n \"symbol\",\n \"svg\",\n \"text\",\n \"tspan\",\n \"use\",\n \"view\",\n];\n//# sourceMappingURL=lowercase-elements.js.map","import { lowercaseSVGElements } from \"../../svg/lowercase-elements\";\nexport function isSVGComponent(Component) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")) {\n return false;\n }\n else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)) {\n return true;\n }\n return false;\n}\n//# sourceMappingURL=is-svg-component.js.map","\"use client\";\nimport { isMotionValue } from \"motion-dom\";\nimport { Fragment, createElement, useMemo } from \"react\";\nimport { useHTMLProps } from \"../html/use-props\";\nimport { useSVGProps } from \"../svg/use-props\";\nimport { filterProps } from \"./utils/filter-props\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport function useRender(Component, props, ref, { latestValues, }, isStatic, forwardMotionProps = false, isSVG, isValidProp) {\n const useVisualProps = (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps;\n const visualProps = useVisualProps(props, latestValues, isStatic, Component);\n const filteredProps = filterProps(props, typeof Component === \"string\", forwardMotionProps, isValidProp);\n const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props;\n const renderedChildren = useMemo(() => (isMotionValue(children) ? children.get() : children), [children]);\n return createElement(Component, {\n ...elementProps,\n children: renderedChildren,\n });\n}\n//# sourceMappingURL=use-render.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * @public\n */\nexport const PresenceContext = \n/* @__PURE__ */ createContext(null);\n//# sourceMappingURL=PresenceContext.js.map","\"use client\";\nimport { isAnimationControls, isControllingVariants as checkIsControllingVariants, isVariantNode as checkIsVariantNode, resolveVariantFromProps, } from \"motion-dom\";\nimport { useContext } from \"react\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext, } from \"../../context/PresenceContext\";\nimport { useConstant } from \"../../utils/use-constant\";\nimport { resolveMotionValue } from \"motion-dom\";\nfunction makeState({ scrapeMotionValuesFromProps, createRenderState, }, props, context, presenceContext) {\n const state = {\n latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),\n renderState: createRenderState(),\n };\n return state;\n}\nfunction makeLatestValues(props, context, presenceContext, scrapeMotionValues) {\n const values = {};\n const motionValues = scrapeMotionValues(props, {});\n for (const key in motionValues) {\n values[key] = resolveMotionValue(motionValues[key]);\n }\n let { initial, animate } = props;\n const isControllingVariants = checkIsControllingVariants(props);\n const isVariantNode = checkIsVariantNode(props);\n if (context &&\n isVariantNode &&\n !isControllingVariants &&\n props.inherit !== false) {\n if (initial === undefined)\n initial = context.initial;\n if (animate === undefined)\n animate = context.animate;\n }\n let isInitialAnimationBlocked = presenceContext\n ? presenceContext.initial === false\n : false;\n isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;\n const variantToSet = isInitialAnimationBlocked ? animate : initial;\n if (variantToSet &&\n typeof variantToSet !== \"boolean\" &&\n !isAnimationControls(variantToSet)) {\n const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];\n for (let i = 0; i < list.length; i++) {\n const resolved = resolveVariantFromProps(props, list[i]);\n if (resolved) {\n const { transitionEnd, transition, ...target } = resolved;\n for (const key in target) {\n let valueTarget = target[key];\n if (Array.isArray(valueTarget)) {\n /**\n * Take final keyframe if the initial animation is blocked because\n * we want to initialise at the end of that blocked animation.\n */\n const index = isInitialAnimationBlocked\n ? valueTarget.length - 1\n : 0;\n valueTarget = valueTarget[index];\n }\n if (valueTarget !== null) {\n values[key] = valueTarget;\n }\n }\n for (const key in transitionEnd) {\n values[key] = transitionEnd[key];\n }\n }\n }\n }\n return values;\n}\nexport const makeUseVisualState = (config) => (props, isStatic) => {\n const context = useContext(MotionContext);\n const presenceContext = useContext(PresenceContext);\n const make = () => makeState(config, props, context, presenceContext);\n return isStatic ? make() : useConstant(make);\n};\n//# sourceMappingURL=use-visual-state.js.map","\"use client\";\nimport { useRef } from \"react\";\n/**\n * Creates a constant value over the lifecycle of a component.\n *\n * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer\n * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`\n * you can ensure that initialisers don't execute twice or more.\n */\nexport function useConstant(init) {\n const ref = useRef(null);\n if (ref.current === null) {\n ref.current = init();\n }\n return ref.current;\n}\n//# sourceMappingURL=use-constant.js.map","\"use client\";\nimport { scrapeHTMLMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createHtmlRenderState } from \"./utils/create-render-state\";\nexport const useHTMLVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeHTMLMotionValuesFromProps,\n createRenderState: createHtmlRenderState,\n});\n//# sourceMappingURL=use-html-visual-state.js.map","\"use client\";\nimport { scrapeSVGMotionValuesFromProps } from \"motion-dom\";\nimport { makeUseVisualState } from \"../../motion/utils/use-visual-state\";\nimport { createSvgRenderState } from \"./utils/create-render-state\";\nexport const useSVGVisualState = /*@__PURE__*/ makeUseVisualState({\n scrapeMotionValuesFromProps: scrapeSVGMotionValuesFromProps,\n createRenderState: createSvgRenderState,\n});\n//# sourceMappingURL=use-svg-visual-state.js.map","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\";\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n};\nlet isInitialized = false;\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized)\n return;\n const initialFeatureDefinitions = {};\n for (const key in featureProps) {\n initialFeatureDefinitions[key] = {\n isEnabled: (props) => featureProps[key].some((name) => !!props[name]),\n };\n }\n setFeatureDefinitions(initialFeatureDefinitions);\n isInitialized = true;\n}\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions() {\n initFeatureDefinitions();\n return getFeatureDefinitions();\n}\n//# sourceMappingURL=definitions.js.map","import { setFeatureDefinitions } from \"motion-dom\";\nimport { getInitializedFeatureDefinitions } from \"./definitions\";\nexport function loadFeatures(features) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n for (const key in features) {\n featureDefinitions[key] = {\n ...featureDefinitions[key],\n ...features[key],\n };\n }\n setFeatureDefinitions(featureDefinitions);\n}\n//# sourceMappingURL=load-features.js.map","export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\");\n//# sourceMappingURL=symbol.js.map","\"use client\";\nimport { useCallback, useInsertionEffect, useRef } from \"react\";\n/**\n * Creates a ref function that, when called, hydrates the provided\n * external ref and VisualElement.\n */\nexport function useMotionRef(visualState, visualElement, externalRef) {\n /**\n * Store externalRef in a ref to avoid including it in the useCallback\n * dependency array. Including externalRef in dependencies causes issues\n * with libraries like Radix UI that create new callback refs on each render\n * when using asChild - this would cause the callback to be recreated,\n * triggering element remounts and breaking AnimatePresence exit animations.\n */\n const externalRefContainer = useRef(externalRef);\n useInsertionEffect(() => {\n externalRefContainer.current = externalRef;\n });\n // Store cleanup function returned by callback refs (React 19 feature)\n const refCleanup = useRef(null);\n return useCallback((instance) => {\n if (instance) {\n visualState.onMount?.(instance);\n }\n if (visualElement) {\n instance ? visualElement.mount(instance) : visualElement.unmount();\n }\n const ref = externalRefContainer.current;\n if (typeof ref === \"function\") {\n if (instance) {\n const cleanup = ref(instance);\n if (typeof cleanup === \"function\") {\n refCleanup.current = cleanup;\n }\n }\n else if (refCleanup.current) {\n refCleanup.current();\n refCleanup.current = null;\n }\n else {\n ref(instance);\n }\n }\n else if (ref) {\n ;\n ref.current = instance;\n }\n }, [visualElement]);\n}\n//# sourceMappingURL=use-motion-ref.js.map","\"use client\";\nimport { createContext } from \"react\";\n/**\n * Internal, exported only for usage in Framer\n */\nexport const SwitchLayoutGroupContext = createContext({});\n//# sourceMappingURL=SwitchLayoutGroupContext.js.map","export function isRefObject(ref) {\n return (ref &&\n typeof ref === \"object\" &&\n Object.prototype.hasOwnProperty.call(ref, \"current\"));\n}\n//# sourceMappingURL=is-ref-object.js.map","export const isBrowser = typeof window !== \"undefined\";\n//# sourceMappingURL=is-browser.js.map","\"use client\";\nimport { useEffect, useLayoutEffect } from \"react\";\nimport { isBrowser } from \"./is-browser\";\nexport const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n//# sourceMappingURL=use-isomorphic-effect.js.map","\"use client\";\nimport { optimizedAppearDataAttribute, } from \"motion-dom\";\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\";\nimport { MotionContext } from \"../../context/MotionContext\";\nimport { PresenceContext } from \"../../context/PresenceContext\";\nimport { SwitchLayoutGroupContext, } from \"../../context/SwitchLayoutGroupContext\";\nimport { isRefObject } from \"../../utils/is-ref-object\";\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\";\nexport function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {\n const { visualElement: parent } = useContext(MotionContext);\n const lazyContext = useContext(LazyContext);\n const presenceContext = useContext(PresenceContext);\n const motionConfig = useContext(MotionConfigContext);\n const reducedMotionConfig = motionConfig.reducedMotion;\n const skipAnimations = motionConfig.skipAnimations;\n const visualElementRef = useRef(null);\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false);\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n lazyContext.renderer;\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n });\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true;\n }\n }\n const visualElement = visualElementRef.current;\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);\n if (visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")) {\n createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);\n }\n const isMounted = useRef(false);\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext);\n }\n });\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId = props[optimizedAppearDataAttribute];\n const wantsHandoff = useRef(Boolean(optimisedAppearId) &&\n typeof window !== \"undefined\" &&\n !window.MotionHandoffIsComplete?.(optimisedAppearId) &&\n window.MotionHasOptimisedAnimation?.(optimisedAppearId));\n /**\n * Layout effects re-run when a hidden Suspense/Activity boundary is\n * revealed, but passive effects only re-run if this component re-renders\n * (not the case for memoized elements). Replay animations on every\n * reconnection. Must be declared before the effect that sets hasMountedOnce.\n */\n useIsomorphicLayoutEffect(() => {\n if (!hasMountedOnce.current || !visualElement)\n return;\n visualElement.animationState?.animateChanges();\n visualElement.enteringChildren = undefined;\n }, []);\n useIsomorphicLayoutEffect(() => {\n /**\n * Track that this component has mounted. This is used to detect when\n * LazyMotion features load after the component has already committed.\n */\n hasMountedOnce.current = true;\n if (!visualElement)\n return;\n isMounted.current = true;\n window.MotionIsMounted = true;\n visualElement.updateFeatures();\n visualElement.scheduleRenderMicrotask();\n /**\n * Ideally this function would always run in a useEffect.\n *\n * However, if we have optimised appear animations to handoff from,\n * it needs to happen synchronously to ensure there's no flash of\n * incorrect styles in the event of a hydration error.\n *\n * So if we detect a situation where optimised appear animations\n * are running, we use useLayoutEffect to trigger animations.\n */\n if (wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n });\n useEffect(() => {\n if (!visualElement)\n return;\n if (!wantsHandoff.current && visualElement.animationState) {\n visualElement.animationState.animateChanges();\n }\n if (wantsHandoff.current) {\n // This ensures all future calls to animateChanges() in this component will run in useEffect\n queueMicrotask(() => {\n window.MotionHandoffMarkAsComplete?.(optimisedAppearId);\n });\n wantsHandoff.current = false;\n }\n /**\n * Now we've finished triggering animations for this element we\n * can wipe the enteringChildren set for the next render.\n */\n visualElement.enteringChildren = undefined;\n });\n return visualElement;\n}\nfunction createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {\n const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade, } = props;\n visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props[\"data-framer-portal-id\"]\n ? undefined\n : getClosestProjectingNode(visualElement.parent));\n visualElement.projection.setOptions({\n layoutId,\n layout,\n alwaysMeasureLayout: Boolean(drag) || (dragConstraints && isRefObject(dragConstraints)),\n visualElement,\n /**\n * TODO: Update options in an effect. This could be tricky as it'll be too late\n * to update by the time layout animations run.\n * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,\n * ensuring it gets called if there's no potential layout animations.\n *\n */\n animationType: typeof layout === \"string\" ? layout : \"both\",\n initialPromotionConfig,\n crossfade: layoutCrossfade,\n layoutScroll,\n layoutRoot,\n layoutAnchor,\n });\n}\nfunction getClosestProjectingNode(visualElement) {\n if (!visualElement)\n return undefined;\n return visualElement.options.allowProjection !== false\n ? visualElement.projection\n : getClosestProjectingNode(visualElement.parent);\n}\n//# sourceMappingURL=use-visual-element.js.map","\"use client\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { invariant, warning } from \"motion-utils\";\nimport { forwardRef, useContext } from \"react\";\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\";\nimport { LazyContext } from \"../context/LazyContext\";\nimport { MotionConfigContext } from \"../context/MotionConfigContext\";\nimport { MotionContext } from \"../context/MotionContext\";\nimport { useCreateMotionContext } from \"../context/MotionContext/create\";\nimport { useRender } from \"../render/dom/use-render\";\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\";\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\";\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\";\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\";\nimport { loadFeatures } from \"./features/load-features\";\nimport { motionComponentSymbol } from \"./utils/symbol\";\nimport { useMotionRef } from \"./utils/use-motion-ref\";\nimport { useVisualElement } from \"./utils/use-visual-element\";\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {\n preloadedFeatures && loadFeatures(preloadedFeatures);\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component);\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;\n function MotionDOMComponent(props, externalRef) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout;\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n };\n const { isStatic, isValidProp } = configAndProps;\n const context = useCreateMotionContext(props);\n const visualState = useVisualState(props, isStatic);\n if (!isStatic && typeof window !== \"undefined\") {\n useStrictMode(configAndProps, preloadedFeatures);\n const layoutProjection = getProjectionFunctionality(configAndProps);\n MeasureLayout = layoutProjection.MeasureLayout;\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);\n }\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (_jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? (_jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps })) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG, isValidProp)] }));\n }\n MotionDOMComponent.displayName = `motion.${typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`}`;\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);\n ForwardRefMotionComponent[motionComponentSymbol] = Component;\n return ForwardRefMotionComponent;\n}\nfunction useLayoutId({ layoutId }) {\n const layoutGroupId = useContext(LayoutGroupContext).id;\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId;\n}\nfunction useStrictMode(configAndProps, preloadedFeatures) {\n const isStrict = useContext(LazyContext).strict;\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict) {\n const strictMessage = \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\";\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\");\n }\n}\nfunction getProjectionFunctionality(props) {\n const featureDefinitions = getInitializedFeatureDefinitions();\n const { drag, layout } = featureDefinitions;\n if (!drag && !layout)\n return {};\n const combined = { ...drag, ...layout };\n return {\n MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n };\n}\n//# sourceMappingURL=index.js.map","import { createMotionComponent } from \"../../../motion\";\nexport function createMinimalMotionComponent(Component, options) {\n return createMotionComponent(Component, options);\n}\n//# sourceMappingURL=create.js.map","\"use client\";\nimport { createMinimalMotionComponent } from \"./create\";\n/**\n * HTML components\n */\nexport const MotionA = /*@__PURE__*/ createMinimalMotionComponent(\"a\");\nexport const MotionAbbr = /*@__PURE__*/ createMinimalMotionComponent(\"abbr\");\nexport const MotionAddress = \n/*@__PURE__*/ createMinimalMotionComponent(\"address\");\nexport const MotionArea = /*@__PURE__*/ createMinimalMotionComponent(\"area\");\nexport const MotionArticle = \n/*@__PURE__*/ createMinimalMotionComponent(\"article\");\nexport const MotionAside = /*@__PURE__*/ createMinimalMotionComponent(\"aside\");\nexport const MotionAudio = /*@__PURE__*/ createMinimalMotionComponent(\"audio\");\nexport const MotionB = /*@__PURE__*/ createMinimalMotionComponent(\"b\");\nexport const MotionBase = /*@__PURE__*/ createMinimalMotionComponent(\"base\");\nexport const MotionBdi = /*@__PURE__*/ createMinimalMotionComponent(\"bdi\");\nexport const MotionBdo = /*@__PURE__*/ createMinimalMotionComponent(\"bdo\");\nexport const MotionBig = /*@__PURE__*/ createMinimalMotionComponent(\"big\");\nexport const MotionBlockquote = \n/*@__PURE__*/ createMinimalMotionComponent(\"blockquote\");\nexport const MotionBody = /*@__PURE__*/ createMinimalMotionComponent(\"body\");\nexport const MotionButton = /*@__PURE__*/ createMinimalMotionComponent(\"button\");\nexport const MotionCanvas = /*@__PURE__*/ createMinimalMotionComponent(\"canvas\");\nexport const MotionCaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"caption\");\nexport const MotionCite = /*@__PURE__*/ createMinimalMotionComponent(\"cite\");\nexport const MotionCode = /*@__PURE__*/ createMinimalMotionComponent(\"code\");\nexport const MotionCol = /*@__PURE__*/ createMinimalMotionComponent(\"col\");\nexport const MotionColgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"colgroup\");\nexport const MotionData = /*@__PURE__*/ createMinimalMotionComponent(\"data\");\nexport const MotionDatalist = \n/*@__PURE__*/ createMinimalMotionComponent(\"datalist\");\nexport const MotionDd = /*@__PURE__*/ createMinimalMotionComponent(\"dd\");\nexport const MotionDel = /*@__PURE__*/ createMinimalMotionComponent(\"del\");\nexport const MotionDetails = \n/*@__PURE__*/ createMinimalMotionComponent(\"details\");\nexport const MotionDfn = /*@__PURE__*/ createMinimalMotionComponent(\"dfn\");\nexport const MotionDialog = /*@__PURE__*/ createMinimalMotionComponent(\"dialog\");\nexport const MotionDiv = /*@__PURE__*/ createMinimalMotionComponent(\"div\");\nexport const MotionDl = /*@__PURE__*/ createMinimalMotionComponent(\"dl\");\nexport const MotionDt = /*@__PURE__*/ createMinimalMotionComponent(\"dt\");\nexport const MotionEm = /*@__PURE__*/ createMinimalMotionComponent(\"em\");\nexport const MotionEmbed = /*@__PURE__*/ createMinimalMotionComponent(\"embed\");\nexport const MotionFieldset = \n/*@__PURE__*/ createMinimalMotionComponent(\"fieldset\");\nexport const MotionFigcaption = \n/*@__PURE__*/ createMinimalMotionComponent(\"figcaption\");\nexport const MotionFigure = /*@__PURE__*/ createMinimalMotionComponent(\"figure\");\nexport const MotionFooter = /*@__PURE__*/ createMinimalMotionComponent(\"footer\");\nexport const MotionForm = /*@__PURE__*/ createMinimalMotionComponent(\"form\");\nexport const MotionH1 = /*@__PURE__*/ createMinimalMotionComponent(\"h1\");\nexport const MotionH2 = /*@__PURE__*/ createMinimalMotionComponent(\"h2\");\nexport const MotionH3 = /*@__PURE__*/ createMinimalMotionComponent(\"h3\");\nexport const MotionH4 = /*@__PURE__*/ createMinimalMotionComponent(\"h4\");\nexport const MotionH5 = /*@__PURE__*/ createMinimalMotionComponent(\"h5\");\nexport const MotionH6 = /*@__PURE__*/ createMinimalMotionComponent(\"h6\");\nexport const MotionHead = /*@__PURE__*/ createMinimalMotionComponent(\"head\");\nexport const MotionHeader = /*@__PURE__*/ createMinimalMotionComponent(\"header\");\nexport const MotionHgroup = /*@__PURE__*/ createMinimalMotionComponent(\"hgroup\");\nexport const MotionHr = /*@__PURE__*/ createMinimalMotionComponent(\"hr\");\nexport const MotionHtml = /*@__PURE__*/ createMinimalMotionComponent(\"html\");\nexport const MotionI = /*@__PURE__*/ createMinimalMotionComponent(\"i\");\nexport const MotionIframe = /*@__PURE__*/ createMinimalMotionComponent(\"iframe\");\nexport const MotionImg = /*@__PURE__*/ createMinimalMotionComponent(\"img\");\nexport const MotionInput = /*@__PURE__*/ createMinimalMotionComponent(\"input\");\nexport const MotionIns = /*@__PURE__*/ createMinimalMotionComponent(\"ins\");\nexport const MotionKbd = /*@__PURE__*/ createMinimalMotionComponent(\"kbd\");\nexport const MotionKeygen = /*@__PURE__*/ createMinimalMotionComponent(\"keygen\");\nexport const MotionLabel = /*@__PURE__*/ createMinimalMotionComponent(\"label\");\nexport const MotionLegend = /*@__PURE__*/ createMinimalMotionComponent(\"legend\");\nexport const MotionLi = /*@__PURE__*/ createMinimalMotionComponent(\"li\");\nexport const MotionLink = /*@__PURE__*/ createMinimalMotionComponent(\"link\");\nexport const MotionMain = /*@__PURE__*/ createMinimalMotionComponent(\"main\");\nexport const MotionMap = /*@__PURE__*/ createMinimalMotionComponent(\"map\");\nexport const MotionMark = /*@__PURE__*/ createMinimalMotionComponent(\"mark\");\nexport const MotionMenu = /*@__PURE__*/ createMinimalMotionComponent(\"menu\");\nexport const MotionMenuitem = \n/*@__PURE__*/ createMinimalMotionComponent(\"menuitem\");\nexport const MotionMeter = /*@__PURE__*/ createMinimalMotionComponent(\"meter\");\nexport const MotionNav = /*@__PURE__*/ createMinimalMotionComponent(\"nav\");\nexport const MotionObject = /*@__PURE__*/ createMinimalMotionComponent(\"object\");\nexport const MotionOl = /*@__PURE__*/ createMinimalMotionComponent(\"ol\");\nexport const MotionOptgroup = \n/*@__PURE__*/ createMinimalMotionComponent(\"optgroup\");\nexport const MotionOption = /*@__PURE__*/ createMinimalMotionComponent(\"option\");\nexport const MotionOutput = /*@__PURE__*/ createMinimalMotionComponent(\"output\");\nexport const MotionP = /*@__PURE__*/ createMinimalMotionComponent(\"p\");\nexport const MotionParam = /*@__PURE__*/ createMinimalMotionComponent(\"param\");\nexport const MotionPicture = \n/*@__PURE__*/ createMinimalMotionComponent(\"picture\");\nexport const MotionPre = /*@__PURE__*/ createMinimalMotionComponent(\"pre\");\nexport const MotionProgress = \n/*@__PURE__*/ createMinimalMotionComponent(\"progress\");\nexport const MotionQ = /*@__PURE__*/ createMinimalMotionComponent(\"q\");\nexport const MotionRp = /*@__PURE__*/ createMinimalMotionComponent(\"rp\");\nexport const MotionRt = /*@__PURE__*/ createMinimalMotionComponent(\"rt\");\nexport const MotionRuby = /*@__PURE__*/ createMinimalMotionComponent(\"ruby\");\nexport const MotionS = /*@__PURE__*/ createMinimalMotionComponent(\"s\");\nexport const MotionSamp = /*@__PURE__*/ createMinimalMotionComponent(\"samp\");\nexport const MotionScript = /*@__PURE__*/ createMinimalMotionComponent(\"script\");\nexport const MotionSection = \n/*@__PURE__*/ createMinimalMotionComponent(\"section\");\nexport const MotionSelect = /*@__PURE__*/ createMinimalMotionComponent(\"select\");\nexport const MotionSmall = /*@__PURE__*/ createMinimalMotionComponent(\"small\");\nexport const MotionSource = /*@__PURE__*/ createMinimalMotionComponent(\"source\");\nexport const MotionSpan = /*@__PURE__*/ createMinimalMotionComponent(\"span\");\nexport const MotionStrong = /*@__PURE__*/ createMinimalMotionComponent(\"strong\");\nexport const MotionStyle = /*@__PURE__*/ createMinimalMotionComponent(\"style\");\nexport const MotionSub = /*@__PURE__*/ createMinimalMotionComponent(\"sub\");\nexport const MotionSummary = \n/*@__PURE__*/ createMinimalMotionComponent(\"summary\");\nexport const MotionSup = /*@__PURE__*/ createMinimalMotionComponent(\"sup\");\nexport const MotionTable = /*@__PURE__*/ createMinimalMotionComponent(\"table\");\nexport const MotionTbody = /*@__PURE__*/ createMinimalMotionComponent(\"tbody\");\nexport const MotionTd = /*@__PURE__*/ createMinimalMotionComponent(\"td\");\nexport const MotionTextarea = \n/*@__PURE__*/ createMinimalMotionComponent(\"textarea\");\nexport const MotionTfoot = /*@__PURE__*/ createMinimalMotionComponent(\"tfoot\");\nexport const MotionTh = /*@__PURE__*/ createMinimalMotionComponent(\"th\");\nexport const MotionThead = /*@__PURE__*/ createMinimalMotionComponent(\"thead\");\nexport const MotionTime = /*@__PURE__*/ createMinimalMotionComponent(\"time\");\nexport const MotionTitle = /*@__PURE__*/ createMinimalMotionComponent(\"title\");\nexport const MotionTr = /*@__PURE__*/ createMinimalMotionComponent(\"tr\");\nexport const MotionTrack = /*@__PURE__*/ createMinimalMotionComponent(\"track\");\nexport const MotionU = /*@__PURE__*/ createMinimalMotionComponent(\"u\");\nexport const MotionUl = /*@__PURE__*/ createMinimalMotionComponent(\"ul\");\nexport const MotionVideo = /*@__PURE__*/ createMinimalMotionComponent(\"video\");\nexport const MotionWbr = /*@__PURE__*/ createMinimalMotionComponent(\"wbr\");\nexport const MotionWebview = \n/*@__PURE__*/ createMinimalMotionComponent(\"webview\");\n/**\n * SVG components\n */\nexport const MotionAnimate = \n/*@__PURE__*/ createMinimalMotionComponent(\"animate\");\nexport const MotionCircle = /*@__PURE__*/ createMinimalMotionComponent(\"circle\");\nexport const MotionDefs = /*@__PURE__*/ createMinimalMotionComponent(\"defs\");\nexport const MotionDesc = /*@__PURE__*/ createMinimalMotionComponent(\"desc\");\nexport const MotionEllipse = \n/*@__PURE__*/ createMinimalMotionComponent(\"ellipse\");\nexport const MotionG = /*@__PURE__*/ createMinimalMotionComponent(\"g\");\nexport const MotionImage = /*@__PURE__*/ createMinimalMotionComponent(\"image\");\nexport const MotionLine = /*@__PURE__*/ createMinimalMotionComponent(\"line\");\nexport const MotionFilter = /*@__PURE__*/ createMinimalMotionComponent(\"filter\");\nexport const MotionMarker = /*@__PURE__*/ createMinimalMotionComponent(\"marker\");\nexport const MotionMask = /*@__PURE__*/ createMinimalMotionComponent(\"mask\");\nexport const MotionMetadata = \n/*@__PURE__*/ createMinimalMotionComponent(\"metadata\");\nexport const MotionPath = /*@__PURE__*/ createMinimalMotionComponent(\"path\");\nexport const MotionPattern = \n/*@__PURE__*/ createMinimalMotionComponent(\"pattern\");\nexport const MotionPolygon = \n/*@__PURE__*/ createMinimalMotionComponent(\"polygon\");\nexport const MotionPolyline = \n/*@__PURE__*/ createMinimalMotionComponent(\"polyline\");\nexport const MotionRect = /*@__PURE__*/ createMinimalMotionComponent(\"rect\");\nexport const MotionStop = /*@__PURE__*/ createMinimalMotionComponent(\"stop\");\nexport const MotionSvg = /*@__PURE__*/ createMinimalMotionComponent(\"svg\");\nexport const MotionSymbol = /*@__PURE__*/ createMinimalMotionComponent(\"symbol\");\nexport const MotionText = /*@__PURE__*/ createMinimalMotionComponent(\"text\");\nexport const MotionTspan = /*@__PURE__*/ createMinimalMotionComponent(\"tspan\");\nexport const MotionUse = /*@__PURE__*/ createMinimalMotionComponent(\"use\");\nexport const MotionView = /*@__PURE__*/ createMinimalMotionComponent(\"view\");\nexport const MotionClipPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"clipPath\");\nexport const MotionFeBlend = \n/*@__PURE__*/ createMinimalMotionComponent(\"feBlend\");\nexport const MotionFeColorMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feColorMatrix\");\nexport const MotionFeComponentTransfer = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComponentTransfer\");\nexport const MotionFeComposite = \n/*@__PURE__*/ createMinimalMotionComponent(\"feComposite\");\nexport const MotionFeConvolveMatrix = \n/*@__PURE__*/ createMinimalMotionComponent(\"feConvolveMatrix\");\nexport const MotionFeDiffuseLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDiffuseLighting\");\nexport const MotionFeDisplacementMap = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDisplacementMap\");\nexport const MotionFeDistantLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDistantLight\");\nexport const MotionFeDropShadow = \n/*@__PURE__*/ createMinimalMotionComponent(\"feDropShadow\");\nexport const MotionFeFlood = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFlood\");\nexport const MotionFeFuncA = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncA\");\nexport const MotionFeFuncB = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncB\");\nexport const MotionFeFuncG = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncG\");\nexport const MotionFeFuncR = \n/*@__PURE__*/ createMinimalMotionComponent(\"feFuncR\");\nexport const MotionFeGaussianBlur = \n/*@__PURE__*/ createMinimalMotionComponent(\"feGaussianBlur\");\nexport const MotionFeImage = \n/*@__PURE__*/ createMinimalMotionComponent(\"feImage\");\nexport const MotionFeMerge = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMerge\");\nexport const MotionFeMergeNode = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMergeNode\");\nexport const MotionFeMorphology = \n/*@__PURE__*/ createMinimalMotionComponent(\"feMorphology\");\nexport const MotionFeOffset = \n/*@__PURE__*/ createMinimalMotionComponent(\"feOffset\");\nexport const MotionFePointLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"fePointLight\");\nexport const MotionFeSpecularLighting = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpecularLighting\");\nexport const MotionFeSpotLight = \n/*@__PURE__*/ createMinimalMotionComponent(\"feSpotLight\");\nexport const MotionFeTile = /*@__PURE__*/ createMinimalMotionComponent(\"feTile\");\nexport const MotionFeTurbulence = \n/*@__PURE__*/ createMinimalMotionComponent(\"feTurbulence\");\nexport const MotionForeignObject = \n/*@__PURE__*/ createMinimalMotionComponent(\"foreignObject\");\nexport const MotionLinearGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"linearGradient\");\nexport const MotionRadialGradient = \n/*@__PURE__*/ createMinimalMotionComponent(\"radialGradient\");\nexport const MotionTextPath = \n/*@__PURE__*/ createMinimalMotionComponent(\"textPath\");\n//# sourceMappingURL=elements.js.map","import { m } from \"./\";\nexport const MotionDiv = m.div;\n//# sourceMappingURL=size.js.map","\"use client\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { LazyContext } from \"../../context/LazyContext\";\nimport { loadFeatures } from \"../../motion/features/load-features\";\n/**\n * Used in conjunction with the `m` component to reduce bundle size.\n *\n * `m` is a version of the `motion` component that only loads functionality\n * critical for the initial render.\n *\n * `LazyMotion` can then be used to either synchronously or asynchronously\n * load animation and gesture support.\n *\n * ```jsx\n * // Synchronous loading\n * import { LazyMotion, m, domAnimation } from \"framer-motion\"\n *\n * function App() {\n * return (\n * \n * \n * \n * )\n * }\n *\n * // Asynchronous loading\n * import { LazyMotion, m } from \"framer-motion\"\n *\n * function App() {\n * return (\n * import('./path/to/domAnimation')}>\n * \n * \n * )\n * }\n * ```\n *\n * @public\n */\nexport function LazyMotion({ children, features, strict = false }) {\n const [, setIsLoaded] = useState(!isLazyBundle(features));\n const loadedRenderer = useRef(undefined);\n /**\n * If this is a synchronous load, load features immediately\n */\n if (!isLazyBundle(features)) {\n const { renderer, ...loadedFeatures } = features;\n loadedRenderer.current = renderer;\n loadFeatures(loadedFeatures);\n }\n useEffect(() => {\n if (isLazyBundle(features)) {\n features().then(({ renderer, ...loadedFeatures }) => {\n loadFeatures(loadedFeatures);\n loadedRenderer.current = renderer;\n setIsLoaded(true);\n });\n }\n }, []);\n return (_jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children: children }));\n}\nfunction isLazyBundle(features) {\n return typeof features === \"function\";\n}\n//# sourceMappingURL=index.js.map","import { Feature, resolveVariant } from \"motion-dom\";\nlet id = 0;\nexport class ExitAnimationFeature extends Feature {\n constructor() {\n super(...arguments);\n this.id = id++;\n }\n update() {\n const { presenceContext, prevPresenceContext, animationState } = this.node;\n if (!presenceContext || !animationState)\n return;\n const { isPresent, onExitComplete } = presenceContext;\n const prevIsPresent = prevPresenceContext?.isPresent;\n if (isPresent === prevIsPresent)\n return;\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering after the exit completed (element is at\n * rest), replay the enter animation from initial.\n */\n if (this.exit === true) {\n const { initial } = this.node.getProps();\n if (initial && !Array.isArray(initial)) {\n const { transition, transitionEnd, ...target } = resolveVariant(this.node, initial) || {};\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(target[key]);\n }\n }\n /**\n * A re-entering element is no longer an initial child, so\n * AnimatePresence's initial={false} mustn't block its enter.\n */\n this.node.blockInitialAnimation = false;\n animationState.reset();\n animationState.animateChanges();\n }\n else {\n animationState.setActive(\"exit\", false);\n }\n this.exit = undefined;\n return;\n }\n const exit = (this.exit = animationState.setActive(\"exit\", !isPresent));\n if (onExitComplete && !isPresent) {\n exit.then(() => {\n /**\n * An exit can resolve after the element has re-entered, e.g.\n * when its final tick lands in the stop() of the enter.\n */\n if (this.exit !== exit)\n return;\n this.exit = true;\n onExitComplete(this.id);\n });\n }\n }\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {};\n if (onExitComplete) {\n onExitComplete(this.id);\n }\n if (register) {\n this.unmount = register(this.id, this.node);\n }\n }\n unmount() { }\n}\n//# sourceMappingURL=exit.js.map","import { AnimationFeature } from \"./animation\";\nimport { ExitAnimationFeature } from \"./animation/exit\";\nexport const animations = {\n animation: {\n Feature: AnimationFeature,\n },\n exit: {\n Feature: ExitAnimationFeature,\n },\n};\n//# sourceMappingURL=animations.js.map","import { createAnimationState, Feature, isAnimationControls, } from \"motion-dom\";\nexport class AnimationFeature extends Feature {\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node) {\n super(node);\n node.animationState || (node.animationState = createAnimationState(node));\n }\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps();\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node);\n }\n }\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription();\n }\n update() {\n const { animate } = this.node.getProps();\n const { animate: prevAnimate } = this.node.prevProps || {};\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription();\n }\n }\n unmount() {\n this.node.animationState.reset();\n this.unmountControls?.();\n }\n}\n//# sourceMappingURL=index.js.map","import { isPrimaryPointer } from \"motion-dom\";\nexport function extractEventInfo(event) {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n };\n}\nexport const addPointerInfo = (handler) => (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));\n//# sourceMappingURL=event-info.js.map","import { Feature, frame, hover } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handleHoverEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\");\n }\n const eventName = (\"onHover\" + lifecycle);\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class HoverGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\");\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\");\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=hover.js.map","import { Feature, frame, press } from \"motion-dom\";\nimport { extractEventInfo } from \"../events/event-info\";\nfunction handlePressEvent(node, event, lifecycle) {\n const { props } = node;\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return;\n }\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\");\n }\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle));\n const callback = props[eventName];\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)));\n }\n}\nexport class PressGesture extends Feature {\n mount() {\n const { current } = this.node;\n if (!current)\n return;\n const { globalTapTarget, propagate } = this.node.props;\n this.unmount = press(current, (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\");\n return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? \"End\" : \"Cancel\");\n }, {\n useGlobalTarget: globalTapTarget,\n stopPropagation: propagate?.tap === false,\n });\n }\n unmount() { }\n}\n//# sourceMappingURL=press.js.map","/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap();\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap();\nconst fireObserverCallback = (entry) => {\n const callback = observerCallbacks.get(entry.target);\n callback && callback(entry);\n};\nconst fireAllObserverCallbacks = (entries) => {\n entries.forEach(fireObserverCallback);\n};\nfunction initIntersectionObserver({ root, ...options }) {\n const lookupRoot = root || document;\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {});\n }\n const rootObservers = observers.get(lookupRoot);\n const key = JSON.stringify(options);\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });\n }\n return rootObservers[key];\n}\nexport function observeIntersection(element, options, callback) {\n const rootInteresectionObserver = initIntersectionObserver(options);\n observerCallbacks.set(element, callback);\n rootInteresectionObserver.observe(element);\n return () => {\n observerCallbacks.delete(element);\n rootInteresectionObserver.unobserve(element);\n };\n}\n//# sourceMappingURL=observers.js.map","import { Feature } from \"motion-dom\";\nimport { observeIntersection } from \"./observers\";\nconst thresholdNames = {\n some: 0,\n all: 1,\n};\nexport class InViewFeature extends Feature {\n constructor() {\n super(...arguments);\n this.hasEnteredView = false;\n this.isInView = false;\n }\n startObserver() {\n this.stopObserver?.();\n const { viewport = {} } = this.node.getProps();\n const { root, margin: rootMargin, amount = \"some\", once } = viewport;\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholdNames[amount],\n };\n const onIntersectionUpdate = (entry) => {\n const { isIntersecting } = entry;\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting)\n return;\n this.isInView = isIntersecting;\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return;\n }\n else if (isIntersecting) {\n this.hasEnteredView = true;\n }\n if (this.node.animationState) {\n this.node.animationState.setActive(\"whileInView\", isIntersecting);\n }\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps();\n const callback = isIntersecting ? onViewportEnter : onViewportLeave;\n callback && callback(entry);\n };\n this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);\n }\n mount() {\n this.startObserver();\n }\n update() {\n if (typeof IntersectionObserver === \"undefined\")\n return;\n const { props, prevProps } = this.node;\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(hasViewportOptionChanged(props, prevProps));\n if (hasOptionsChanged) {\n this.startObserver();\n }\n }\n unmount() {\n this.stopObserver?.();\n this.hasEnteredView = false;\n this.isInView = false;\n }\n}\nfunction hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {\n return (name) => viewport[name] !== prevViewport[name];\n}\n//# sourceMappingURL=index.js.map","import { HoverGesture } from \"../../gestures/hover\";\nimport { FocusGesture } from \"../../gestures/focus\";\nimport { PressGesture } from \"../../gestures/press\";\nimport { InViewFeature } from \"./viewport\";\nexport const gestureAnimations = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n};\n//# sourceMappingURL=gestures.js.map","\"use client\";\nimport { animations } from \"../../motion/features/animations\";\nimport { gestureAnimations } from \"../../motion/features/gestures\";\nimport { createDomVisualElement } from \"./create-visual-element\";\n/**\n * @public\n */\nexport const domAnimation = {\n renderer: createDomVisualElement,\n ...animations,\n ...gestureAnimations,\n};\n//# sourceMappingURL=features-animation.js.map","import { HTMLVisualElement, SVGVisualElement } from \"motion-dom\";\nimport { Fragment } from \"react\";\nimport { isSVGComponent } from \"./utils/is-svg-component\";\nexport const createDomVisualElement = (Component, options) => {\n /**\n * Use explicit isSVG override if provided, otherwise auto-detect\n */\n const isSVG = options.isSVG ?? isSVGComponent(Component);\n return isSVG\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options, {\n allowProjection: Component !== Fragment,\n });\n};\n//# sourceMappingURL=create-visual-element.js.map","import { Feature, addDomEvent } from \"motion-dom\";\nimport { pipe } from \"motion-utils\";\nexport class FocusGesture extends Feature {\n constructor() {\n super(...arguments);\n this.isActive = false;\n }\n onFocus() {\n let isFocusVisible = false;\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current.matches(\":focus-visible\");\n }\n catch (e) {\n isFocusVisible = true;\n }\n if (!isFocusVisible || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", true);\n this.isActive = true;\n }\n onBlur() {\n if (!this.isActive || !this.node.animationState)\n return;\n this.node.animationState.setActive(\"whileFocus\", false);\n this.isActive = false;\n }\n mount() {\n this.unmount = pipe(addDomEvent(this.node.current, \"focus\", () => this.onFocus()), addDomEvent(this.node.current, \"blur\", () => this.onBlur()));\n }\n unmount() { }\n}\n//# sourceMappingURL=focus.js.map"],"names":["clamp","min","max","v","MotionGlobalConfig","isNumericalString","test","isZeroValueString","memo","callback","result","undefined","noop","any","pipe","transformers","reduce","a","b","progress","from","to","value","range","SubscriptionManager","constructor","this","subscriptions","add","handler","arr","item","indexOf","push","remove","index","splice","removeItem","notify","c","numSubscriptions","length","i","getSize","clear","secondsToMilliseconds","seconds","millisecondsToSeconds","milliseconds","velocityPerSecond","velocity","frameDuration","calcBezier","t","a1","a2","cubicBezier","mX1","mY1","mX2","mY2","x","lowerBound","upperBound","currentX","mirrorEasing","easing","p","reverseEasing","backOut","backIn","backInOut","anticipate","Math","pow","circIn","sin","acos","circOut","circInOut","easeIn","easeOut","easeInOut","isBezierDefinition","Array","isArray","easingLookup","linear","easingDefinitionToFunction","definition","x1","y1","x2","y2","LayoutGroupContext","createContext","LazyContext","strict","MotionConfigContext","transformPagePoint","isStatic","reducedMotion","MotionContext","frameData","delta","timestamp","isProcessing","now","clearTime","time","set","useManualTiming","performance","newTime","queueMicrotask","sanitize","round","checkStringStartsWith","token","key","startsWith","isCSSVariableName","startsAsVariableToken","isCSSVariableToken","singleCssVariableRegex","split","trim","containsCSSVariable","includes","number","parse","parseFloat","transform","alpha","scale","default","floatRegex","singleColorRegex","isColorString","type","testProp","Boolean","isNullish","Object","prototype","hasOwnProperty","call","splitColor","aName","bName","cName","match","rgbUnit","clampRgbUnit","rgba","red","green","blue","alpha$1","hex","r","g","substring","parseInt","createUnitType","unit","endsWith","degrees","percent","px","vh","vw","progressPercentage","hsla","hue","saturation","lightness","color","getAnimatableNone","parsed","hasFloat","RegExp","source","hasColor","NUMBER_TOKEN","COLOR_TOKEN","complexRegex","hasComplexValues","asString","toString","analyseComplexValue","originalValue","values","indexes","var","types","replace","parsedValue","buildTransformer","numSections","output","convertToZero","splitBefore","complex","isNaN","createTransformer","info","transformer","map","hueToRgb","q","mixImmediate","mixNumber","mixLinearColor","fromExpo","expo","sqrt","colorTypes","asRGBA","find","model","hslaToRgba","mixColor","fromRGBA","toRGBA","blended","invisibleValues","Set","mixNumber$1","getMixer","mixComplex","mixArray","mixObject","numValues","blendValue","origin","target","template","originStats","targetStats","has","mixVisibility","orderedOrigin","pointers","originIndex","originValue","matchOrder","unitValue","mix","mixer","exec","mixUnit","stepsOrder","createRenderBatcher","scheduleNextBatch","allowKeepAlive","state","runNextFrame","useDefaultElapsed","flagRunNextFrame","steps","acc","thisFrame","nextFrame","flushNextFrame","toKeepAlive","latestFrameData","triggerCallback","step","schedule","keepAlive","immediate","queue","cancel","delete","process","prevFrame","forEach","createRenderStep","setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender","processBatch","frame","cancelFrame","requestAnimationFrame","frameloopDriver","passTimestamp","start","stop","generateLinearEasing","duration","resolution","points","numPoints","maxGeneratorDuration","calcGeneratorDuration","generator","timeStep","maxDuration","keyframes","next","done","Infinity","springDefaults","granular","bounceToDampingRatio","bounce","overdampedFreqScale","dampingRatio","criticalFreqTime","root","slow","fast","exp","approximateRoot","freqTime","calcAngularFreq","undampedFreq","rootIterations","envelope","derivative","initialGuess","safeMin","isValidPhysics","canBeZero","resolvePhysics","getSpringOptions","options","validStiffness","stiffness","validDamping","damping","validMass","mass","springOptions","isResolvedFromDuration","isTimeDefined","visualDuration","PI","assign","exponentialDecay","e","f","criticalFreq","findSpring","spring","optionsOrVisualDuration","inheritVelocity","undampedAngularFreq","decay","s","restSpeed","restDelta","setRestThresholds","isGranularScale","abs","resolveSpring","resolveVelocity","angularFreq","A","sinC","cosC","env","cos","sample","C","dampedAngularFreq","limit","decayAt","rate","S","F","P","calculatedDuration","retarget","newVelocity","current","currentVelocity","easingDuration","toTransition","inertia","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","nearestBoundary","amplitude","ideal","calcDelta","applyFriction","timeReachedBoundary","spring$1","checkCatchBoundary","hasUpdatedFrame","interpolate","input","isClamp","ease","inputLength","isZeroDeltaRange","reverse","mixers","customMixer","mixerFactory","numMixers","easingFunction","createMixers","interpolator","progressInRange","defaultOffset","offset","remaining","offsetProgress","fillOffset","keyframeValues","times","easingFunctions","isEasingArray","absoluteTimes","o","convertOffsetToTimes","mapTimeToKeyframe","applyToOptions","generatorOptions","createGenerator","k","createGeneratorEasing","calcGeneratorVelocity","initialVelocity","resolveValue","prevT","getGeneratorVelocity","isNotNull","getFinalKeyframe","repeat","repeatType","finalKeyframe","speed","resolvedKeyframes","filter","transitionTypeMap","tween","replaceTransitionType","transition","resolveStartTime","startTime","baseRecord","kind","animation","frameTimestamp","frameIsProcessing","notifyAnimationStart","globalThis","__MOTION_INSPECT__","WithPromise","isResolved","finished","_finished","Promise","resolve","_resolve","updateFinished","notifyFinished","then","onResolve","onReject","percentToProgress","JSAnimation","super","isStopped","currentTime","holdTime","playbackSpeed","delayState","motionValue","updatedAt","tick","teardown","onStop","initAnimation","play","autoplay","pause","repeatDelay","keyframes$1","generatorFactory","mixKeyframes","mirroredGenerator","resolvedDuration","totalDuration","updateTime","animationTime","delay","onUpdate","pendingStartTime","timeWithoutDelay","isInDelayPhase","generate","isAnimationFinished","finish","at","sampleAt","resolved","elapsed","frameGenerator","currentIteration","floor","iterationProgress","reject","iterationDuration","driver","newSpeed","hasChanged","onPlay","complete","onComplete","onCancel","stopDriver","sampleTime","attachTimeline","timeline","allowFlatten","observe","maxDefaults","applyDefaultFilter","name","slice","defaultValue","functionRegex","functions","join","mask","int","numberValueTypes","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY","rotate","pathRotation","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","skew","skewX","skewY","distance","translateX","translateY","translateZ","y","z","perspective","transformPerspective","opacity","originX","originY","originZ","zIndex","fillOpacity","strokeOpacity","numOctaves","defaultValueTypes","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","WebkitFilter","WebkitMask","getDefaultValueType","customTypes","defaultValueType","radToDeg","rad","angle","atan2","rebaseAngle","matrix2dParsers","atan","hypot","matrix3dParsers","defaultTransformValue","parseValueFromTransform","matrix3dMatch","parsers","matrix2dMatch","valueParser","convertTransformToNumber","transformPropOrder","transformProps","isNumOrPxType","transformKeys","nonTranslationalTransformKeys","boxDependentValues","measureDimension","computed","measureBox","axis","paddingStart","paddingEnd","boxSizing","size","positionalValues","toResolve","isScheduled","anyNeedsMeasurement","isForced","measureAllKeyframes","resolversToMeasure","elementsToMeasure","elementsToUntransform","resolver","needsMeasurement","element","transformsToRestore","Map","removedTransforms","visualElement","getValue","get","reset","removeNonTranslationalTransform","measureInitialState","restore","measureEndState","suspendedScrollY","window","scrollTo","readAllKeyframes","readKeyframes","KeyframeResolver","unresolvedKeyframes","isAsync","scheduleResolve","currentValue","valueAsRead","readOrigin","readValue","fillWildcards","setFinalKeyframe","renderEndStyles","isForcedComplete","resume","setStyle","isCSSVar","style","setProperty","supportsFlags","memoSupports","supportsFlag","memoized","supportsScrollTimeline","ScrollTimeline","supportsLinearEasing","document","createElement","animate","cubicBezierAsString","d","supportedWaapiEasing","mapEasingToNativeEasing","segmentEasing","startWaapiAnimation","valueName","pseudoElement","keyframeOptions","iterations","direction","isGenerator","NativeAnimation","finishedTime","manualStartTime","isPseudoElement","applyGeneratorOptions","onfinish","keyframe","updateMotionValue","commitStyles","isConnected","effect","getComputedTiming","Number","wasFinished","playbackRate","playState","newStartTime","onAttach","updateTiming","unsupportedEasingFunctions","replaceStringEasing","NativeAnimationExtended","sampler","liveValue","setWithVelocity","sign","isAnimatable","makeAnimationInstant","acceleratedValues","browserColorFunctions","colorProperties","supportsWaapi","Element","supportsBrowserAnimation","subject","owner","HTMLElement","SVGElement","transformTemplate","getProps","hasBrowserOnlyColors","getValueAsType","translateAlias","numTransforms","buildTransform","latestValues","transformString","transformIsDefault","valueIsDefault","valueAsType","transformGroups","WeakMap","easingTolerance","byTime","spread","n","getOwner","getGroup","TransformAnimation","canAccelerate","isHandoff","hasOnUpdate","projection","isProjecting","canAccelerateTransform","js","group","isJS","isFinishing","release","isAccelerated","sync","timing","tracks","isNativeEasing","boundaries","offsets","iterationStart","numberAt","byKey","statics","keys","built","segments","needsBuild","isEnded","hasChurned","lastChurn","track","valuesAt","settled","compose","commit","shouldCommit","end","segment","isDone","some","oncancel","demote","jumpAt","change","mid","getEasing","moving","bounds","samples","ceil","concat","sort","position","shared","progressAt","first","changes","every","point","isStraight","depth","ends","getTween","run","nativeEasing","flatMap","cycle","cycleStart","looping","trackEnd","trackCycle","isHeld","phase","retime","builtTime","builtSpeed","wasHeld","trackTime","trackElapsed","trackRate","local","build","shouldBuild","churned","build_","isChurn","check","canReturn","createGroup","AsyncMotionValueAnimation","_animation","stopTimeline","keyframeResolver","createdAt","optionsWithDefaults","KeyframeResolver$1","forced","onKeyframesResolved","resolvedAt","canAnimateValue","originKeyframe","targetKeyframe","isOriginAnimatable","isTargetAnimatable","hasKeyframesChanged","canAnimate","instantAnimations","useWaapi","isGroupedTransform","canGroupTransform","pendingTimeline","_onReject","finally","calcChildStagger","children","child","delayChildren","staggerChildren","staggerDirection","sortNodePosition","numChildren","maxStaggerDuration","MotionValue","init","canTrackVelocity","events","updateAndNotify","setPrevFrameValue","prev","setCurrent","notifyChange","dependents","dependent","dirty","hasAnimated","prevFrameValue","prevUpdatedAt","onChange","subscription","on","eventName","_a","onChangeSubscribe","changeSubscriber","stopIfUnobserved","clearListeners","eventManagers","attach","passiveEffect","stopPassiveEffect","jump","endAnimation","addDependent","removeDependent","sampled","getCurrent","getPrevious","getVelocity","startAnimation","isComplete","animationComplete","clearAnimation","animationStart","animationCancel","isAnimating","destroy","resolveTransition","parentTransition","inherit","_","rest","getValueTransition","valueTransition","underDampedSpring","keyframesTransition","getDefaultTransition","valueKey","orchestrationKeys","animateMotionValue","isTransitionDefined","shouldSkip","skipAnimations","shouldSkipAnimations","isSync","splitCSSVariableRegex","getVariableValue","fallback","token1","token2","parseCSSVariable","getComputedStyle","getPropertyValue","trimmed","resolveVariantFromProps","props","custom","resolveFunction","def","getValueState","variants","resolveVariant","getTypeCustom","presenceContext","positionalKeys","setMotionValue","hasValue","addValue","resolveFinalValueInKeyframes","isKeyframesTarget","isMotionValue","addValueToWillChange","willChange","WillChange","newWillChange","camelToDash","str","toLowerCase","optimizedAppearDataAttribute","getOptimisedAppearId","isBrowser","shouldBlockAnimation","protectedKeys","needsAnimating","shouldBlock","animateTarget","targetAndTransition","transitionOverride","transitionEnd","defaultTransition","reduceMotion","animations","animationTypeState","animationState","getState","path","animateValues","animateVisualElement","valueTarget","MotionHandoffAnimation","appearId","shouldReduceMotion","applyTransitionEnd","setTarget","all","animateVariant","variant","getAnimation","getChildAnimations","variantChildren","when","dimensionValueTypes","findDimensionValueType","testValueType","isNone","invalidTemplates","DOMKeyframesResolver","canReadNow","resolveNoneKeyframes","originType","targetType","noneKeyframeIndexes","animatableTemplate","noneIndex","makeNoneKeyframesAnimatable","measure","measureViewportBox","pageYOffset","measuredOrigin","measureKeyframe","finalKeyframeIndex","unsetTransformName","unsetTransformValue","buildHTMLStyles","vars","transformOrigin","hasTransform","hasTransformOrigin","dashKeys","array","camelKeys","cssStyleProperties","buildSVGAttrs","attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset","latest","isSVGTag","styleProp","viewBox","attrs","transformBox","spacing","useDashCase","buildSVGPath","microtask","isDragging","setupGesture","elementOrSelector","elements","scope","selectorCache","EventTarget","querySelectorAll","resolveElements","gestureAbortController","AbortController","passive","signal","abort","isValidHover","event","pointerType","hover","onHoverStart","eventOptions","hoverEndCallback","isPressed","deferredHoverEnd","endHover","removeEventListener","onPointerLeave","onPointerUp","leaveEvent","addEventListener","enterEvent","onHoverEnd","isNodeOrChild","parent","parentElement","keyboardAccessibleElements","isPressing","WeakSet","filterEvents","firePointerEvent","dispatchEvent","PointerEvent","isPrimary","bubbles","isValidPressEvent","button","isPrimaryPointer","claimedPointerDownEvents","press","targetOrSelector","onPressStart","targets","cancelEvents","startPress","startEvent","currentTarget","stopPropagation","onPressEnd","endEventOptions","capture","onPointerEnd","endEvent","success","onPointerCancel","upEvent","useGlobalTarget","cancelEvent","focusEvent","handleKeydown","handleKeyup","enableKeyboardPress","tagName","isContentEditable","isElementKeyboardAccessible","hasAttribute","tabIndex","createBox","visualElementStore","isAnimationControls","isVariantLabel","variantPriorityOrder","variantProps","isControllingVariants","isVariantNode","prefersReducedMotion","hasReducedMotionListener","propEventHandlers","featureDefinitions","setFeatureDefinitions","definitions","VisualElement","scrapeMotionValuesFromProps","_props","_prevProps","_visualElement","reducedMotionConfig","blockInitialAnimation","visualState","features","valueSubscriptions","prevMotionValues","hasBeenMounted","propEventSubscriptions","notifyUpdate","triggerBuild","renderInstance","renderState","renderScheduledAt","scheduleRender","baseTarget","initialValues","initial","skipAnimationsConfig","manuallyAnimateOnMount","initialMotionValues","mount","instance","node","removeFromVariantTree","bindToMotionValue","matchMedia","motionMediaQuery","setReducedMotionPreferences","matches","initPrefersReducedMotion","addChild","unmount","removeChild","feature","isMounted","enteringChildren","accelerate","factory","cleanup","valueIsTransform","onBindTransform","removeOnChange","latestValue","isTransformDirty","removeSyncCheck","MotionCheckAppearSync","other","sortInstanceNodePosition","updateFeatures","featureDefinition","isEnabled","Feature","FeatureConstructor","measureInstanceViewportBox","getStaticValue","setStaticValue","prevProps","prevPresenceContext","listener","nextValue","prevValue","existingValue","liveStyle","removeValue","updateMotionValuesFromProps","handleChildMotionValue","getVariant","getTransformPagePoint","unsubscribe","removeValueFromRenderState","getDefaultValue","getBaseTargetFromProps","readValueFromInstance","setBaseTarget","args","scheduleRenderMicrotask","DOMVisualElement","arguments","compareDocumentPosition","childSubscription","textContent","renderHTML","elementStyle","applyProjectionStyles","scaleCorrectors","isForcedMotionValue","layout","layoutId","prevStyle","newValues","HTMLVisualElement","readTransformValue","computedStyle","transformPoint","convertBoundingBoxToBox","topLeft","bottomRight","transformBoxPoints","getBoundingClientRect","camelCaseAttributes","tag","scrapeMotionValuesFromProps$1","charAt","toUpperCase","SVGVisualElement","defaultType","getAttribute","_styleProp","setAttribute","renderSVG","shallowCompare","prevLength","reversePriorityOrder","createAnimationState","createState","isInitialRender","wasReset","animateChanges","changedActiveType","isMounting","removedKeys","encounteredKeys","removedVariantIndex","typeState","ownProp","inheritedProp","prop","propIsVariant","activeDelta","isActive","isInherited","prevProp","prevResolvedValues","variantDidChange","checkVariantsDidChange","shouldAnimateType","handledRemovedValues","definitionList","resolvedValues","valueHasChanged","fallbackAnimation","resolvedInitial","fromInitial","fromProps","blockAnimation","setActive","setAnimateFunction","makeAnimator","addDomEvent","resolveMotionValue","useCreateMotionContext","context","getCurrentTreeVariants","useContext","useMemo","variantLabelsAsDependency","createHtmlRenderState","copyRawValuesOnly","useStyle","useInitialMotionValues","useHTMLProps","htmlProps","drag","dragListener","draggable","userSelect","WebkitUserSelect","WebkitTouchCallout","touchAction","onTap","onTapStart","whileTap","createSvgRenderState","useSVGProps","_isStatic","Component","visualProps","rawStyles","validMotionProps","isValidMotionProp","shouldForward","isValidProp","lowercaseSVGElements","isSVGComponent","useRender","ref","forwardMotionProps","isSVG","filteredProps","isDom","filterProps","elementProps","Fragment","renderedChildren","PresenceContext","makeLatestValues","scrapeMotionValues","motionValues","checkIsControllingVariants","checkIsVariantNode","isInitialAnimationBlocked","variantToSet","list","makeUseVisualState","config","make","createRenderState","makeState","useRef","useConstant","useHTMLVisualState","scrapeHTMLMotionValuesFromProps","useSVGVisualState","scrapeSVGMotionValuesFromProps","featureProps","exit","focus","tap","pan","inView","isInitialized","getInitializedFeatureDefinitions","initialFeatureDefinitions","initFeatureDefinitions","loadFeatures","motionComponentSymbol","Symbol","for","useMotionRef","externalRef","externalRefContainer","useInsertionEffect","refCleanup","useCallback","onMount","SwitchLayoutGroupContext","isRefObject","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useVisualElement","createVisualElement","ProjectionNodeConstructor","lazyContext","motionConfig","visualElementRef","hasMountedOnce","renderer","initialLayoutGroupConfig","initialPromotionConfig","dragConstraints","layoutScroll","layoutRoot","layoutAnchor","layoutCrossfade","getClosestProjectingNode","setOptions","alwaysMeasureLayout","animationType","crossfade","createProjectionNode","optimisedAppearId","wantsHandoff","MotionHandoffIsComplete","MotionHasOptimisedAnimation","MotionIsMounted","MotionHandoffMarkAsComplete","allowProjection","createMotionComponent","preloadedFeatures","useVisualState","MotionDOMComponent","MeasureLayout","configAndProps","useLayoutId","layoutProjection","combined","ProjectionNode","getProjectionFunctionality","_jsxs","Provider","_jsx","displayName","ForwardRefMotionComponent","forwardRef","layoutGroupId","id","createMinimalMotionComponent","MotionDiv","LazyMotion","setIsLoaded","useState","isLazyBundle","loadedRenderer","loadedFeatures","updateAnimationControlsSubscription","unmountControls","subscribe","prevAnimate","isPresent","onExitComplete","prevIsPresent","register","extractEventInfo","pageX","pageY","handleHoverEvent","lifecycle","whileHover","handlePressEvent","HTMLButtonElement","disabled","observerCallbacks","observers","fireObserverCallback","entry","fireAllObserverCallbacks","entries","observeIntersection","rootInteresectionObserver","lookupRoot","rootObservers","JSON","stringify","IntersectionObserver","initIntersectionObserver","unobserve","thresholdNames","domAnimation","hasEnteredView","isInView","startObserver","stopObserver","viewport","rootMargin","amount","once","threshold","isIntersecting","onViewportEnter","onViewportLeave","prevViewport","hasViewportOptionChanged","globalTapTarget","propagate","_element","onFocus","isFocusVisible","onBlur"],"mappings":"6QAAA,MAAMA,EAAQ,CAACC,EAAKC,EAAKC,IACjBA,EAAID,EACGA,EACPC,EAAIF,EACGA,EACJE,ECLX,MAAMC,EAAqB,CAAA,ECGrBC,EAAqBF,GAAM,+BAA+BG,KAAKH,GCA/DI,EAAqBJ,GAAM,cAAcG,KAAKH,GCFpD,SAASK,EAAKC,GACV,IAAIC,EACJ,MAAO,UACYC,IAAXD,IACAA,EAASD,KACNC,EAEf,CCPA,MAAME,EAAQC,GAAQA,ECMhBC,EAAO,IAAIC,IAAiBA,EAAaC,OAAO,CAACC,EAAGC,IAAOf,GAAMe,EAAED,EAAEd,KCCrEgB,EAAW,CAACC,EAAMC,EAAIC,KACxB,MAAMC,EAAQF,EAAKD,EACnB,OAAOG,GAASD,EAAQF,GAAQG,EAAQ,GCR5C,MAAMC,EACF,WAAAC,GACIC,KAAKC,cAAgB,EACzB,CACA,GAAAC,CAAIC,GCNR,IAAuBC,EAAKC,EDQpB,OCReD,EDODJ,KAAKC,cCPCI,EDOcF,GCNZ,IAAtBC,EAAIE,QAAQD,IACZD,EAAIG,KAAKF,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