{"version":3,"file":"index.js","sources":["../../src/frameloop/frame-data.ts","../../src/frameloop/sync-time.ts","../../src/value/types/utils/sanitize.ts","../../src/animation/utils/is-css-variable.ts","../../src/value/types/numbers/index.ts","../../src/value/types/utils/float-regex.ts","../../src/value/types/utils/is-nullish.ts","../../src/value/types/utils/single-color-regex.ts","../../src/value/types/color/utils.ts","../../src/value/types/color/rgba.ts","../../src/value/types/color/hex.ts","../../src/value/types/numbers/units.ts","../../src/value/types/color/hsla.ts","../../src/value/types/color/index.ts","../../src/value/types/utils/color-regex.ts","../../src/value/types/complex/index.ts","../../src/value/types/color/hsla-to-rgba.ts","../../src/utils/mix/immediate.ts","../../src/utils/mix/number.ts","../../src/utils/mix/color.ts","../../src/utils/mix/visibility.ts","../../src/utils/mix/complex.ts","../../src/utils/mix/index.ts","../../src/frameloop/order.ts","../../src/frameloop/render-step.ts","../../src/frameloop/batcher.ts","../../src/frameloop/frame.ts","../../src/animation/drivers/frame.ts","../../src/animation/waapi/utils/linear.ts","../../src/animation/generators/utils/calc-duration.ts","../../src/animation/generators/utils/create-generator-easing.ts","../../src/animation/generators/spring.ts","../../src/animation/generators/inertia.ts","../../src/utils/interpolate.ts","../../src/animation/keyframes/offsets/fill.ts","../../src/animation/keyframes/offsets/default.ts","../../src/animation/keyframes/offsets/time.ts","../../src/animation/generators/keyframes.ts","../../src/animation/generators/utils/velocity.ts","../../src/animation/keyframes/get-final.ts","../../src/animation/utils/replace-transition-type.ts","../../src/animation/utils/resolve-start-time.ts","../../src/animation/utils/notify-inspector.ts","../../src/animation/utils/WithPromise.ts","../../src/animation/JSAnimation.ts","../../src/value/types/complex/filter.ts","../../src/value/types/complex/mask.ts","../../src/value/types/int.ts","../../src/value/types/maps/transform.ts","../../src/value/types/maps/number.ts","../../src/value/types/maps/defaults.ts","../../src/value/types/utils/animatable-none.ts","../../src/animation/keyframes/utils/fill-wildcards.ts","../../src/render/dom/parse-transform.ts","../../src/render/utils/keys-transform.ts","../../src/animation/keyframes/utils/unit-conversion.ts","../../src/animation/keyframes/KeyframesResolver.ts","../../src/render/dom/is-css-var.ts","../../src/render/dom/style-set.ts","../../src/utils/supports/flags.ts","../../src/utils/supports/memo.ts","../../src/utils/supports/scroll-timeline.ts","../../src/utils/supports/linear-easing.ts","../../src/animation/waapi/easing/cubic-bezier.ts","../../src/animation/waapi/easing/supported.ts","../../src/animation/waapi/easing/map-easing.ts","../../src/animation/waapi/start-waapi-animation.ts","../../src/animation/generators/utils/is-generator.ts","../../src/animation/waapi/utils/apply-generator.ts","../../src/animation/NativeAnimation.ts","../../src/animation/waapi/utils/unsupported-easing.ts","../../src/animation/NativeAnimationExtended.ts","../../src/animation/utils/is-animatable.ts","../../src/animation/utils/can-animate.ts","../../src/animation/utils/make-animation-instant.ts","../../src/animation/waapi/utils/accelerated-values.ts","../../src/animation/waapi/utils/is-browser-color.ts","../../src/animation/waapi/supports/waapi.ts","../../src/value/types/utils/get-as-type.ts","../../src/render/html/utils/build-transform.ts","../../src/animation/waapi/transforms/groups.ts","../../src/animation/waapi/transforms/TransformAnimation.ts","../../src/animation/AsyncMotionValueAnimation.ts","../../src/animation/GroupAnimation.ts","../../src/animation/GroupAnimationWithThen.ts","../../src/animation/NativeAnimationWrapper.ts","../../src/animation/utils/active-animations.ts","../../src/animation/utils/calc-child-stagger.ts","../../src/value/index.ts","../../src/animation/utils/resolve-transition.ts","../../src/animation/utils/get-value-transition.ts","../../src/animation/utils/default-transitions.ts","../../src/animation/utils/is-transition-defined.ts","../../src/animation/interfaces/motion-value.ts","../../src/animation/utils/arc.ts","../../src/animation/utils/css-variables-conversion.ts","../../src/render/utils/resolve-variants.ts","../../src/render/utils/resolve-dynamic-variants.ts","../../src/render/utils/keys-position.ts","../../src/render/utils/is-keyframes-target.ts","../../src/render/utils/setters.ts","../../src/value/utils/is-motion-value.ts","../../src/value/will-change/is.ts","../../src/value/will-change/add-will-change.ts","../../src/render/dom/utils/camel-to-dash.ts","../../src/animation/optimized-appear/data-id.ts","../../src/animation/optimized-appear/get-appear-id.ts","../../src/animation/interfaces/visual-element-target.ts","../../src/animation/interfaces/visual-element-variant.ts","../../src/animation/interfaces/visual-element.ts","../../src/value/types/auto.ts","../../src/value/types/test.ts","../../src/value/types/dimensions.ts","../../src/animation/keyframes/utils/is-none.ts","../../src/animation/keyframes/utils/make-none-animatable.ts","../../src/animation/keyframes/DOMKeyframesResolver.ts","../../src/utils/border-radius.ts","../../src/animation/waapi/utils/px-values.ts","../../src/animation/keyframes/utils/apply-px-defaults.ts","../../src/animation/waapi/easing/is-supported.ts","../../src/animation/waapi/supports/partial-keyframes.ts","../../src/animation/animate/effects.ts","../../src/utils/is-html-element.ts","../../src/utils/is-svg-element.ts","../../src/utils/resolve-elements.ts","../../src/effects/utils/create-dom-effect.ts","../../src/effects/MotionValueState.ts","../../src/effects/utils/create-effect.ts","../../src/effects/style/transform.ts","../../src/effects/style/index.ts","../../src/render/html/utils/build-styles.ts","../../src/render/svg/utils/path.ts","../../src/render/svg/utils/build-attrs.ts","../../src/effects/attr/index.ts","../../src/effects/svg/index.ts","../../src/projection/geometry/conversion.ts","../../src/projection/utils/has-transform.ts","../../src/projection/geometry/delta-apply.ts","../../src/projection/utils/measure.ts","../../src/animation/animate/element.ts","../../src/effects/prop/index.ts","../../src/frameloop/microtask.ts","../../src/gestures/drag/state/is-active.ts","../../src/gestures/drag/state/set-active.ts","../../src/gestures/utils/setup.ts","../../src/gestures/hover.ts","../../src/gestures/utils/is-node-or-child.ts","../../src/gestures/utils/is-primary-pointer.ts","../../src/gestures/press/utils/is-keyboard-accessible.ts","../../src/gestures/press/utils/state.ts","../../src/gestures/press/utils/keyboard.ts","../../src/gestures/press/index.ts","../../src/render/dom/style-computed.ts","../../src/resize/handle-element.ts","../../src/resize/handle-window.ts","../../src/resize/index.ts","../../src/stats/buffer.ts","../../src/stats/index.ts","../../src/utils/is-svg-svg-element.ts","../../src/utils/stagger.ts","../../src/utils/transform.ts","../../src/animation/FollowAnimation.ts","../../src/value/utils/as-number.ts","../../src/value/utils/follow.ts","../../src/value/follow-value.ts","../../src/value/subscribe-value.ts","../../src/value/transform-value.ts","../../src/value/map-value.ts","../../src/value/spring-value.ts","../../src/value/types/utils/find.ts","../../src/view/utils/assign-names.ts","../../src/view/utils/choose-layer-type.ts","../../src/view/utils/css.ts","../../src/view/utils/get-layer-info.ts","../../src/view/utils/get-view-animations.ts","../../src/view/utils/has-target.ts","../../src/view/start.ts","../../src/view/queue.ts","../../src/view/index.ts","../../src/projection/geometry/models.ts","../../src/render/store.ts","../../src/render/utils/is-animation-controls.ts","../../src/render/utils/is-variant-label.ts","../../src/render/utils/variant-props.ts","../../src/render/utils/is-controlling-variants.ts","../../src/render/utils/motion-values.ts","../../src/render/utils/reduced-motion/state.ts","../../src/render/utils/reduced-motion/index.ts","../../src/render/VisualElement.ts","../../src/render/dom/DOMVisualElement.ts","../../src/render/Feature.ts","../../src/render/html/utils/render.ts","../../src/projection/styles/scale-correction.ts","../../src/render/utils/is-forced-motion-value.ts","../../src/render/html/utils/scrape-motion-values.ts","../../src/render/html/HTMLVisualElement.ts","../../src/render/object/ObjectVisualElement.ts","../../src/render/svg/utils/camel-case-attrs.ts","../../src/render/svg/utils/is-svg-tag.ts","../../src/render/svg/utils/render.ts","../../src/render/svg/utils/scrape-motion-values.ts","../../src/render/svg/SVGVisualElement.ts","../../src/render/utils/shallow-compare.ts","../../src/render/utils/animation-state.ts","../../src/render/utils/get-variant-context.ts","../../src/projection/geometry/copy.ts","../../src/projection/geometry/delta-calc.ts","../../src/projection/geometry/delta-remove.ts","../../src/projection/geometry/utils.ts","../../src/projection/utils/each-axis.ts","../../src/projection/styles/scale-border-radius.ts","../../src/projection/styles/scale-box-shadow.ts","../../src/projection/styles/transform.ts","../../src/projection/animation/mix-values.ts","../../src/animation/animate/single-value.ts","../../src/events/add-dom-event.ts","../../src/projection/utils/compare-by-depth.ts","../../src/projection/utils/flat-tree.ts","../../src/utils/delay.ts","../../src/value/utils/resolve-motion-value.ts","../../src/projection/shared/stack.ts","../../src/projection/styles/default-scale-correctors.ts","../../src/projection/node/state.ts","../../src/projection/node/create-projection-node.ts","../../src/projection/node/DocumentProjectionNode.ts","../../src/projection/node/group.ts","../../src/projection/node/HTMLProjectionNode.ts","../../src/layout/LayoutAnimationBuilder.ts","../../src/layout/animate-layout.ts","../../src/frameloop/index-legacy.ts"],"sourcesContent":["import { FrameData } from \"./types\"\n\n/**\n * The frameloop's state, kept apart from the frameloop itself so that\n * reading it doesn't bundle the scheduler.\n */\nexport const frameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame-data\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n","// If this number is a decimal, make it just five decimal places\n// to avoid exponents\nexport const sanitize = (v: number) => Math.round(v * 100000) / 100000\n","import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n (token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n","import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n","export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n","export function isNullish(v: any): v is null | undefined {\n return v == null\n}\n","export const singleColorRegex =\n /^(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))$/iu\n","import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n (aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n","import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n","import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n","import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n","import { HSLA, RGBA } from \"../types\"\nimport { hex } from \"./hex\"\nimport { hsla } from \"./hsla\"\nimport { rgba } from \"./rgba\"\n\nexport const color = {\n test: (v: any) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v: any): RGBA | HSLA => {\n if (rgba.test(v)) {\n return rgba.parse(v)\n } else if (hsla.test(v)) {\n return hsla.parse(v)\n } else {\n return hex.parse(v)\n }\n },\n transform: (v: HSLA | RGBA | string) => {\n return typeof v === \"string\"\n ? v\n : v.hasOwnProperty(\"red\")\n ? rgba.transform(v as RGBA)\n : hsla.transform(v as HSLA)\n },\n getAnimatableNone: (v: string) => {\n const parsed = color.parse(v)\n parsed.alpha = 0\n return color.transform(parsed)\n },\n}\n","export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\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\")\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (hasFloat.test(v) || hasColor.test(v))\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`.\n// The lookahead skips digits in function names, like the 3 in matrix3d(.\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?![a-z]*\\()/giu\n\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 */\nexport function hasComplexValues(value: AnyResolvedKeyframe) {\n const asString = value.toString()\n return hasFloat.test(asString) || hasColor.test(asString)\n}\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction buildTransformer({ split, types }: ComplexValueInfo) {\n const numSections = split.length\n return (v: Array) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n return buildTransformer(analyseComplexValue(source))\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\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 = (\n value: ComplexValues[number],\n splitBefore: string\n): ComplexValues[number] => {\n if (typeof value === \"number\") {\n return splitBefore?.trim().endsWith(\"/\") ? value : 0\n }\n return convertNumbersToZero(value as string)\n}\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const info = analyseComplexValue(v)\n const transformer = buildTransformer(info)\n return transformer(\n info.values.map((value, i) => convertToZero(value, info.split[i]))\n )\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n","import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n","export function mixImmediate(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n","/*\n Value in range from progress\n\n Given a lower limit and an upper limit, we return the value within\n that range as expressed by progress (usually a number from 0 to 1)\n\n So progress = 0.5 would change\n\n from -------- to\n\n to\n\n from ---- to\n\n E.g. from = 10, to = 20, progress = 0.5 => 15\n\n @param [number]: Lower limit of range\n @param [number]: Upper limit of range\n @param [number]: The progress between lower and upper limits expressed 0-1\n @return [number]: Value as calculated from progress within range (not limited within range)\n*/\nexport const mixNumber = (from: number, to: number, progress: number) => {\n return from + (to - from) * progress\n}\n","import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n if (!type) {\n warning(\n false,\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n return false\n }\n\n let model = type.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n","export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n","import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n","import { sanitize } from \"../../value/types/utils/sanitize\"\nimport { getMixer } from \"./complex\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { Mixer } from \"./types\"\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/**\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: string, to: string): Mixer | undefined {\n const a = unitValue.exec(from)\n if (!a) return\n const b = unitValue.exec(to)\n if (!b || a[2] !== b[2]) return\n\n const unit = a[2]\n const origin = parseFloat(a[1])\n const target = parseFloat(b[1])\n\n return (p: number) =>\n sanitize(mixNumberImmediate(origin, target, p)) + unit\n}\n\nexport function mix(from: T, to: T): Mixer\nexport function mix(from: number, to: number, p: number): number\nexport function mix(from: T, to: T, p?: T): Mixer | number {\n if (\n typeof from === \"number\" &&\n typeof to === \"number\" &&\n typeof p === \"number\"\n ) {\n return mixNumberImmediate(from, to, p)\n }\n\n if (typeof from === \"string\" && typeof to === \"string\") {\n const mixer = mixUnit(from, to)\n if (mixer) return mixer as Mixer\n }\n\n const mixer = getMixer(from)\n return mixer(from as any, to as any) as Mixer\n}\n","import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n","import { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(runNextFrame: () => void): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set()\n let nextFrame = new Set()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n * 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\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n nextFrame.add(callback)\n runNextFrame()\n }\n\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n const prevFrame = thisFrame\n thisFrame = nextFrame\n nextFrame = prevFrame\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean,\n state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(flagRunNextFrame)\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const useManualTiming = MotionGlobalConfig.useManualTiming\n const timestamp = useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n","import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\nimport { frameData } from \"./frame-data\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true,\n frameData\n)\n","import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n","import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n","import { KeyframeGenerator } from \"../../types\"\n\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nexport const maxGeneratorDuration = 20_000\n\nexport function calcGeneratorDuration(\n generator: KeyframeGenerator,\n timeStep = 50,\n maxDuration = maxGeneratorDuration,\n keyframes?: T[]\n): number {\n let duration = 0\n let state = generator.next(duration)\n keyframes?.push(state.value)\n\n while (!state.done && duration < maxDuration) {\n duration += timeStep\n state = generator.next(duration)\n keyframes?.push(state.value)\n }\n\n return duration >= maxDuration ? Infinity : duration\n}\n","import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n /**\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 as any\n const delta = k && k[k.length - 1] - k[0]\n\n const generator = createGenerator({\n ...options,\n velocity: v && delta ? (v * scale) / delta : v,\n keyframes: [0, scale],\n })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../types\"\nimport { generateLinearEasing } from \"../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"./utils/calc-duration\"\nimport { createGeneratorEasing } from \"./utils/create-generator-easing\"\n\nconst springDefaults = {\n // Default spring physics\n stiffness: 100,\n damping: 10,\n mass: 1.0,\n\n // Default duration/bounce-based options\n duration: 800, // in ms\n bounce: 0.3,\n visualDuration: 0.3, // in seconds\n\n // Rest thresholds\n restSpeed: {\n granular: 0.01,\n default: 2,\n },\n restDelta: {\n granular: 0.005,\n default: 0.5,\n },\n\n // Limits\n minDuration: 0.01, // in seconds\n maxDuration: 10.0, // in seconds\n minDamping: 0.05,\n}\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: number) =>\n bounce < 0\n ? 1 / Math.max(1 + bounce, springDefaults.minDamping)\n : Math.max(1 - bounce, springDefaults.minDamping)\n\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: number, criticalFreqTime: number) {\n if (!(dampingRatio > 1)) return 1\n\n const root = Math.sqrt(dampingRatio * dampingRatio - 1)\n const slow = dampingRatio - root\n const fast = dampingRatio + root\n const target =\n 2 * root * Math.exp(-criticalFreqTime) * (1 + criticalFreqTime)\n\n return (\n approximateRoot(\n (freqTime) =>\n fast * Math.exp(-slow * freqTime) -\n slow * Math.exp(-fast * freqTime) -\n target,\n (freqTime) =>\n Math.exp(-fast * freqTime) - Math.exp(-slow * freqTime),\n criticalFreqTime\n ) / criticalFreqTime\n )\n}\n\nfunction calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: (num: number) => number,\n derivative: (num: number) => number,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\nconst safeMin = 0.001\n\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({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n}: SpringOptions) {\n let envelope: (num: number) => number\n let derivative: (num: number) => number\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n const dampingRatio = bounceToDampingRatio(bounce)\n\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (exponentialDecay / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const e =\n 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 } 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\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = -undampedFreq * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const criticalFreq = approximateRoot(envelope, derivative, initialGuess)\n const undampedFreq =\n criticalFreq *\n overdampedFreqScale(dampingRatio, criticalFreq * duration)\n const stiffness = undampedFreq * undampedFreq\n\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(stiffness),\n duration: secondsToMilliseconds(duration),\n }\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: number | undefined, canBeZero?: boolean) =>\n (canBeZero ? value! >= 0 : value! > 0) && value! < Infinity\n\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: number | undefined, canBeZero?: boolean) {\n if (isValidPhysics(value, canBeZero)) return value\n\n if (process.env.NODE_ENV !== \"production\") {\n warning(\n value === undefined,\n \"Spring stiffness and mass must be positive, damping 0 or greater\",\n \"spring-invalid-physics\"\n )\n }\n\n return undefined\n}\n\nfunction getSpringOptions(options: SpringOptions) {\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\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:\n (validStiffness ?? validDamping ?? validMass) === undefined &&\n (options.duration !== undefined || options.bounce !== undefined),\n }\n\n if (springOptions.isTimeDefined) {\n if (options.visualDuration) {\n const dampingRatio = bounceToDampingRatio(options.bounce || 0)\n const root =\n ((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 } else {\n Object.assign(springOptions, findSpring(springOptions))\n springOptions.isResolvedFromDuration = true\n }\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 (\n !isValidPhysics(springOptions.stiffness) ||\n !isValidPhysics(springOptions.damping, true)\n ) {\n springOptions.stiffness = springDefaults.stiffness\n springOptions.damping = springDefaults.damping\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions)\n : optionsOrVisualDuration\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n isResolvedFromDuration,\n isTimeDefined,\n } = getSpringOptions({ ...options })\n\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: number) =>\n isTimeDefined ? 0 : -millisecondsToSeconds(velocity)\n\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n const decay = dampingRatio * undampedAngularFreq\n\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 /**\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\n let resolveSpring: (v: number) => number\n let resolveVelocity: (t: number) => number\n\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: VoidFunction\n\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\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\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\n const sample = (t: number) => {\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\n // Underdamped spring\n resolveSpring = (t: number) => {\n sample(t)\n return s.target - c.env * (c.A * c.sin + s.delta * c.cos)\n }\n\n resolveVelocity = (t: number) => {\n sample(t)\n return c.env * (c.sinC * c.sin + c.cosC * c.cos)\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n s.target -\n Math.exp(-undampedAngularFreq * t) *\n (s.delta + (s.velocity + undampedAngularFreq * s.delta) * t)\n\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: number) =>\n Math.exp(-undampedAngularFreq * t) *\n (undampedAngularFreq * c.C * t - s.velocity)\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 =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n const slow = decay - dampedAngularFreq\n const fast = decay + dampedAngularFreq\n\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: number, t: number) =>\n Math.exp(\n t > limit ? -rate * limit - decay * (t - limit) : -rate * t\n )\n\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\n resolveSpring = (t: number) =>\n s.target - c.S * decayAt(slow, t) - c.F * decayAt(fast, t)\n\n // Analytical derivative of overdamped spring (px/ms)\n resolveVelocity = (t: number) =>\n slow * c.S * decayAt(slow, t) + fast * c.F * decayAt(fast, t)\n }\n\n update()\n\n const calculatedDuration = isResolvedFromDuration ? duration || null : null\n\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: number[], newVelocity: number) => {\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)) setRestThresholds()\n // Invalidate any duration lazily cached by JSAnimation\n generator.calculatedDuration = calculatedDuration\n state.done = false\n update()\n },\n velocity: (t: number) => secondsToMilliseconds(resolveVelocity(t)),\n next: (t: number) => {\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n const currentVelocity = secondsToMilliseconds(\n resolveVelocity(t)\n )\n state.done =\n Math.abs(currentVelocity) <= s.restSpeed &&\n Math.abs(s.target - current) <= s.restDelta\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? s.target : current\n\n return state\n },\n toString: () => {\n const easingDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(easingDuration * progress).value,\n easingDuration,\n 30\n )\n\n return easingDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n","import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions): KeyframeGenerator {\n const origin = keyframes[0]\n\n const state: AnimationState = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) => v < min! || v > max!\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : target + delta\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n /**\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\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n","import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory\n}\n\nfunction createMixers(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory\n) {\n const mixers: Array> = []\n const mixerFactory: MixerFactory =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n","import { progress } from \"motion-utils\"\nimport { mixNumber } from \"../../../utils/mix/number\"\n\nexport function fillOffset(offset: number[], remaining: number): void {\n const min = offset[offset.length - 1]\n for (let i = 1; i <= remaining; i++) {\n const offsetProgress = progress(0, remaining, i)\n offset.push(mixNumber(min, 1, offsetProgress))\n }\n}\n","import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n","export function convertOffsetToTimes(offset: number[], duration: number) {\n return offset.map((o) => o * duration)\n}\n","import {\n clamp,\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n MotionGlobalConfig,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { mix } from \"../../utils/mix\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions): KeyframeGenerator {\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 /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Fast setup path for two keyframes one easing.\n */\n if (\n keyframeValues.length === 2 &&\n !Array.isArray(easingFunctions) &&\n (!times ||\n times.length !== 2 ||\n (times[0] === 0 && times[1] === 1))\n ) {\n const [origin, target] = keyframeValues\n const mixer =\n origin === target\n ? undefined\n : (MotionGlobalConfig.mix || mix)(origin, target)\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mixer\n ? mixer(\n easingFunctions(\n duration > 0 ? clamp(0, 1, t / duration) : 1\n )\n )\n : target\n state.done = t >= duration\n return state\n },\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),\n duration\n )\n\n const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n","import { velocityPerSecond } from \"motion-utils\"\nimport { KeyframeGenerator } from \"../../types\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n\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 */\nexport function calcGeneratorVelocity(\n generator: KeyframeGenerator,\n t: number,\n initialVelocity = 0\n): number {\n if (t <= 0) return initialVelocity\n\n return generator.velocity\n ? generator.velocity(t)\n : getGeneratorVelocity(\n (s) => generator.next(s).value as number,\n t,\n generator.next(t).value as number\n )\n}\n","import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n","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\n\nexport const resolveStartTime = (startTime: number, now: number) =>\n now - startTime > MAX_START_DELAY && !MotionGlobalConfig.useManualTiming\n ? now\n : startTime\n","import { frameData } from \"../../frameloop/frame-data\"\nimport { time } from \"../../frameloop/sync-time\"\n\ninterface MotionInspectBase {\n animation: unknown\n timestamp: number\n frameTimestamp: number\n frameIsProcessing: boolean\n}\n\ninterface MotionInspectAnimationStart extends MotionInspectBase {\n kind: \"animation-start\"\n options: object\n}\n\ninterface MotionInspectLayoutAnimationStart extends MotionInspectBase {\n kind: \"layout-animation-start\"\n node: unknown\n}\n\ntype MotionInspectRecord =\n | MotionInspectAnimationStart\n | MotionInspectLayoutAnimationStart\n\ntype MotionInspectHook = (record: MotionInspectRecord) => void\n\ntype InspectGlobal = typeof globalThis & {\n __MOTION_INSPECT__?: MotionInspectHook\n}\n\nfunction baseRecord(\n kind: K,\n animation: unknown\n) {\n return {\n kind,\n animation,\n timestamp: time.now(),\n frameTimestamp: frameData.timestamp,\n frameIsProcessing: frameData.isProcessing,\n }\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 */\nexport function notifyAnimationStart(\n animation: unknown,\n options: object,\n transition?: object\n): void {\n const notify = (globalThis as InspectGlobal).__MOTION_INSPECT__\n if (!notify) return\n\n try {\n notify({\n ...baseRecord(\"animation-start\", animation),\n options: transition ? { ...options, ...transition } : options,\n })\n } catch {}\n}\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 */\nexport function notifyLayoutAnimationStart(\n animation: unknown,\n node: unknown\n): void {\n const notify = (globalThis as InspectGlobal).__MOTION_INSPECT__\n if (!notify) return\n\n try {\n notify({\n ...baseRecord(\"layout-animation-start\", animation),\n node,\n })\n } catch {}\n}\n","export class WithPromise {\n /**\n * The promise and its resolver are only created when `finished` is\n * first read. Most animations are never awaited, so this saves a\n * Promise allocation per value animation.\n */\n private _finished?: Promise\n\n private _resolve?: VoidFunction\n\n private 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\n return this._finished\n }\n\n protected updateFinished() {\n this._finished = this._resolve = undefined\n this.isResolved = false\n }\n\n protected notifyFinished() {\n this.isResolved = true\n this._resolve?.()\n }\n\n /**\n * Allows the animation to be awaited.\n *\n * @deprecated Use `finished` instead.\n */\n then(onResolve: VoidFunction, onReject?: VoidFunction) {\n return this.finished.then(onResolve, onReject)\n }\n}\n","import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { calcGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { resolveStartTime } from \"./utils/resolve-start-time\"\nimport { notifyAnimationStart } from \"./utils/notify-inspector\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport const round = (value: number) => Math.round(value * 10000) / 10000\n\nexport class JSAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n protected driver?: DriverControls\n\n protected isStopped = false\n\n /**\n * The start time this animation picked for itself, until its first tick.\n */\n private pendingStartTime?: number\n\n private generator: KeyframeGenerator\n\n private calculatedDuration: number\n\n protected resolvedDuration: number\n\n protected totalDuration: number\n\n protected options: ValueAnimationOptions\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n protected holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer | undefined\n\n private mirroredGenerator: KeyframeGenerator | undefined\n\n /**\n * Reusable state object for the delay phase to avoid\n * allocating a new object every frame.\n */\n private delayState: AnimationState = {\n done: false,\n value: undefined as unknown as T,\n }\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n\n notifyAnimationStart(this, this.options)\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory(\n keyframes === options.keyframes\n ? options\n : { ...options, keyframes }\n )\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const { generator, totalDuration, calculatedDuration } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n if (this.startTime === this.pendingStartTime) {\n this.startTime = resolveStartTime(this.startTime, timestamp)\n }\n this.pendingStartTime = undefined\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n const state = this.generate(this.currentTime, isInDelayPhase)\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * This animation's time, including delay, at a timestamp.\n */\n at(timestamp: number) {\n return (\n this.holdTime ??\n round((timestamp - this.startTime!) * this.playbackSpeed)\n )\n }\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: number, resolved?: boolean): T {\n const { options, totalDuration } = this\n const t = this.at(timestamp) - (options.delay || 0)\n\n return t >= totalDuration && options.type !== inertia\n ? getFinalKeyframe(\n options.keyframes,\n options,\n resolved ? undefined : options.finalKeyframe\n )\n : this.generate(Math.max(t, 0), t < 0).value\n }\n\n /**\n * The generator's state `currentTime` ms after the delay, without\n * changing the animation's own state.\n */\n protected generate(\n currentTime: number,\n isInDelayPhase: boolean\n ): AnimationState {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n } = this\n const { keyframes, repeat, repeatType, repeatDelay } = this.options\n\n let elapsed = currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n let state: AnimationState\n if (isInDelayPhase) {\n this.delayState.value = keyframes[0]\n state = this.delayState\n } else {\n state = frameGenerator.next(elapsed)\n }\n\n if (mixKeyframes && !isInDelayPhase) {\n state.value = mixKeyframes(state.value as number)\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n if (this.driver) {\n this.driver.start(false)\n } else {\n this.startTime = 0\n this.state = \"paused\"\n this.holdTime = newTime\n this.tick(newTime)\n }\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(): number {\n return calcGeneratorVelocity(\n this.generator,\n this.currentTime,\n this.options.velocity\n )\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n const hasChanged = this.playbackSpeed !== newSpeed\n\n if (hasChanged && this.driver) {\n this.updateTime(time.now())\n }\n\n this.playbackSpeed = newSpeed\n\n if (hasChanged && this.driver) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime / (this.playbackSpeed || 1)\n } else if (!this.startTime) {\n this.startTime = startTime ?? (this.pendingStartTime = now)\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue(\n options: ValueAnimationOptions\n) {\n return new JSAnimation(options)\n}\n","import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n","import { complex } from \".\"\nimport { AnyResolvedKeyframe } from \"../../../animation/types\"\n\nexport const mask = {\n ...complex,\n getAnimatableNone: (v: AnyResolvedKeyframe) => {\n const parsed = complex.parse(v)\n const transformer = complex.createTransformer(v)\n return transformer(\n parsed.map((v) =>\n typeof v === \"number\" ? 0 : typeof v === \"object\" ? { ...v, alpha: 1 } : v\n )\n )\n },\n}\n","import { number } from \"./numbers\"\n\nexport const int = {\n ...number,\n transform: Math.round,\n}\n","import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n /**\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","import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n","import { color } from \"../color\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { numberValueTypes } from \"./number\"\nimport { ValueTypeMap } from \"./types\"\n\n/**\n * A map of default value types for common values\n */\nexport const defaultValueTypes: ValueTypeMap = {\n ...numberValueTypes,\n\n // Color props\n color,\n backgroundColor: color,\n outlineColor: color,\n fill: color,\n stroke: color,\n\n // Border props\n borderColor: color,\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n borderLeftColor: color,\n filter,\n WebkitFilter: filter,\n mask,\n WebkitMask: mask,\n}\n\n/**\n * Gets the default ValueType for the provided value key\n */\nexport const getDefaultValueType = (key: string) => defaultValueTypes[key]\n","import { complex } from \"../complex\"\nimport { filter } from \"../complex/filter\"\nimport { mask } from \"../complex/mask\"\nimport { getDefaultValueType } from \"../maps/defaults\"\n\nconst customTypes = /*@__PURE__*/ new Set([filter, mask])\n\nexport function getAnimatableNone(key: string, value: string) {\n let defaultValueType = getDefaultValueType(key)\n if (!customTypes.has(defaultValueType as any)) defaultValueType = complex\n // If value is not recognised as animatable, ie \"none\", create an animatable version origin based on the target\n return defaultValueType.getAnimatableNone\n ? defaultValueType.getAnimatableNone(value)\n : undefined\n}\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\n\nexport function fillWildcards(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[]\n) {\n for (let i = 1; i < keyframes.length; i++) {\n keyframes[i] ??= keyframes[i - 1]\n }\n}\n","import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n 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} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.hypot(v[0], v[1])\nconst scaleY = (v: number[]) => Math.hypot(v[4], v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n 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} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"scaleZ\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n *\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 */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set([...transformPropOrder, \"pathRotation\"]))()\n","import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\n/**\n * Measures a positional value in pixels from an element's computed style.\n * The bounding box is only measured on demand as it forces layout and is\n * affected by transforms.\n */\ntype GetActualMeasurementInPixels = (\n computedStyle: Partial,\n measureBox: () => Box\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\n\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 */\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n const current = value.get()\n const reset = key.startsWith(\"scale\") ? 1 : 0\n\n if (current === reset) return\n\n removedTransforms.push([key, current])\n value.set(reset)\n }\n })\n\n return removedTransforms\n}\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 */\nexport const boxDependentValues = new Set([\"bottom\", \"right\"])\n\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(\n computed: string | undefined,\n measureBox: () => Box,\n axis: \"x\" | \"y\",\n paddingStart: string,\n paddingEnd: string,\n boxSizing?: string\n) {\n const px = parseFloat(computed as string)\n if (!isNaN(px)) return px\n\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}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: (\n { width, paddingLeft = \"0\", paddingRight = \"0\", boxSizing },\n measureBox\n ) =>\n measureDimension(\n width,\n measureBox,\n \"x\",\n paddingLeft,\n paddingRight,\n boxSizing\n ),\n height: (\n { height, paddingTop = \"0\", paddingBottom = \"0\", boxSizing },\n measureBox\n ) =>\n measureDimension(\n height,\n measureBox,\n \"y\",\n paddingTop,\n paddingBottom,\n boxSizing\n ),\n\n top: ({ top }) => parseFloat(top as string),\n left: ({ left }) => parseFloat(left as string),\n bottom: ({ top }, measureBox) => {\n const { y } = measureBox()\n return parseFloat(top as string) + (y.max - y.min)\n },\n right: ({ left }, measureBox) => {\n const { x } = measureBox()\n return parseFloat(left as string) + (x.max - x.min)\n },\n\n // Transform\n x: ({ transform }) => parseValueFromTransform(transform, \"x\"),\n y: ({ transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n","import { isNumericalString, isZeroValueString } from \"motion-utils\"\nimport { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { complex } from \"../../value/types/complex\"\nimport { getAnimatableNone } from \"../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport {\n boxDependentValues,\n removeNonTranslationalTransform,\n} from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes = Array\n\nexport type ResolvedKeyframes = Array\n\nconst toResolve = new Set()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure: KeyframeResolver[] = []\n const elementsToMeasure = new Set()\n const elementsToUntransform = new Set()\n\n toResolve.forEach((resolver) => {\n if (!resolver.needsMeasurement) return\n\n resolversToMeasure.push(resolver)\n elementsToMeasure.add(resolver.element!)\n\n if (boxDependentValues.has(resolver.name!)) {\n elementsToUntransform.add(resolver.element!)\n }\n })\n\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\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: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\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(\n value: AnyResolvedKeyframe | null | undefined,\n name: string,\n target: AnyResolvedKeyframe | null\n) {\n if (typeof value === \"string\") {\n if (isNumericalString(value) || isZeroValueString(value)) {\n return parseFloat(value)\n } else if (!complex.test(value) && complex.test(target)) {\n return getAnimatableNone(name, target as string)\n }\n }\n\n return value ?? undefined\n}\n\nexport type OnKeyframesResolved = (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes\n\n protected motionValue?: MotionValue\n private onComplete: OnKeyframesResolved\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = readOrigin(\n element.readValue(name, finalKeyframe),\n name,\n finalKeyframe\n )\n\n if (valueAsRead !== undefined) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n","export const isCSSVar = (name: string) => name.startsWith(\"--\")\n","import { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVar } from \"./is-css-var\"\n\nexport function setStyle(\n element: HTMLElement | SVGElement,\n name: string,\n value: AnyResolvedKeyframe\n) {\n isCSSVar(name)\n ? element.style.setProperty(name, value as string)\n : (element.style[name as any] = value as string)\n}\n","/**\n * Add the ability for test suites to manually set support flags\n * to better test more environments.\n */\nexport const supportsFlags: Record = {}\n","import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n","import { ProgressTimeline } from \"../..\"\nimport { memoSupports } from \"./memo\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n ViewTimeline: ViewTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\ndeclare class ViewTimeline implements ProgressTimeline {\n constructor(options: { subject: Element; axis?: string })\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nexport const supportsScrollTimeline = /* @__PURE__ */ memoSupports(\n () => window.ScrollTimeline !== undefined,\n \"scrollTimeline\"\n)\n\nexport const supportsViewTimeline = /* @__PURE__ */ memoSupports(\n () => window.ViewTimeline !== undefined,\n \"viewTimeline\"\n)\n","import { memoSupports } from \"./memo\"\n\nexport const supportsLinearEasing = /*@__PURE__*/ memoSupports(() => {\n try {\n document\n .createElement(\"div\")\n .animate({ opacity: 0 }, { easing: \"linear(0, 1)\" })\n } catch (e) {\n return false\n }\n return true\n}, \"linearEasing\")\n","import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n","import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n","import { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n return element.animate(keyframeOptions, options)\n}\n","import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n","import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n","import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { notifyAnimationStart } from \"./utils/notify-inspector\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions\n extends DOMValueAnimationOptions {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\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\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n\n notifyAnimationStart(this, options, transition)\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n const element = this.options?.element\n if (!this.isPseudoElement && element?.isConnected) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n const wasFinished = this.finishedTime !== null\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n\n if (wasFinished) {\n this.animation.pause()\n }\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({\n timeline,\n onAttach,\n observe,\n }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n onAttach?.(this.animation)\n\n return noop\n } else {\n return observe(this)\n }\n }\n}\n","import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n","import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended =\n NativeAnimationOptions & ValueAnimationOptions & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nexport const sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n options: NativeAnimationOptionsExtended\n\n constructor(options: NativeAnimationOptionsExtended) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n /**\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\n this.options = options\n }\n\n private sampler?: JSAnimation\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 private elapsed() {\n return this.state === \"running\"\n ? (time.now() - this.startTime) * this.speed\n : this.time * 1000\n }\n\n /**\n * The value at a time, from a renderless JS animation.\n */\n private sample(sampleTime: number) {\n if (!this.sampler) {\n const {\n motionValue,\n onUpdate,\n onComplete,\n onPlay,\n onStop,\n element,\n ...options\n } = this.options\n\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\n return this.sampler.sample(Math.max(0, sampleTime)).value\n }\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\n if (state === \"running\" || state === \"paused\") {\n return this.sample(this.elapsed())\n }\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?: T) {\n const { motionValue, element, name } = this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const { speed } = this\n const sampleTime = this.elapsed()\n const delta =\n this.state === \"running\" && speed\n ? clamp(0, sampleDelta, sampleTime)\n : 0\n const current = this.sample(sampleTime)\n\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) setStyle(element, name, current)\n\n motionValue.setWithVelocity(\n this.sample(sampleTime - delta * Math.sign(speed)),\n current,\n delta / Math.abs(speed || 1)\n )\n }\n}\n","import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n","import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n // 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(\n false,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n","import { ValueAnimationOptions } from \"../types\"\n\nexport function makeAnimationInstant(\n options: Partial<{\n duration: ValueAnimationOptions[\"duration\"]\n type: ValueAnimationOptions[\"type\"]\n }>\n): void {\n options.duration = 0\n options.type = \"keyframes\"\n}\n","/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n \"backgroundColor\",\n])\n","const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n","import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\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])\n\nexport const supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation(\n options: ValueAnimationOptionsWithRenderContext\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\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 (\n !name ||\n !(acceleratedValues.has(name) || colorProperties.has(name))\n ) {\n return false\n }\n\n const subject = motionValue?.owner?.current\n\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 (\n !(subject instanceof HTMLElement) &&\n !(subject instanceof SVGElement)\n ) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n 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}\n","import { ValueType } from \"../types\"\n\n/**\n * Provided a value and a ValueType, returns the value as that value type.\n */\nexport const getValueAsType = (value: any, type?: ValueType) => {\n return type && typeof value === \"number\"\n ? (type as any).transform(value)\n : value\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport const translateAlias: Record = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i]\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n // `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(\n pathRotation,\n numberValueTypes.pathRotation\n )}) `\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n","/**\n * The independent transform (x, scale, rotate etc) animations running on\n * each element, composed into one hardware-accelerated `transform`.\n *\n * Kept apart from the group itself so renderers and projection can tell a\n * group about outside changes without importing the animation code.\n */\nexport interface TransformGroupHooks {\n /**\n * A transform value may have been set by something other than one of\n * the group's animations.\n */\n check(): void\n\n /**\n * Hand every animation in the group back to the main thread, with\n * up-to-date values, e.g. before layout is measured.\n */\n demote(): void\n}\n\nexport const transformGroups = new WeakMap()\n","import {\n BezierDefinition,\n clamp,\n isBezierDefinition,\n millisecondsToSeconds,\n progress,\n} from \"motion-utils\"\nimport { frame } from \"../../../frameloop/frame\"\nimport { frameData } from \"../../../frameloop/frame-data\"\nimport { time } from \"../../../frameloop/sync-time\"\nimport {\n buildTransform,\n translateAlias,\n} from \"../../../render/html/utils/build-transform\"\nimport type { ResolvedValues } from \"../../../render/types\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { mixNumber } from \"../../../utils/mix/number\"\nimport type { MotionValue, Owner } from \"../../../value\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { frameloopDriver } from \"../../drivers/frame\"\nimport { DriverControls } from \"../../drivers/types\"\nimport { keyframes as keyframesGenerator } from \"../../generators/keyframes\"\nimport { defaultOffset } from \"../../keyframes/offsets/default\"\nimport { JSAnimation, round } from \"../../JSAnimation\"\nimport { sampleDelta } from \"../../NativeAnimationExtended\"\nimport {\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"../../types\"\nimport { cubicBezierAsString } from \"../easing/cubic-bezier\"\nimport { supportedWaapiEasing } from \"../easing/supported\"\nimport { supportsWaapi } from \"../supports/waapi\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { TransformGroupHooks, transformGroups } from \"./groups\"\n\n/**\n * Independent transforms (x, y, scale, rotate etc) all write to the one\n * `transform` style, so they can't each run as their own WAAPI animation.\n * Instead, every transform animation on an element joins a group. While\n * every animation in the group can be accelerated, the group composes them\n * into a single `transform` WAAPI animation. The animations stay\n * JSAnimations, but their driver doesn't tick, so they do no work per\n * frame.\n *\n * When every animation follows the same eased progress, which is the case\n * for values that share a transition, the WAAPI animation has just two\n * keyframes and that easing. Otherwise it has as few sampled keyframes\n * as keep it accurate. It's only rebuilt when an animation starts or\n * stops. Pausing, seeking and speed changes that apply to every animation\n * in the group are made to the WAAPI animation, and animations complete\n * on its finish events.\n *\n * If one of them can't be accelerated, or something else keeps writing\n * the element's transform, the whole group moves to the main thread.\n */\n\ninterface TransformOwner extends Owner {\n current: HTMLElement\n latestValues?: Record\n getValue(key: string): MotionValue | undefined\n projection?: { isProjecting(): boolean }\n}\n\ninterface TransformDriverControls extends DriverControls {\n js: DriverControls\n}\n\ninterface TransformGroup extends TransformGroupHooks {\n tracks: Set>\n\n /**\n * Whether the group's animations are running on the main thread.\n */\n isJS: boolean\n\n /**\n * Whether animations are finishing because they reached their end,\n * which the WAAPI animation has already rendered.\n */\n isFinishing: boolean\n\n /**\n * Rebuild or retime the WAAPI animation. A churn is a change it may\n * not be able to follow, like a seek or an outside write.\n */\n schedule(needsBuild: boolean, isChurn?: boolean): void\n\n /**\n * An animation was stopped. Rebuild without it or, if it was the last,\n * end the group.\n */\n release(track: TransformAnimation): void\n demote(canReturn?: boolean): void\n}\n\n/**\n * Where each animation was when the WAAPI animation was built: its time,\n * speed and whether it was held.\n */\ntype BuiltState = [number, number, boolean]\n\ninterface Segment {\n animation: Animation\n /**\n * When this starts and ends, relative to when the group was built.\n */\n offset: number\n end: number\n isDone?: boolean\n}\n\n/**\n * Sample at the interruption sampling rate, up to a cap for long\n * animations.\n */\nconst maxSamples = 200\n\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/**\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/**\n * Named easings that are the same cubic-bezier in JS and CSS.\n */\nconst isNativeEasing = (ease: unknown): ease is \"linear\" =>\n /^(linear|ease(In|Out|InOut))$/.test(ease as string)\n\nconst byTime = (a: number, b: number) => a - b\n\n/**\n * n + 1 evenly spaced timestamps, from one timestamp to another.\n */\nconst spread = (from: number, to: number, n: number) => {\n const result: number[] = []\n for (let i = 0; i <= n; i++) result.push(mixNumber(from, to, i / n))\n return result\n}\n\nconst getOwner = (options: ValueAnimationOptions) =>\n options.motionValue!.owner as TransformOwner\n\nconst getGroup = (element: Element) =>\n transformGroups.get(element) as TransformGroup | undefined\n\nconst read = (owner: TransformOwner, key: string) =>\n owner.latestValues ? owner.latestValues[key] : owner.getValue(key)?.get()\n\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 */\nexport const canGroupTransform = ({\n name,\n motionValue,\n}: ValueAnimationOptions) =>\n name &&\n transformPropOrder.includes(name) &&\n motionValue?.owner?.current instanceof HTMLElement &&\n supportsWaapi() &&\n supportsLinearEasing()\n\nfunction canAccelerateTransform(options: ValueAnimationOptions) {\n const owner = getOwner(options)\n const { onUpdate, transformTemplate } = owner.getProps()\n\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 )\n}\n\nexport class TransformAnimation<\n T extends number | string\n> extends JSAnimation {\n canAccelerate: boolean\n\n constructor(options: ValueAnimationOptions) {\n const element = getOwner(options).current\n const { driver = frameloopDriver } = options\n let animation: TransformAnimation\n\n /**\n * Before JSAnimation replaces the type with its generator.\n */\n const canAccelerate = canAccelerateTransform(options)\n\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\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 /**\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 } as TransformDriverControls\n }\n\n super(options)\n\n animation = this\n this.canAccelerate = canAccelerate\n\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\n get group() {\n return getGroup(getOwner(this.options).current)\n }\n\n get js() {\n return (this.driver as TransformDriverControls | undefined)?.js\n }\n\n get name() {\n return this.options.name!\n }\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\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 /**\n * Whether this is running, or paused, on the compositor.\n */\n isAccelerated() {\n const { group, state } = this\n return (\n group?.tracks.has(this) &&\n !group.isJS &&\n this.canAccelerate &&\n (state === \"running\" || state === \"paused\")\n )\n }\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 /**\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(): [number, number, string] | undefined {\n const { keyframes, type, ease, times, repeat, delay = 0 } = this.options\n const easing = isBezierDefinition(ease!)\n ? cubicBezierAsString(ease as BezierDefinition)\n : isNativeEasing(ease) && supportedWaapiEasing[ease]\n\n if (\n easing &&\n !repeat &&\n !times &&\n keyframes.length === 2 &&\n type === keyframesGenerator &&\n this.holdTime === null\n ) {\n const start = this.startTime! + delay / this.speed\n return [start, start + this.resolvedDuration / this.speed, easing]\n }\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: number, to: number) {\n const { startTime, speed, resolvedDuration, options } = this\n const {\n delay = 0,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n times,\n keyframes,\n type,\n } = options\n const offsets =\n (type || keyframesGenerator) === keyframesGenerator\n ? times || defaultOffset(keyframes)\n : [0, 1]\n const start = startTime! + delay / speed\n const result: number[] = []\n\n if (this.holdTime !== null || !(resolvedDuration > 0)) return result\n\n for (\n let i = Math.max(\n 0,\n Math.floor(((from - start) * speed) / resolvedDuration)\n );\n i <= repeat;\n i++\n ) {\n const iterationStart = start + (i * resolvedDuration) / speed\n if (iterationStart > to) break\n\n for (const offset of offsets) {\n const t =\n 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\n return result\n }\n\n /**\n * The value at a timestamp, as a number.\n */\n numberAt(timestamp: number) {\n return parseFloat(this.sampleAt(timestamp, true) as string)\n }\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(\n this.sampleAt(now - sampleDelta, true),\n this.sampleAt(now, true),\n sampleDelta\n )\n }\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) return\n ;(this.group || createGroup(getOwner(this.options))).tracks.add(this)\n\n super.play()\n }\n\n pause() {\n super.pause()\n\n if (this.isAccelerated()) {\n this.sync()\n this.group!.schedule(false)\n }\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 /**\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(\n clamp(\n 0,\n this.totalDuration,\n this.at(time.now()) - (this.options.delay || 0)\n )\n )\n }\n\n return super.time\n }\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: number) {\n super.time = newTime\n this.isAccelerated() && this.sync()\n }\n\n /**\n * Scroll timelines set time every frame, so run these on the main\n * thread.\n */\n attachTimeline(timeline: TimelineWithFallback) {\n this.canAccelerate = false\n this.group?.demote(true)\n return super.attachTimeline(timeline)\n }\n}\n\nfunction createGroup(owner: TransformOwner): TransformGroup {\n const element = owner.current\n const tracks = new Set>()\n const byKey = new Map>()\n\n /**\n * Transforms that aren't animating, as built into the WAAPI animation.\n */\n let statics: Record = {}\n /**\n * The transforms in the WAAPI animation, in order.\n */\n let keys: string[] = []\n let built = new Map, BuiltState>()\n let segments: Segment[] = []\n let needsBuild = false\n let isScheduled = false\n let isEnded = false\n let hasChurned = false\n let lastChurn = -Infinity\n\n const has = (key: string) => {\n for (const track of tracks) if (track.name === key) return true\n }\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?: number, settled?: number) => {\n const values: ResolvedValues = {}\n for (const key of timestamp === undefined ? transformPropOrder : keys) {\n const track = byKey.get(key)\n const value =\n timestamp === undefined\n ? read(owner, key)\n : track\n ? track.sampleAt(\n settled! > timestamp && !track.timing()[1]\n ? settled!\n : timestamp\n )\n : statics[key]\n\n if (value !== undefined) values[key] = value\n }\n return values\n }\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: number, settled?: number) => {\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 /**\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 /**\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\n const add = (animation: Animation, offset: number, end = Infinity) => {\n const segment: Segment = { animation, offset, end }\n animation.startTime = time.now() + offset\n\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 /**\n * Something else cancelled it, so carry on on the main thread.\n */\n animation.oncancel = () => segments.includes(segment) && group.demote()\n\n segments.push(segment)\n }\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: (t: number) => number, a: number, b: number) => {\n const change = (x: number, y: number) => 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 /**\n * If every moving animation follows the same eased progress between\n * two timestamps, the easing that describes it.\n */\n const getEasing = (\n moving: TransformAnimation[],\n from: number,\n to: number,\n bounds: number[]\n ) => {\n const samples = Math.min(\n maxSamples,\n Math.max(2, Math.ceil((to - from) / sampleDelta))\n )\n\n /**\n * Too many keyframes or repeats to follow with this many samples.\n */\n if (bounds.length * 4 > samples) return\n\n const at = spread(from, to, samples).concat(bounds).sort(byTime)\n\n const position = (t: number) => progress(from, to, t)\n let shared: number[] | undefined\n let progressAt: (t: number) => number\n\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 /**\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(\n (change) => Math.abs(change) * easingTolerance > Math.abs(end)\n )\n ? 0\n : end\n\n const progress = changes.map((change) =>\n range ? change / range : change\n )\n\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 } else if (!shared) {\n shared = progress\n progressAt = (t) => (track.numberAt(t) - first) / range\n } else if (\n progress.some(\n (p, i) => !(Math.abs(p - shared![i]) <= easingTolerance)\n )\n ) {\n return\n }\n }\n\n if (\n !shared ||\n shared.every(\n (p, i) => Math.abs(p - position(at[i])) <= easingTolerance\n )\n ) {\n return \"linear\"\n }\n\n /**\n * A repeat that starts again jumps back, which takes two points at\n * the same position.\n */\n const points: string[] = []\n const point = (t: number, p = progressAt(t)) =>\n 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\n return \"linear(\" + points + \")\"\n }\n\n /**\n * Sample timestamps between two timestamps, closer together where the\n * moving animations curve.\n */\n const sample = (\n moving: TransformAnimation[],\n from: number,\n to: number,\n bounds: number[]\n ) => {\n const times = [from]\n\n /**\n * Values that aren't numbers, like calc(), are left to the\n * browser to interpolate.\n */\n const isStraight = (a: number, b: number) =>\n moving.every(\n (track) =>\n !(\n Math.abs(\n track.numberAt((a + b) / 2) -\n (track.numberAt(a) + track.numberAt(b)) / 2\n ) >\n (track.name.startsWith(\"scale\")\n ? scaleTolerance\n : sampleTolerance)\n )\n )\n\n const split = (a: number, b: number, depth: number) => {\n if (b - a < 1 || isStraight(a, b)) {\n times.push(b)\n } else if (depth < 4) {\n split(a, (a + b) / 2, depth + 1)\n split((a + b) / 2, b, depth + 1)\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 /**\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) ends.push(t, Math.min(t + 0.01, to))\n\n let start = from\n for (const end of ends.sort(byTime)) {\n end > start && split(start, end, 0)\n start = end\n }\n\n return times.sort(byTime)\n }\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: TransformAnimation[]) => {\n let shared: [number, number, string] | undefined\n\n for (const track of moving) {\n const tween = track.tween()\n if (\n !tween ||\n shared?.some((v: any, i) =>\n i < 2\n ? Math.abs((tween[i] as number) - v) > 1\n : tween[i] !== v\n )\n ) {\n return\n }\n shared = tween\n }\n\n return shared\n }\n\n /**\n * A WAAPI animation of the composed transform between two timestamps.\n */\n const run = (\n moving: TransformAnimation[],\n from: number,\n to: number,\n options: KeyframeAnimationOptions = { fill: \"both\" },\n settled?: number,\n nativeEasing?: string\n ) => {\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: PropertyIndexedKeyframes | null = { transform }\n if (!easing) {\n keyframes.offset = times.map((t) => progress(from, to, t))\n }\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\n return element.animate(keyframes, {\n ...options,\n duration: to - from,\n easing: easing || \"linear\",\n })\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: number) => {\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: TransformAnimation[] = []\n const looping: TransformAnimation[] = []\n const ends = new Set()\n\n byKey.clear()\n built = new Map()\n\n for (const track of tracks) {\n byKey.set(track.name, track)\n\n const [trackEnd, trackCycle] = track.timing()\n const isHeld = trackEnd === Infinity\n\n built.set(track, [track.at(now), track.speed, isHeld])\n\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\n if (track.speed < 0) return\n\n if (trackCycle) {\n if (cycle) {\n const phase = (trackEnd - cycleStart) / trackCycle\n if (\n Math.abs(trackCycle - cycle) > 1 ||\n Math.abs(phase - Math.round(phase)) * cycle > 1\n ) {\n return\n }\n } else {\n cycle = trackCycle\n cycleStart = trackEnd\n }\n looping.push(track)\n } else {\n ends.add(trackEnd)\n }\n\n moving.push(track)\n end = Math.max(end, trackEnd)\n }\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)) return true\n const value = (statics[key] = read(owner, key))\n return (\n value !== undefined &&\n parseFloat(value as string) !==\n (key.startsWith(\"scale\") ? 1 : 0)\n )\n })\n\n stop(false)\n\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\n try {\n if (tween && tween[1] > now) {\n const [from, to, easing] = tween\n add(\n run(moving, from, to, undefined, undefined, easing),\n from - now,\n to - from\n )\n } else if (end > now) {\n add(run(moving, now, end), 0, end - now)\n\n /**\n * Animations that end sooner finish on the events of\n * empty animations that end with them.\n */\n ends.forEach(\n (trackEnd) =>\n trackEnd < end - 1 &&\n add(\n element.animate(null, {\n duration: trackEnd - now,\n }),\n 0,\n trackEnd - now\n )\n )\n }\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 =\n cycleStart + Math.floor((end - cycleStart) / cycle) * cycle\n\n add(\n run(\n looping,\n from,\n from + cycle,\n {\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 },\n end\n ),\n end - now\n )\n }\n } catch {\n return\n }\n\n /**\n * Everything is held, so hold it with an inline style instead.\n */\n segments.length || stop()\n\n return true\n }\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: number) => {\n let elapsed: number | undefined\n let rate = 0\n\n for (const track of tracks) {\n const state = built.get(track)\n if (!state) return false\n\n const [builtTime, builtSpeed, wasHeld] = state\n const trackTime = track.at(now)\n const isHeld = track.timing()[0] === Infinity\n\n if (wasHeld) {\n if (isHeld && trackTime === builtTime) continue\n return false\n }\n\n const trackElapsed = (trackTime - builtTime) / builtSpeed\n const trackRate = isHeld ? 0 : track.speed / builtSpeed\n\n if (elapsed === undefined) {\n elapsed = trackElapsed\n rate = trackRate\n } else if (\n Math.abs(trackElapsed - elapsed) > 1 ||\n trackRate !== rate\n ) {\n return false\n }\n }\n\n if (elapsed === undefined) return true\n if (!segments.length) return false\n\n for (const { offset, end, isDone } of segments) {\n const local = elapsed - offset\n if (\n end < Infinity &&\n (isDone ? local < end - 1 : local < 0 || local >= end)\n ) {\n return false\n }\n }\n\n for (const { animation, offset, isDone } of segments) {\n if (isDone) continue\n\n const local = elapsed - offset\n if (rate) {\n animation.playbackRate = rate\n animation.startTime = now - local / rate\n } else {\n animation.pause()\n animation.currentTime = local\n }\n }\n\n return true\n }\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) return false\n\n isEnded = true\n transformGroups.delete(element)\n group.isJS || stop()\n return true\n }\n\n const build = () => {\n const now = time.now()\n\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\n if (\n track.state === \"running\" &&\n track.speed > 0 &&\n !trackCycle &&\n trackEnd <= now + 1\n ) {\n track.complete()\n\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\n isScheduled = false\n\n if (isEnded) return\n\n tracks.forEach(({ state }, track) => {\n if (state === \"idle\" || state === \"finished\") tracks.delete(track)\n })\n\n if (end()) return\n\n for (const track of tracks) {\n if (!track.canAccelerate) return group.demote(true)\n }\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\n const shouldBuild = needsBuild\n const churned = hasChurned\n needsBuild = hasChurned = false\n\n if (shouldBuild || !retime(now)) {\n if (churned) {\n if (now - lastChurn < churnWindow) return group.demote()\n lastChurn = now\n }\n if (!animate(now)) return group.demote()\n }\n }\n\n const group: TransformGroup = {\n tracks,\n isJS: false,\n isFinishing: false,\n\n schedule(build_: boolean, isChurn?: boolean) {\n if (isEnded) return\n\n needsBuild ||= build_\n hasChurned ||= !!isChurn\n\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 /**\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\") tracks.delete(track)\n end() || group.schedule(true)\n },\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) return\n\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\n demote(canReturn?: boolean) {\n if (group.isJS || isEnded) return\n\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\n group.isJS = true\n built = new Map()\n\n stop()\n\n tracks.forEach(\n (track) => track.state === \"running\" && track.js?.start()\n )\n },\n }\n\n transformGroups.set(element, group)\n\n return group\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { resolveStartTime } from \"./utils/resolve-start-time\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\nimport {\n canGroupTransform,\n TransformAnimation,\n} from \"./waapi/transforms/TransformAnimation\"\n\ntype ResolvedOptions =\n ValueAnimationOptions & {\n startTime?: number\n finalKeyframe?: T\n }\n\nexport class AsyncMotionValueAnimation\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.createdAt = time.now()\n\n const { keyframes, name, motionValue, element } = options\n\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 as ResolvedOptions\n optionsWithDefaults.autoplay ??= true\n optionsWithDefaults.delay ??= 0\n optionsWithDefaults.type ??= \"keyframes\"\n optionsWithDefaults.repeat ??= 0\n optionsWithDefaults.repeatDelay ??= 0\n optionsWithDefaults.repeatType ??= \"loop\"\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes,\n finalKeyframe: T,\n options: ResolvedOptions,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n let canAnimateValue = true\n if (!canAnimate(keyframes, name, type, velocity)) {\n canAnimateValue = false\n\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n 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 /**\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 =\n canAnimateValue && !isHandoff && supportsBrowserAnimation(options)\n\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 /**\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 (\n sync &&\n (useWaapi ||\n isGroupedTransform ||\n this.resolvedAt !== this.createdAt)\n ) {\n options.startTime ??= resolveStartTime(\n this.createdAt,\n this.resolvedAt!\n )\n }\n\n let animation: AnimationPlaybackControls\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 as any)\n } catch {\n animation = new JSAnimation(options)\n }\n } else if (isGroupedTransform) {\n animation = new TransformAnimation(options)\n } else {\n animation = new JSAnimation(options)\n }\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n return this._animation ? this._animation.finished : super.finished\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n /**\n * The value now, if the animation runs on the compositor.\n */\n liveValue() {\n return (\n this._animation as { liveValue?: () => T | undefined } | undefined\n )?.liveValue?.()\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n","import { AnimationPlaybackControls, TimelineWithFallback } from \"./types\"\n\ntype PropNames =\n | \"time\"\n | \"speed\"\n | \"duration\"\n | \"attachTimeline\"\n | \"startTime\"\n | \"state\"\n\nexport type AcceptedAnimations = AnimationPlaybackControls\n\nexport type GroupedAnimations = AcceptedAnimations[]\n\nexport class GroupAnimation implements AnimationPlaybackControls {\n animations: GroupedAnimations\n\n constructor(animations: Array) {\n this.animations = animations.filter(Boolean) as GroupedAnimations\n }\n\n get finished() {\n return Promise.all(\n this.animations.map((animation) => animation.finished)\n )\n }\n\n /**\n * TODO: Filter out cancelled or stopped animations before returning\n */\n private getAll(propName: PropNames) {\n return this.animations[0][propName] as any\n }\n\n private setAll(propName: PropNames, newValue: any) {\n for (let i = 0; i < this.animations.length; i++) {\n ;(this.animations[i][propName] as any) = newValue\n }\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n const subscriptions = this.animations.map((animation) =>\n animation.attachTimeline(timeline)\n )\n\n return () => {\n subscriptions.forEach((cancel, i) => {\n cancel && cancel()\n this.animations[i].stop()\n })\n }\n }\n\n get time() {\n return this.getAll(\"time\")\n }\n\n set time(time: number) {\n this.setAll(\"time\", time)\n }\n\n get speed() {\n return this.getAll(\"speed\")\n }\n\n set speed(speed: number) {\n this.setAll(\"speed\", speed)\n }\n\n get state() {\n return this.getAll(\"state\")\n }\n\n get startTime() {\n return this.getAll(\"startTime\")\n }\n\n get duration() {\n return getMax(this.animations, \"duration\")\n }\n\n get iterationDuration() {\n return getMax(this.animations, \"iterationDuration\")\n }\n\n private runAll(\n methodName: keyof Omit<\n AnimationPlaybackControls,\n PropNames | \"then\" | \"finished\" | \"iterationDuration\"\n >\n ) {\n this.animations.forEach((controls) => controls[methodName]())\n }\n\n play() {\n this.runAll(\"play\")\n }\n\n pause() {\n this.runAll(\"pause\")\n }\n\n // Bound to accommodate common `return animation.stop` pattern\n stop = () => this.runAll(\"stop\")\n\n cancel() {\n this.runAll(\"cancel\")\n }\n\n complete() {\n this.runAll(\"complete\")\n }\n}\n\nfunction getMax(\n animations: GroupedAnimations,\n propName: \"iterationDuration\" | \"duration\"\n): number {\n let max = 0\n\n for (let i = 0; i < animations.length; i++) {\n const value = animations[i][propName]\n if (value !== null && value > max) {\n max = value\n }\n }\n return max\n}\n","import { GroupAnimation } from \"./GroupAnimation\"\nimport { AnimationPlaybackControlsWithThen } from \"./types\"\n\nexport class GroupAnimationWithThen\n extends GroupAnimation\n implements AnimationPlaybackControlsWithThen\n{\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n}\n","import { NativeAnimation } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"./types\"\nimport { notifyAnimationStart } from \"./utils/notify-inspector\"\n\nexport class NativeAnimationWrapper<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation {\n constructor(animation: Animation) {\n super()\n\n this.animation = animation\n animation.onfinish = () => {\n this.finishedTime = this.time\n this.notifyFinished()\n }\n\n /**\n * The optionless super() returns before NativeAnimation's own\n * notify, so wrapped animations (view transition cross-fades)\n * report here, after the wrapped WAAPI animation is attached.\n */\n notifyAnimationStart(this, {})\n }\n}\n","import { NativeAnimation } from \"../NativeAnimation\"\nimport { AnyResolvedKeyframe } from \"../types\"\n\nconst animationMaps = new WeakMap<\n Element,\n Map>\n>()\nexport const animationMapKey = (name: string, pseudoElement: string = \"\") =>\n `${name}:${pseudoElement}`\n\nexport function getAnimationMap(element: Element) {\n let map = animationMaps.get(element)\n if (!map) {\n map = new Map()\n animationMaps.set(element, map)\n }\n return map\n}\n","import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set,\n child: VisualElement,\n delayChildren?: number | DynamicOption,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\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\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n","import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n MotionValueAnimation,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: MotionValueAnimation\n\n /**\n * The sole `change` subscriber. Most values have exactly one (an\n * effect or a follower), so it's stored and notified directly. A\n * SubscriptionManager is only created for a second subscriber.\n */\n private changeSubscriber?: Subscriber\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return \n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n on>(\n eventName: EventName,\n callback: MotionValueEventCallbacks[EventName]\n ): VoidFunction {\n if (eventName === \"change\") return this.onChangeSubscribe(callback)\n\n return (this.events[eventName] ||= new SubscriptionManager()).add(\n callback\n )\n }\n\n private onChangeSubscribe(callback: Subscriber): VoidFunction {\n const { events } = this\n\n if (!events.change && !this.changeSubscriber) {\n this.changeSubscriber = callback\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\n return () => {\n if (this.changeSubscriber === callback) {\n this.changeSubscriber = undefined\n } else {\n events.change?.remove(callback)\n }\n this.stopIfUnobserved()\n }\n }\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n private stopIfUnobserved() {\n frame.read(() => {\n if (!this.changeSubscriber && !this.events.change?.getSize()) {\n this.stop()\n }\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 /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.notifyChange()\n }\n\n private 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 } else {\n this.events.change?.notify(current)\n }\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.notifyChange()\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n /**\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\n return sampled === undefined ? this.current! : (sampled as V)\n }\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 /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise((resolve) => {\n this.hasAnimated = true\n\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: MotionValueAnimation | undefined\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) this.clearAnimation()\n resolve()\n })\n\n if (!isComplete) this.animation = animation\n\n this.events.animationStart?.notify()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n // Assign rather than delete to keep the object's shape stable\n this.animation = undefined\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue(init: V, options?: MotionValueOptions) {\n return new MotionValue(init, options)\n}\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 */\nexport function resolveTransition(\n transition: any,\n parentTransition?: any\n) {\n if (transition?.inherit && parentTransition) {\n const { inherit: _, ...rest } = transition\n return { ...parentTransition, ...rest }\n }\n\n return transition\n}\n","import { resolveTransition } from \"./resolve-transition\"\n\nexport function getValueTransition(transition: any, key: string) {\n const valueTransition =\n transition?.[key as keyof typeof transition] ??\n transition?.[\"default\"] ??\n transition\n\n if (valueTransition !== transition) {\n return resolveTransition(valueTransition, transition)\n }\n\n return valueTransition\n}\n","import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n","import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\nconst 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/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined(\n transition: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }\n) {\n for (const key in transition) {\n if (!orchestrationKeys.has(key)) return true\n }\n return false\n}\n","import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../keyframes/get-final\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { AnimationElement } from \"../keyframes/types\"\n\nexport const animateMotionValue =\n (\n name: string,\n value: MotionValue,\n target: V | UnresolvedKeyframes,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: AnimationElement,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n hasOnUpdate: !!valueTransition.onUpdate,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations ||\n element?.shouldSkipAnimations ||\n valueTransition.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n","import { wrap } from \"motion-utils\"\nimport { motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n MotionPath,\n PathInterpolator,\n Point2D,\n} from \"../types\"\nimport { getValueTransition } from \"./get-value-transition\"\n\nexport interface ArcOptions {\n /**\n * How far the arc bulges perpendicular to the straight-line path,\n * as a fraction of the total distance. A value of `1` means the arc\n * peaks at a height equal to the full travel distance. Default `0.5`.\n */\n strength?: number\n /**\n * Where along the path (0–1) the arc reaches its maximum height.\n * Default `0.5` (symmetric).\n */\n peak?: number\n /**\n * Which side the arc bulges toward.\n * - `\"cw\"` / `\"ccw\"` — locked relative to direction of travel\n * - unset — auto-pick a stable screen-space side\n */\n direction?: \"cw\" | \"ccw\"\n /**\n * Rotates the element to follow the tangent of the arc path.\n * - `true` — full tangent following (1.0)\n * - number 0–1 — scale factor\n */\n rotate?: boolean | number\n}\n\nconst MIN_LAYOUT_DISTANCE = 20\n\nfunction bezierPoint(\n t: number,\n origin: number,\n control: number,\n target: number\n): number {\n const inv = 1 - t\n return inv * inv * origin + 2 * inv * t * control + t * t * target\n}\n\nfunction bezierTangentAngle(\n t: number,\n originX: number,\n controlX: number,\n targetX: number,\n originY: number,\n controlY: number,\n targetY: number\n): number {\n const dx =\n 2 * (1 - t) * (controlX - originX) + 2 * t * (targetX - controlX)\n const dy =\n 2 * (1 - t) * (controlY - originY) + 2 * t * (targetY - controlY)\n return Math.atan2(dy, dx) * (180 / Math.PI)\n}\n\nfunction computeArcControlPoint(\n fromX: number,\n fromY: number,\n toX: number,\n toY: number,\n strength: number,\n peak: number\n): { x: number; y: number } {\n const deltaX = toX - fromX\n const deltaY = toY - fromY\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY)\n\n if (distance > 0) {\n const normalPerpX = -deltaY / distance\n const normalPerpY = deltaX / distance\n const desiredHeight = strength * distance\n\n return {\n x: fromX + deltaX * peak + normalPerpX * desiredHeight,\n y: fromY + deltaY * peak + normalPerpY * desiredHeight,\n }\n }\n\n return { x: fromX, y: fromY }\n}\n\n/**\n * The pure sampling factory: `(from, to) => (t) => point`. Internal —\n * used by {@link arc} and the unit tests. Not part of the public surface.\n */\nexport function createArcPath({\n strength = 0.5,\n peak = 0.5,\n direction,\n rotate = false,\n}: ArcOptions = {}): (from: Point2D, to: Point2D) => PathInterpolator {\n const rotationScale =\n rotate === true ? 1 : typeof rotate === \"number\" ? rotate : 0\n\n // Auto-direction only: persists across calls to flip the bulge back\n // onto the same screen side when the dominant axis changes between\n // calls. Reuse the factory (module scope / useMemo) to keep this alive.\n let prevBulgeSign: number | undefined\n\n const createInterpolator = (\n from: Point2D,\n to: Point2D\n ): PathInterpolator => {\n const dx = to.x - from.x\n const dy = to.y - from.y\n\n let signed: number\n if (direction === \"cw\") {\n signed = -strength\n } else if (direction === \"ccw\") {\n signed = strength\n } else {\n const dom = Math.abs(dx) >= Math.abs(dy) ? dx : dy\n signed = dom < 0 ? -strength : strength\n }\n\n let control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n\n if (direction === undefined) {\n const isVertical = Math.abs(dx) < Math.abs(dy)\n const midX = from.x + dx * peak\n const midY = from.y + dy * peak\n const bulgeSign = isVertical\n ? Math.sign(control.x - midX)\n : Math.sign(control.y - midY)\n\n if (\n prevBulgeSign !== undefined &&\n bulgeSign !== 0 &&\n bulgeSign !== prevBulgeSign\n ) {\n signed = -signed\n control = computeArcControlPoint(\n from.x,\n from.y,\n to.x,\n to.y,\n signed,\n peak\n )\n } else if (bulgeSign !== 0) {\n prevBulgeSign = bulgeSign\n }\n }\n\n const tangent0 = rotationScale\n ? bezierTangentAngle(\n 0,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangent1 = rotationScale\n ? bezierTangentAngle(\n 1,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n : 0\n const tangentDelta = rotationScale\n ? wrap(-180, 180, tangent1 - tangent0)\n : 0\n\n return (t: number) => {\n const out: { x: number; y: number; rotate?: number } = {\n x: bezierPoint(t, from.x, control.x, to.x),\n y: bezierPoint(t, from.y, control.y, to.y),\n }\n if (rotationScale) {\n const raw = bezierTangentAngle(\n t,\n from.x,\n control.x,\n to.x,\n from.y,\n control.y,\n to.y\n )\n const baseline = tangent0 + tangentDelta * t\n out.rotate = wrap(-180, 180, raw - baseline) * rotationScale\n }\n return out\n }\n }\n\n return createInterpolator\n}\n\n/**\n * Creates a curved path for `transition.path`:\n *\n * ```ts\n * \n * ```\n *\n * Reuse the returned value (module scope / useMemo / useRef) so its\n * continuity closure survives re-renders — a fresh `arc()` has no memory.\n */\nexport function arc(options: ArcOptions = {}): MotionPath {\n const sample = createArcPath(options)\n\n const path: MotionPath = {\n interpolateProjection(delta) {\n // `from` is the current translate offset (carries any in-flight\n // displacement when interrupted); `to` is the new layout origin.\n // The distance floor avoids visible wobble on tiny shifts.\n const tx = delta.x.translate\n const ty = delta.y.translate\n if (Math.sqrt(tx * tx + ty * ty) < MIN_LAYOUT_DISTANCE) {\n return undefined\n }\n return sample({ x: tx, y: ty }, { x: 0, y: 0 })\n },\n\n animateValues(getValue, target, transition, delay, animations) {\n if (!(\"x\" in target || \"y\" in target)) return\n\n const xValue = getValue(\"x\")\n const yValue = getValue(\"y\")\n\n const xRaw = target.x as number | number[] | undefined\n const yRaw = target.y as number | number[] | undefined\n\n const xFrom = ((Array.isArray(xRaw) && xRaw[0] != null\n ? xRaw[0]\n : xValue?.get()) as number) ?? 0\n const yFrom = ((Array.isArray(yRaw) && yRaw[0] != null\n ? yRaw[0]\n : yValue?.get()) as number) ?? 0\n const xTo = (Array.isArray(xRaw)\n ? xRaw[xRaw.length - 1]\n : xRaw ?? xFrom) as number\n const yTo = (Array.isArray(yRaw)\n ? yRaw[yRaw.length - 1]\n : yRaw ?? yFrom) as number\n\n // Interruption needs no flag: x/y already hold the displaced\n // mid-arc position, so xFrom/yFrom carry the continuity geometry.\n const interpolate = sample(\n { x: xFrom, y: yFrom },\n { x: xTo, y: yTo }\n )\n\n // Drive a dedicated `pathRotation` value (composed onto `rotate`\n // at the build sites) rather than `rotate` itself, so a\n // concurrent rotate animation composes and nothing accumulates\n // on interrupt.\n const pathRotationValue =\n interpolate(0).rotate !== undefined\n ? getValue(\"pathRotation\")\n : undefined\n\n const pathTransition = {\n delay,\n ...getValueTransition(transition || {}, \"x\"),\n }\n delete (pathTransition as { path?: unknown }).path\n\n const progress = motionValue(0)\n progress.start(\n animateMotionValue(\"\", progress, [0, 1000] as any, {\n ...pathTransition,\n isSync: true,\n velocity: 0,\n onUpdate: (latest: number) => {\n const point = interpolate(latest / 1000)\n xValue?.set(point.x)\n yValue?.set(point.y)\n if (pathRotationValue && point.rotate !== undefined) {\n pathRotationValue.set(point.rotate)\n }\n },\n onComplete: () => {\n xValue?.set(xTo)\n yValue?.set(yTo)\n pathRotationValue?.set(0)\n },\n // Interrupt/cancel must clear our additive contribution\n // so it can't linger on top of the user's `rotate`.\n onStop: () => pathRotationValue?.set(0),\n onCancel: () => pathRotationValue?.set(0),\n })\n )\n\n if (progress.animation) {\n animations.push(\n progress.animation as AnimationPlaybackControlsWithThen\n )\n }\n\n delete (target as { x?: unknown }).x\n delete (target as { y?: unknown }).y\n },\n }\n\n return path\n}\n","import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n","import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n const resolveFunction = (def: any) =>\n typeof def === \"function\"\n ? def(\n custom !== undefined ? custom : props.custom,\n ...getValueState(visualElement)\n )\n : def\n\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\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n return resolveFunction(definition)\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n return resolveVariantFromProps(\n visualElement.getProps(),\n definition,\n custom,\n visualElement\n )\n}\n\n/**\n * Exit variants resolve with AnimatePresence's custom, every other type\n * with the element's own.\n */\nexport const getTypeCustom = (visualElement: any, type?: AnimationType) =>\n type === \"exit\" ? visualElement.presenceContext?.custom : undefined\n","import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n","import type { UnresolvedValueKeyframe, ValueKeyframesDefinition } from \"../../animation/types\"\n\nexport const isKeyframesTarget = (\n v: ValueKeyframesDefinition\n): v is UnresolvedValueKeyframe[] => {\n return Array.isArray(v)\n}\n","import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n","import type { MotionValue } from \"..\"\n\nexport const isMotionValue = (value: any): value is MotionValue =>\n Boolean(value && value.getVelocity)\n","import { isMotionValue } from \"../utils/is-motion-value\"\nimport type { WillChange } from \"./types\"\n\nexport function isWillChangeMotionValue(value: any): value is WillChange {\n return Boolean(isMotionValue(value) && (value as WillChange).add)\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n","export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n","import { optimizedAppearDataAttribute } from \"./data-id\"\nimport type { WithAppearProps } from \"./types\"\n\nexport function getOptimisedAppearId(\n visualElement: WithAppearProps\n): string | undefined {\n return visualElement.props[optimizedAppearDataAttribute]\n}\n","import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { resolveTransition } from \"../utils/resolve-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { MotionPath } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock = key in protectedKeys && !needsAnimating[key]\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition,\n transitionEnd,\n ...target\n } = targetAndTransition\n\n const defaultTransition = visualElement.getDefaultTransition()\n transition = transition\n ? resolveTransition(transition, defaultTransition)\n : defaultTransition\n\n const reduceMotion = (transition as { reduceMotion?: boolean })?.reduceMotion\n const skipAnimations = transition?.skipAnimations\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type && visualElement.animationState?.getState()[type]\n\n const path = (transition as { path?: MotionPath } | undefined)?.path\n if (path) {\n // path mutates `target` to claim x/y; loop below skips them.\n path.animateValues\n ? path.animateValues(\n (key) =>\n visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? 0\n ),\n target,\n transition,\n delay,\n animations\n )\n : path.animateVisualElement?.(\n visualElement,\n target,\n transition,\n delay,\n animations\n )\n }\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n if (skipAnimations) valueTransition.skipAnimations = true\n\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 (\n currentValue !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n frame.update(() => value.set(valueTarget as any))\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (isBrowser && window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n const shouldReduceMotion =\n reduceMotion ?? visualElement.shouldReduceMotion\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation as\n | AnimationPlaybackControlsWithThen\n | undefined\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n\n if (animations.length) {\n Promise.all(animations).then(applyTransitionEnd)\n } else {\n applyTransitionEnd()\n }\n }\n\n return animations\n}\n","import {\n getTypeCustom,\n resolveVariant,\n} from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise {\n const resolved = resolveVariant(\n visualElement,\n variant,\n getTypeCustom(visualElement, options.type)\n )\n\n const transition =\n options.transitionOverride ||\n (resolved?.transition ?? (visualElement.getDefaultTransition() || {}))\n\n const getAnimation = () =>\n Promise.all(\n resolved ? animateTarget(visualElement, resolved, options) : []\n )\n\n const getChildAnimations = (delay = 0) => {\n const { variantChildren } = visualElement\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n const animations: Promise[] = []\n\n variantChildren?.forEach((child) => {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\"\n ? 0\n : delayChildren) +\n calcChildStagger(\n variantChildren,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n })\n\n return Promise.all(animations)\n }\n\n /**\n * when: \"beforeChildren\" | \"afterChildren\" runs this element's animation\n * and its children's in sequence.\n */\n const { when } = transition\n\n return when\n ? when === \"beforeChildren\"\n ? getAnimation().then(() => getChildAnimations())\n : getChildAnimations().then(getAnimation)\n : Promise.all([getAnimation(), getChildAnimations(options.delay)])\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n\n const animation = Array.isArray(definition)\n ? Promise.all(\n definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n )\n : typeof definition === \"string\"\n ? animateVariant(visualElement, definition, options)\n : Promise.all(\n animateTarget(\n visualElement,\n resolveVariant(visualElement, definition, options.custom),\n options\n )\n )\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n","import { ValueType } from \"./types\"\n\n/**\n * ValueType for \"auto\"\n */\nexport const auto: ValueType = {\n test: (v: any) => v === \"auto\",\n parse: (v) => v,\n}\n","import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n","import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n","import { isZeroValueString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../types\"\n\nexport function isNone(value: AnyResolvedKeyframe | null) {\n if (typeof value === \"number\") {\n return value === 0\n } else if (value !== null) {\n return value === \"none\" || value === \"0\" || isZeroValueString(value)\n } else {\n return true\n }\n}\n","import { hasComplexValues } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n hasComplexValues(keyframe)\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\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) continue\n\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n","import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes,\n onComplete: OnKeyframesResolved,\n name?: string,\n motionValue?: MotionValue,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\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) return this.complete()\n }\n\n super.scheduleResolve()\n }\n\n private canReadNow() {\n const { unresolvedKeyframes, element, motionValue } = this\n const origin = unresolvedKeyframes[0] ?? motionValue?.get()\n\n if (!element?.current || origin === undefined) return false\n\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (containsCSSVariable(i ? unresolvedKeyframes[i] : origin)) {\n return false\n }\n }\n\n return true\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n\n // Two numbers share a unit, so skip the value type search.\n if (typeof origin === \"number\" && typeof target === \"number\") return\n\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n private measure() {\n const { element, name } = this\n return positionalValues[name](\n window.getComputedStyle(element!.current!),\n () => element!.measureViewportBox()\n )\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = this.measure()\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n this.motionValue?.jump(measureKeyframe as T, false)\n }\n }\n\n measureEndState() {\n const { element, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n this.motionValue?.jump(this.measuredOrigin as T, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = this.measure() as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n","/**\n * The four corner-radius longhands. Shared so the projection mixer, scale\n * corrector, WAAPI px-value set and view-transition crop pass don't each carry\n * their own copy. Order is irrelevant - every consumer mixes/corrects/animates\n * each corner independently.\n */\nexport const cornerRadiusProps = [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n] as const\n","import { cornerRadiusProps } from \"../../../utils/border-radius\"\n\nexport const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n ...cornerRadiusProps,\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n","import { UnresolvedValueKeyframe, ValueKeyframe } from \"../../types\"\nimport { pxValues } from \"../../waapi/utils/px-values\"\n\nexport function applyPxDefaults(\n keyframes: ValueKeyframe[] | UnresolvedValueKeyframe[],\n name: string\n) {\n for (let i = 0; i < keyframes.length; i++) {\n if (typeof keyframes[i] === \"number\" && pxValues.has(name)) {\n keyframes[i] = keyframes[i] + \"px\"\n }\n }\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n","import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n","import { invariant, removeItem } from \"motion-utils\"\nimport { AnimateEffect } from \"../../effects/utils/create-effect\"\nimport { frame } from \"../../frameloop\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { animateMotionValue } from \"../interfaces/motion-value\"\nimport { AnimationElement } from \"../keyframes/types\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueTransition,\n} from \"../types\"\n\n/**\n * Effects registered via `animate.addEffect()`, most recent first.\n */\nconst effects: AnimateEffect[] = []\n\nexport function addEffect(effect: AnimateEffect): void {\n invariant(\n typeof effect.test === \"function\" && typeof effect.read === \"function\",\n \"Effects passed to animate.addEffect() need test() and read().\",\n \"effect-missing-test\"\n )\n\n removeEffect(effect)\n effects.unshift(effect)\n}\n\nexport function removeEffect(effect: AnimateEffect): void {\n removeItem(effects, effect)\n}\n\nexport function findEffect(subject: unknown): AnimateEffect | undefined {\n return effects.find((effect) => effect.test(subject))\n}\n\nexport interface EffectKeyframes {\n [key: string]:\n | UnresolvedValueKeyframe\n | UnresolvedValueKeyframe[]\n | Record\n | undefined\n transition?: Record\n transitionEnd?: Record\n}\n\n/**\n * Effect subjects can expose any key, so per-key transition overrides\n * are keyed by arbitrary strings.\n */\nexport type EffectTransition = ValueTransition & {\n reduceMotion?: boolean\n skipAnimations?: boolean\n} & Record\n\n/**\n * Animate each key in `keyframes` on the motion value `getValue` returns\n * for it. `element` is what the keyframe resolver uses to read, render\n * and measure the subject when the effect defers resolution to it.\n */\nexport function animateValues(\n getValue: (key: string) => MotionValue,\n keyframes: EffectKeyframes,\n transition: EffectTransition = {},\n element?: AnimationElement\n): AnimationPlaybackControlsWithThen[] {\n const animations: AnimationPlaybackControlsWithThen[] = []\n const { velocity, path } = transition\n const reduceMotion = transition.reduceMotion ?? element?.shouldReduceMotion\n\n /**\n * Only elements have x/y to move along a path. path claims them by\n * deleting them, so hand it a copy.\n */\n if (path?.animateValues && element) {\n keyframes = { ...keyframes }\n path.animateValues(getValue, keyframes, transition, 0, animations)\n }\n\n for (const key in keyframes) {\n if (key === \"transition\" || key === \"transitionEnd\") continue\n\n const target = keyframes[key]\n if (target === undefined) continue\n\n const value = getValue(key)\n\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 current = value.get()\n if (\n current !== undefined &&\n !value.isAnimating() &&\n !Array.isArray(target) &&\n target === current &&\n !velocity\n ) {\n frame.update(() => value.set(target))\n continue\n }\n\n value.start(\n animateMotionValue(\n key,\n value,\n target as any,\n reduceMotion && positionalKeys.has(key)\n ? { type: false }\n : transition,\n element\n )\n )\n\n value.animation &&\n animations.push(\n value.animation as AnimationPlaybackControlsWithThen\n )\n }\n\n const { transitionEnd } = keyframes\n if (transitionEnd) {\n const applyTransitionEnd = () =>\n frame.update(() => {\n for (const key in transitionEnd) {\n getValue(key).set(transitionEnd[key])\n }\n })\n\n animations.length\n ? Promise.all(animations).then(applyTransitionEnd)\n : applyTransitionEnd()\n }\n\n return animations\n}\n\n/**\n * Animate the keys of `subject` via `effect`. Motion values are created on\n * first animation and bound to the subject through the effect for the\n * rest of its life.\n *\n * Without `element`, a new value is seeded synchronously from the first\n * keyframe or `effect.read()`. With it, the value starts undefined and the\n * keyframe resolver reads the subject (batched, with unit conversion by\n * measurement) via `element`.\n */\nexport function animateEffectSubject(\n effect: AnimateEffect,\n subject: Subject,\n keyframes: EffectKeyframes,\n transition?: EffectTransition,\n element?: AnimationElement\n): AnimationPlaybackControlsWithThen[] {\n return animateValues(\n (key) => {\n let value = effect.get(subject, key)\n\n if (!value) {\n let initial: AnyResolvedKeyframe | undefined\n\n if (!element) {\n const target = keyframes[key] as\n | UnresolvedValueKeyframe\n | UnresolvedValueKeyframe[]\n initial =\n firstKeyframe(target) ??\n effect.read(subject, key, target)\n\n invariant(\n initial !== undefined,\n `\"${key}\" can't be read from the animated subject. Provide [from, to] keyframes.`,\n \"effect-unreadable-value\"\n )\n }\n\n value = motionValue(initial, { owner: element })\n effect(subject, { [key]: value })\n }\n\n return value\n },\n keyframes,\n transition,\n element\n )\n}\n\nfunction firstKeyframe(\n target: UnresolvedValueKeyframe | UnresolvedValueKeyframe[] | undefined\n) {\n const first = Array.isArray(target) ? target[0] : undefined\n return first === null ? undefined : first\n}\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 */\nexport function isHTMLElement(element: unknown): element is HTMLElement {\n return (\n isObject(element) &&\n \"offsetHeight\" in element &&\n !(\"ownerSVGElement\" in element)\n )\n}\n","import { isObject } from \"motion-utils\"\n\n/**\n * Checks if an element is an SVG element in a way\n * that works across iframes\n */\nexport function isSVGElement(element: unknown): element is SVGElement {\n return isObject(element) && \"ownerSVGElement\" in element\n}\n","export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport {\n AnimateEffect,\n Effect,\n EffectOptions,\n EffectRead,\n EffectTest,\n} from \"./create-effect\"\n\n/**\n * The element overloads come last so generic inference sees the subject type.\n */\nexport interface SelectorEffect extends EffectOptions {\n (\n subject: ElementOrSelector,\n values: Record\n ): VoidFunction\n (subject: T, values: Record): VoidFunction\n\n get(subject: ElementOrSelector, key: string): MotionValue | undefined\n get(subject: T, key: string): MotionValue | undefined\n\n flush(subject: T): void\n state(subject: T): MotionValueState | undefined\n}\n\nexport interface SelectorAnimateEffect\n extends SelectorEffect {\n test: EffectTest\n read: EffectRead\n}\n\n/**\n * Wraps a per-element effect so it also accepts selectors and element\n * lists. `test`, `read` and `get` still address a single element, so the\n * result can be registered with `animate.addEffect()`.\n */\nexport function createSelectorEffect(\n subjectEffect: AnimateEffect\n): SelectorAnimateEffect\nexport function createSelectorEffect(\n subjectEffect: Effect\n): SelectorEffect\nexport function createSelectorEffect(\n subjectEffect: Effect\n): SelectorEffect {\n const effect = (\n subject: T | ElementOrSelector,\n values: Record\n ) => {\n const elements = resolveElements(subject as ElementOrSelector)\n const subscriptions: VoidFunction[] = []\n\n for (const element of elements) {\n const remove = subjectEffect(element as T, values)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const remove of subscriptions) remove()\n }\n }\n\n const { test, read, get, flush, state } = subjectEffect\n\n return Object.assign(effect, {\n test,\n read,\n get: get as SelectorEffect[\"get\"],\n flush,\n state,\n })\n}\n","import { frame } from \"../frameloop/frame\"\nimport { Schedule } from \"../frameloop/types\"\nimport { MotionValue } from \"../value\"\n\ninterface Entry {\n value: MotionValue\n render?: VoidFunction\n onRemove: VoidFunction\n}\n\nexport class MotionValueState {\n /**\n * Transform keys bound to this state, in `transformPropOrder`, and\n * the value bound to each. Lets the transform builder visit only\n * bound transforms, reading each value directly.\n */\n transformKeys?: string[]\n transformValues?: Record\n\n private values = new Map()\n\n /**\n * Renders scheduled for the next flush, usually one or two (values\n * bound to the same computed render, e.g. `x` and `y` to `transform`,\n * share an entry). Tracked with a count rather than truncating the\n * array so no backing store is reallocated every frame. Kept per\n * state so pending writes can be flushed synchronously before the\n * subject is measured.\n */\n private pending: VoidFunction[] = []\n private numPending = 0\n\n /**\n * @param step - The frameloop step renders are scheduled in. Defaults\n * to `frame.render`. Effects that feed a render loop running in\n * `frame.render` (GPU scenes) should write in `frame.preRender`.\n */\n constructor(private step: Schedule = frame.render) {}\n\n /**\n * @param render - Writes the value to the subject. Renders read the\n * motion value directly rather than a cached copy, so there is one\n * place a value lives.\n * @param computed - A value already in this state (e.g. `transform`)\n * whose render should run whenever `value` changes.\n */\n set(\n name: string,\n value: MotionValue,\n render?: VoidFunction,\n computed?: MotionValue\n ): VoidFunction {\n this.values.get(name)?.onRemove()\n\n if (computed) {\n for (const entry of this.values.values()) {\n if (entry.value === computed) render = entry.render\n }\n }\n\n const onChange = () => render && this.schedule(render)\n\n /**\n * Values created ahead of a DOM read start out undefined and\n * have nothing to render until they're set.\n */\n value.get() !== undefined && onChange()\n\n const cancelOnChange = value.on(\"change\", onChange)\n\n const onRemove = () => {\n cancelOnChange()\n render && !computed && this.cancel(render)\n /**\n * A later set() of the same name has already removed this\n * entry, so leave the one that replaced it.\n */\n this.values.get(name)?.onRemove === onRemove &&\n this.values.delete(name)\n }\n\n this.values.set(name, {\n value,\n render: computed ? undefined : render,\n onRemove,\n })\n\n return onRemove\n }\n\n get(name: string): MotionValue | undefined {\n return this.values.get(name)?.value\n }\n\n /**\n * Detach every value from this state and return them, so another\n * renderer can take them over. The state stays cached by its effect,\n * so the bound transforms are reset too rather than leaking into\n * values bound later.\n */\n release() {\n const values = new Map()\n this.values.forEach((entry, name) => {\n values.set(name, entry.value)\n entry.onRemove()\n })\n this.transformKeys = this.transformValues = undefined\n return values\n }\n\n private schedule(render: VoidFunction) {\n const { pending, numPending } = this\n\n for (let i = 0; i < numPending; i++) {\n if (pending[i] === render) return\n }\n\n numPending || this.step(this.flush)\n\n pending[this.numPending++] = render\n }\n\n private cancel(render: VoidFunction) {\n const { pending } = this\n\n for (let i = 0; i < this.numPending; i++) {\n if (pending[i] === render) {\n pending[i] = pending[--this.numPending]\n return\n }\n }\n }\n\n /**\n * Run the pending renders. Resetting the count first means a render\n * scheduled while flushing lands in the next frame, as with the\n * frameloop itself.\n */\n flush = () => {\n const { pending, numPending } = this\n this.numPending = 0\n for (let i = 0; i < numPending; i++) pending[i]()\n }\n}\n","import {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n} from \"../../animation/types\"\nimport { Schedule } from \"../../frameloop/types\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\n\n/**\n * Returns true if the effect knows how to write to `subject`.\n */\nexport type EffectTest = (\n subject: unknown\n) => subject is Subject\n\n/**\n * Reads the current value of `key` from `subject`, used as the initial\n * keyframe when `animate()` creates a motion value for the subject.\n * Returns `undefined` when the value can't be read.\n *\n * `keyframes` is the target being animated to, so effects can match\n * the format of the initial value (for instance color vs numeric).\n */\nexport type EffectRead = (\n subject: Subject,\n key: string,\n keyframes?: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n) => AnyResolvedKeyframe | undefined\n\nexport interface EffectOptions {\n test?: EffectTest\n read?: EffectRead\n\n /**\n * Frameloop step writes are scheduled in. Defaults to `frame.render`.\n */\n step?: Schedule\n}\n\nexport interface Effect\n extends EffectOptions {\n (subject: Subject, values: Record): VoidFunction\n\n /**\n * Returns the motion value currently bound to `key` on `subject`, if any.\n */\n get(subject: Subject, key: string): MotionValue | undefined\n\n /**\n * Write `subject`'s pending values now rather than in the next frame,\n * e.g. so it can be measured with a target applied.\n */\n flush(subject: Subject): void\n\n /**\n * The state holding the motion values bound to `subject`, if any have\n * been, so they can be handed to another renderer.\n */\n state(subject: Subject): MotionValueState | undefined\n}\n\n/**\n * An effect that can be registered with `animate.addEffect()`.\n */\nexport interface AnimateEffect\n extends Effect {\n test: EffectTest\n read: EffectRead\n}\n\nexport type AddEffectValue = (\n subject: Subject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => VoidFunction\n\nexport function createEffect(\n addValue: AddEffectValue,\n options: EffectOptions & {\n test: EffectTest\n read: EffectRead\n }\n): AnimateEffect\nexport function createEffect(\n addValue: AddEffectValue,\n options?: EffectOptions\n): Effect\nexport function createEffect(\n addValue: AddEffectValue,\n { step, ...options }: EffectOptions = {}\n): Effect {\n const stateCache = new WeakMap()\n\n const effect = (\n subject: Subject,\n values: Record\n ): VoidFunction => {\n const state = stateCache.get(subject) ?? new MotionValueState(step)\n\n stateCache.set(subject, state)\n\n const subscriptions: VoidFunction[] = []\n\n for (const key in values) {\n const value = values[key]\n const remove = addValue(subject, state, key, value)\n subscriptions.push(remove)\n }\n\n return () => {\n for (const cancel of subscriptions) cancel()\n }\n }\n\n return Object.assign(effect, options, {\n get: (subject: Subject, key: string) =>\n stateCache.get(subject)?.get(key),\n flush: (subject: Subject) => stateCache.get(subject)?.flush(),\n state: (subject: Subject) => stateCache.get(subject),\n })\n}\n","import { translateAlias } from \"../../render/html/utils/build-transform\"\nimport { transformValueTypes } from \"../../value/types/maps/transform\"\nimport { getValueAsType } from \"../../value/types/utils/get-as-type\"\nimport { MotionValueState } from \"../MotionValueState\"\n\n/**\n * Cache of `translateX(`-style openers so each render is a few string\n * concatenations rather than a template per transform.\n */\nconst openers: Record = {}\n\nexport function buildTransform(state: MotionValueState) {\n let transform = \"\"\n const { transformKeys: keys = [], transformValues: values = {} } = state\n\n /**\n * Loop over the bound transforms in order, adding the ones that\n * aren't at their default value to the transform string.\n */\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n const value = values[key].getCurrent()\n\n if (value === undefined) continue\n\n const parsed = typeof value === \"number\" ? value : parseFloat(value)\n\n if (parsed !== (key.startsWith(\"scale\") ? 1 : 0)) {\n transform +=\n (transform && \" \") +\n (openers[key] ||\n (openers[key] = (translateAlias[key] || key) + \"(\")) +\n getValueAsType(value, transformValueTypes[key]) +\n \")\"\n }\n }\n\n // See build-transform.ts: additive `rotate()` so user `rotate` isn't\n // clobbered. Not a `transformPropOrder` slot.\n const pathRotation = state.get(\"pathRotation\")?.get()\n if (pathRotation) {\n transform +=\n (transform && \" \") +\n \"rotate(\" +\n getValueAsType(pathRotation, transformValueTypes.pathRotation) +\n \")\"\n }\n\n return transform || \"none\"\n}\n","import { transformGroups } from \"../../animation/waapi/transforms/groups\"\nimport { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { readTransformValue } from \"../../render/dom/parse-transform\"\nimport {\n transformPropOrder,\n transformProps,\n} from \"../../render/utils/keys-transform\"\nimport { isHTMLElement } from \"../../utils/is-html-element\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { MotionValue } from \"../../value\"\nimport { numberValueTypes } from \"../../value/types/maps/number\"\nimport { getValueAsType } from \"../../value/types/utils/get-as-type\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\nimport { buildTransform } from \"./transform\"\n\nexport const originProps = new Set([\"originX\", \"originY\", \"originZ\"])\n\n/**\n * A bound value in its default unit, e.g. `originX: 50` -> `\"50%\"`.\n */\nconst styleValue = (state: MotionValueState, key: string) =>\n getValueAsType(state.get(key)?.get(), numberValueTypes[key])\n\nexport const addStyleValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n let render: VoidFunction | undefined = undefined\n let computed: MotionValue | undefined = undefined\n\n if (transformProps.has(key)) {\n if (key !== \"pathRotation\") {\n const keys = (state.transformKeys ??= [])\n ;(state.transformValues ??= {})[key] = value\n\n if (!keys.includes(key)) {\n keys.push(key)\n keys.sort(\n (a, b) =>\n transformPropOrder.indexOf(a) -\n transformPropOrder.indexOf(b)\n )\n }\n }\n\n if (!state.get(\"transform\")) {\n // If this is an HTML element, we need to set the transform-box to fill-box\n // to normalise the transform relative to the element's bounding box\n if (!isHTMLElement(element) && !state.get(\"transformBox\")) {\n addStyleValue(\n element,\n state,\n \"transformBox\",\n new MotionValue(\"fill-box\")\n )\n }\n\n state.set(\"transform\", new MotionValue(\"none\"), () => {\n transformGroups.get(element)?.check()\n element.style.transform = buildTransform(state)\n })\n }\n\n computed = state.get(\"transform\")\n } else if (originProps.has(key)) {\n if (!state.get(\"transformOrigin\")) {\n state.set(\"transformOrigin\", new MotionValue(\"\"), () => {\n const originX = styleValue(state, \"originX\") ?? \"50%\"\n const originY = styleValue(state, \"originY\") ?? \"50%\"\n const originZ = styleValue(state, \"originZ\") ?? 0\n element.style.transformOrigin = `${originX} ${originY} ${originZ}`\n })\n }\n\n computed = state.get(\"transformOrigin\")\n } else if (isCSSVar(key)) {\n render = () => {\n element.style.setProperty(key, value.getCurrent() as string)\n }\n } else {\n render = () => {\n element.style[key as any] = getValueAsType(\n value.getCurrent(),\n numberValueTypes[key]\n ) as string\n }\n }\n\n return state.set(key, value, render, computed)\n}\n\nexport type StyleSubject = HTMLElement | SVGElement\n\nconst isStyleSubject = (subject: unknown): subject is StyleSubject =>\n isHTMLElement(subject) || isSVGElement(subject)\n\n/**\n * Reads the current value of a style from the element, as the initial\n * keyframe when `animate()` targets an element via this effect. Transforms\n * are parsed out of the computed matrix; everything else is the computed\n * style. Units aren't converted to match the target keyframes. A style\n * the browser can't report is 0, as a VisualElement reports it.\n */\nexport const readStyleValue = (element: StyleSubject, key: string) => {\n if (transformProps.has(key)) {\n return readTransformValue(element as HTMLElement, key)\n }\n\n const computedStyle = getComputedStyle(element)\n const value = isCSSVar(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as any]\n\n return (typeof value === \"string\" && value.trim()) || 0\n}\n\n/**\n * The per-element effect `animate()` binds through, so HTML values share\n * state with a direct `styleEffect()` call. The exported `styleEffect`\n * is this wrapped to also accept selectors.\n */\nexport const styleSubjectEffect = /*@__PURE__*/ createEffect(addStyleValue, {\n test: isStyleSubject,\n read: readStyleValue,\n})\n\nexport const styleEffect =\n /*@__PURE__*/ createSelectorEffect(styleSubjectEffect)\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n","import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n","import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * 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 */\nexport const cssStyleProperties = [\n \"transform\",\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n for (const key of cssStyleProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { MotionValue } from \"../../value\"\nimport { numberValueTypes } from \"../../value/types/maps/number\"\nimport { getValueAsType } from \"../../value/types/utils/get-as-type\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction canSetAsProperty(element: HTMLElement | SVGElement, name: string) {\n if (!(name in element)) return false\n\n const descriptor =\n Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), name) ||\n Object.getOwnPropertyDescriptor(element, name)\n\n // Check if it has a setter\n return descriptor && typeof descriptor.set === \"function\"\n}\n\n/**\n * `name` is the attribute written when it differs from the key the value\n * is stored under, e.g. `attrX` -> `x`. Numbers take the attribute's\n * default unit (`x: 100` -> `\"100px\"`), as they do when key and name match.\n */\nexport const addAttrValue = (\n element: HTMLElement | SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue,\n name: string = key\n) => {\n const isProp = canSetAsProperty(element, name)\n if (!isProp && (name.startsWith(\"data\") || name.startsWith(\"aria\"))) {\n name = camelToDash(name)\n }\n\n const type = numberValueTypes[key] || numberValueTypes[name]\n\n /**\n * Set attribute directly via property if available\n */\n const render = isProp\n ? () => {\n ;(element as any)[name] = getValueAsType(\n value.get(),\n numberValueTypes[key]\n )\n }\n : () => {\n const v = getValueAsType(value.get(), type)\n if (v === null || v === undefined) {\n element.removeAttribute(name)\n } else {\n element.setAttribute(name, String(v))\n }\n }\n\n return state.set(key, value, render)\n}\n\nexport const attrEffect = /*@__PURE__*/ createSelectorEffect(\n /*@__PURE__*/ createEffect(addAttrValue)\n)\n","import { frame } from \"../../frameloop\"\nimport { isCSSVar } from \"../../render/dom/is-css-var\"\nimport { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\nimport { cssStyleProperties } from \"../../render/svg/utils/build-attrs\"\nimport { transformProps } from \"../../render/utils/keys-transform\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { MotionValue } from \"../../value\"\nimport { numberValueTypes } from \"../../value/types/maps/number\"\nimport { addAttrValue } from \"../attr\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { addStyleValue, originProps, readStyleValue } from \"../style\"\nimport { createSelectorEffect } from \"../utils/create-dom-effect\"\nimport { createEffect } from \"../utils/create-effect\"\n\nfunction addSVGPathValue(\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) {\n frame.render(() => element.setAttribute(\"pathLength\", \"1\"))\n\n if (key === \"pathOffset\") {\n return state.set(key, value, () => {\n // Use unitless value to avoid Safari zoom bug\n const offset = value.get()\n element.setAttribute(\"stroke-dashoffset\", `${-offset}`)\n })\n } else {\n if (!state.get(\"stroke-dasharray\")) {\n state.set(\"stroke-dasharray\", new MotionValue(\"1 1\"), () => {\n const pathLength = state.get(\"pathLength\")?.get() ?? 1\n const pathSpacing = state.get(\"pathSpacing\")?.get()\n\n // Use unitless values to avoid Safari zoom bug\n element.setAttribute(\n \"stroke-dasharray\",\n `${pathLength} ${pathSpacing ?? 1 - Number(pathLength)}`\n )\n })\n }\n\n return state.set(key, value, undefined, state.get(\"stroke-dasharray\"))\n }\n}\n\nexport const addSVGValue = (\n element: SVGElement,\n state: MotionValueState,\n key: string,\n value: MotionValue\n) => {\n if (key.startsWith(\"path\") && !transformProps.has(key)) {\n return addSVGPathValue(element, state, key, value)\n } else if (key.startsWith(\"attr\")) {\n return addAttrValue(element, state, key, value, convertAttrKey(key))\n }\n\n /**\n * Transforms and origins aren't CSS properties (bar `x`/`y` in some\n * browsers), so check them by name rather than `key in element.style`.\n */\n const handler =\n transformProps.has(key) ||\n originProps.has(key) ||\n isCSSVar(key) ||\n key in element.style\n ? addStyleValue\n : addAttrValue\n return handler(element, state, key, value)\n}\n\n/**\n * Reads the current value of `key` from an SVG element as the origin of\n * an animation, as the SVG VisualElement does: transforms start from\n * their defaults, CSS variables and the few CSS-only properties come from\n * computed style, falling back to the attribute when that's empty (e.g.\n * the element isn't rendered), and everything else is read from the\n * attribute, dash-cased (`strokeWidth` -> `stroke-width`) or, failing\n * that, as written (`baseFrequency`).\n */\nexport const readSVGValue = (element: SVGElement, key: string) => {\n if (transformProps.has(key)) {\n return numberValueTypes[key]?.default || 0\n }\n\n if (isCSSVar(key) || cssStyleProperties.includes(key)) {\n return (\n readStyleValue(element, key) ||\n element.getAttribute(camelToDash(key)) ||\n 0\n )\n }\n\n key = convertAttrKey(key)\n\n return (\n element.getAttribute(camelToDash(key)) ??\n element.getAttribute(key) ??\n undefined\n )\n}\n\n/**\n * The per-element effect `animate()` binds through, so SVG values share\n * state with a direct `svgEffect()` call.\n */\nexport const svgSubjectEffect = /*@__PURE__*/ createEffect(addSVGValue, {\n test: isSVGElement,\n read: readSVGValue,\n})\n\nexport const svgEffect = /*@__PURE__*/ createSelectorEffect(svgSubjectEffect)\n\nfunction convertAttrKey(key: string) {\n return key.replace(/^attr([A-Z])/, (_, firstChar) =>\n firstChar.toLowerCase()\n )\n}\n","import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n","import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.rotateZ ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n","import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(box.x, -node.scroll.offset.x)\n translateAxis(box.y, -node.scroll.offset.y)\n }\n\n if (delta) {\n // Incorporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues, node.layout?.layoutBox)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min += distance\n axis.max += distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\nfunction resolveAxisTranslate(\n value: number | string | undefined,\n axis: Axis\n): number | undefined {\n if (typeof value === \"string\") {\n return (parseFloat(value) / 100) * (axis.max - axis.min)\n }\n return value as number | undefined\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(\n box: Box,\n transform: ResolvedValues,\n sourceBox?: Box\n) {\n const resolveBox = sourceBox ?? box\n transformAxis(\n box.x,\n resolveAxisTranslate(transform.x, resolveBox.x),\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n resolveAxisTranslate(transform.y, resolveBox.y),\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n","import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n","import { styleSubjectEffect, StyleSubject } from \"../../effects/style\"\nimport { svgSubjectEffect } from \"../../effects/svg\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { MotionValue, Owner } from \"../../value\"\nimport { DOMKeyframesResolver } from \"../keyframes/DOMKeyframesResolver\"\nimport { AnimationElement } from \"../keyframes/types\"\nimport { AnimationPlaybackControlsWithThen } from \"../types\"\nimport {\n animateEffectSubject,\n animateValues,\n EffectKeyframes,\n EffectTransition,\n} from \"./effects\"\n\nconst noProps = {}\n\ntype ElementEffect = typeof styleSubjectEffect\n\nconst getElementEffect = (element: Element) =>\n (isSVGElement(element)\n ? svgSubjectEffect\n : styleSubjectEffect) as ElementEffect\n\n/**\n * Presents an effect bound to a DOM element in the shape the DOM keyframe\n * resolver and WAAPI expect, which is that of a VisualElement. Holds no\n * state: everything delegates to the effect. Goes once the resolver takes\n * an effect and subject directly.\n */\nclass EffectSubject implements AnimationElement, Owner {\n KeyframeResolver = DOMKeyframesResolver\n\n constructor(private effect: ElementEffect, public current: StyleSubject) {}\n\n getValue(key: string) {\n return this.effect.get(this.current, key)\n }\n\n readValue(key: string, target?: unknown) {\n return this.effect.read(this.current, key, target as any)\n }\n\n render() {\n this.effect.flush(this.current)\n }\n\n measureViewportBox() {\n return measureViewportBox(this.current as HTMLElement)\n }\n\n getProps() {\n return noProps\n }\n}\n\n/**\n * Animate a DOM element's styles. HTML elements are bound through\n * styleEffect, SVG through svgEffect, and both are resolved with the DOM\n * keyframe resolver so reads are batched, units are converted by\n * measurement and eligible values run on WAAPI.\n *\n * Pass the element's VisualElement (a component or an\n * animateLayout() node) to animate its values instead, so the two keep\n * sharing values and a renderer.\n */\nexport function animateElement(\n element: StyleSubject,\n keyframes: EffectKeyframes,\n transition?: EffectTransition,\n visualElement?: VisualElement\n): AnimationPlaybackControlsWithThen[] {\n if (visualElement) {\n return animateValues(\n (key) => visualElement.getValue(key, null),\n keyframes,\n transition,\n visualElement\n )\n }\n\n const effect = getElementEffect(element)\n\n return animateEffectSubject(\n effect,\n element,\n keyframes,\n transition,\n new EffectSubject(effect, element)\n )\n}\n\n/**\n * Hand the values styleEffect/svgEffect are rendering on `element`,\n * whether bound by animate() or directly, to a VisualElement that now\n * owns the element (e.g. created by animateLayout()), so a single\n * renderer drives them alongside its own values.\n */\nexport function handOffElementState(\n element: Element,\n visualElement: VisualElement\n) {\n const state = getElementEffect(element).state(element as StyleSubject)\n if (!state) return\n\n const { transformKeys } = state\n state.release().forEach((value: MotionValue, key: string) => {\n /**\n * The style effect derives transform (from the bound transform\n * keys) and transformBox itself; a VisualElement builds its own.\n */\n const derived =\n key === \"transformBox\" ||\n (key === \"transform\" && transformKeys?.length)\n\n derived || visualElement.addValue(key, value)\n })\n}\n","import { isObject } from \"motion-utils\"\nimport { MotionValue } from \"../../value\"\nimport { MotionValueState } from \"../MotionValueState\"\nimport { createEffect } from \"../utils/create-effect\"\n\ninterface PropSubject {\n [key: string]: any\n}\n\n/**\n * Writes motion values to the properties of any object. This is\n * animate()'s fallback for subjects no registered effect claims.\n */\nexport const propEffect = /*@__PURE__*/ createEffect(\n (\n subject: PropSubject,\n state: MotionValueState,\n key: string,\n value: MotionValue\n ) => {\n return state.set(\n key,\n value,\n () => {\n subject[key] = value.get()\n }\n )\n },\n {\n test: (subject: unknown): subject is PropSubject => isObject(subject),\n read: (subject, key) => {\n const value = subject[key]\n return typeof value === \"string\" || typeof value === \"number\"\n ? value\n : undefined\n },\n }\n)\n","import { createRenderBatcher } from \"./batcher\"\n\nexport const { schedule: microtask, cancel: cancelMicrotask } =\n /* @__PURE__ */ createRenderBatcher(queueMicrotask, false)\n","export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n","import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\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 */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\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 */\nexport const isNodeOrChild = (\n parent: Element | null,\n child?: Element | null\n): boolean => {\n if (!child) {\n return false\n } else if (parent === child) {\n return true\n } else {\n return isNodeOrChild(parent, child.parentElement)\n }\n}\n","export const isPrimaryPointer = (event: PointerEvent) => {\n if (event.pointerType === \"mouse\") {\n return typeof event.button !== \"number\" || event.button <= 0\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","const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\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 */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\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 */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n","export const isPressing = new WeakSet()\n","import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n","import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\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: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nconst claimedPointerDownEvents = new WeakSet()\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n stopPropagation?: boolean\n}\n\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 */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n if (claimedPointerDownEvents.has(startEvent)) return\n\n isPressing.add(target)\n\n if (options.stopPropagation) {\n claimedPointerDownEvents.add(startEvent)\n }\n\n const onPressEnd = onPressStart(target, startEvent)\n\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\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\n \"pointerup\",\n onPointerUp,\n endEventOptions\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, endEventOptions)\n window.addEventListener(\n \"pointercancel\",\n onPointerCancel,\n endEventOptions\n )\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n","import { isCSSVar } from \"./is-css-var\"\n\nexport function getComputedStyle(\n element: HTMLElement | SVGElement,\n name: string\n) {\n const computedStyle = window.getComputedStyle(element)\n return isCSSVar(name)\n ? computedStyle.getPropertyValue(name)\n : computedStyle[name as any]\n}\n","import { isSVGElement } from \"../utils/is-svg-element\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport { ResizeHandler } from \"./types\"\n\nconst resizeHandlers = new WeakMap>>()\n\nlet observer: ResizeObserver | undefined\n\nconst getSize =\n (\n borderBoxAxis: \"inline\" | \"block\",\n svgAxis: \"width\" | \"height\",\n htmlAxis: \"offsetWidth\" | \"offsetHeight\"\n ) =>\n (target: Element, borderBoxSize?: ReadonlyArray) => {\n if (borderBoxSize && borderBoxSize[0]) {\n return borderBoxSize[0][\n (borderBoxAxis + \"Size\") as keyof ResizeObserverSize\n ]\n } else if (isSVGElement(target) && \"getBBox\" in target) {\n return (target as SVGGraphicsElement).getBBox()[svgAxis]\n } else {\n return (target as HTMLElement)[htmlAxis]\n }\n }\n\nconst getWidth = /*@__PURE__*/ getSize(\"inline\", \"width\", \"offsetWidth\")\nconst getHeight = /*@__PURE__*/ getSize(\"block\", \"height\", \"offsetHeight\")\n\nfunction notifyTarget({ target, borderBoxSize }: ResizeObserverEntry) {\n resizeHandlers.get(target)?.forEach((handler) => {\n handler(target, {\n get width() {\n return getWidth(target, borderBoxSize)\n },\n get height() {\n return getHeight(target, borderBoxSize)\n },\n })\n })\n}\n\nfunction notifyAll(entries: ResizeObserverEntry[]) {\n entries.forEach(notifyTarget)\n}\n\nfunction createResizeObserver() {\n if (typeof ResizeObserver === \"undefined\") return\n\n observer = new ResizeObserver(notifyAll)\n}\n\nexport function resizeElement(\n target: ElementOrSelector,\n handler: ResizeHandler\n) {\n if (!observer) createResizeObserver()\n\n const elements = resolveElements(target)\n\n elements.forEach((element) => {\n let elementHandlers = resizeHandlers.get(element)\n\n if (!elementHandlers) {\n elementHandlers = new Set()\n resizeHandlers.set(element, elementHandlers)\n }\n\n elementHandlers.add(handler)\n observer?.observe(element)\n })\n\n return () => {\n elements.forEach((element) => {\n const elementHandlers = resizeHandlers.get(element)\n\n elementHandlers?.delete(handler)\n\n if (!elementHandlers?.size) {\n observer?.unobserve(element)\n }\n })\n }\n}\n","import { WindowResizeHandler } from \"./types\"\n\nconst windowCallbacks = new Set()\n\nlet windowResizeHandler: VoidFunction | undefined\n\nfunction createWindowResizeHandler() {\n windowResizeHandler = () => {\n const info = {\n get width() {\n return window.innerWidth\n },\n get height() {\n return window.innerHeight\n },\n }\n\n windowCallbacks.forEach((callback) => callback(info))\n }\n\n window.addEventListener(\"resize\", windowResizeHandler)\n}\n\nexport function resizeWindow(callback: WindowResizeHandler) {\n windowCallbacks.add(callback)\n\n if (!windowResizeHandler) createWindowResizeHandler()\n\n return () => {\n windowCallbacks.delete(callback)\n\n if (\n !windowCallbacks.size &&\n typeof windowResizeHandler === \"function\"\n ) {\n window.removeEventListener(\"resize\", windowResizeHandler)\n windowResizeHandler = undefined\n }\n }\n}\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { resizeElement } from \"./handle-element\"\nimport { resizeWindow } from \"./handle-window\"\nimport { ResizeHandler, WindowResizeHandler } from \"./types\"\n\nexport function resize(onResize: WindowResizeHandler): VoidFunction\nexport function resize(\n target: ElementOrSelector,\n onResize: ResizeHandler\n): VoidFunction\nexport function resize(\n a: WindowResizeHandler | ElementOrSelector,\n b?: ResizeHandler\n) {\n return typeof a === \"function\" ? resizeWindow(a) : resizeElement(a, b!)\n}\n","import type { LayoutProjectionMetrics, StatsRecording } from \"./types\"\n\nexport type InactiveStatsBuffer = {\n value: null\n addProjectionMetrics: null\n}\n\nexport type ActiveStatsBuffer = {\n value: StatsRecording\n addProjectionMetrics: (metrics: LayoutProjectionMetrics) => void\n}\n\nexport const statsBuffer: InactiveStatsBuffer | ActiveStatsBuffer = {\n value: null,\n addProjectionMetrics: null,\n}\n","import { ActiveStatsBuffer, statsBuffer } from \"./buffer\"\n\nfunction clearStatsBuffer() {\n statsBuffer.value = null\n statsBuffer.addProjectionMetrics = null\n}\n\nexport function recordStats() {\n if (statsBuffer.value) {\n clearStatsBuffer()\n throw new Error(\"Stats are already being measured\")\n }\n\n const buffer = statsBuffer as unknown as ActiveStatsBuffer\n\n buffer.value = {\n layoutProjection: {\n nodes: [],\n calculatedTargetDeltas: [],\n calculatedProjections: [],\n },\n }\n\n buffer.addProjectionMetrics = (metrics) => {\n const { layoutProjection } = buffer.value\n layoutProjection.nodes.push(metrics.nodes)\n layoutProjection.calculatedTargetDeltas.push(\n metrics.calculatedTargetDeltas\n )\n layoutProjection.calculatedProjections.push(\n metrics.calculatedProjections\n )\n }\n}\n","import { isSVGElement } from \"./is-svg-element\"\n\n/**\n * Checks if an element is specifically an SVGSVGElement (the root SVG element)\n * in a way that works across iframes\n */\nexport function isSVGSVGElement(element: unknown): element is SVGSVGElement {\n return isSVGElement(element) && element.tagName === \"svg\"\n}\n","import { Easing, easingDefinitionToFunction } from \"motion-utils\"\nimport { DynamicOption } from \"../animation/types\"\n\nexport type StaggerOrigin =\n | \"first\"\n | \"last\"\n | \"center\"\n | \"edges\"\n | \"random\"\n | number\n\nexport type StaggerOptions = {\n startDelay?: number\n from?: StaggerOrigin\n ease?: Easing\n /**\n * Treat elements as a grid of `[columns, rows]`, in reading order.\n * Delays are then based on the 2D distance from `from`.\n */\n grid?: [number, number]\n}\n\nexport function getOriginIndex(from: StaggerOrigin, total: number) {\n if (from === \"first\") {\n return 0\n } else {\n const lastIndex = total - 1\n return from === \"last\" ? lastIndex : lastIndex / 2\n }\n}\n\nexport function stagger(\n duration: number = 0.1,\n { startDelay = 0, from = 0, ease, grid }: StaggerOptions = {}\n): DynamicOption {\n /**\n * Distances from the origin for each element count. The final entry\n * holds the distance used to normalise easing.\n */\n const cache: { [total: number]: number[] } = {}\n\n return (i: number, total: number) => {\n let distances = cache[total]\n\n if (!distances) {\n const [columns, rows] = grid || [Infinity, 1]\n const lastX = Math.min(columns, total) - 1\n const lastY = Math.max(rows, Math.ceil(total / columns)) - 1\n const isIndex = typeof from === \"number\"\n const scale = from === \"first\" ? 0 : from === \"last\" ? 1 : 0.5\n const originX = isIndex ? from % columns : lastX * scale\n const originY = isIndex ? Math.floor(from / columns) : lastY * scale\n\n distances = cache[total] = []\n\n for (let j = 0; j < total; j++) {\n const x = j % columns\n const y = Math.floor(j / columns)\n const edgeX = Math.min(x, lastX - x)\n const edgeY = Math.min(y, lastY - y)\n\n if (from === \"random\") {\n // Inside-out shuffle, so each element gets a distinct step\n const k = (Math.random() * (j + 1)) | 0\n distances[j] = distances[k]\n distances[k] = j\n } else {\n distances[j] =\n from === \"edges\"\n ? Math.min(\n lastX ? edgeX : edgeY,\n lastY ? edgeY : edgeX\n )\n : Math.hypot(x - originX, y - originY)\n }\n }\n\n distances.push(grid ? Math.max(...distances) : total)\n }\n\n let delay = duration * distances[i]\n const maxDelay = duration * distances[total]\n\n if (ease && maxDelay) {\n const easingFunction = easingDefinitionToFunction(ease)\n delay = easingFunction(delay / maxDelay) * maxDelay\n }\n\n return startDelay + delay\n }\n}\n","import { EasingFunction } from \"motion-utils\"\nimport { interpolate } from \"./interpolate\"\n\n/**\n * @public\n */\nexport interface TransformOptions {\n /**\n * Clamp values to within the given range. Defaults to `true`\n *\n * @public\n */\n clamp?: boolean\n\n /**\n * Easing functions to use on the interpolations between each value in the input and output ranges.\n *\n * If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition **between** each.\n *\n * @public\n */\n ease?: EasingFunction | EasingFunction[]\n\n /**\n * Provide a function that can interpolate between any two values in the provided range.\n *\n * @public\n */\n mixer?: (from: T, to: T) => (v: number) => any\n}\n\n/**\n * Transforms numbers into other values by mapping them from an input range to an output range.\n * Returns the type of the input provided.\n *\n * @remarks\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [0, 200]\n * const outputRange = [0, 1]\n * const output = transform(100, inputRange, outputRange)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n * ```\n *\n * @param inputValue - A number to transform between the input and output ranges.\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors, strings, or arrays/objects of those. Must be the same length as `inputRange`.\n * @param options - Clamp: Clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputValue: number,\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): T\n/**\n *\n * Transforms numbers into other values by mapping them from an input range to an output range.\n *\n * Given an input range of `[0, 200]` and an output range of\n * `[0, 1]`, this function will return a value between `0` and `1`.\n * The input range must be a linear series of numbers. The output range\n * can be any supported value type, such as numbers, colors, shadows, arrays, objects and more.\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * export function MyComponent() {\n * const inputRange = [-200, -100, 100, 200]\n * const outputRange = [0, 1, 1, 0]\n * const convertRange = transform(inputRange, outputRange)\n * const output = convertRange(-150)\n *\n * // Returns 0.5\n * return
{output}
\n * }\n *\n * ```\n *\n * @param inputRange - A linear series of numbers (either all increasing or decreasing).\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options - Clamp: clamp values to within the given range. Defaults to `true`.\n *\n * @public\n */\nexport function transform(\n inputRange: number[],\n outputRange: T[],\n options?: TransformOptions\n): (inputValue: number) => T\nexport function transform(\n ...args:\n | [number, number[], T[], TransformOptions?]\n | [number[], T[], TransformOptions?]\n) {\n const useImmediate = !Array.isArray(args[0])\n const argOffset = useImmediate ? 0 : -1\n const inputValue = args[0 + argOffset] as number\n const inputRange = args[1 + argOffset] as number[]\n const outputRange = args[2 + argOffset] as T[]\n const options = args[3 + argOffset] as TransformOptions\n\n const interpolator = interpolate(inputRange, outputRange, options)\n\n return useImmediate ? interpolator(inputValue) : interpolator\n}\n","import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport { FrameData } from \"../frameloop/types\"\nimport { DriverControls } from \"./drivers/types\"\nimport { calcGeneratorVelocity } from \"./generators/utils/velocity\"\nimport { resolveStartTime } from \"./utils/resolve-start-time\"\nimport {\n GeneratorFactory,\n KeyframeGenerator,\n MotionValueAnimation,\n ValueAnimationOptions,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\n/**\n * Every running follower ticks from this one frame callback.\n */\nconst active = new Set()\n\nconst tickAll = ({ timestamp }: FrameData) => {\n active.forEach((animation) => animation.tick(timestamp))\n}\n\n/**\n * A lean animation for values that follow a target (`followValue`,\n * `springValue`): a single numeric generator, retargeted in place as\n * the target moves and ticked from a frame callback shared by every\n * follower. Only implements the controls `MotionValue.animation`\n * exposes. Repeat options are ignored: a follower only ever heads for\n * its latest target.\n */\nexport class FollowAnimation\n extends WithPromise\n implements MotionValueAnimation\n{\n state: AnimationPlayState = \"idle\"\n\n private generator: KeyframeGenerator\n\n private factory: GeneratorFactory\n\n private options: ValueAnimationOptions\n\n private startTime = 0\n\n private currentTime = 0\n\n /**\n * Whether the first tick has fired `onPlay`.\n */\n private started = false\n\n /**\n * A target set since the last tick, applied at the next one so any\n * number of sets per frame cost one retarget.\n */\n private hasNextTarget = false\n\n private nextTarget = 0\n\n private nextVelocity?: number\n\n /**\n * Only created when a custom driver is passed, otherwise the\n * follower ticks from the shared frame callback.\n */\n private driver?: DriverControls\n\n constructor(options: ValueAnimationOptions) {\n super()\n\n this.options = options\n this.factory = options.type as GeneratorFactory\n this.generator = this.factory(options)\n\n const { driver } = options\n if (driver) this.driver = driver((timestamp) => this.tick(timestamp))\n\n this.startTime = this.now()\n this.state = \"running\"\n\n if (this.driver) {\n this.driver.start()\n } else {\n active.size || frame.update(tickAll, true)\n active.add(this)\n }\n }\n\n /**\n * Aim at a new target from wherever the animation has reached by the\n * next tick. `velocity` fixes the velocity to steer with, otherwise\n * the generator's is used.\n */\n setTarget(target: number, velocity?: number) {\n this.nextTarget = target\n this.nextVelocity = velocity\n this.hasNextTarget = true\n }\n\n /**\n * Steer towards new keyframes from the current position and velocity.\n * Springs are updated in place; other generators are recreated.\n */\n retarget(keyframes: number[], velocity: number) {\n const { options, generator } = this\n options.keyframes = keyframes\n options.velocity = velocity\n this.startTime = this.now()\n this.currentTime = 0\n\n if (generator.retarget) {\n generator.retarget(keyframes, velocity)\n } else {\n this.generator = this.factory(options)\n }\n }\n\n tick(timestamp: number) {\n const { options, hasNextTarget: retargeted } = this\n const { delay = 0, onUpdate, onPlay } = options\n // Retargets happen on a tick, so only the first start can lag\n if (!this.started) {\n this.startTime = resolveStartTime(this.startTime, timestamp)\n }\n const elapsed = Math.round(timestamp - this.startTime) - delay\n const t = (this.currentTime = Math.max(0, elapsed))\n const state = this.generator.next(t)\n // Hold the origin through the delay, even if the generator is already at rest\n const value = elapsed < 0 ? options.keyframes[0] : state.value\n\n if (retargeted) {\n /**\n * Steer from where the current trajectory has reached this\n * frame, then render that position as the new origin.\n */\n this.hasNextTarget = false\n const { keyframes } = options\n keyframes[0] = value\n keyframes[1] = this.nextTarget\n this.retarget(\n keyframes,\n this.nextVelocity ?? this.getGeneratorVelocity()\n )\n }\n\n if (retargeted || !this.started) {\n this.started = true\n onPlay?.()\n }\n\n /**\n * Callbacks may stop this animation or set a new target, so check\n * the live state rather than what was read at the top of the tick.\n */\n if (this.state !== \"running\") return\n\n onUpdate?.(value)\n\n if (\n state.done &&\n elapsed >= 0 &&\n !retargeted &&\n !this.hasNextTarget &&\n this.state === \"running\"\n ) {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n options.onComplete?.()\n }\n }\n\n getGeneratorVelocity(): number {\n return calcGeneratorVelocity(\n this.generator,\n this.currentTime,\n this.options.velocity\n )\n }\n\n /**\n * Bound to the instance so `animation.stop` can be passed around.\n */\n stop = () => {\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n private now() {\n return this.driver ? this.driver.now() : time.now()\n }\n\n private teardown() {\n this.state = \"idle\"\n\n if (this.driver) {\n this.driver.stop()\n } else {\n active.delete(this)\n active.size || cancelFrame(tickAll)\n }\n }\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\n\nexport const asNumber = (v: AnyResolvedKeyframe) =>\n typeof v === \"number\" ? v : parseFloat(v)\n","import type { MotionValue } from \"..\"\nimport { FollowAnimation } from \"../../animation/FollowAnimation\"\nimport type {\n AnyResolvedKeyframe,\n GeneratorFactory,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport type { FollowValueOptions } from \"../follow-value\"\nimport { asNumber } from \"./as-number\"\nimport { isMotionValue } from \"./is-motion-value\"\n\nexport type FollowOptions = FollowValueOptions & { type: GeneratorFactory }\n\n/**\n * Animate `value` to its latest value with the generator in\n * `options.type`, tracking `source` if it's a `MotionValue`. Takes a\n * generator rather than a type name, so spring-only callers don't\n * bundle every generator.\n */\nexport function follow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowOptions\n): VoidFunction {\n const initialValue = value.get()\n\n let activeAnimation: FollowAnimation | null = null\n let set: (v: T) => void\n\n const unit =\n typeof initialValue === \"string\"\n ? initialValue.replace(/[\\d.-]/g, \"\")\n : undefined\n\n const onUpdate = (v: number) => set((unit ? v + unit : v) as T)\n\n const onPlay = () => value[\"events\"].animationStart?.notify()\n\n const stopAnimation = () => {\n if (activeAnimation) {\n activeAnimation.stop()\n activeAnimation = null\n }\n value.animation = undefined\n }\n\n value.attach((v, safeSet) => {\n set = safeSet\n const target = asNumber(v)\n\n if (activeAnimation?.state === \"running\") {\n /**\n * Steer the running animation rather than replacing it. This\n * keeps its completion promise and uses its analytical velocity\n * for accuracy, preventing systematic velocity loss at high\n * frame rates (240hz+).\n */\n activeAnimation.setTarget(target, options.velocity)\n return\n }\n\n const current = asNumber(value.get())\n const velocity = activeAnimation\n ? activeAnimation.getGeneratorVelocity()\n : value.getVelocity()\n\n stopAnimation()\n\n // Don't animate if we're already at the target\n if (current === target) return\n\n const animationOptions: ValueAnimationOptions = {\n keyframes: [current, target],\n velocity,\n restDelta: 0.001,\n restSpeed: 0.01,\n ...options,\n onUpdate,\n }\n\n const animation = (activeAnimation = new FollowAnimation({\n ...animationOptions,\n onPlay,\n }))\n\n value.animation = animation\n\n animation.then(() => {\n // Ignore if this animation has since been replaced\n if (activeAnimation !== animation) return\n activeAnimation = null\n value.animation = undefined\n value[\"events\"].animationComplete?.notify()\n })\n }, stopAnimation)\n\n if (isMotionValue(source)) {\n let skipNextAnimation = options.skipInitialAnimation === true\n\n const onSourceChange = (v: T) => {\n if (skipNextAnimation) {\n skipNextAnimation = false\n value.jump(parseValue(v, unit) as T, false)\n } else {\n value.set(parseValue(v, unit) as T)\n }\n }\n\n const removeSourceOnChange = source.on(\"change\", onSourceChange)\n\n /**\n * Catch up on a change made before we subscribed, for instance\n * between a React render reading the source and the effect\n * attaching to it. Subtracting is falsy for equal or non-numeric\n * (NaN) values.\n */\n const latest = source.get()\n if (asNumber(latest) - asNumber(value.get())) onSourceChange(latest)\n\n const removeValueOnDestroy = value.on(\"destroy\", removeSourceOnChange)\n\n /**\n * Stop our animation on detach, otherwise a re-attach (new\n * options, Strict Mode) starts a second animation that fights\n * this orphaned one. The catch-up above resumes from the\n * current value and velocity.\n */\n return () => {\n removeSourceOnChange()\n removeValueOnDestroy()\n stopAnimation()\n }\n }\n\n return stopAnimation\n}\n\nfunction parseValue(v: AnyResolvedKeyframe, unit?: string) {\n return unit ? v + unit : v\n}\n","import { MotionValue, motionValue } from \".\"\nimport { keyframes } from \"../animation/generators/keyframes\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationTransition,\n} from \"../animation/types\"\nimport { replaceTransitionType } from \"../animation/utils/replace-transition-type\"\nimport { follow, FollowOptions } from \"./utils/follow\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Options for useFollowValue hook, extending ValueAnimationTransition\n * but excluding lifecycle callbacks that don't make sense for the hook pattern,\n * and repeat options, as a follower always heads for its latest value.\n */\nexport type FollowValueOptions = Omit<\n ValueAnimationTransition,\n | \"onUpdate\"\n | \"onComplete\"\n | \"onPlay\"\n | \"onRepeat\"\n | \"onStop\"\n | \"repeat\"\n | \"repeatType\"\n | \"repeatDelay\"\n> & {\n /**\n * When true, the first change from a tracked `MotionValue` source\n * will jump to the new value instead of animating. Subsequent\n * changes animate normally. This prevents unwanted animations\n * on page refresh or back navigation (e.g. `useScroll` + `useSpring`).\n *\n * @default false\n */\n skipInitialAnimation?: boolean\n}\n\n/**\n * Create a `MotionValue` that animates to its latest value using any transition type.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = followValue(x, { type: \"spring\", stiffness: 300 })\n * // or with tween\n * const z = followValue(x, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function followValue(\n source: T | MotionValue,\n options?: FollowValueOptions\n) {\n const initialValue = isMotionValue(source) ? source.get() : source\n const value = motionValue(initialValue)\n\n attachFollow(value, source, options)\n\n return value\n}\n\n/**\n * Attach an animation to a MotionValue that will animate whenever the value changes.\n * Similar to attachSpring but supports any transition type (spring, tween, inertia, etc.)\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Animation transition options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachFollow(\n value: MotionValue,\n source: T | MotionValue,\n options: FollowValueOptions = {}\n): VoidFunction {\n // Default to spring if no type specified (matches useSpring behavior)\n const transition: FollowValueOptions = { type: \"spring\", ...options }\n replaceTransitionType(transition)\n transition.type = transition.type || keyframes\n\n return follow(value, source, transition as FollowOptions)\n}\n","import { MotionValue } from \".\"\nimport { cancelFrame, frame } from \"../frameloop\"\n\nexport function subscribeValue(\n inputValues: MotionValue[],\n outputValue: MotionValue,\n getLatest: () => O\n) {\n const update = () => outputValue.set(getLatest())\n const scheduleUpdate = () => frame.preRender(update, false, true)\n\n const subscriptions = inputValues.map((v) => v.on(\"change\", scheduleUpdate))\n\n outputValue.on(\"destroy\", () => {\n subscriptions.forEach((unsubscribe) => unsubscribe())\n cancelFrame(update)\n })\n}\n","import { MotionValue, collectMotionValues, motionValue } from \".\"\nimport { subscribeValue } from \"./subscribe-value\"\n\nexport type TransformInputRange = number[]\nexport type SingleTransformer = (input: I) => O\nexport type MultiTransformer = (input: I[]) => O\nexport type ValueTransformer =\n | SingleTransformer\n | MultiTransformer\n\n/**\n * Create a `MotionValue` that transforms the output of other `MotionValue`s by\n * passing their latest values through a transform function.\n *\n * Whenever a `MotionValue` referred to in the provided function is updated,\n * it will be re-evaluated.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = transformValue(() => x.get() * 2) // double x\n * ```\n *\n * @param transformer - A transform function. This function must be pure with no side-effects or conditional statements.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function transformValue(transform: () => O): MotionValue {\n const collectedValues: MotionValue[] = []\n\n /**\n * Open session of collectMotionValues. Any MotionValue that calls get()\n * inside transform will be saved into this array.\n */\n collectMotionValues.current = collectedValues\n const initialValue = transform()\n collectMotionValues.current = undefined\n\n const value = motionValue(initialValue)\n\n subscribeValue(collectedValues, value, transform)\n\n return value\n}\n","import { MotionValue } from \".\"\nimport { transform, TransformOptions } from \"../utils/transform\"\nimport { transformValue } from \"./transform-value\"\n\nexport type MapInputRange = number[]\n\n/**\n * Create a `MotionValue` that maps the output of another `MotionValue` by\n * mapping it from one range of values into another.\n *\n * @remarks\n *\n * Given an input range of `[-200, -100, 100, 200]` and an output range of\n * `[0, 1, 1, 0]`, the returned `MotionValue` will:\n *\n * - When provided a value between `-200` and `-100`, will return a value between `0` and `1`.\n * - When provided a value between `-100` and `100`, will return `1`.\n * - When provided a value between `100` and `200`, will return a value between `1` and `0`\n *\n * The input range must be a linear series of numbers. The output range\n * can be any value type supported by Motion: numbers, colors, shadows, etc.\n *\n * Every value in the output range must be of the same type and in the same format.\n *\n * ```jsx\n * const x = motionValue(0)\n * const xRange = [-200, -100, 100, 200]\n * const opacityRange = [0, 1, 1, 0]\n * const opacity = mapValue(x, xRange, opacityRange)\n * ```\n *\n * @param inputValue - `MotionValue`\n * @param inputRange - A linear series of numbers (either all increasing or decreasing)\n * @param outputRange - A series of numbers, colors or strings. Must be the same length as `inputRange`.\n * @param options -\n *\n * - clamp: boolean. Clamp values to within the given range. Defaults to `true`\n * - ease: EasingFunction[]. Easing functions to use on the interpolations between each value in the input and output ranges. If provided as an array, the array must be one item shorter than the input and output ranges, as the easings apply to the transition between each.\n *\n * @returns `MotionValue`\n *\n * @public\n */\nexport function mapValue(\n inputValue: MotionValue,\n inputRange: MapInputRange,\n outputRange: O[],\n options?: TransformOptions\n): MotionValue {\n const map = transform(inputRange, outputRange, options)\n return transformValue(() => map(inputValue.get()))\n}\n","import { MotionValue, motionValue } from \".\"\nimport { spring } from \"../animation/generators/spring\"\nimport { AnyResolvedKeyframe, SpringOptions } from \"../animation/types\"\nimport { follow } from \"./utils/follow\"\nimport { isMotionValue } from \"./utils/is-motion-value\"\n\n/**\n * Create a `MotionValue` that animates to its latest value using a spring.\n * Can either be a value or track another `MotionValue`.\n *\n * ```jsx\n * const x = motionValue(0)\n * const y = springValue(x, { stiffness: 300 })\n * ```\n *\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns `MotionValue`\n *\n * @public\n */\nexport function springValue(\n source: T | MotionValue,\n options?: SpringOptions\n) {\n const value = motionValue(isMotionValue(source) ? source.get() : source)\n\n attachSpring(value, source, options)\n\n return value\n}\n\n/**\n * Attach a spring animation to a MotionValue that will animate whenever the value changes.\n *\n * @param value - The MotionValue to animate\n * @param source - Initial value or MotionValue to track\n * @param options - Spring configuration options\n * @returns Cleanup function\n *\n * @public\n */\nexport function attachSpring(\n value: MotionValue,\n source: T | MotionValue,\n options?: SpringOptions\n): VoidFunction {\n return follow(value, source, { ...options, type: spring })\n}\n","import { color } from \"../color\"\nimport { complex } from \"../complex\"\nimport { dimensionValueTypes } from \"../dimensions\"\nimport { testValueType } from \"../test\"\n\n/**\n * A list of all ValueTypes\n */\nconst valueTypes = [...dimensionValueTypes, color, complex]\n\n/**\n * Tests a value against the list of ValueTypes\n */\nexport const findValueType = (v: any) => valueTypes.find(testValueType(v))\n","import { ElementOrSelector, resolveElements } from \"../../utils/resolve-elements\"\n\nlet nameCount = 0\n\n/**\n * Generated names live in their own namespace so we can tell a name we own\n * (and must clean up) from an author-defined one - and so a stale generated\n * name left behind by an interrupted transition is re-owned, not mistaken for\n * the author's and leaked.\n */\nconst generatedName = () => `motion-view-${nameCount++}`\n\nconst isGeneratedName = (name: string) => name.startsWith(\"motion-view-\")\n\n/**\n * Tag a captured element with a `view-transition-class` so authors can target\n * its generated layer from CSS (e.g. `::view-transition-group(.hero)`) without\n * the opaque generated name. Tracked in `classed` - separate from the generated\n * names in `assigned` - so cleanup removes the class without ever stripping an\n * author's own inline `view-transition-name`.\n */\nfunction tagClass(\n element: Element,\n className: string | undefined,\n classed: Element[]\n) {\n if (!className) return\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-class\",\n className\n )\n classed.push(element)\n}\n\n/**\n * Set the element's `view-transition-group` so its layer reconstructs the DOM\n * hierarchy in the pseudo-tree (`contain`) - or stays flat (`none`). Tracked in\n * `grouped` for cleanup. When the element clips (any non-`visible` overflow) its\n * name is recorded in `clipChildren` so the caller can clip the nested children\n * (`::view-transition-group-children(name)`), mirroring the live clip through\n * the whole transition rather than only at the live-DOM handoff.\n *\n * Ignored by browsers without nested view-transition groups, where it harmlessly\n * degrades to the flat default.\n */\nfunction applyGroup(\n element: Element,\n name: string,\n group: string | undefined,\n grouped: Element[],\n clipChildren?: Set\n) {\n if (!group) return\n ;(element as HTMLElement).style?.setProperty(\"view-transition-group\", group)\n grouped.push(element)\n\n if (group !== \"none\" && clipChildren) {\n const style = getComputedStyle(element)\n if (style.overflowX !== \"visible\" || style.overflowY !== \"visible\") {\n clipChildren.add(name)\n }\n }\n}\n\n/**\n * Resolve a selector/Element to elements and ensure each one carries a\n * `view-transition-name` we can target from script.\n *\n * Author-defined names are reused as-is. Elements that are unnamed (or use\n * the browser's `auto`/`match-element`, whose generated name is not exposed\n * to script) are given a unique generated name, set inline so it's captured,\n * and tracked in `assigned` for later cleanup.\n *\n * `registry` maps each Element to its name so the same element keeps its name\n * across both captures (before and after the update), which is what allows a\n * persistent element to animate as a single `group` layer.\n */\nexport function assignViewTransitionNames(\n definition: ElementOrSelector,\n registry: Map,\n assigned: Element[],\n forcedNames?: string[],\n className?: string,\n classed: Element[] = [],\n group?: string,\n grouped: Element[] = [],\n clipChildren?: Set\n): string[] {\n const elements = resolveElements(definition)\n\n /**\n * The new end of a paired morph: give each element the matching name from\n * the old end (by index) so the two share one layer and morph. If the new\n * end resolves to *more* elements than the old end named, the extras have no\n * counterpart - give them a fresh name so they animate as newcomers rather\n * than being silently left unnamed. We return the names actually assigned\n * (sized to the resolved elements), not the raw `forcedNames`, so stagger\n * totals and the layer set stay in step with what's on the page.\n */\n if (forcedNames) {\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const name = forcedNames[i] ?? generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n }\n\n /**\n * Read every current name up front, before assigning any. Interleaving the\n * reads with the inline `setProperty` writes below would dirty styles\n * between reads and force a style recalc per element; batching the reads\n * keeps it to one. Elements already in the registry keep their name and\n * need no read.\n */\n const currentNames = elements.map((element) =>\n registry.has(element)\n ? undefined\n : getComputedStyle(element).getPropertyValue(\"view-transition-name\")\n )\n\n return elements.map((element, i) => {\n const existing = registry.get(element)\n if (existing) return existing\n\n const current = currentNames[i]\n\n let name: string\n if (\n current &&\n current !== \"none\" &&\n current !== \"auto\" &&\n current !== \"match-element\" &&\n !isGeneratedName(current)\n ) {\n /**\n * The author already named this layer - target it as-is and leave\n * it to them to clean up. `auto`/`match-element` are overridden\n * because their generated name is not exposed to script, and a\n * stale `motion-view-*` (e.g. left by an interrupted transition) is\n * re-owned rather than adopted as an author name and leaked.\n */\n name = current\n } else {\n name = generatedName()\n ;(element as HTMLElement).style?.setProperty(\n \"view-transition-name\",\n name\n )\n assigned.push(element)\n }\n\n registry.set(element, name)\n tagClass(element, className, classed)\n applyGroup(element, name, group, grouped, clipChildren)\n\n return name\n })\n}\n\n/**\n * Remove the `view-transition-name`s we generated and the\n * `view-transition-class`es we applied. Author-defined names are never touched\n * (they're not in `assigned`). Safe to call more than once (e.g. on both a\n * finished and an interrupted transition).\n */\nexport function releaseViewTransitionNames(\n assigned: Element[],\n classed: Element[] = [],\n grouped: Element[] = []\n): void {\n for (const element of assigned) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-name\")\n }\n for (const element of classed) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-class\")\n }\n for (const element of grouped) {\n ;(element as HTMLElement).style?.removeProperty(\"view-transition-group\")\n }\n}\n","export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n return \"old\"\n}\n","let pendingRules: Record> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n","export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n // `group-children` (nested transitions) before `group` so it wins.\n /::view-transition-(old|new|group-children|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n","export function getViewAnimations() {\n return document.getAnimations().filter((animation) => {\n const { effect } = animation\n return (\n !!effect &&\n effect.target === document.documentElement &&\n (effect as KeyframeEffect).pseudoElement?.startsWith(\n \"::view-transition\"\n )\n )\n })\n}\n","import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n","import { secondsToMilliseconds, warnOnce } from \"motion-utils\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport { NativeAnimationWrapper } from \"../animation/NativeAnimationWrapper\"\nimport { AnimationPlaybackControls, DOMKeyframesDefinition } from \"../animation/types\"\nimport { getValueTransition } from \"../animation/utils/get-value-transition\"\nimport { mapEasingToNativeEasing } from \"../animation/waapi/easing/map-easing\"\nimport { applyGeneratorOptions } from \"../animation/waapi/utils/apply-generator\"\nimport { cornerRadiusProps } from \"../utils/border-radius\"\nimport { ElementOrSelector, resolveElements } from \"../utils/resolve-elements\"\nimport type { ViewTransitionBuilder } from \"./index\"\nimport { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"./types\"\nimport {\n assignViewTransitionNames,\n releaseViewTransitionNames,\n} from \"./utils/assign-names\"\nimport { chooseLayerType } from \"./utils/choose-layer-type\"\nimport { css } from \"./utils/css\"\nimport { getViewAnimationLayerInfo } from \"./utils/get-layer-info\"\nimport { getViewAnimations } from \"./utils/get-view-animations\"\nimport { hasTarget } from \"./utils/has-target\"\n\nconst definitionNames = [\"layout\", \"enter\", \"exit\", \"new\", \"old\"] as const\n\ntype CornerRadii = Record<(typeof cornerRadiusProps)[number], string>\n\n/**\n * Whether a computed border-radius is square (every component zero). Splitting\n * on whitespace handles two-value/elliptical radii like \"0px 20px\" - a leading\n * `parseFloat` alone would misread the non-zero vertical radius as square.\n */\nconst isSquareRadius = (radius: string) =>\n radius.split(\" \").every((value) => parseFloat(value) === 0)\n\n/**\n * The `ViewTransitionTarget` buckets driving each generated layer type, in\n * priority order - the inverse of `chooseLayerType`. The new view is driven by\n * `new`/`enter`, the old by `old`/`exit`. `group-children`/`image-pair` have no\n * bucket; they follow the default layout timing.\n */\nconst typeBuckets: Record = {\n group: [\"layout\"],\n new: [\"new\", \"enter\"],\n old: [\"old\", \"exit\"],\n}\n\n/**\n * Default \"absent\" origin for a single-value keyframe, by pseudo type, so e.g.\n * `enter({ scale: 1 })` grows in from 0.85 and `exit({ opacity: 0 })` fades\n * from 1. `enter` prefers the matching `exit` value over these (see below).\n */\nconst ORIGIN_DEFAULTS: Record> = {\n new: { opacity: 0, scale: 0.85 },\n old: { opacity: 1, scale: 1 },\n}\n\n/**\n * How much two box aspect ratios must differ before a morph is treated as\n * aspect-changing (and so worth cropping). Matches the projection engine's\n * `preserve-aspect` threshold, so small layout jitter doesn't trigger a crop.\n */\nconst ASPECT_TOLERANCE = 0.2\n\nexport function startViewAnimation(\n builder: ViewTransitionBuilder\n): Promise {\n const {\n update,\n targets,\n resolveDefs,\n cropOverride,\n pairs,\n classNames,\n flatGroups,\n options: defaultOptions,\n } = builder\n\n if (!document.startViewTransition) {\n // An async IIFE (not `new Promise(async …)`) so a throwing/rejecting\n // update rejects this promise rather than leaving it unsettled.\n return (async () => {\n await update()\n return new GroupAnimation([])\n })()\n }\n\n /**\n * Resolve any selector/Element targets to layer names, assigning a\n * `view-transition-name` to each element as we go. We run this before the\n * update (so the elements are captured in the old snapshot) and again\n * after it (for the new snapshot). An element present in both keeps the\n * same name and animates as a single `group` layer.\n */\n const nameRegistry = new Map()\n const assigned: Element[] = []\n /**\n * Elements we tagged with a `view-transition-class` (via `.class()`),\n * tracked separately from `assigned` so cleanup removes the class without\n * ever stripping an author's own inline `view-transition-name`.\n */\n const classed: Element[] = []\n /**\n * Elements we set a `view-transition-group` on (for nesting), tracked for\n * cleanup. `clipChildren` collects the names of nested parents that clip in\n * the live layout, so their `::view-transition-group-children` is clipped\n * through the transition - not just once the live DOM takes back over.\n */\n const grouped: Element[] = []\n const clipChildren = new Set()\n const layerTargets = new Map()\n const croppedNames = new Set()\n /**\n * Each layer's explicit `.crop(true | false)` override (by resolved name),\n * so `finalizeCrop` can let an author's choice win over the morph default.\n */\n const cropForName = new Map()\n /**\n * Each layer's stagger position (index + total) within its subject, per\n * snapshot. Resolving against the snapshot the layer belongs to keeps\n * stagger correct when `update()` replaces the matched elements, and lets\n * us skip a layer that's absent from a snapshot (e.g. an exited element\n * has no `new` pseudo-element).\n */\n const layerStagger = new Map<\n string,\n { old?: [number, number]; new?: [number, number] }\n >()\n /**\n * Names allocated for a paired subject in the old snapshot, replayed onto\n * its new-snapshot target so both ends share a layer and morph.\n */\n const pairNames = new Map()\n /**\n * The old (`from`) elements of each paired subject, so their names can be\n * transferred off before the new (`to`) elements inherit them.\n */\n const pairFrom = new Map()\n\n const resolveLayers = (phase: \"old\" | \"new\") => {\n targets.forEach((target, definition) => {\n const className = classNames.get(definition)\n /**\n * Nest each resolved layer under its DOM-ancestor layer by default\n * (`contain`), so an ancestor's clip/transform/opacity reach it\n * through the transition; `.group(false)` opts a subject out (`none`)\n * to stay flat and escape. Skipped for root / pre-named layers, which\n * aren't elements we resolve and style.\n */\n const group =\n definition === \"root\" || !resolveDefs.has(definition)\n ? undefined\n : flatGroups.has(definition)\n ? \"none\"\n : \"contain\"\n let names: string[]\n if (definition === \"root\" || !resolveDefs.has(definition)) {\n names = [definition as string]\n } else if (pairs.has(definition)) {\n /**\n * Paired morph: name the old target in the old snapshot, then\n * force the same name(s) onto the new target in the new one, so\n * two different elements morph as a single layer.\n */\n if (phase === \"old\") {\n pairFrom.set(\n definition,\n resolveElements(definition as ElementOrSelector)\n )\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n pairNames.set(definition, names)\n } else {\n /**\n * Transfer the name(s) off the `from` elements before the\n * `to` elements inherit them. A `from` that survives into\n * the new snapshot (e.g. hidden with `visibility: hidden`\n * rather than removed) would otherwise keep the name and\n * collide - \"duplicate view-transition-name\".\n */\n for (const el of pairFrom.get(definition) ?? []) {\n ;(el as HTMLElement).style?.removeProperty(\n \"view-transition-name\"\n )\n /**\n * Drop the old end from the registry too, so the new\n * end alone supplies this name's `new` crop radii - we\n * neither re-measure nor get ordered by a stale element.\n */\n nameRegistry.delete(el)\n }\n names = assignViewTransitionNames(\n pairs.get(definition) as ElementOrSelector,\n nameRegistry,\n assigned,\n pairNames.get(definition),\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n } else {\n names = assignViewTransitionNames(\n definition as ElementOrSelector,\n nameRegistry,\n assigned,\n undefined,\n className,\n classed,\n group,\n grouped,\n clipChildren\n )\n }\n\n // Record any explicit `.crop(true | false)` per resolved name; the\n // crop set itself is computed later by `finalizeCrop` (it needs both\n // snapshots to know which morphs change aspect ratio).\n const override = cropOverride.get(definition)\n\n names.forEach((name, index) => {\n /**\n * If two subjects resolve to the same element, merge their\n * definitions so neither subject's animations are dropped.\n */\n const existing = layerTargets.get(name)\n layerTargets.set(\n name,\n existing && existing !== target\n ? { ...existing, ...target }\n : target\n )\n\n if (override !== undefined) cropForName.set(name, override)\n\n const stagger = layerStagger.get(name) ?? {}\n stagger[phase] = [index, names.length]\n layerStagger.set(name, stagger)\n })\n })\n }\n\n /**\n * The stagger index/total for a layer, resolved against the snapshot it\n * belongs to. Returns index -1 when the layer is absent from that snapshot\n * so the caller can skip a pseudo-element that doesn't exist.\n */\n const staggerPosition = (name: string, type: string) => {\n const stagger = layerStagger.get(name)\n const position =\n type === \"old\"\n ? stagger?.old\n : type === \"new\"\n ? stagger?.new\n : // group / group-children / image-pair persist across both.\n stagger?.new ?? stagger?.old\n return position ?? ([-1, 1] as const)\n }\n\n /**\n * Merge default + per-layer transition options for a generated layer and\n * resolve any stagger/delay function against this element's position. Used\n * by both the morph-retiming and crop corner-radius passes.\n */\n const resolveLayerTransition = (\n target: ViewTransitionTarget | undefined,\n type: string,\n transitionName: string,\n index: number,\n total: number\n ) => {\n const transition = mergeTransition(\n getValueTransition(defaultOptions, transitionName),\n getValueTransition(\n (layerOptions(target, type) ?? {}) as any,\n transitionName\n )\n )\n\n if (typeof transition.delay === \"function\") {\n transition.delay = transition.delay(index, total)\n }\n\n return transition\n }\n\n /**\n * Resolve a layer's group (`layout`) timing to plain WAAPI values: native\n * ms `delay`/`duration` and a baked `ease`. The single source of group\n * timing, shared by the generated-group retiming and the crop corner-radius\n * pass so the rounded clip animates on exactly the box's timing. It returns\n * no generator `type` (the WAAPI-only `NativeAnimation` rejects a string\n * type) nor `repeat`/`times` (which the group's `updateTiming` ignores), so\n * none of them can leak into the radius animation and desync it.\n */\n const resolveGroupTiming = (name: string) => {\n const [index, total] = staggerPosition(name, \"group\")\n const transition = resolveLayerTransition(\n layerTargets.get(name),\n \"group\",\n \"layout\",\n index === -1 ? 0 : index,\n total\n )\n transition.duration &&= secondsToMilliseconds(transition.duration)\n const { delay = 0, duration, ease } = applyGeneratorOptions(transition)\n return { delay: secondsToMilliseconds(delay), duration, ease }\n }\n\n /**\n * Each layer's measured box + corner radii per snapshot. The box lets\n * `finalizeCrop` tell whether a morph's aspect ratio changed (the only case\n * worth cropping); the radii let a cropped morph's group clip animate each\n * corner from the old element's radius to the new element's, keeping it\n * rounded where `overflow: clip` would otherwise square the corners.\n *\n * We never flatten the source for capture (a snapshot is a paint of the live\n * DOM, so squaring an element just for its capture would flash one real\n * square frame). For an aspect-changing morph `object-fit: cover` crops each\n * snapshot's own baked corners off-screen mid-morph, so the animated clip is\n * the only visible corner; a near-same-aspect forced crop (`.crop(true)`)\n * can't hide the outgoing snapshot's silhouette, but the endpoints coincide.\n */\n const cropMeasurements = new Map<\n string,\n {\n old?: { width: number; height: number; radii: CornerRadii }\n new?: { width: number; height: number; radii: CornerRadii }\n }\n >()\n\n const measureLayers = (phase: \"old\" | \"new\") =>\n nameRegistry.forEach((name, element) => {\n const el = element as HTMLElement\n const rect = el.getBoundingClientRect?.()\n if (rect && rect.height) {\n const style = getComputedStyle(el)\n const radii = {} as CornerRadii\n for (const corner of cornerRadiusProps) {\n radii[corner] = style[corner]\n }\n const entry = cropMeasurements.get(name) ?? {}\n entry[phase] = { width: rect.width, height: rect.height, radii }\n cropMeasurements.set(name, entry)\n }\n })\n\n /**\n * With both snapshots measured, settle which layers crop. The default crops\n * only a morph whose aspect ratio *changes* between snapshots - the one case\n * where `object-fit: cover` does real work. A same-aspect morph or a\n * fade-only layer is left uncropped: its corners scale naturally (no flash\n * from squaring, no `overflow: clip` eating its shadow) and a backdrop can't\n * be clipped to nothing. An explicit `.crop(true | false)` overrides either\n * way. Runs after both snapshots are measured, since aspect needs both.\n */\n const finalizeCrop = () => {\n croppedNames.clear()\n for (const name of layerStagger.keys()) {\n if (name === \"root\") continue\n // An explicit `.crop(true | false)` wins; otherwise crop a morph\n // whose aspect ratio changed.\n if (cropForName.get(name) ?? aspectChanged(name)) {\n croppedNames.add(name)\n }\n }\n }\n\n /**\n * Whether a layer is a morph whose box aspect ratio changed between\n * snapshots (beyond a small tolerance). Fade-only layers (one snapshot) are\n * never \"changed\".\n */\n const aspectChanged = (name: string) => {\n const box = cropMeasurements.get(name)\n if (!box?.old || !box?.new || !box.old.height || !box.new.height) {\n return false\n }\n return (\n Math.abs(\n box.old.width / box.old.height -\n box.new.width / box.new.height\n ) > ASPECT_TOLERANCE\n )\n }\n\n /**\n * Write the persistent view-transition CSS: suppress root capture when the\n * root has no animations of its own; force linear timing (baked into the\n * keyframes, so we can retime later via updateTiming); and clip +\n * object-fit: cover every cropped morph (the UA default overflows on\n * aspect-ratio change).\n *\n * `css.commit` replaces rather than appends, so we re-set the full rule set\n * each call - the crop rules are only known after `finalizeCrop` runs in the\n * update callback, so the second call writes them.\n */\n const commitViewCSS = () => {\n if (!hasTarget(\"root\", targets)) {\n css.set(\":root\", { \"view-transition-name\": \"none\" })\n }\n\n css.set(\n \"::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)\",\n { \"animation-timing-function\": \"linear !important\" }\n )\n\n croppedNames.forEach((name) => {\n css.set(`::view-transition-group(${name})`, { overflow: \"clip\" })\n css.set(\n `::view-transition-old(${name}), ::view-transition-new(${name})`,\n { width: \"100%\", height: \"100%\", \"object-fit\": \"cover\" }\n )\n })\n\n /**\n * Clip the nested children of any layer that clips in the live layout,\n * so a wrapper crops its child for the whole morph (mirroring the DOM)\n * rather than only at the live-DOM handoff. No-op on browsers without\n * nested view-transition groups.\n */\n clipChildren.forEach((name) => {\n css.set(`::view-transition-group-children(${name})`, {\n overflow: \"clip\",\n })\n })\n\n css.commit() // Write\n }\n\n const cleanup = () => {\n releaseViewTransitionNames(assigned, classed, grouped)\n css.remove() // Write\n }\n\n const callback = async () => {\n await update()\n\n /**\n * Re-resolve so elements created by the update are named for the new\n * snapshot, then measure them. With both snapshots measured we can\n * settle the crop set (aspect-changing morphs + forced).\n */\n resolveLayers(\"new\")\n measureLayers(\"new\")\n finalizeCrop()\n\n /**\n * Re-commit the crop CSS unconditionally: `finalizeCrop` is computed\n * here (after both snapshots are measured), so the clip rules must be\n * (re)written to match the settled set.\n */\n commitViewCSS()\n }\n\n let transition: ViewTransition\n try {\n resolveLayers(\"old\")\n /**\n * Measure the old snapshot against the optimistic crop set (the new\n * snapshot doesn't exist yet, so aspect change can't be known here;\n * `finalizeCrop` settles it post-update).\n */\n measureLayers(\"old\")\n commitViewCSS()\n transition = document.startViewTransition(callback)\n } catch (error) {\n /**\n * The prelude writes inline names before the transition exists. If it\n * throws (e.g. startViewTransition rejects in a bad UA state), release\n * them so we neither leak DOM state nor stall the queue on a promise\n * that never settles - hand back a rejection it can advance past.\n */\n cleanup()\n return Promise.reject(error)\n }\n\n transition.finished.finally(cleanup)\n\n return new Promise((resolve, reject) => {\n transition.ready\n .then(() => {\n const generatedViewAnimations = getViewAnimations()\n\n const animations: AnimationPlaybackControls[] = []\n\n /**\n * Create animations for each of our explicitly-defined subjects.\n * `opacityAnimated` additionally tracks which `${name}:${type}`\n * we faded, so we can keep the UA `plus-lighter` blend only for a\n * genuine opacity crossfade (both sides fading) and drop it for a\n * slide/transform, where additive compositing would flash bright.\n */\n const explicitlyAnimated = new Set()\n const opacityAnimated = new Set()\n layerTargets.forEach((target, name) => {\n const stagger = layerStagger.get(name)\n /**\n * Presence: `enter` only fires for a pure newcomer (a new\n * view with no old), `exit` only for a pure leaver. A\n * survivor (both) gets neither - it just morphs.\n */\n const enterApplies = !!stagger?.new && !stagger?.old\n const exitApplies = !!stagger?.old && !stagger?.new\n\n for (const key of definitionNames) {\n if (!target[key]) continue\n if (key === \"enter\" && !enterApplies) continue\n if (key === \"exit\" && !exitApplies) continue\n\n const type = chooseLayerType(\n key as keyof ViewTransitionTarget\n )\n const [index, total] = staggerPosition(name, type)\n // Skip a layer absent from its snapshot.\n if (index === -1) continue\n\n const { keyframes, options } =\n target[key as keyof ViewTransitionTarget]!\n\n for (let [valueName, valueKeyframes] of Object.entries(\n keyframes\n )) {\n // Skip only missing values - `0` (e.g. opacity: 0)\n // is valid and must reach the from-value inference.\n if (valueKeyframes == null) continue\n\n /**\n * The view path hands keyframes straight to WAAPI,\n * so Motion's `x`/`y` shorthands (compiled to\n * `transform` only via the value pipeline) have no\n * effect. Warn and skip - use `transform`/`translate`.\n */\n if (valueName === \"x\" || valueName === \"y\") {\n warnOnce(\n false,\n `animateView() animates view-transition layers with CSS properties; the \"${valueName}\" shorthand has no effect - use transform, e.g. { transform: \"translateX(40px)\" }.`\n )\n continue\n }\n\n /**\n * enter/exit win over new/old on a shared property -\n * skip it here when the gated bucket also defines it.\n */\n if (\n key === \"new\" &&\n enterApplies &&\n target.enter?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n if (\n key === \"old\" &&\n exitApplies &&\n target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ] != null\n ) {\n continue\n }\n\n const valueOptions = mergeTransition(\n getValueTransition(\n defaultOptions as any,\n valueName\n ),\n getValueTransition(options as any, valueName)\n )\n\n /**\n * Infer an origin for a single-value keyframe. An\n * `enter` mirrors the matching `exit` value (a\n * defined exit reverses into the enter for free);\n * otherwise the per-type default (opacity 0/1, scale\n * 0.85). No default -> left as-is (animates from the\n * live value).\n *\n * `new`/`old` fire for survivors too, where only the\n * opacity crossfade default applies - a transform\n * default like scale 0.85 would pop a persisting\n * element, so gate it on the layer actually\n * entering/leaving.\n */\n if (!Array.isArray(valueKeyframes)) {\n const exitValue =\n key === \"enter\"\n ? target.exit?.keyframes[\n valueName as keyof DOMKeyframesDefinition\n ]\n : undefined\n const allowDefault =\n valueName === \"opacity\" ||\n (type === \"new\" ? enterApplies : exitApplies)\n const from =\n exitValue != null\n ? Array.isArray(exitValue)\n ? exitValue[exitValue.length - 1]\n : exitValue\n : allowDefault\n ? ORIGIN_DEFAULTS[type]?.[valueName]\n : undefined\n if (from !== undefined) {\n valueKeyframes = [from, valueKeyframes]\n }\n }\n\n /**\n * Resolve stagger function if provided, per element\n * across this subject's resolved layers.\n */\n if (typeof valueOptions.delay === \"function\") {\n valueOptions.delay = valueOptions.delay(\n index,\n total\n )\n }\n\n valueOptions.duration &&= secondsToMilliseconds(\n valueOptions.duration\n )\n\n valueOptions.delay &&= secondsToMilliseconds(\n valueOptions.delay\n )\n\n animations.push(\n new NativeAnimation({\n ...valueOptions,\n element: document.documentElement,\n name: valueName,\n pseudoElement: `::view-transition-${type}(${name})`,\n keyframes: valueKeyframes,\n })\n )\n explicitlyAnimated.add(`${name}:${type}`)\n if (valueName === \"opacity\") {\n opacityAnimated.add(`${name}:${type}`)\n }\n }\n }\n })\n\n /**\n * Handle browser generated animations\n */\n for (const animation of generatedViewAnimations) {\n if (animation.playState === \"finished\") continue\n\n const { effect } = animation\n if (!effect || !(effect instanceof KeyframeEffect)) continue\n\n const { pseudoElement } = effect\n if (!pseudoElement) continue\n\n const name = getViewAnimationLayerInfo(pseudoElement)\n if (!name) continue\n\n const targetDefinition = layerTargets.get(name.layer)\n\n /**\n * We built our own animation for this layer, so drop the\n * browser-generated fade we're replacing. The UA\n * `plus-lighter` blend is a *separate* generated animation on\n * the same pseudo (it sets `mix-blend-mode` in its keyframes):\n * keep it *only* for a true opacity crossfade - both sides\n * fading - so a symmetric crossfade composites without\n * darkening, but a slide/transform (where both layers stay\n * opaque and overlap) doesn't flash bright from the addition.\n */\n if (explicitlyAnimated.has(`${name.layer}:${name.type}`)) {\n const isCrossfade =\n opacityAnimated.has(`${name.layer}:new`) &&\n opacityAnimated.has(`${name.layer}:old`)\n if (\n isCrossfade &&\n effect\n .getKeyframes()\n .some((keyframe) => keyframe.mixBlendMode)\n ) {\n animations.push(new NativeAnimationWrapper(animation))\n } else {\n animation.cancel()\n }\n continue\n }\n\n /**\n * Drop the orphaned half of the default crossfade. The UA\n * fades old out and new in as a *pair*; if the opposing half\n * was explicitly overridden with something other than an\n * opacity fade (a clip or transform reveal), this side's\n * default opacity fade has no partner - left to run it would\n * dissolve what should be a static backdrop (e.g.\n * `.new({ clipPath })` should reveal over a still old view,\n * not fade the old out around the growing clip). Cancel it -\n * and its `plus-lighter` sibling on the same pseudo, which\n * would otherwise flash bright where the two opaque layers\n * overlap. A genuine crossfade (the opposing side also fading\n * opacity) keeps both halves and is handled above.\n */\n const opposite =\n name.type === \"old\"\n ? \"new\"\n : name.type === \"new\"\n ? \"old\"\n : undefined\n if (\n opposite &&\n explicitlyAnimated.has(\n `${name.layer}:${opposite}`\n ) &&\n !opacityAnimated.has(`${name.layer}:${opposite}`)\n ) {\n animation.cancel()\n continue\n }\n\n /**\n * Otherwise retime the browser-generated animation to\n * Motion's timing. This auto-enables the layout (group)\n * morph for any resolved/named target, and applies the\n * default timing to old/new layers we haven't explicitly\n * overridden.\n *\n * group + group-children both follow the layout timing so\n * the nesting container stays in sync with the morph.\n */\n /**\n * A survivor's old + new are the two halves of one\n * `plus-lighter` crossfade. They must share identical timing\n * (so their opacities stay mirrored and sum to 1 - else the\n * additive blend flashes bright wherever both are partly\n * visible) and fade linearly (the bounce belongs on the\n * group's geometry, not the opacity). So time them as the\n * group, rather than via their own - potentially staggered,\n * or enter/exit-derived - old/new options.\n */\n const stagger = layerStagger.get(name.layer)\n const isMorphCrossfade =\n (name.type === \"old\" || name.type === \"new\") &&\n !!stagger?.old &&\n !!stagger?.new\n\n let timing: {\n delay: number\n duration?: number\n easing: string\n }\n if (name.type.startsWith(\"group\")) {\n // group + group-children follow the resolved group\n // timing - the single source shared with the crop\n // corner-radius pass below.\n const { delay, duration, ease } = resolveGroupTiming(\n name.layer\n )\n timing = {\n delay,\n duration,\n easing: mapEasingToNativeEasing(\n ease,\n duration!\n ) as string,\n }\n } else {\n const timingType = isMorphCrossfade ? \"group\" : name.type\n const [index, total] = staggerPosition(\n name.layer,\n timingType\n )\n const transitionName =\n timingType === \"group\" ? \"layout\" : \"\"\n let animationTransition = resolveLayerTransition(\n targetDefinition,\n timingType,\n transitionName,\n index === -1 ? 0 : index,\n total\n )\n\n /**\n * The crossfade should resolve at the spring's\n * *perceptual* (visual) duration - the geometry can keep\n * bouncing, but the opacity shouldn't drag through the\n * settle. So capture `visualDuration` before\n * `applyGeneratorOptions` replaces it with the full\n * overshoot duration, and use it for the fade.\n */\n const visualDuration = animationTransition.visualDuration\n\n animationTransition.duration &&= secondsToMilliseconds(\n animationTransition.duration\n )\n\n animationTransition =\n applyGeneratorOptions(animationTransition)\n\n timing = {\n delay: secondsToMilliseconds(\n animationTransition.delay ?? 0\n ),\n duration:\n isMorphCrossfade && visualDuration !== undefined\n ? secondsToMilliseconds(visualDuration)\n : animationTransition.duration,\n easing: isMorphCrossfade\n ? \"linear\"\n : (mapEasingToNativeEasing(\n animationTransition.ease,\n animationTransition.duration!\n ) as string),\n }\n }\n\n effect.updateTiming(timing)\n\n animations.push(new NativeAnimationWrapper(animation))\n }\n\n /**\n * Round each cropped layer's clip. Its `::view-transition-group`\n * has `overflow: clip`, which would otherwise square the corners\n * mid-morph; animate each corner from the old element's radius to\n * the new element's so the crop stays rounded. Timed as the group\n * (`layout`) so the radius tracks the morphing box.\n */\n cropMeasurements.forEach((entry, name) => {\n if (!croppedNames.has(name)) return\n\n // Reuse the group's resolved timing - native ms delay/\n // duration + a baked ease, with no generator `type` or\n // repeat/times to leak into (or throw inside) NativeAnimation.\n const { delay, duration, ease } = resolveGroupTiming(name)\n\n for (const corner of cornerRadiusProps) {\n // `||` (not `??`) so an empty measurement falls back to\n // the other snapshot rather than an invalid keyframe.\n const from =\n entry.old?.radii[corner] ||\n entry.new?.radii[corner] ||\n \"0px\"\n const to =\n entry.new?.radii[corner] ||\n entry.old?.radii[corner] ||\n \"0px\"\n // Nothing to round if the corner is square at both ends.\n if (isSquareRadius(from) && isSquareRadius(to)) continue\n\n animations.push(\n new NativeAnimation({\n element: document.documentElement,\n name: corner,\n pseudoElement: `::view-transition-group(${name})`,\n keyframes: [from, to],\n delay,\n duration,\n ease,\n })\n )\n }\n })\n\n resolve(new GroupAnimation(animations))\n })\n .catch(() =>\n /**\n * `ready` rejects when the transition is skipped - no visual\n * change, or superseded by an interrupting transition. The DOM\n * update still applied, so settle with no animations rather than\n * surfacing it as an error to an awaiting caller. A genuine\n * failure in `update()` rejects `updateCallbackDone` (already\n * settled by now), so propagate that instead.\n */\n transition.updateCallbackDone.then(\n () => resolve(new GroupAnimation([])),\n reject\n )\n )\n })\n}\n\n/**\n * The options that should time a given generated layer type, so a retimed\n * group/old/new picks up any per-target transition the user provided. Checks\n * the type's buckets in priority order (e.g. `new` before `enter`).\n */\nfunction layerOptions(target: ViewTransitionTarget | undefined, type: string) {\n for (const bucket of typeBuckets[type] ?? []) {\n const options = target?.[bucket]?.options\n if (options) return options\n }\n}\n\n/**\n * Merge a base transition (e.g. the default `options`) with a per-layer/value\n * override. An explicit `duration` on the override must win over an inherited\n * generator's own timing: a spring prefers `visualDuration`, and\n * `spring.applyToOptions` overwrites `duration` with the computed settle time -\n * so without this the override is silently discarded. Dropping the inherited\n * `type`/`visualDuration` makes the layer a plain tween of that duration, unless\n * it asked for its own generator `type`/`visualDuration`.\n */\nfunction mergeTransition(base: any, override: any) {\n const merged = { ...base, ...override }\n\n if (override.duration !== undefined) {\n if (override.visualDuration === undefined) delete merged.visualDuration\n if (override.type === undefined) delete merged.type\n }\n\n return merged\n}\n","import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder)\n .then((animation) => {\n builder.notifyReady(animation)\n return animation.finished\n })\n // A genuinely failed transition (a throwing update) rejects the\n // builder; a skipped/interrupted one resolves with no animations (see\n // start.ts). Either way, advance the queue - else later transitions hang.\n .catch((error) => builder.notifyReject(error))\n .finally(next)\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n","import { noop } from \"motion-utils\"\nimport type { GroupAnimation } from \"../animation/GroupAnimation\"\nimport { AnimationOptions, DOMKeyframesDefinition } from \"../animation/types\"\nimport { addToQueue } from \"./queue\"\nimport {\n ViewTransitionOptions,\n ViewTransitionTarget,\n ViewTransitionTargetDefinition,\n} from \"./types\"\nimport \"./types.global\"\n\n// Re-export the public view-transition types so they flow out through\n// motion-dom -> framer-motion -> motion alongside `animateView`.\nexport type * from \"./types\"\n\nexport class ViewTransitionBuilder {\n private currentSubject: ViewTransitionTargetDefinition = \"root\"\n\n targets = new Map()\n\n /**\n * Definitions that must be resolved to elements (and assigned a\n * `view-transition-name`) rather than treated as pre-named layers.\n */\n resolveDefs = new Set()\n\n /**\n * Per-subject crop override: `true` forces the crop (clip + object-fit:\n * cover + animated corner radii) on, `false` forces it off. A subject with\n * no entry uses the default - crop only a genuine morph (a layer present in\n * both snapshots), so a fade-only enter/exit isn't clipped to nothing.\n */\n cropOverride = new Map()\n\n /**\n * Subjects paired with a different new-snapshot target (the second `.add()`\n * argument), so two distinct elements share one name and morph into each\n * other - a shared-element transition.\n */\n pairs = new Map<\n ViewTransitionTargetDefinition,\n ViewTransitionTargetDefinition\n >()\n\n /**\n * A `view-transition-class` to apply to each subject's resolved elements,\n * so authors can target the generated layers from CSS by class rather than\n * the opaque generated name.\n */\n classNames = new Map()\n\n /**\n * Subjects opted out of automatic group nesting via `.group(false)`. Their\n * layer stays a flat top-level group (`view-transition-group: none`) instead\n * of nesting under its DOM-ancestor layer - so it animates independently and\n * escapes an ancestor's clip/transform (e.g. an element that lifts out of a\n * card and flies across, which nesting would clip to the card).\n */\n flatGroups = new Set()\n\n update: () => void | Promise\n\n options: ViewTransitionOptions\n\n notifyReady: (value: GroupAnimation) => void = noop\n\n notifyReject: (error: unknown) => void = noop\n\n private readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.notifyReject = reject\n })\n\n constructor(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n ) {\n this.update = update\n this.options = {\n interrupt: \"wait\",\n ...options,\n }\n // Avoid an unhandled rejection when a failed transition has no\n // `.then(_, reject)` handler attached (e.g. fire-and-forget).\n this.readyPromise.catch(noop)\n addToQueue(this)\n }\n\n /**\n * Target elements resolved from a selector or Element, each assigned a\n * `view-transition-name` automatically.\n *\n * Passing a second target pairs them: the first is resolved in the old\n * snapshot and the second in the new, sharing one name so two *different*\n * elements morph into each other (e.g. `.add(card, \".modal\")`). Symmetric -\n * pass them the other way round to morph back.\n */\n add(\n subject: ViewTransitionTargetDefinition,\n newSubject?: ViewTransitionTargetDefinition\n ) {\n this.currentSubject = subject\n this.resolveDefs.add(subject)\n if (newSubject !== undefined) this.pairs.set(subject, newSubject)\n // Register the subject so it participates (and gets an automatic\n // layout/morph animation) even without an explicit enter/exit/layout.\n if (!this.targets.has(subject)) this.targets.set(subject, {})\n\n return this\n }\n\n /**\n * Control this subject's crop (clip + `object-fit: cover` + animated\n * corners). By default a subject auto-crops only when it actually morphs -\n * present in both snapshots (a survivor, or an `.add(a, b)` pair). A\n * fade-only enter/exit has no second box to crop against, so it's left to\n * the browser default; in particular the `overflow: clip` a crop adds would\n * otherwise clip a mis-sized enter/exit layer to nothing.\n *\n * `.crop(false)` forces the crop off (e.g. a text morph, where\n * `object-fit: cover` clips glyphs as the box grows); `.crop(true)` forces\n * it on for a non-morph the default wouldn't otherwise crop.\n */\n crop(enabled = true) {\n this.cropOverride.set(this.currentSubject, enabled)\n\n return this\n }\n\n /**\n * By default a subject's layer nests under its nearest DOM-ancestor layer\n * (`view-transition-group: contain`), so the ancestor's clip/transform/opacity\n * apply to it through the transition - mirroring how the DOM actually paints,\n * and letting a wrapper crop its child for the whole morph rather than only\n * once the live DOM takes back over. (Needs a browser that supports nested\n * view-transition groups; elsewhere it degrades to the flat default.)\n *\n * Call `.group(false)` to opt out: the layer stays flat and top-level, so it\n * animates independently and escapes an ancestor's clip - e.g. an element\n * that should lift out of a card and fly across, which nesting would clip.\n */\n group(enabled = true) {\n enabled\n ? this.flatGroups.delete(this.currentSubject)\n : this.flatGroups.add(this.currentSubject)\n\n return this\n }\n\n /**\n * Tag this subject's generated layers with a `view-transition-class`, so\n * they can be targeted from CSS - `::view-transition-group(.name)`,\n * `::view-transition-old/new(.name)`, `::view-transition-image-pair(.name)`\n * - without the opaque generated `view-transition-name`. Because `.add()`\n * can match many elements, a shared class targets them all at once (and,\n * for a pair, both ends). The escape hatch for z-index / custom keyframes\n * on a morph layer.\n */\n class(name: string) {\n this.classNames.set(this.currentSubject, name)\n\n return this\n }\n\n /**\n * Set the transition for this subject's morph. The morph is enabled\n * automatically by `.add()`; this just customises its timing (duration,\n * easing, a `delay`/`stagger`, …). On the implicit `root` subject it also\n * opts the page into the transition (the root crossfade).\n */\n layout(options: AnimationOptions = {}) {\n this.updateTarget(\"layout\", {}, options)\n\n return this\n }\n\n enter(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"enter\", keyframes, options)\n\n return this\n }\n\n exit(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"exit\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the new view directly, whether the element is appearing or\n * persisting (unlike `.enter()`, which only fires for a pure newcomer).\n * Pair with `.old()` for a crossfade or slide-through.\n */\n new(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"new\", keyframes, options)\n\n return this\n }\n\n /**\n * Animate the old view directly, whether the element is leaving or\n * persisting (unlike `.exit()`, which only fires for a pure leaver).\n */\n old(keyframes: DOMKeyframesDefinition, options?: AnimationOptions) {\n this.updateTarget(\"old\", keyframes, options)\n\n return this\n }\n\n updateTarget(\n target: \"enter\" | \"exit\" | \"layout\" | \"new\" | \"old\",\n keyframes: DOMKeyframesDefinition,\n options: AnimationOptions = {}\n ) {\n const { currentSubject, targets } = this\n\n if (!targets.has(currentSubject)) {\n targets.set(currentSubject, {})\n }\n\n const targetData = targets.get(currentSubject)!\n\n targetData[target] = { keyframes, options }\n }\n\n then(resolve: () => void, reject?: () => void) {\n return this.readyPromise.then(resolve, reject)\n }\n}\n\nexport function animateView(\n update: () => void | Promise,\n options: ViewTransitionOptions = {}\n) {\n return new ViewTransitionBuilder(update, options)\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n","import type { VisualElement } from \"./VisualElement\"\n\nexport const visualElementStore = new WeakMap()\n","import type { LegacyAnimationControls } from \"../../node/types\"\n\nexport function isAnimationControls(v?: unknown): v is LegacyAnimationControls {\n return (\n v !== null &&\n typeof v === \"object\" &&\n typeof (v as LegacyAnimationControls).start === \"function\"\n )\n}\n","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n","import type { AnimationType } from \"../types\"\n\nexport const variantPriorityOrder: AnimationType[] = [\n \"animate\",\n \"whileInView\",\n \"whileFocus\",\n \"whileHover\",\n \"whileTap\",\n \"whileDrag\",\n \"exit\",\n]\n\nexport const variantProps = [\"initial\", ...variantPriorityOrder]\n","import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n if (isAnimationControls(props.animate)) return true\n\n for (let i = 0; i < variantProps.length; i++) {\n if (isVariantLabel(props[variantProps[i] as keyof typeof props])) {\n return true\n }\n }\n\n return false\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n","import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n","interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n","import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n","import {\n Box,\n isNumericalString,\n isZeroValueString,\n secondsToMilliseconds,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport { NativeAnimation } from \"../animation/NativeAnimation\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { acceleratedValues } from \"../animation/waapi/utils/accelerated-values\"\nimport { transformGroups } from \"../animation/waapi/transforms/groups\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { complex } from \"../value/types/complex\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { Feature } from \"./Feature\"\nimport { visualElementStore } from \"./store\"\nimport {\n FeatureDefinitions,\n MotionConfigContextProps,\n PresenceContextProps,\n ReducedMotionConfig,\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport {\n hasReducedMotionListener,\n initPrefersReducedMotion,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(\n definitions: Partial\n) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inheriting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * The value getValue starts a new motion value from when it isn't given\n * a default. Without it, values start unread and the keyframe resolver\n * reads their origin.\n */\n getDefaultValue?(key: string): AnyResolvedKeyframe | undefined\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inheriting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Decides whether animations should be skipped for this VisualElement.\n * Useful for E2E tests and visual regression testing.\n */\n shouldSkipAnimations: boolean = false\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * A reference to the skipAnimations config passed to the VisualElement's host React component.\n */\n private skipAnimationsConfig: boolean | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n * @internal\n */\n baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n * @internal\n */\n initialValues: ResolvedValues\n\n /**\n * Track whether this element has been mounted before, to detect\n * remounts after Suspense unmount/remount cycles.\n */\n private hasBeenMounted = false\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n skipAnimations,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.skipAnimationsConfig = skipAnimations\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n /**\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\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n /**\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: VisualElement | undefined | false = this\n do node = node.props.inherit !== false && node.parent\n while (node && !node.isVariantNode)\n\n if (node) {\n const { variantChildren } = node\n variantChildren!.add(this)\n this.removeFromVariantTree = () => variantChildren!.delete(this)\n }\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n /**\n * Set whether animations should be skipped based on the config.\n */\n this.shouldSkipAnimations = this.skipAnimationsConfig ?? false\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n\n this.hasBeenMounted = true\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n if (\n value.accelerate &&\n acceleratedValues.has(key) &&\n this.current instanceof HTMLElement\n ) {\n const { factory, keyframes, times, ease, duration } =\n value.accelerate\n\n const animation = new NativeAnimation({\n element: this.current,\n name: key,\n keyframes,\n times,\n ease,\n duration: secondsToMilliseconds(duration),\n })\n\n const cleanup = factory(animation)\n\n this.valueSubscriptions.set(key, () => {\n cleanup()\n animation.cancel()\n })\n return\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform) {\n if (this.projection) {\n this.projection.isTransformDirty = true\n }\n transformGroups.get(this.current!)?.check()\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (\n typeof window !== \"undefined\" &&\n (window as any).MotionCheckAppearSync\n ) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(\n this,\n key,\n value\n )\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) 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\n sortNodePosition(other: VisualElement) {\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 (\n !this.current ||\n !other.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(\n props: MotionNodeOptions,\n presenceContext: PresenceContextProps | null\n ) {\n const { transformTemplate, onUpdate } = this.props\n\n if (props.transformTemplate || transformTemplate) {\n this.scheduleRender()\n }\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 (\n (props.transformTemplate && !transformTemplate) ||\n (props.onUpdate && !onUpdate)\n ) {\n transformGroups.get(this.current!)?.demote()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n\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) this.latestValues[key] = latest\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(defaultValue ?? this.getDefaultValue?.(key), {\n owner: this,\n })\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (\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 ) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n on(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n","import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b precedes a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n","import type { VisualElement } from \"./VisualElement\"\n\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 */\nexport abstract class Feature {\n isMounted = false\n\n node: VisualElement\n\n constructor(node: VisualElement) {\n this.node = node\n }\n\n abstract mount(): void\n\n abstract unmount(): void\n\n update(): void {}\n}\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { HTMLRenderState } from \"../types\"\n\nexport function renderHTML(\n element: HTMLElement,\n { style, vars }: HTMLRenderState,\n styleProp?: MotionStyle,\n projection?: any\n) {\n const elementStyle = element.style\n\n let key: string\n for (key in style) {\n // CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.\n elementStyle[key as unknown as number] = style[key] as string\n }\n\n // Write projection styles directly to element style\n projection?.applyProjectionStyles(elementStyle, styleProp)\n\n for (key in vars) {\n // Loop over any CSS variables and assign those.\n // They can only be assigned using `setProperty`.\n elementStyle.setProperty(key, vars[key] as string)\n }\n}\n","import { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const scaleCorrectors: ScaleCorrectorMap = {}\n\nexport function addScaleCorrector(correctors: ScaleCorrectorMap) {\n for (const key in correctors) {\n scaleCorrectors[key] = correctors[key]\n if (isCSSVariableName(key)) {\n scaleCorrectors[key].isCSSVariable = true\n }\n }\n}\n","import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n","import { invariant, type Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n mount(instance: HTMLElement) {\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(\n Boolean(instance.style),\n \"motion.create() components must forward their ref to a HTML or SVG element\",\n \"custom-component-ref\"\n )\n\n super.mount(instance)\n }\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n","import { createBox } from \"../../projection/geometry/models\"\nimport { ResolvedValues } from \"../types\"\nimport { VisualElement } from \"../VisualElement\"\n\ninterface ObjectRenderState {\n output: ResolvedValues\n}\n\nfunction isObjectKey(key: string, object: Object): key is keyof Object {\n return key in object\n}\n\nexport class ObjectVisualElement extends VisualElement<\n Object,\n ObjectRenderState\n> {\n type = \"object\"\n\n readValueFromInstance(instance: Object, key: string) {\n if (isObjectKey(key, instance)) {\n const value = instance[key]\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value\n }\n }\n\n return undefined\n }\n\n getBaseTargetFromProps() {\n return undefined\n }\n\n removeValueFromRenderState(\n key: string,\n renderState: ObjectRenderState\n ): void {\n delete renderState.output[key]\n }\n\n measureInstanceViewportBox() {\n return createBox()\n }\n\n build(renderState: ObjectRenderState, latestValues: ResolvedValues) {\n Object.assign(renderState.output, latestValues)\n }\n\n renderInstance(instance: Object, { output }: ObjectRenderState) {\n Object.assign(instance, output)\n }\n\n sortInstanceNodePosition() {\n return 0\n }\n}\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n","export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n /**\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 (\n key !== \"children\" &&\n (isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps]))\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport { defaultTransformValue } from \"../dom/parse-transform\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs, cssStyleProperties } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue | undefined {\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 as keyof MotionNodeOptions]\n }\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: string) {\n return transformProps.has(key)\n ? this.latestValues[key] ?? defaultTransformValue(key)\n : undefined\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n\n if (cssStyleProperties.includes(key)) {\n const computedStyle = getComputedStyle(instance)\n const value = computedStyle[key as keyof typeof computedStyle]\n if (typeof value === \"string\" && value) return value.trim()\n }\n\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n","export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { getTypeCustom, resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\n\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 */\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate: AnimateFunction = (animations) =>\n Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n let state = createState()\n let isInitialRender = true\n\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\n function animateChanges(changedActiveType?: AnimationType) {\n const { props, parent, manuallyAnimateOnMount } = visualElement\n const isMounting = isInitialRender || wasReset\n const animations: DefinitionAndOptions[] = []\n\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 /**\n * Values claimed by active, higher-priority types.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\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 /**\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 source = source.props.inherit !== false && source.parent\n while (source && !source.isControllingVariants)\n\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 =\n ownProp !== undefined\n ? ownProp\n : isVariantLabel(inheritedProp) || inheritedProp === false\n ? inheritedProp\n : undefined\n const propIsVariant = isVariantLabel(prop)\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * Inherited labels are animated by the parent through\n * variantChildren, unless this element mounted after its parent.\n */\n const isInherited =\n propIsVariant &&\n ownProp === undefined &&\n !(isMounting && manuallyAnimateOnMount)\n\n typeState.protectedKeys = { ...encounteredKeys }\n\n if (\n (!typeState.isActive && activeDelta === null) ||\n (!prop && !typeState.prevProp) ||\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n return\n }\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\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n let shouldAnimateType =\n variantDidChange ||\n (propIsVariant &&\n ((activeDelta && !isInherited) || i > removedVariantIndex))\n let handledRemovedValues = false\n const definitionList = Array.isArray(prop) ? prop : [prop]\n let resolvedValues: { [key: string]: any } = {}\n\n if (activeDelta !== false) {\n for (const definition of definitionList) {\n const { transition, transitionEnd, ...target } =\n resolveVariant(\n visualElement,\n definition,\n getTypeCustom(visualElement, type)\n ) || {}\n resolvedValues = {\n ...resolvedValues,\n ...target,\n ...transitionEnd,\n }\n }\n }\n\n const { prevResolvedValues } = typeState\n\n for (const key in { ...prevResolvedValues, ...resolvedValues }) {\n if (key in encounteredKeys) continue\n\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n /**\n * Keyframes compare by value, but replay whenever the\n * variant label changed.\n */\n const valueHasChanged =\n Array.isArray(next) && Array.isArray(prev)\n ? !shallowCompare(next, prev) || variantDidChange\n : next !== prev\n\n if (\n valueHasChanged &&\n (next === undefined || next === null)\n ) {\n removedKeys.add(key)\n } else if (\n valueHasChanged ||\n (next !== undefined && removedKeys.has(key))\n ) {\n shouldAnimateType = true\n if (removedKeys.delete(key)) handledRemovedValues = true\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n } else {\n typeState.protectedKeys[key] = true\n }\n }\n\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (\n shouldAnimateType &&\n (!(isInherited && variantDidChange) || handledRemovedValues)\n ) {\n for (const animation of definitionList) {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * Elements that mount into an already-mounted parent\n * animate themselves, staggered by the parent variant's\n * delayChildren.\n */\n if (\n typeof animation === \"string\" &&\n isMounting &&\n manuallyAnimateOnMount &&\n parent?.enteringChildren\n ) {\n const delayChildren = resolveVariant(parent, animation)\n ?.transition?.delayChildren\n\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n\n animations.push({ animation, options })\n }\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: { [key: string]: any } = {}\n const resolvedInitial =\n typeof initial !== \"boolean\" &&\n resolveVariant(\n visualElement,\n Array.isArray(initial) ? initial[0] : initial,\n visualElement.presenceContext?.custom\n )\n\n if (resolvedInitial && resolvedInitial.transition) {\n fallbackAnimation.transition = resolvedInitial.transition\n }\n\n removedKeys.forEach((key) => {\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n const fromInitial =\n resolvedInitial && !Array.isArray(initial)\n ? (resolvedInitial as any)[key]\n : undefined\n const fromProps = visualElement.getBaseTargetFromProps(\n props,\n key\n )\n\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 /**\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 (\n process.env.NODE_ENV !== \"production\" &&\n fallbackAnimation[key] === null &&\n visualElement.initialValues[key] !== undefined\n ) {\n delete visualElement.initialValues[key]\n motionValue?.stop()\n visualElement.baseTarget[key] = motionValue?.get()\n }\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n const blockAnimation =\n (isMounting && visualElement.blockInitialAnimation) ||\n (isInitialRender &&\n !manuallyAnimateOnMount &&\n (props.initial === false || props.initial === props.animate))\n\n isInitialRender = wasReset = false\n\n return !blockAnimation && animations.length\n ? animate(animations)\n : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n if (state[type].isActive === isActive) return Promise.resolve()\n\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as AnimationType].protectedKeys = {}\n }\n\n return animations\n }\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}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createState() {\n const state = {} as { [K in AnimationType]: AnimationTypeState }\n\n for (const type of variantPriorityOrder) {\n state[type] = {\n isActive: type === \"animate\",\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n }\n\n return state\n}\n","import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n","import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n","import { Axis, AxisDelta, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(\n target: Axis,\n relative: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = anchorPoint + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(\n target: Box,\n relative: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxis(target.x, relative.x, parent.x, anchor?.x)\n calcRelativeAxis(target.y, relative.y, parent.y, anchor?.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis,\n anchor: number = 0\n) {\n const anchorPoint = anchor\n ? mixNumber(parent.min, parent.max, anchor)\n : parent.min\n target.min = layout.min - anchorPoint\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(\n target: Box,\n layout: Box,\n parent: Box,\n anchor?: Point\n) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x, anchor?.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y, anchor?.y)\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n","export function eachAxis(callback: (axis: \"x\" | \"y\") => T): T[] {\n return [callback(\"x\"), callback(\"y\")]\n}\n","import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n","import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n","import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const {\n transformPerspective,\n rotate,\n pathRotation,\n rotateX,\n rotateY,\n rotateZ,\n skewX,\n skewY,\n } = latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n // Additive `rotate()` so user `rotate` isn't clobbered.\n if (pathRotation) transform += `rotate(${pathRotation}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (rotateZ) transform += `rotateZ(${rotateZ}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n","import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\nimport { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { asNumber } from \"../../value/utils/as-number\"\n\nconst numBorders = cornerRadiusProps.length\n\nconst mixedTransforms = [\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skewX\",\n \"skewY\",\n]\nconst numMixedTransforms = mixedTransforms.length\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = cornerRadiusProps[i]\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation and skew. These can't be projected, so mix them every\n * frame rather than leaving them frozen at the animation-start snapshot.\n */\n for (let i = 0; i < numMixedTransforms; i++) {\n const key = mixedTransforms[i]\n if (follow[key] || lead[key]) {\n target[key] = mixNumber(\n (follow[key] as number) || 0,\n (lead[key] as number) || 0,\n progress\n )\n }\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n","import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue(\n value: MotionValue | V,\n keyframes: V | UnresolvedValueKeyframe[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation as AnimationPlaybackControlsWithThen\n}\n","export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler, options)\n}\n","import type { VisualElement } from \"../../render/VisualElement\"\n\nexport interface WithDepth {\n depth: number\n}\n\nexport const compareByDepth = (a: VisualElement, b: VisualElement) =>\n a.depth - b.depth\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n","import { cancelFrame, frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\nimport type { FrameData } from \"../frameloop/types\"\nimport { secondsToMilliseconds } from \"motion-utils\"\n\nexport type DelayedFunction = (overshoot: number) => void\n\n/**\n * Timeout defined in ms\n */\nexport function delay(callback: DelayedFunction, timeout: number) {\n const start = time.now()\n\n const checkElapsed = ({ timestamp }: FrameData) => {\n const elapsed = timestamp - start\n\n if (elapsed >= timeout) {\n cancelFrame(checkElapsed)\n callback(elapsed - timeout)\n }\n }\n\n frame.setup(checkElapsed, true)\n\n return () => cancelFrame(checkElapsed)\n}\n\nexport function delayInSeconds(callback: DelayedFunction, timeout: number) {\n return delay(callback, secondsToMilliseconds(timeout))\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isMotionValue } from \"./is-motion-value\"\nimport type { MotionValue } from \"../index\"\n\n/**\n * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself\n */\nexport function resolveMotionValue(\n value?: AnyResolvedKeyframe | MotionValue\n): AnyResolvedKeyframe {\n return isMotionValue(value) ? value.get() : value\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport type { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n\n for (let i = this.members.length - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member === node || member === this.lead || member === this.prevLead) continue\n const inst = member.instance as HTMLElement | undefined\n if ((!inst || inst.isConnected === false) && !member.snapshot) {\n removeItem(this.members, member)\n member.unmount()\n }\n }\n\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) this.prevLead = undefined\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) this.promote(prevLead)\n }\n }\n\n relegate(node: IProjectionNode) {\n for (let i = this.members.indexOf(node) - 1; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false && (member.instance as HTMLElement)?.isConnected !== false) {\n this.promote(member)\n return true\n }\n }\n return false\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n node.show()\n\n if (prevLead) {\n prevLead.updateSnapshot()\n node.scheduleRender()\n\n const { layoutDependency: prevDep } = prevLead.options\n const { layoutDependency: nextDep } = node.options\n\n if (prevDep === undefined || prevDep !== nextDep) {\n node.resumeFrom = prevLead\n if (preserveFollowOpacity) prevLead.preserveOpacity = true\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root?.isUpdating) node.isLayoutDirty = true\n }\n if (node.options.crossfade === false) prevLead.hide()\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((member) => {\n member.options.onExitComplete?.()\n member.resumingFrom?.options.onExitComplete?.()\n })\n }\n\n scheduleRender() {\n this.members.forEach(\n (member) => member.instance && member.scheduleRender(false)\n )\n }\n\n removeLeadSnapshot() {\n if (this.lead?.snapshot) this.lead.snapshot = undefined\n }\n}\n","import { cornerRadiusProps } from \"../../utils/border-radius\"\nimport { correctBorderRadius } from \"./scale-border-radius\"\nimport { correctBoxShadow } from \"./scale-box-shadow\"\nimport type { ScaleCorrectorMap } from \"./types\"\n\nexport const defaultScaleCorrectors: ScaleCorrectorMap = {\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [...cornerRadiusProps],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n}\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n","import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { notifyLayoutAnimationStart } from \"../../animation/utils/notify-inspector\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport {\n MotionPath,\n PathInterpolator,\n Transition,\n ValueAnimationOptions,\n} from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { transformGroups } from \"../../animation/waapi/transforms/groups\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { defaultScaleCorrectors } from \"../styles/default-scale-correctors\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\n/**\n * Correctors registered via addScaleCorrector before projection loaded\n * (e.g. with an async LazyMotion bundle) take precedence over the defaults.\n */\nObject.assign(scaleCorrectors, {\n ...defaultScaleCorrectors,\n ...scaleCorrectors,\n})\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nconst demoteTransforms = ({ instance }: IProjectionNode) =>\n instance && transformGroups.get(instance)?.demote()\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig) {\n return class ProjectionNode implements IProjectionNode {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * A measurement taken just before the current update of a dragged node\n * without a snapshot (one without `layout`).\n */\n dragSnapshot: Measurements | undefined\n\n /**\n * The nearest dragged ancestor, recorded in willUpdate.\n */\n dragAncestor: IProjectionNode | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to visually\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n /**\n * Whether the layout animation \"didUpdate\" handler has been registered.\n */\n hasLayoutListener?: boolean\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n this.addLayoutListener()\n }\n\n /**\n * Only register the layout animation handler if this node requires\n * layout animation. This is called on mount, and again whenever options\n * change, as `layout` or `layoutId` may be enabled after mount.\n */\n addLayoutListener() {\n const { layoutId, layout, visualElement, animate } = this.options\n\n if (\n !this.instance ||\n this.hasLayoutListener ||\n animate === false ||\n !visualElement ||\n !(layoutId || layout)\n )\n return\n\n this.hasLayoutListener = true\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isAnimationBlocked) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(layoutTransition, \"layout\"),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged,\n (animationOptions as { path?: MotionPath }).path\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n this.hasLayoutListener = false\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n /**\n * Accelerated transforms aren't reflected in latestValues or\n * removed by resetTransform, so move them back to the main\n * thread before this node, or its ancestors, are measured.\n */\n demoteTransforms(this)\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n demoteTransforms(node)\n\n /**\n * Percentage translates resolve against layoutBox dimensions,\n * so ancestors with them must be re-measured after transform reset.\n */\n if (\n typeof node.latestValues.x === \"string\" ||\n typeof node.latestValues.y === \"string\"\n ) {\n node.isLayoutDirty = true\n }\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n\n /**\n * Measure the nearest dragged ancestor before the DOM\n * changes, so this node can follow its layout change.\n */\n if (node.isAnimationBlocked) {\n node.dragSnapshot ||= node.measure()\n this.dragAncestor = node\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n const wasBlockedByResize = this.updateBlockedByResize\n\n this.unblockUpdate()\n this.updateBlockedByResize = false\n this.clearAllSnapshots()\n\n /**\n * When blocked by resize, still measure layouts so\n * callbacks like onLayoutMeasure fire (e.g. Reorder).\n * Skip notifyLayoutUpdate to prevent animations.\n */\n if (wasBlockedByResize) {\n this.nodes!.forEach(forceLayoutMeasure)\n }\n\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Ensure animation-blocked nodes (e.g. during drag)\n * get measured even when memoized (willUpdate skipped).\n */\n this.nodes!.forEach(ensureDraggedNodesSnapshotted)\n this.nodes!.forEach(syncRelativeLayout)\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n\n /**\n * A stack's last member can unmount while a replacement with the\n * same layoutId mounts in the same commit, so the stack (and its\n * lead) must outlive the unmount for the replacement to resume\n * from it. By now that handoff has happened, so stacks that are\n * still empty only retain unmounted nodes and can be released.\n */\n this.sharedNodes.forEach((stack, layoutId) =>\n stack.members.length\n ? stack.removeLeadSnapshot()\n : this.sharedNodes.delete(layoutId)\n )\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n if (!this.layoutCorrected) this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n isResetRequested && demoteTransforms(this)\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false, output?: Box): Box {\n const withTransforms = output || createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n translateAxis(withTransforms.x, -node.scroll.offset.x)\n translateAxis(withTransforms.y, -node.scroll.offset.y)\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(\n withTransforms,\n node.latestValues,\n node.layout?.layoutBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(\n withTransforms,\n this.latestValues,\n this.layout?.layoutBox\n )\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!hasTransform(node.latestValues)) continue\n\n let sourceBox: Box | undefined\n\n if (node.instance) {\n hasScale(node.latestValues) && node.updateSnapshot()\n sourceBox = createBox()\n copyBoxInto(sourceBox, node.measurePageBox())\n }\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot?.layoutBox,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n this.addLayoutListener()\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n relativeParent.layout\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target,\n this.options.layoutAnchor || undefined\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n this.applyTransform(\n this.layout.layoutBox,\n false,\n this.target\n )\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n this.options.layoutAnchor !== false &&\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout,\n this.options.layoutAnchor || undefined\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false,\n pathFn?: MotionPath\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n // The path decides whether the layout shift is worth curving\n // (distance floor) and resolves the interpolator from the delta.\n const interpolate: PathInterpolator | undefined =\n pathFn?.interpolateProjection(delta)\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n const point = interpolate?.(progress)\n\n if (point) {\n targetDelta.x.translate = point.x\n targetDelta.x.scale = mixNumber(delta.x.scale, 1, progress)\n targetDelta.x.origin = delta.x.origin\n targetDelta.x.originPoint = delta.x.originPoint\n targetDelta.y.translate = point.y\n targetDelta.y.scale = mixNumber(delta.y.scale, 1, progress)\n targetDelta.y.origin = delta.y.origin\n targetDelta.y.originPoint = delta.y.originPoint\n } else {\n mixAxisDeltaLinear(targetDelta.x, delta.x, progress)\n mixAxisDeltaLinear(targetDelta.y, delta.y, progress)\n }\n\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox,\n this.options.layoutAnchor || undefined\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n if (point && point.rotate !== undefined) {\n // Dedicated `pathRotation` channel, not `rotate`, so an\n // animating `rotate` is composed with, never clobbered.\n if (!this.animationValues)\n this.animationValues = mixedValues\n this.animationValues.pathRotation = point.rotate\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue\n startAnimation(options: ValueAnimationOptions) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n this.motionValue ||= motionValue(0)\n this.motionValue.jump(0, false)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onComplete: () => {\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation\n\n notifyLayoutAnimationStart(this.currentAnimation, this)\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n const { targetWithTransforms, layout, latestValues } = lead\n let { target } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom =\n this.snapshot =\n this.dragSnapshot =\n this.dragAncestor =\n undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\n/**\n * Nodes are depth-ordered, so a dragged ancestor's layout is updated before\n * its descendants'.\n */\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n followDraggedAncestor(node)\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (animationType === \"x\" || animationType === \"y\") {\n const snapAxis = animationType === \"x\" ? \"y\" : \"x\"\n copyAxisInto(\n isShared\n ? snapshot.measuredBox[snapAxis]\n : snapshot.layoutBox[snapAxis],\n layout[snapAxis]\n )\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const anchor =\n node.options.layoutAnchor || undefined\n\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox,\n anchor\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox,\n anchor\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction forceLayoutMeasure(node: IProjectionNode) {\n node.isLayoutDirty = true\n node.updateLayout()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\n/**\n * A dragged node doesn't layout animate, so it jumps to its new layout. Shift\n * its descendants' snapshots by the same amount, so they only animate layout\n * changes relative to it, rather than lagging behind.\n */\nfunction followDraggedAncestor(node: IProjectionNode) {\n const { snapshot, dragAncestor } = node\n const to = dragAncestor?.layout\n if (!snapshot || !to || node.resumeFrom || node.isAnimationBlocked) return\n\n const from = dragAncestor!.dragSnapshot!\n eachAxis((axis) =>\n translateAxis(\n snapshot.layoutBox[axis],\n to.layoutBox[axis].min - from.layoutBox[axis].min\n )\n )\n}\n\n/**\n * When a node is animation-blocked (e.g. during drag) and its component\n * didn't re-render (memoized), willUpdate() is never called so there's\n * no snapshot. Use the previous layout as a snapshot and mark dirty so\n * resetTransform/updateLayout/notifyLayoutUpdate process it normally.\n */\nfunction ensureDraggedNodesSnapshotted(node: IProjectionNode) {\n if (node.isAnimationBlocked && node.layout && !node.isLayoutDirty) {\n node.snapshot = node.dragSnapshot || node.layout\n node.isLayoutDirty = true\n }\n}\n\n/**\n * If a node's relative parent is about to be re-measured but the node isn't\n * (e.g. it's in another LayoutGroup), its relative target is out of date.\n * If it's layout animating, re-measure it too, so its relative target keeps\n * resolving against current layouts. Otherwise its layout is still valid\n * relative to its parent, so drop the relative target, and any targetDelta\n * left over from a finished animation while an ancestor still animates, to be\n * rebuilt from its layout.\n */\nfunction syncRelativeLayout(node: IProjectionNode) {\n if (node.relativeTarget && node.relativeParent?.isLayoutDirty) {\n if (node.currentAnimation) {\n node.isLayoutDirty = true\n } else {\n node.targetDelta = undefined\n node.removeRelativeTarget()\n }\n }\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction mixAxisDeltaLinear(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n","import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n","import { IProjectionNode } from \"./types\"\n\nconst notify = (node: IProjectionNode) =>\n !node.isLayoutDirty && node.willUpdate(false)\n\nexport interface NodeGroup {\n add: (node: IProjectionNode) => void\n remove: (node: IProjectionNode) => void\n dirty: VoidFunction\n}\n\nexport function nodeGroup(): NodeGroup {\n const nodes = new Set()\n const subscriptions = new WeakMap void>()\n\n const dirtyAll = () => nodes.forEach(notify)\n\n return {\n add: (node) => {\n nodes.add(node)\n subscriptions.set(\n node,\n node.addEventListener(\"willUpdate\", dirtyAll)\n )\n },\n remove: (node) => {\n nodes.delete(node)\n const unsubscribe = subscriptions.get(node)\n if (unsubscribe) {\n unsubscribe()\n subscriptions.delete(node)\n }\n dirtyAll()\n },\n dirty: dirtyAll,\n }\n}\n","import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n","import { clamp } from \"motion-utils\"\nimport { handOffElementState } from \"../animation/animate/element\"\nimport { GroupAnimation } from \"../animation/GroupAnimation\"\nimport type { AnimationOptions, Transition } from \"../animation/types\"\nimport { frameData, frameSteps } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport type { IProjectionNode } from \"../projection/node/types\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { visualElementStore } from \"../render/store\"\nimport { hasTransform } from \"../projection/utils/has-transform\"\nimport {\n resolveElements,\n type ElementOrSelector,\n} from \"../utils/resolve-elements\"\n\ntype LayoutAnimationScope = Element | Document\ntype LayoutBuilderResolve = (animation: GroupAnimation) => void\ntype LayoutBuilderReject = (error: unknown) => void\n\ninterface RestorePoint {\n parent: Element\n next: ChildNode | null\n}\n\nconst layoutSelector = \"[data-layout],[data-layout-id]\"\n\n/**\n * All imperatively-created projection nodes live in one persistent tree,\n * shared across animateLayout() calls (and with any React-created nodes,\n * via the singleton document root). Keyed by element for reuse.\n */\nconst layoutNodes = new WeakMap()\n\n/**\n * Builders created within the same synchronous tick are flushed together\n * as a single \"commit\": every node is snapshotted before any updateDom\n * runs, mirroring React batching renders from different parts of the tree.\n */\nlet pendingBuilders: LayoutAnimationBuilder[] | undefined\n\nfunction collectLayoutElements(scope: LayoutAnimationScope): HTMLElement[] {\n const elements: HTMLElement[] = []\n\n if (scope instanceof HTMLElement && scope.matches(layoutSelector)) {\n elements.push(scope)\n }\n\n scope.querySelectorAll(layoutSelector).forEach((element) => {\n if (element instanceof HTMLElement) elements.push(element)\n })\n\n return elements\n}\n\n/**\n * Process any work scheduled on the frameloop now. A previous animation\n * may have been seeked while paused (controls.time = x) without a frame\n * having rendered it - we must materialise that state into the DOM\n * before taking snapshots.\n */\nfunction flushPendingFrame() {\n if (frameData.isProcessing) return\n\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n}\n\nfunction getProjectionParent(element: Element): IProjectionNode | undefined {\n let ancestor = element.parentElement\n while (ancestor) {\n const node = layoutNodes.get(ancestor)\n if (node && node.instance) return node\n ancestor = ancestor.parentElement\n }\n return undefined\n}\n\nfunction createVisualElement() {\n return new HTMLVisualElement(\n {\n props: {},\n presenceContext: null,\n visualState: {\n latestValues: {},\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n },\n },\n },\n { allowProjection: true }\n )\n}\n\nfunction readNodeOptions(element: HTMLElement, transition?: Transition) {\n const layoutAttr = element.getAttribute(\"data-layout\")\n const layoutId = element.getAttribute(\"data-layout-id\") ?? undefined\n\n return {\n layoutId,\n layout: layoutAttr !== null ? true : undefined,\n animationType: (!layoutAttr || layoutAttr === \"true\"\n ? \"both\"\n : layoutAttr) as \"both\",\n transition,\n }\n}\n\nfunction prepareNode(\n element: HTMLElement,\n transition?: Transition\n): IProjectionNode {\n let node = layoutNodes.get(element)\n\n if (!node) {\n let visualElement = visualElementStore.get(element) as\n | HTMLVisualElement\n | undefined\n\n if (!visualElement) {\n visualElement = createVisualElement()\n\n /**\n * Values animate() has been rendering on this element move to\n * the VisualElement, so the layout animation composes with\n * them instead of overwriting them.\n */\n handOffElementState(element, visualElement)\n }\n\n /**\n * A first-time element may carry a projection transform in its\n * inline style (e.g. it was cloned from an element mid-animation).\n * That transform isn't tracked in latestValues so the engine can't\n * reset it before measuring - clear it now so the first layout\n * measurement isn't inflated.\n */\n if (\n element.style.transform &&\n !hasTransform(visualElement.latestValues)\n ) {\n element.style.transform = \"\"\n }\n\n node = new HTMLProjectionNode(\n visualElement.latestValues,\n getProjectionParent(element)\n )\n visualElement.projection = node\n\n node.setOptions({\n ...readNodeOptions(element, transition),\n visualElement,\n })\n node.mount(element)\n layoutNodes.set(element, node)\n } else {\n node.setOptions(readNodeOptions(element, transition))\n }\n\n node.isPresent = true\n if (node.options.onExitComplete) {\n node.setOptions({ onExitComplete: undefined })\n }\n\n return node\n}\n\nfunction sortDocumentOrder(elements: Iterable) {\n return [...elements].sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n )\n}\n\nfunction dropNode(element: Element, node: IProjectionNode) {\n node.setOptions({ onExitComplete: undefined })\n\n /**\n * Stop any lingering animation so it can't leak into future updates.\n * A follow node can share its currentAnimation with a surviving lead\n * (via resumingFrom), in which case it isn't ours to stop.\n */\n const stack = node.getStack()\n if (!stack || node.isLead()) node.currentAnimation?.stop()\n\n node.unmount()\n layoutNodes.delete(element)\n}\n\nfunction flushPendingBuilders() {\n const builders = pendingBuilders!\n pendingBuilders = undefined\n\n flushPendingFrame()\n\n /**\n * Discover and mount every node across all builders before snapshotting\n * any of them. Mounting during an active update flags isLayoutDirty,\n * which would make that node's own willUpdate skip its snapshot.\n * Document order guarantees ancestors mount before descendants, even\n * when they're discovered by different builders.\n */\n const targets = new Map()\n for (const builder of builders) {\n for (const element of builder.collectTargets()) {\n const owners = targets.get(element)\n owners ? owners.push(builder) : targets.set(element, [builder])\n }\n }\n\n const union = new Map()\n for (const element of sortDocumentOrder(targets.keys())) {\n const owners = targets.get(element)!\n const node = prepareNode(\n element,\n owners[owners.length - 1].transitionFor(element)\n )\n for (const owner of owners) owner.adopt(element, node)\n union.set(element, node)\n }\n\n union.forEach((node) => {\n node.isLayoutDirty = false\n node.willUpdate()\n })\n\n const updatePromises: Promise[] = []\n for (const builder of builders) {\n const result = builder.runUpdate()\n if (result) updatePromises.push(result)\n }\n\n const commit = () => {\n /**\n * Process all additions before any removals so that, even across\n * builders, a removed member knows whether a replacement with the\n * same layoutId was added in this commit.\n */\n const newMemberIds = new Set()\n for (const builder of builders) {\n builder.reconcileAdditions(newMemberIds)\n }\n for (const builder of builders) {\n builder.reconcileRemovals(newMemberIds)\n }\n\n let root: IProjectionNode | undefined\n union.forEach((node) => (root ||= node.root))\n for (const builder of builders) root ||= builder.getRoot()\n\n root?.didUpdate()\n\n /**\n * The root flushes the update on a microtask, synchronously\n * processing the frame that creates the layout animations. Collect\n * them in a later microtask step of the same pass.\n */\n microtask.render(() => {\n for (const builder of builders) builder.finalize()\n })\n }\n\n updatePromises.length ? Promise.all(updatePromises).then(commit) : commit()\n}\n\nexport class LayoutAnimationBuilder {\n private sharedTransitions = new Map()\n\n private notifyReady: LayoutBuilderResolve = () => {}\n private rejectReady: LayoutBuilderReject = () => {}\n private readyPromise: Promise\n\n private tracked = new Map()\n private restorePoints = new Map()\n private updateError: unknown\n\n constructor(\n private scope: LayoutAnimationScope,\n private updateDom: () => void | Promise,\n private defaultOptions?: AnimationOptions\n ) {\n this.readyPromise = new Promise((resolve, reject) => {\n this.notifyReady = resolve\n this.rejectReady = reject\n })\n\n if (!pendingBuilders) {\n pendingBuilders = []\n queueMicrotask(flushPendingBuilders)\n }\n pendingBuilders.push(this)\n }\n\n shared(id: string, transition: AnimationOptions): this {\n this.sharedTransitions.set(id, transition)\n return this\n }\n\n then(resolve: LayoutBuilderResolve, reject?: LayoutBuilderReject) {\n return this.readyPromise.then(resolve, reject)\n }\n\n transitionFor(element: HTMLElement): Transition | undefined {\n const layoutId = element.getAttribute(\"data-layout-id\")\n return ((layoutId && this.sharedTransitions.get(layoutId)) ||\n this.defaultOptions) as Transition | undefined\n }\n\n adopt(element: HTMLElement, node: IProjectionNode) {\n this.tracked.set(element, node)\n this.restorePoints.set(element, {\n parent: element.parentElement!,\n next: element.nextSibling,\n })\n }\n\n collectTargets() {\n return collectLayoutElements(this.scope)\n }\n\n runUpdate(): Promise | undefined {\n try {\n const result = this.updateDom()\n if (result && typeof result.then === \"function\") {\n return result.then(undefined, (error: unknown) => {\n this.updateError = error\n })\n }\n } catch (error) {\n this.updateError = error\n }\n return undefined\n }\n\n reconcileAdditions(newMemberIds: Set) {\n for (const element of collectLayoutElements(this.scope)) {\n if (this.tracked.has(element)) continue\n const node = prepareNode(element, this.transitionFor(element))\n this.adopt(element, node)\n node.options.layoutId && newMemberIds.add(node.options.layoutId)\n }\n }\n\n reconcileRemovals(newMemberIds: Set) {\n this.tracked.forEach((node, element) => {\n if (element.isConnected) return\n\n const restore = this.restorePoints.get(element)\n this.restorePoints.delete(element)\n\n const { layoutId } = node.options\n const stack = node.getStack()\n const hasSurvivor =\n stack &&\n stack.members.some(\n (member) =>\n member !== node &&\n (member.instance as HTMLElement | undefined)\n ?.isConnected\n )\n\n /**\n * A removed lead with a surviving stack member - and no\n * replacement member added this commit - runs an exit\n * crossfade: restore the element to its old position in the\n * DOM, relegate it and let the survivor take over. It's\n * removed again once the animation completes.\n */\n if (\n layoutId &&\n node.isLead() &&\n hasSurvivor &&\n !newMemberIds.has(layoutId)\n ) {\n if (restore && restore.parent.isConnected) {\n restore.parent.insertBefore(\n element,\n restore.next && restore.next.parentNode === restore.parent\n ? restore.next\n : null\n )\n node.isPresent = false\n node.setOptions({\n onExitComplete: () => {\n element.remove()\n dropNode(element, node)\n },\n })\n if (node.relegate()) return\n\n element.remove()\n }\n }\n\n dropNode(element, node)\n this.tracked.delete(element)\n })\n }\n\n getRoot(): IProjectionNode | undefined {\n let root: IProjectionNode | undefined\n this.tracked.forEach((node) => (root ||= node.root))\n return root\n }\n\n finalize() {\n if (this.updateError) {\n this.rejectReady(this.updateError)\n return\n }\n\n const animations = new Set()\n this.tracked.forEach((node) => {\n if (node.instance && node.currentAnimation) {\n animations.add(node.currentAnimation)\n }\n })\n\n this.notifyReady(new GroupAnimation([...animations]))\n }\n}\n\nexport function parseAnimateLayoutArgs(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): {\n scope: Element | Document\n updateDom: () => void\n defaultOptions?: AnimationOptions\n} {\n if (typeof scopeOrUpdateDom === \"function\") {\n return {\n scope: document,\n updateDom: scopeOrUpdateDom,\n defaultOptions: updateDomOrOptions as AnimationOptions | undefined,\n }\n }\n\n const scope =\n scopeOrUpdateDom instanceof Document\n ? scopeOrUpdateDom\n : resolveElements(scopeOrUpdateDom)[0] ?? document\n\n return {\n scope,\n updateDom: updateDomOrOptions as () => void,\n defaultOptions: options,\n }\n}\n","import type { AnimationOptions } from \"../animation/types\"\nimport type { ElementOrSelector } from \"../utils/resolve-elements\"\nimport {\n LayoutAnimationBuilder,\n parseAnimateLayoutArgs,\n} from \"./LayoutAnimationBuilder\"\n\n/**\n * Animate layout changes made within `updateDom` on elements tagged\n * with `data-layout` or `data-layout-id`.\n *\n * ```\n * animateLayout(() => {\n * element.style.justifyContent = \"flex-end\"\n * })\n * ```\n */\nexport function animateLayout(\n scopeOrUpdateDom: ElementOrSelector | (() => void),\n updateDomOrOptions?: (() => void) | AnimationOptions,\n options?: AnimationOptions\n): LayoutAnimationBuilder {\n const { scope, updateDom, defaultOptions } = parseAnimateLayoutArgs(\n scopeOrUpdateDom,\n updateDomOrOptions,\n options\n )\n return new LayoutAnimationBuilder(scope, updateDom, defaultOptions)\n}\n","import { cancelFrame, frame } from \".\"\nimport { stepsOrder } from \"./order\"\nimport { Process } from \"./types\"\n\n/**\n * @deprecated\n *\n * Import as `frame` instead.\n */\nexport const sync = frame\n\n/**\n * @deprecated\n *\n * Use cancelFrame(callback) instead.\n */\nexport const cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = (process: Process) => cancelFrame(process)\n return acc\n}, {} as Record void>)\n"],"names":["MotionGlobalConfig","clamp","alpha","alphaType","getAnimatableNone","mixNumber","warning","mixNumberImmediate","pipe","noop","millisecondsToSeconds","secondsToMilliseconds","spring","createSpring","invariant","progress","easeInOut","isEasingArray","easingDefinitionToFunction","velocityPerSecond","keyframesGenerator","keyframes","isNumericalString","isZeroValueString","memo","isBezierDefinition","anticipate","backInOut","circInOut","buildTransform","KeyframeResolver","DefaultKeyframeResolver","warnOnce","SubscriptionManager","wrap","isBrowser","removeItem","isObject","getComputedStyle","checkIsControllingVariants","checkIsVariantNode","scrapeMotionValuesFromProps","scrapeHTMLMotionValuesFromProps","circOut","calcProgress","motionValue","createMotionValue","addUniqueItem"],"mappings":";;;;;;AAEA;;;AAGG;AACI,MAAM,SAAS,GAAc;AAChC,IAAA,KAAK,EAAE,GAAG;AACV,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,YAAY,EAAE,KAAK;;;ACNvB,IAAI,GAAuB;AAE3B,SAAS,SAAS,GAAA;IACd,GAAG,GAAG,SAAS;AACnB;AAEA;;;;;;;AAOG;AACI,MAAM,IAAI,GAAG;IAChB,GAAG,EAAE,MAAa;AACd,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,IAAI,CAAC,GAAG,CACJ,SAAS,CAAC,YAAY,IAAIA,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