🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

framer-motion

Package Overview
Dependencies
Maintainers
65
Versions
1387
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

framer-motion - npm Package Compare versions

Comparing version
12.35.2
to
12.36.0
dist/cjs/feature-bundle-BakEQtGR.js

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

+1
-1

@@ -5,3 +5,3 @@ 'use strict';

var featureBundle = require('./feature-bundle-DqHxNjy5.js');
var featureBundle = require('./feature-bundle-BakEQtGR.js');
require('motion-dom');

@@ -8,0 +8,0 @@ require('react');

@@ -207,4 +207,8 @@ 'use strict';

* in favour of explicit injection.
*
* String concatenation prevents bundlers like webpack (e.g. Storybook)
* from statically resolving this optional dependency at build time.
*/
loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
const emotionPkg = "@emotion/is-prop-" + "valid";
loadExternalIsValidProp(require(emotionPkg).default);
}

@@ -226,2 +230,4 @@ catch {

continue;
if (motionDom.isMotionValue(props[key]))
continue;
if (shouldForward(key) ||

@@ -228,0 +234,0 @@ (forwardMotionProps === true && isValidMotionProp(key)) ||

@@ -150,4 +150,4 @@ "use client";

}
exitingComponents.current.add(key);
if (exitComplete.has(key)) {
exitingComponents.current.add(key);
exitComplete.set(key, true);

@@ -154,0 +154,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"index.mjs","sources":["../../../../src/components/AnimatePresence/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren<AnimatePresenceProps>) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map<ComponentKey, boolean>())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set<ComponentKey>())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n exitingComponents.current.add(key)\n\n if (exitComplete.has(key)) {\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n <PresenceChild\n key={key}\n isPresent={isPresent}\n initial={\n !isInitialRender.current || initial\n ? undefined\n : false\n }\n custom={custom}\n presenceAffectsLayout={presenceAffectsLayout}\n mode={mode}\n root={root}\n onExitComplete={isPresent ? undefined : onExit}\n anchorX={anchorX}\n anchorY={anchorY}\n >\n {child}\n </PresenceChild>\n )\n })}\n </>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACI;;AAcH;;;AAGG;AACH;AAEA;;;AAGG;AACH;AAGA;;AAEG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;AAGG;;;;AAKC;AACA;AAEA;;AAEG;AACH;;;;AAKY;;;;AAGJ;AACA;;;AAGZ;;AAIA;AACI;AAEA;;;AAGG;AACH;AACI;AACA;;;AAII;;;AAIR;;;AAGG;;;;AAKH;;AAGA;;;AAGG;AACH;;AAGJ;AAEI;AACA;AAEA;;AAKJ;;;;AAIG;;;AAMS;AAEA;AAEQ;;AAEE;;;;;AAMN;AAEA;AACI;;;;;;AAMJ;AACI;;AACJ;;;AAII;AAEA;;;AAIR;AAEA;AAMgB;;;AAiBhC;;"}
{"version":3,"file":"index.mjs","sources":["../../../../src/components/AnimatePresence/index.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useContext, useMemo, useRef, useState } from \"react\"\nimport { LayoutGroupContext } from \"../../context/LayoutGroupContext\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { PresenceChild } from \"./PresenceChild\"\nimport { AnimatePresenceProps } from \"./types\"\nimport { usePresence } from \"./use-presence\"\nimport { ComponentKey, getChildKey, onlyElements } from \"./utils\"\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nexport const AnimatePresence = ({\n children,\n custom,\n initial = true,\n onExitComplete,\n presenceAffectsLayout = true,\n mode = \"sync\",\n propagate = false,\n anchorX = \"left\",\n anchorY = \"top\",\n root\n}: React.PropsWithChildren<AnimatePresenceProps>) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate)\n\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children])\n\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys =\n propagate && !isParentPresent ? [] : presentChildren.map(getChildKey)\n\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true)\n\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren)\n\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map<ComponentKey, boolean>())\n\n /**\n * Track which components are currently processing exit to prevent duplicate processing.\n */\n const exitingComponents = useRef(new Set<ComponentKey>())\n\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren)\n const [renderedChildren, setRenderedChildren] = useState(presentChildren)\n\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false\n pendingPresentChildren.current = presentChildren\n\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i])\n\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false)\n }\n } else {\n exitComplete.delete(key)\n exitingComponents.current.delete(key)\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")])\n\n const exitingChildren: any[] = []\n\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren]\n\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i]\n const key = getChildKey(child)\n\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child)\n exitingChildren.push(child)\n }\n }\n\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren\n }\n\n setRenderedChildren(onlyElements(nextChildren))\n setDiffedChildren(presentChildren)\n\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return null\n }\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1\n ) {\n console.warn(\n `You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`\n )\n }\n\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext)\n\n return (\n <>\n {renderedChildren.map((child) => {\n const key = getChildKey(child)\n\n const isPresent =\n propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key)\n\n const onExit = () => {\n if (exitingComponents.current.has(key)) {\n return\n }\n\n if (exitComplete.has(key)) {\n exitingComponents.current.add(key)\n exitComplete.set(key, true)\n } else {\n return\n }\n\n let isEveryExitComplete = true\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete) isEveryExitComplete = false\n })\n\n if (isEveryExitComplete) {\n forceRender?.()\n setRenderedChildren(pendingPresentChildren.current)\n\n propagate && safeToRemove?.()\n\n onExitComplete && onExitComplete()\n }\n }\n\n return (\n <PresenceChild\n key={key}\n isPresent={isPresent}\n initial={\n !isInitialRender.current || initial\n ? undefined\n : false\n }\n custom={custom}\n presenceAffectsLayout={presenceAffectsLayout}\n mode={mode}\n root={root}\n onExitComplete={isPresent ? undefined : onExit}\n anchorX={anchorX}\n anchorY={anchorY}\n >\n {child}\n </PresenceChild>\n )\n })}\n </>\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCG;AACI;;AAcH;;;AAGG;AACH;AAEA;;;AAGG;AACH;AAGA;;AAEG;AACH;AAEA;;;;AAIG;AACH;AAEA;;AAEG;;AAGH;;AAEG;;AAGH;;;AAGG;;;;AAKC;AACA;AAEA;;AAEG;AACH;;;;AAKY;;;;AAGJ;AACA;;;AAGZ;;AAIA;AACI;AAEA;;;AAGG;AACH;AACI;AACA;;;AAII;;;AAIR;;;AAGG;;;;AAKH;;AAGA;;;AAGG;AACH;;AAGJ;AAEI;AACA;AAEA;;AAKJ;;;;AAIG;;;AAMS;AAEA;AAEQ;;AAEE;;;;;AAON;AACI;AACA;;;;;;AAMJ;AACI;;AACJ;;;AAII;AAEA;;;AAIR;AAEA;AAMgB;;;AAiBhC;;"}

@@ -95,2 +95,3 @@ "use client";

return () => {
ref.current?.removeAttribute("data-motion-pop-id");
if (parent.contains(style)) {

@@ -97,0 +98,0 @@ parent.removeChild(style);

@@ -1,1 +0,1 @@

{"version":3,"file":"PopChild.mjs","sources":["../../../../src/components/AnimatePresence/PopChild.tsx"],"sourcesContent":["\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject<HTMLElement | null>\n sizeRef: React.RefObject<Size>\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component<MeasureProps> {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef<HTMLElement>(null)\n const size = useRef<Size>({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef =\n (children.props as { ref?: React.Ref<HTMLElement> })?.ref ??\n (children as unknown as { ref?: React.Ref<HTMLElement> })?.ref\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n <PopChildMeasure isPresent={isPresent} childRef={ref} sizeRef={size} pop={pop}>\n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n </PopChildMeasure>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAgCA;;;AAGG;AACH;AACI;;;AAGQ;AACA;AACI;;AAEJ;AACI;;AAGJ;;;;AAIA;AACA;AACA;AACA;;AAGJ;;AAGJ;;AAEG;AACH;;AAGI;;AAEP;AAEK;AACF;AACA;;AAEI;AACA;AACA;AACA;AACA;AACA;AACH;;AAED;;;AAGG;AACH;;;AAKA;;;;;;;;AAQG;;AAEC;AACA;;AAEA;AACA;;;AAKA;AAAW;AAEX;AACA;AAEA;AACI;;;;;;;;AAQH;;AAGD;AACI;AACI;;AAER;AACJ;;AAKY;AACA;AAGhB;;"}
{"version":3,"file":"PopChild.mjs","sources":["../../../../src/components/AnimatePresence/PopChild.tsx"],"sourcesContent":["\"use client\"\n\nimport { isHTMLElement } from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useId, useInsertionEffect, useRef } from \"react\"\n\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { useComposedRefs } from \"../../utils/use-composed-ref\"\n\ninterface Size {\n width: number\n height: number\n top: number\n left: number\n right: number\n bottom: number\n}\n\ninterface Props {\n children: React.ReactElement\n isPresent: boolean\n anchorX?: \"left\" | \"right\"\n anchorY?: \"top\" | \"bottom\"\n root?: HTMLElement | ShadowRoot\n pop?: boolean\n}\n\ninterface MeasureProps extends Props {\n childRef: React.RefObject<HTMLElement | null>\n sizeRef: React.RefObject<Size>\n}\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component<MeasureProps> {\n getSnapshotBeforeUpdate(prevProps: MeasureProps) {\n const element = this.props.childRef.current\n if (isHTMLElement(element) && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {\n const parent = element.offsetParent\n const parentWidth = isHTMLElement(parent)\n ? parent.offsetWidth || 0\n : 0\n const parentHeight = isHTMLElement(parent)\n ? parent.offsetHeight || 0\n : 0\n\n const computedStyle = getComputedStyle(element)\n const size = this.props.sizeRef.current!\n size.height = parseFloat(computedStyle.height)\n size.width = parseFloat(computedStyle.width)\n size.top = element.offsetTop\n size.left = element.offsetLeft\n size.right = parentWidth - size.width - size.left\n size.bottom = parentHeight - size.height - size.top\n }\n\n return null\n }\n\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() {}\n\n render() {\n return this.props.children\n }\n}\n\nexport function PopChild({ children, isPresent, anchorX, anchorY, root, pop }: Props) {\n const id = useId()\n const ref = useRef<HTMLElement>(null)\n const size = useRef<Size>({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n })\n const { nonce } = useContext(MotionConfigContext)\n /**\n * In React 19, refs are passed via props.ref instead of element.ref.\n * We check props.ref first (React 19) and fall back to element.ref (React 18).\n */\n const childRef =\n (children.props as { ref?: React.Ref<HTMLElement> })?.ref ??\n (children as unknown as { ref?: React.Ref<HTMLElement> })?.ref\n const composedRef = useComposedRefs(ref, childRef)\n\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left, right, bottom } = size.current\n if (isPresent || pop === false || !ref.current || !width || !height) return\n\n const x = anchorX === \"left\" ? `left: ${left}` : `right: ${right}`\n const y = anchorY === \"bottom\" ? `bottom: ${bottom}` : `top: ${top}`\n\n ref.current.dataset.motionPopId = id\n\n const style = document.createElement(\"style\")\n if (nonce) style.nonce = nonce\n\n const parent = root ?? document.head\n parent.appendChild(style)\n\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n ${x}px !important;\n ${y}px !important;\n }\n `)\n }\n\n return () => {\n ref.current?.removeAttribute(\"data-motion-pop-id\")\n if (parent.contains(style)) {\n parent.removeChild(style)\n }\n }\n }, [isPresent])\n\n return (\n <PopChildMeasure isPresent={isPresent} childRef={ref} sizeRef={size} pop={pop}>\n {pop === false\n ? children\n : React.cloneElement(children as any, { ref: composedRef })}\n </PopChildMeasure>\n )\n}\n"],"names":[],"mappings":";;;;;;;;AAgCA;;;AAGG;AACH;AACI;;;AAGQ;AACA;AACI;;AAEJ;AACI;;AAGJ;;;;AAIA;AACA;AACA;AACA;;AAGJ;;AAGJ;;AAEG;AACH;;AAGI;;AAEP;AAEK;AACF;AACA;;AAEI;AACA;AACA;AACA;AACA;AACA;AACH;;AAED;;;AAGG;AACH;;;AAKA;;;;;;;;AAQG;;AAEC;AACA;;AAEA;AACA;;;AAKA;AAAW;AAEX;AACA;AAEA;AACI;;;;;;;;AAQH;;AAGD;AACI;AACA;AACI;;AAER;AACJ;;AAKY;AACA;AAGhB;;"}

@@ -290,3 +290,4 @@ import { createBox, frame, eachAxis, measurePageBox, convertBoxToBoundingBox, convertBoundingBoxToBox, addValueToWillChange, animateMotionValue, mixNumber, addDomEvent, setDragLock, percent, calcLength, resize, isElementTextInput } from 'motion-dom';

let transition = (constraints && constraints[axis]) || {};
if (dragSnapToOrigin)
if (dragSnapToOrigin === true ||
dragSnapToOrigin === axis)
transition = { min: 0, max: 0 };

@@ -293,0 +294,0 @@ /**

@@ -1,1 +0,1 @@

{"version":3,"file":"VisualElementDragControls.mjs","sources":["../../../../src/gestures/drag/VisualElementDragControls.ts"],"sourcesContent":["import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement<HTMLElement>\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement<HTMLElement>) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial<ResolvedConstraints> = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (dragSnapToOrigin) transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase<DragDirection>}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n"],"names":[],"mappings":";;;;;;;;;AAsCO,MAAM,mBAAmB,GAAG,IAAI,OAAO;MAuBjC,yBAAyB,CAAA;AAkClC,IAAA,WAAA,CAAY,aAAyC,EAAA;QA7B7C,IAAA,CAAA,YAAY,GAAwB,IAAI;QAEhD,IAAA,CAAA,UAAU,GAAG,KAAK;QACV,IAAA,CAAA,gBAAgB,GAAyB,IAAI;QAE7C,IAAA,CAAA,WAAW,GAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE3C;;AAEG;QACK,IAAA,CAAA,WAAW,GAAgC,KAAK;QAEhD,IAAA,CAAA,qBAAqB,GAAG,KAAK;AAErC;;AAEG;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AS,GAAG,GAAG;IACnB;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"}
{"version":3,"file":"VisualElementDragControls.mjs","sources":["../../../../src/gestures/drag/VisualElementDragControls.ts"],"sourcesContent":["import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementTextInput,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n resize,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement<HTMLElement>\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement<HTMLElement>) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n if (snapToCursor) {\n this.snapToCursor(extractEventInfo(event).point)\n }\n this.stopAnimation()\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.update(() => onDragStart(event, info), false, true)\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n if (onDrag) {\n frame.update(() => onDrag(event, info), false, true)\n }\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () => {\n const { dragSnapToOrigin: snap } = this.getProps()\n if (snap || this.constraints) {\n this.startAnimation({ x: 0, y: 0 })\n }\n }\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative. This only applies to relative (non-ref)\n * constraints, as ref-based constraints from calcViewportConstraints are already in the\n * correct coordinate space for the motion value transform offset.\n */\n if (\n prevConstraints !== this.constraints &&\n !isRefObject(dragConstraints) &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial<ResolvedConstraints> = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (\n dragSnapToOrigin === true ||\n (dragSnapToOrigin as unknown) === axis\n )\n transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase<DragDirection>}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n\n /**\n * Reset constraints so resolveConstraints() will recalculate them\n * with the freshly measured layout rather than returning the cached value.\n */\n this.constraints = false\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n\n /**\n * Flush the updated transform to the DOM synchronously to prevent\n * a visual flash at the element's CSS layout position (0,0) when\n * the transform was stripped for measurement.\n */\n this.visualElement.render()\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a text input child element\n * (input, textarea, select, contenteditable) where users might\n * want to select text or interact with the control.\n *\n * Buttons and links don't block drag since they don't have\n * click-and-move actions of their own.\n */\n const isClickingTextInputChild =\n target !== element && isElementTextInput(target)\n\n if (drag && dragListener && !isClickingTextInputChild) {\n this.start(event)\n }\n }\n )\n\n /**\n * If using ref-based constraints, observe both the draggable element\n * and the constraint container for size changes via ResizeObserver.\n * Setup is deferred because dragConstraints.current is null when\n * addListeners first runs (React hasn't committed the ref yet).\n */\n let stopResizeObservers: VoidFunction | undefined\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n\n if (!stopResizeObservers) {\n stopResizeObservers = startResizeObservers(\n element,\n dragConstraints.current as HTMLElement,\n () => this.scalePositionWithinConstraints()\n )\n }\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n stopResizeObservers && stopResizeObservers()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction skipFirstCall(callback: VoidFunction): VoidFunction {\n let isFirst = true\n return () => {\n if (isFirst) {\n isFirst = false\n return\n }\n callback()\n }\n}\n\nfunction startResizeObservers(\n element: HTMLElement,\n constraintsElement: HTMLElement,\n onResize: VoidFunction\n): VoidFunction {\n const stopElement = resize(element, skipFirstCall(onResize))\n const stopContainer = resize(constraintsElement, skipFirstCall(onResize))\n return () => {\n stopElement()\n stopContainer()\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n"],"names":[],"mappings":";;;;;;;;;AAsCO,MAAM,mBAAmB,GAAG,IAAI,OAAO;MAuBjC,yBAAyB,CAAA;AAkClC,IAAA,WAAA,CAAY,aAAyC,EAAA;QA7B7C,IAAA,CAAA,YAAY,GAAwB,IAAI;QAEhD,IAAA,CAAA,UAAU,GAAG,KAAK;QACV,IAAA,CAAA,gBAAgB,GAAyB,IAAI;QAE7C,IAAA,CAAA,WAAW,GAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAE3C;;AAEG;QACK,IAAA,CAAA,WAAW,GAAgC,KAAK;QAEhD,IAAA,CAAA,qBAAqB,GAAG,KAAK;AAErC;;AAEG;QACK,IAAA,CAAA,OAAO,GAAG,SAAS,EAAE;AAE7B;;AAEG;QACK,IAAA,CAAA,kBAAkB,GAAwB,IAAI;AAEtD;;AAEG;QACK,IAAA,CAAA,aAAa,GAAmB,IAAI;AAGxC,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;IACtC;IAEA,KAAK,CACD,WAAyB,EACzB,EAAE,YAAY,GAAG,KAAK,EAAE,iBAAiB,EAAA,GAAyB,EAAE,EAAA;AAEpE;;AAEG;AACH,QAAA,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,aAAa;AAC9C,QAAA,IAAI,eAAe,IAAI,eAAe,CAAC,SAAS,KAAK,KAAK;YAAE;AAE5D,QAAA,MAAM,cAAc,GAAG,CAAC,KAAmB,KAAI;YAC3C,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;Y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C,QAAQ,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;AACzE,IAAA,OAAO,MAAK;AACR,QAAA,WAAW,EAAE;AACb,QAAA,aAAa,EAAE;AACnB,IAAA,CAAC;AACL;AAEA,SAAS,UAAU,CACf,SAAwB,EACxB,IAAyC,EACzC,gBAAsC,EAAA;IAEtC,QACI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS;SACnC,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,KAAK,SAAS,CAAC;AAErE;AAEA;;;;;;AAMG;AACH,SAAS,mBAAmB,CACxB,MAAa,EACb,aAAa,GAAG,EAAE,EAAA;IAElB,IAAI,SAAS,GAAyB,IAAI;IAE1C,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;QACpC,SAAS,GAAG,GAAG;IACnB;SAAO,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;QAC3C,SAAS,GAAG,GAAG;IACnB;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"}

@@ -1,1 +0,1 @@

{"version":3,"file":"PanSession.mjs","sources":["../../../../src/gestures/pan/PanSession.ts"],"sourcesContent":["import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial<PanSessionHandlers> = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map<Element | Window, Point> = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial<PanSessionHandlers>,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial<PanSessionHandlers>) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n"],"names":[],"mappings":";;;;;;AAuCA,MAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhE;;AAEG;MACU,UAAU,CAAA;IA0EnB,WAAA,CACI,KAAmB,EACnB,QAAqC,EACrC,EACI,kBAAkB,EAClB,aAAa,GAAG,MAAM,EACtB,gBAAgB,GAAG,KAAK,EACxB,iBAAiB,GAAG,CAAC,EACrB,OAAO,GAAA,GACY,EAAE,EAAA;AA7E7B;;AAEG;QACK,IAAA,CAAA,UAAU,GAAwB,IAAI;AAE9C;;AAEG;QACK,IAAA,CAAA,aAAa,GAAwB,IAAI;AAEjD;;AAEG;QACK,IAAA,CAAA,iBAAiB,GAAqB,IAAI;AAElD;;;;AAIG;QACK,IAAA,CAAA,oBAAoB,GAAqB,IAAI;AAOrD;;AAEG;QACK,IAAA,CAAA,QAAQ,GAAgC,EAAE;AAqBlD;;AAEG;QAC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I,IAAI;KAC/C;AAED,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AACA,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"}
{"version":3,"file":"PanSession.mjs","sources":["../../../../src/gestures/pan/PanSession.ts"],"sourcesContent":["import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean | \"x\" | \"y\"\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * Raw (untransformed) event info, re-transformed each frame\n * so transformPagePoint sees the current parent matrix.\n * @internal\n */\n private lastRawMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial<PanSessionHandlers> = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean | \"x\" | \"y\"\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map<Element | Window, Point> = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial<PanSessionHandlers>,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll)\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n // Re-transform raw point through current transformPagePoint so\n // animated parent transforms (e.g. rotation) are picked up each frame\n if (this.lastRawMoveEventInfo) {\n this.lastMoveEventInfo = transformPoint(\n this.lastRawMoveEventInfo,\n this.transformPagePoint\n )\n }\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastRawMoveEventInfo = info\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial<PanSessionHandlers>) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n /**\n * If the selected point is the pointer-down origin (history[0]),\n * there are better movement points available, and the time gap\n * is suspiciously large (>2x timeDelta), use the next point instead.\n * This prevents stale pointer-down points from diluting velocity\n * in hold-then-flick gestures.\n */\n if (\n timestampedPoint === history[0] &&\n history.length > 2 &&\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta) * 2\n ) {\n timestampedPoint = history[1]\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n"],"names":[],"mappings":";;;;;;AAuCA,MAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEhE;;AAEG;MACU,UAAU,CAAA;IA0EnB,WAAA,CACI,KAAmB,EACnB,QAAqC,EACrC,EACI,kBAAkB,EAClB,aAAa,GAAG,MAAM,EACtB,gBAAgB,GAAG,KAAK,EACxB,iBAAiB,GAAG,CAAC,EACrB,OAAO,GAAA,GACY,EAAE,EAAA;AA7E7B;;AAEG;QACK,IAAA,CAAA,UAAU,GAAwB,IAAI;AAE9C;;AAEG;QACK,IAAA,CAAA,aAAa,GAAwB,IAAI;AAEjD;;AAEG;QACK,IAAA,CAAA,iBAAiB,GAAqB,IAAI;AAElD;;;;AAIG;QACK,IAAA,CAAA,oBAAoB,GAAqB,IAAI;AAOrD;;AAEG;QACK,IAAA,CAAA,QAAQ,GAAgC,EAAE;AAqBlD;;AAEG;QACK,IAAA,CAAA,aAAa,GAAuC,MAAM;AAElE;;;AAGG;AACK,QAAA,IAAA,CAAA,eAAe,GAAiC,IAAI,GAAG,EAAE;AAEjE;;;AAGG;QACK,IAAA,CAAA,qBAAqB,GAAwB,IAAI;AAoGjD,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,KAAY,KAAU;AAC7C,YAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAiB,CAAC;AAC9C,QAAA,CAAC;QAEO,IAAA,CAAA,cAAc,GAAG,MAAW;AAChC,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;AAC7B,QAAA,CAAC;QAyCO,IAAA,CAAA,WAAW,GAAG,MAAK;YACvB,IAAI,EAAE,IAAI,CAAC,aAAa,IAAI,IAAI,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E;QACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACzB;AAEA;;;;;;AAMG;AACH,IAAA,IACI,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,MAAM,GAAG,CAAC;AAClB,QAAA,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS;AAC5C,YAAA,qBAAqB,CAAC,SAAS,CAAC,GAAG,CAAC,EAC1C;AACE,QAAA,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;IACjC;AAEA,IAAA,MAAM,IAAI,GAAG,qBAAqB,CAC9B,SAAS,CAAC,SAAS,GAAG,gBAAgB,CAAC,SAAS,CACnD;AACD,IAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACZ,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACzB;AAEA,IAAA,MAAM,eAAe,GAAG;QACpB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;QAC5C,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,IAAI;KAC/C;AAED,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AACA,IAAA,IAAI,eAAe,CAAC,CAAC,KAAK,QAAQ,EAAE;AAChC,QAAA,eAAe,CAAC,CAAC,GAAG,CAAC;IACzB;AAEA,IAAA,OAAO,eAAe;AAC1B;;;;"}

@@ -1,2 +0,2 @@

import { Feature } from 'motion-dom';
import { Feature, resolveVariant } from 'motion-dom';

@@ -8,2 +8,3 @@ let id = 0;

this.id = id++;
this.isExitComplete = false;
}

@@ -18,5 +19,34 @@ update() {

}
if (isPresent && prevIsPresent === false) {
/**
* When re-entering, if the exit animation already completed
* (element is at rest), reset to initial values so the enter
* animation replays from the correct position.
*/
if (this.isExitComplete) {
const { initial, custom } = this.node.getProps();
if (typeof initial === "string") {
const resolved = resolveVariant(this.node, initial, custom);
if (resolved) {
const { transition, transitionEnd, ...target } = resolved;
for (const key in target) {
this.node
.getValue(key)
?.jump(target[key]);
}
}
}
this.node.animationState.reset();
this.node.animationState.animateChanges();
}
else {
this.node.animationState.setActive("exit", false);
}
this.isExitComplete = false;
return;
}
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
if (onExitComplete && !isPresent) {
exitAnimation.then(() => {
this.isExitComplete = true;
onExitComplete(this.id);

@@ -23,0 +53,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"exit.mjs","sources":["../../../../../src/motion/features/animation/exit.ts"],"sourcesContent":["import { Feature } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature<unknown> {\n private id: number = id++\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;AAEA,IAAI,EAAE,GAAG,CAAC;AAEJ,MAAO,oBAAqB,SAAQ,OAAgB,CAAA;AAA1D,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,EAAE,GAAW,EAAE,EAAE;IAqC7B;IAnCI,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE;QAEhC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe;AAC/D,QAAA,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE;QAExE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,KAAK,aAAa,EAAE;YAC1D;QACJ;AAEA,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CACpD,MAAM,EACN,CAAC,SAAS,CACb;AAED,QAAA,IAAI,cAAc,IAAI,CAAC,SAAS,EAAE;AAC9B,YAAA,aAAa,CAAC,IAAI,CAAC,MAAK;AACpB,gBAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3B,YAAA,CAAC,CAAC;QACN;IACJ;IAEA,KAAK,GAAA;AACD,QAAA,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE;QAEpE,IAAI,cAAc,EAAE;AAChB,YAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B;QAEA,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC;IACJ;AAEA,IAAA,OAAO,KAAI;AACd;;;;"}
{"version":3,"file":"exit.mjs","sources":["../../../../../src/motion/features/animation/exit.ts"],"sourcesContent":["import { Feature, resolveVariant } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature<unknown> {\n private id: number = id++\n private isExitComplete = false\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n if (isPresent && prevIsPresent === false) {\n /**\n * When re-entering, if the exit animation already completed\n * (element is at rest), reset to initial values so the enter\n * animation replays from the correct position.\n */\n if (this.isExitComplete) {\n const { initial, custom } = this.node.getProps()\n\n if (typeof initial === \"string\") {\n const resolved = resolveVariant(\n this.node,\n initial,\n custom\n )\n if (resolved) {\n const { transition, transitionEnd, ...target } =\n resolved\n for (const key in target) {\n this.node\n .getValue(key)\n ?.jump(\n target[\n key as keyof typeof target\n ] as any\n )\n }\n }\n }\n\n this.node.animationState.reset()\n this.node.animationState.animateChanges()\n } else {\n this.node.animationState.setActive(\"exit\", false)\n }\n\n this.isExitComplete = false\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n this.isExitComplete = true\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n"],"names":[],"mappings":";;AAEA,IAAI,EAAE,GAAG,CAAC;AAEJ,MAAO,oBAAqB,SAAQ,OAAgB,CAAA;AAA1D,IAAA,WAAA,GAAA;;QACY,IAAA,CAAA,EAAE,GAAW,EAAE,EAAE;QACjB,IAAA,CAAA,cAAc,GAAG,KAAK;IA8ElC;IA5EI,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE;QAEhC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe;AAC/D,QAAA,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,IAAI,EAAE;QAExE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,SAAS,KAAK,aAAa,EAAE;YAC1D;QACJ;AAEA,QAAA,IAAI,SAAS,IAAI,aAAa,KAAK,KAAK,EAAE;AACtC;;;;AAIG;AACH,YAAA,IAAI,IAAI,CAAC,cAAc,EAAE;AAC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AI,cAAc,EAAE;AAChB,YAAA,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B;QAEA,IAAI,QAAQ,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC;IACJ;AAEA,IAAA,OAAO,KAAI;AACd;;;;"}

@@ -0,1 +1,2 @@

import { isMotionValue } from 'motion-dom';
import { isValidMotionProp } from '../../../motion/utils/valid-prop.mjs';

@@ -28,4 +29,8 @@

* in favour of explicit injection.
*
* String concatenation prevents bundlers like webpack (e.g. Storybook)
* from statically resolving this optional dependency at build time.
*/
loadExternalIsValidProp(require("@emotion/is-prop-valid").default);
const emotionPkg = "@emotion/is-prop-" + "valid";
loadExternalIsValidProp(require(emotionPkg).default);
}

@@ -47,2 +52,4 @@ catch {

continue;
if (isMotionValue(props[key]))
continue;
if (shouldForward(key) ||

@@ -49,0 +56,0 @@ (forwardMotionProps === true && isValidMotionProp(key)) ||

@@ -1,1 +0,1 @@

{"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;AAGA,IAAI,aAAa,GAAG,CAAC,GAAW,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;AAItD,SAAU,uBAAuB,CAAC,WAAyB,EAAA;IAC7D,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE;;IAGvC,aAAa,GAAG,CAAC,GAAW,KACxB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;AACzE;AAEA;;;;;;;;;;;;AAYG;AACH,IAAI;AACA;;;;AAIG;IACH,uBAAuB,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC;AACtE;AAAE,MAAM;;AAER;SAEgB,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAAA;IAE3B,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;QAE1D,IACI,aAAa,CAAC,GAAG,CAAC;aACjB,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"}
{"version":3,"file":"filter-props.mjs","sources":["../../../../../src/render/dom/utils/filter-props.ts"],"sourcesContent":["import { isMotionValue } from \"motion-dom\"\nimport type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n *\n * String concatenation prevents bundlers like webpack (e.g. Storybook)\n * from statically resolving this optional dependency at build time.\n */\n const emotionPkg = \"@emotion/is-prop-\" + \"valid\"\n loadExternalIsValidProp(require(emotionPkg).default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (isMotionValue(props[key as keyof typeof props])) continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n"],"names":[],"mappings":";;;AAIA,IAAI,aAAa,GAAG,CAAC,GAAW,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;AAItD,SAAU,uBAAuB,CAAC,WAAyB,EAAA;IAC7D,IAAI,OAAO,WAAW,KAAK,UAAU;QAAE;;IAGvC,aAAa,GAAG,CAAC,GAAW,KACxB,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;AACzE;AAEA;;;;;;;;;;;;AAYG;AACH,IAAI;AACA;;;;;;;AAOG;AACH,IAAA,MAAM,UAAU,GAAG,mBAAmB,GAAG,OAAO;IAChD,uBAAuB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;AACxD;AAAE,MAAM;;AAER;SAEgB,WAAW,CACvB,KAAkB,EAClB,KAAc,EACd,kBAA2B,EAAA;IAE3B,MAAM,aAAa,GAAgB,EAAE;AAErC,IAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACrB;;;;;;AAMG;QACH,IAAI,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE;AAE1D,QAAA,IAAI,aAAa,CAAC,KAAK,CAAC,GAAyB,CAAC,CAAC;YAAE;QAErD,IACI,aAAa,CAAC,GAAG,CAAC;aACjB,kBAAkB,KAAK,IAAI,IAAI,iBAAiB,CAAC,GAAG,CAAC,CAAC;aACtD,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;;aAElC,KAAK,CAAC,WAAgC,CAAC;AACpC,gBAAA,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAC/B;YACE,aAAa,CAAC,GAAwB,CAAC;gBACnC,KAAK,CAAC,GAAwB,CAAC;QACvC;IACJ;AAEA,IAAA,OAAO,aAAa;AACxB;;;;"}

@@ -1,1 +0,1 @@

{"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue<string>,\n options?: SpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: string,\n options?: SpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: MotionValue<number>,\n options?: SpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: number,\n options?: SpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: MotionValue<string> | MotionValue<number> | string | number,\n options: SpringOptions = {}\n): MotionValue<string> | MotionValue<number> {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA4CI;AACJ;;"}
{"version":3,"file":"use-spring.mjs","sources":["../../../src/value/use-spring.ts"],"sourcesContent":["\"use client\"\n\nimport { FollowValueOptions, MotionValue, SpringOptions } from \"motion-dom\"\nimport { useFollowValue } from \"./use-follow-value\"\n\ntype UseSpringOptions = SpringOptions &\n Pick<FollowValueOptions, \"skipInitialAnimation\">\n\n/**\n * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useSpring(0, { stiffness: 300 })\n * const y = useSpring(x, { damping: 10 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will spring towards that value.\n * @param springConfig - Configuration options for the spring.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useSpring(\n source: MotionValue<string>,\n options?: UseSpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: string,\n options?: UseSpringOptions\n): MotionValue<string>\nexport function useSpring(\n source: MotionValue<number>,\n options?: UseSpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: number,\n options?: UseSpringOptions\n): MotionValue<number>\nexport function useSpring(\n source: MotionValue<string> | MotionValue<number> | string | number,\n options: UseSpringOptions = {}\n): MotionValue<string> | MotionValue<number> {\n return useFollowValue(source as any, { type: \"spring\", ...options })\n}\n"],"names":[],"mappings":";;;;AA+CI;AACJ;;"}

@@ -1,2 +0,2 @@

function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,T=t=>e=>1-t(1-e),w=v(.33,1.53,.69,.99),M=T(w),S=b(M),x=t=>(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),A=t=>1-Math.sin(Math.acos(t)),V=T(A),k=b(A),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),E=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return E(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:A,circInOut:k,circOut:V,backIn:M,backInOut:S,backOut:w,anticipate:x},I=t=>{if(R(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==D[t],`Invalid easing type '${t}'`,"invalid-easing-type"),D[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.has(t)||o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{a=t,s?i=!0:(s=!0,[e,n]=[n,e],e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t)))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming?i.timestamp:performance.now();n=!1,r.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<O.length;e++)o[O[e]].cancel(t)},state:i,steps:o}}const{schedule:$,cancel:K,state:j}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let W;function L(){W=void 0}const Y={now:()=>(void 0===W&&Y.set(j.isProcessing||r.useManualTiming?j.timestamp:performance.now()),W),set:t=>{W=t,queueMicrotask(L)}},U=t=>e=>"string"==typeof e&&e.startsWith(t),X=U("--"),q=U("var(--"),z=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...H,transform:t=>e(0,1,t)},J={...H,default:1},Q=t=>Math.round(1e5*t)/1e5,tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const et=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nt=(t,e)=>n=>Boolean("string"==typeof n&&et.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),st=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(tt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},it={...H,transform:t=>Math.round((t=>e(0,255,t))(t))},rt={test:nt("rgb","red"),parse:st("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+Q(G.transform(s))+")"};const at={test:nt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:rt.transform},ot=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),lt=ot("deg"),ut=ot("%"),ht=ot("px"),ct=ot("vh"),dt=ot("vw"),pt=(()=>({...ut,parse:t=>ut.parse(t)/100,transform:t=>ut.transform(100*t)}))(),mt={test:nt("hsl","hue"),parse:st("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ut.transform(Q(e))+", "+ut.transform(Q(n))+", "+Q(G.transform(s))+")"},ft={test:t=>rt.test(t)||at.test(t)||mt.test(t),parse:t=>rt.test(t)?rt.parse(t):mt.test(t)?mt.parse(t):at.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?rt.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=ft.parse(t);return e.alpha=0,ft.transform(e)}},gt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const yt="number",vt="color",bt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(bt,t=>(ft.test(t)?(s.color.push(r),i.push(vt),n.push(ft.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(yt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function wt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],void 0!==s[r]){const t=e[r];i+=t===yt?Q(s[r]):t===vt?ft.transform(s[r]):s[r]}return i}}const Mt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:ft.test(n)?ft.getAnimatableNone(n):n;var n};const St={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(tt)?.length||0)+(t.match(gt)?.length||0)>0},parse:function(t){return Tt(t).values},createTransformer:function(t){return wt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return wt(e)(e.values.map((t,n)=>Mt(t,e.split[n])))}};function xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function At(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ct=[at,rt,mt];function Ft(t){const e=(n=t,Ct.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===mt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=xt(o,s,t+1/3),r=xt(o,s,t),a=xt(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Pt=(t,e)=>{const n=Ft(t),s=Ft(e);if(!n||!s)return At(t,e);const i={...n};return t=>(i.red=kt(n.red,s.red,t),i.green=kt(n.green,s.green,t),i.blue=kt(n.blue,s.blue,t),i.alpha=Vt(n.alpha,s.alpha,t),rt.transform(i))},Et=new Set(["none","hidden"]);function Bt(t,e){return n=>Vt(t,e,n)}function Rt(t){return"number"==typeof t?Bt:"string"==typeof t?z(t)?At:ft.test(t)?Pt:Ot:Array.isArray(t)?Dt:"object"==typeof t?ft.test(t)?Pt:It:At}function Dt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Rt(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function It(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Rt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Ot=(t,e)=>{const n=St.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Et.has(t)&&!r.values.length||Et.has(e)&&!i.values.length?function(t,e){return Et.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Dt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}(i,r),r.values),n):(s(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),At(t,e))};function Nt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);return Rt(t)(t,e)}const $t=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>K(e),now:()=>j.isProcessing?j.timestamp:Y.now()}},Kt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},jt=2e4;function Wt(t){let e=0;let n=t.next(e);for(;!n.done&&e<jt;)e+=50,n=t.next(e);return e>=jt?1/0:e}function Lt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Wt(s),jt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}const Yt=100,Ut=10,Xt=1,qt=0,zt=800,Zt=.3,_t=.3,Ht={granular:.01,default:2},Gt={granular:.005,default:.5},Jt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const se=.001;const ie=["duration","bounce"],re=["stiffness","damping","mass"];function ae(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let n={velocity:qt,stiffness:Yt,damping:Ut,mass:Xt,isResolvedFromDuration:!1,...t};if(!ae(t,re)&&ae(t,ie))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Xt,stiffness:r,damping:a}}else{const i=function({duration:t=zt,bounce:n=Zt,velocity:i=qt,mass:r=Xt}){let a,o;s(t<=m(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(te,ee,l),t=e(Jt,Qt,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ne(e,l),o=Math.exp(-s);return se-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ne(Math.pow(e,2),l);return(-a(e)+se>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=m(t),isNaN(u))return{stiffness:Yt,damping:Ut,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:Xt},n.isResolvedFromDuration=!0}return n}function le(t=_t,e=Zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-f(n.velocity||0)}),g=d||0,y=u/(2*Math.sqrt(l*h)),v=a-r,b=f(Math.sqrt(l/h)),T=Math.abs(v)<5;let w,M,S,x,A,V;if(s||(s=T?Ht.granular:Ht.default),i||(i=T?Gt.granular:Gt.default),y<1)S=ne(b,y),x=(g+y*b*v)/S,w=t=>{const e=Math.exp(-y*b*t);return a-e*(x*Math.sin(S*t)+v*Math.cos(S*t))},A=y*b*x+v*S,V=y*b*v-x*S,M=t=>Math.exp(-y*b*t)*(A*Math.sin(S*t)+V*Math.cos(S*t));else if(1===y){w=t=>a-Math.exp(-b*t)*(v+(g+b*v)*t);const t=g+b*v;M=e=>Math.exp(-b*e)*(b*t*e-g)}else{const t=b*Math.sqrt(y*y-1);w=e=>{const n=Math.exp(-y*b*e),s=Math.min(t*e,300);return a-n*((g+y*b*v)*Math.sinh(s)+t*v*Math.cosh(s))/t};const e=(g+y*b*v)/t,n=y*b*e-v*t,s=y*b*v-e*t;M=e=>{const i=Math.exp(-y*b*e),r=Math.min(t*e,300);return i*(n*Math.sinh(r)+s*Math.cosh(r))}}const k={calculatedDuration:p&&c||null,velocity:t=>m(M(t)),next:t=>{if(!p&&y<1){const e=Math.exp(-y*b*t),n=Math.sin(S*t),r=Math.cos(S*t),l=a-e*(x*n+v*r),u=m(e*(A*n+V*r));return o.done=Math.abs(u)<=s&&Math.abs(a-l)<=i,o.value=o.done?a:l,o}const e=w(t);if(p)o.done=t>=c;else{const n=m(M(t));o.done=Math.abs(n)<=s&&Math.abs(a-e)<=i}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Wt(k),jt),e=Kt(e=>k.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return k}le.applyToOptions=t=>{const e=Lt(t,100,le);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function ue(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}function he({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let m=n*e;const f=c+m,g=void 0===a?f:a(f);g!==f&&(m=g-c);const y=t=>-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(T=t,w=le({keyframes:[d.value,p(d.value)],velocity:ue(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function ce(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Nt,a=t.length-1;for(let n=0;n<a;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=c(t,r)}s.push(r)}return s}(n,a,o),m=p.length,f=e=>{if(h&&e<t[0])return n[0];let s=0;if(m>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=d(t[s],t[s+1],e);return p[s](i)};return s?n=>f(e(t[0],t[l-1],n)):f}function de(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Vt(n,1,i))}}function pe(t){const e=[0];return de(e,t.length-1),e}function me({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=E(s)?s.map(I):I(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:pe(e),t),o=ce(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const fe=t=>null!==t;function ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(fe),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ye={decay:he,inertia:he,tween:me,keyframes:me,spring:le};function ve(t){"string"==typeof t.type&&(t.type=ye[t.type])}class be{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Te=t=>t/100;class we extends be{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Y.now()&&this.tick(Y.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ve(t);const{type:e=me,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||me;o!==me&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Te,Nt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Wt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b=this.currentTime,T=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(T=a)),b=e(0,1,s)*o}const w=v?{done:!1,value:h[0]}:T.next(b);r&&!v&&(w.value=r(w.value));let{done:M}=w;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==he&&(w.value=ge(h,this.options,g,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(Y.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=$t,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Y.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Me=t=>180*t/Math.PI,Se=t=>{const e=Me(Math.atan2(t[1],t[0]));return Ae(e)},xe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,skewX:t=>Me(Math.atan(t[1])),skewY:t=>Me(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ae=t=>((t%=360)<0&&(t+=360),t),Ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ce={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ve,scaleY:ke,scale:t=>(Ve(t)+ke(t))/2,rotateX:t=>Ae(Me(Math.atan2(t[6],t[5]))),rotateY:t=>Ae(Me(Math.atan2(-t[2],t[0]))),rotateZ:Se,rotate:Se,skewX:t=>Me(Math.atan(t[4])),skewY:t=>Me(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Fe(t){return t.includes("scale")?1:0}function Pe(t,e){if(!t||"none"===t)return Fe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ce,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=xe,i=e}if(!i)return Fe(e);const r=s[e],a=i[1].split(",").map(Ee);return"function"==typeof r?r(a):a[r]}function Ee(t){return parseFloat(t.trim())}const Be=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Re=(()=>new Set(Be))(),De=t=>t===H||t===ht,Ie=new Set(["x","y","z"]),Oe=Be.filter(t=>!Ie.has(t));const Ne={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Pe(e,"x"),y:(t,{transform:e})=>Pe(e,"y")};Ne.translateX=Ne.x,Ne.translateY=Ne.y;const $e=new Set;let Ke=!1,je=!1,We=!1;function Le(){if(je){const t=Array.from($e).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Oe.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}je=!1,Ke=!1,$e.forEach(t=>t.complete(We)),$e.clear()}function Ye(){$e.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(je=!0)})}class Ue{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?($e.add(this),Ke||(Ke=!0,$.read(Ye),$.resolveKeyframes(Le))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$e.delete(this)}cancel(){"scheduled"===this.state&&($e.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Xe(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const qe={};function ze(t,e){const n=l(t);return()=>qe[e]??n()}const Ze=ze(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),_e=ze(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),He=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:He([0,.65,.55,1]),circOut:He([.55,0,1,.45]),backIn:He([.31,.01,.66,-.59]),backOut:He([.33,1.53,.69,.99])};function Je(t,e){return t?"function"==typeof t?_e()?Kt(t,e):"ease-out":R(t)?He(t):Array.isArray(t)?t.map(t=>Je(t,e)||Ge.easeOut):Ge[t]:void 0}function Qe(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=Je(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function tn(t){return"function"==typeof t&&"applyToOptions"in t}class en extends be{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return tn(t)&&_e()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Qe(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ge(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Xe(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ze()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):s(this)}}const nn={anticipate:x,backInOut:S,circInOut:k};function sn(t){"string"==typeof t.ease&&t.ease in nn&&(t.ease=nn[t.ease])}class rn extends en{constructor(t){sn(t),ve(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new we({...a,autoplay:!1}),l=Math.max(10,Y.now()-this.startTime),u=e(0,10,l-10),h=o.sample(l).value,{name:c}=this.options;r&&c&&Xe(r,c,h),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const an=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!St.test(t)&&"0"!==t||t.startsWith("url(")));function on(t){t.duration=0,t.type="keyframes"}const ln=new Set(["opacity","clipPath","filter","transform"]),un=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class hn extends be{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Y.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ue;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Y.now(),function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=an(r,e),l=an(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||tn(n))&&i)}(t,a,o,l)||(!r.instantAnimations&&h||d?.(ge(t,n,e)),t[0]=t[t.length-1],on(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return un()&&n&&ln.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(p),f=p.motionValue?.owner?.current,g=m?new rn({...p,element:f}):new we(p);g.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),We=!0,Ye(),Le(),We=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class cn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return dn(this.animations,"duration")}get iterationDuration(){return dn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function dn(t,e){let n=0;for(let s=0;s<t.length;s++){const i=t[s][e];null!==i&&i>n&&(n=i)}return n}class pn extends cn{then(t,e){return this.finished.finally(t).then(()=>{})}}const mn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=mn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return z(r)?fn(r,e,n+1):r}const gn={type:"spring",stiffness:500,damping:25,restSpeed:10},yn={type:"keyframes",duration:.8},vn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bn=(t,{keyframes:e})=>e.length>2?yn:Re.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:gn:vn,Tn=t=>null!==t;function wn(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Mn(t,e){const n=t?.[e]??t?.default??t;return n!==t?wn(n,t):n}const Sn=(t,e,n,s={},i,a)=>o=>{const l=Mn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,bn(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(on(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,on(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const s=t.filter(Tn);return s[e&&"loop"!==n&&e%2==1?0:s.length-1]}(c.keyframes,l);if(void 0!==t)return void $.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new we(c):new hn(c)};function xn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function An(t,e,n,s){if("function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Vn=new Set(["width","height","top","left","right","bottom",...Be]);class kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Y.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Y.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Y.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cn(t,e){return new kn(t,e)}function Fn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Cn(n))}function Pn(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function En(t,e){const n=function(t,e){const n=t.getProps();return An(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Fn(t,e,Pn(r[e]))}}const Bn=t=>Boolean(t&&t.getVelocity);function Rn(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Bn(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function Dn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const In="data-"+Dn("framerAppearId");function On(t){return t.props[In]}function Nn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function $n(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?wn(r,l):l;const u=r?.reduceMotion;s&&(r=s);const h=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||c&&Nn(c,e))continue;const a={delay:n,...Mn(r||{},e)},l=s.get();if(void 0!==l&&!s.isAnimating&&!Array.isArray(i)&&i===l&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=On(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(a.startTime=t,d=!0)}}Rn(t,e);const p=u??t.shouldReduceMotion;s.start(Sn(e,s,i,p&&Vn.has(e)?{type:!1}:a,t,d));const m=s.animation;m&&h.push(m)}if(a){const e=()=>$.update(()=>{a&&En(t,a)});h.length?Promise.all(h).then(e):e()}return h}const Kn=t=>e=>e.test(t),jn=[H,ht,ut,lt,dt,ct,{test:t=>"auto"===t,parse:t=>t}],Wn=t=>jn.find(Kn(t));function Ln(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const Yn=new Set(["brightness","contrast","saturate","opacity"]);function Un(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(tt)||[];if(!s)return t;const i=n.replace(s,"");let r=Yn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Xn=/\b([a-z-]*)\(.*?\)/gu,qn={...St,getAnimatableNone:t=>{const e=t.match(Xn);return e?e.map(Un).join(" "):t}},zn={...St,getAnimatableNone:t=>{const e=St.parse(t);return St.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Zn={...H,transform:Math.round},_n={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,top:ht,right:ht,bottom:ht,left:ht,inset:ht,insetBlock:ht,insetBlockStart:ht,insetBlockEnd:ht,insetInline:ht,insetInlineStart:ht,insetInlineEnd:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,paddingBlock:ht,paddingBlockStart:ht,paddingBlockEnd:ht,paddingInline:ht,paddingInlineStart:ht,paddingInlineEnd:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,marginBlock:ht,marginBlockStart:ht,marginBlockEnd:ht,marginInline:ht,marginInlineStart:ht,marginInlineEnd:ht,fontSize:ht,backgroundPositionX:ht,backgroundPositionY:ht,...{rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:lt,skewX:lt,skewY:lt,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:G,originX:pt,originY:pt,originZ:ht},zIndex:Zn,fillOpacity:G,strokeOpacity:G,numOctaves:Zn},Hn={..._n,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:qn,WebkitFilter:qn,mask:zn,WebkitMask:zn},Gn=t=>Hn[t],Jn=new Set([qn,zn]);function Qn(t,e){let n=Gn(t);return Jn.has(n)||(n=St),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ts=new Set(["auto","none","0"]);class es extends Ue{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),z(s))){const i=fn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Vn.has(n)||2!==t.length)return;const[s,i]=t,r=Wn(s),a=Wn(i);if(_(s)!==_(i)&&Ne[n])this.needsMeasurement=!0;else if(r!==a)if(De(r)&&De(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ne[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ln(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!ts.has(e)&&Tt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Qn(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ne[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ne[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ns=new Set(["opacity","clipPath","filter","transform"]);const ss=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:is}=N(queueMicrotask,!1);function rs(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const as=[...jn,ft,St],os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ls=new WeakMap;const us=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function hs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||us.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const cs={current:null},ds={current:!1},ps="undefined"!=typeof window;const ms=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fs={};class gs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ue,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Y.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,$.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=hs(e),this.isVariantNode=function(t){return Boolean(hs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&Bn(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ls.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ds.current||function(){if(ds.current=!0,ps)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cs.current=t.matches;t.addEventListener("change",e),e()}else cs.current=!1}(),this.shouldReduceMotion=cs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ns.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new en({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:m(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Re.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in fs){const e=fs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ms.length;e++){const n=ms[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Bn(i))t.addValue(s,i);else if(Bn(r))t.addValue(s,Cn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Cn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Cn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!as.find(Kn(s))&&St.test(e)&&(n=Qn(t,e))),this.setBaseTarget(t,Bn(n)?n.get():n)),Bn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=An(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Bn(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){is.render(this.render)}}class ys extends gs{constructor(){super(...arguments),this.KeyframeResolver=es}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bs=Be.length;function Ts(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Re.has(t))a=!0;else if(X(t))i[t]=n;else{const e=ss(n,_n[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<bs;r++){const a=Be[r],o=t[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);l=a.startsWith("scale")?1===t:0===t}if(!l||n){const t=ss(o,_n[a]);l||(i=!1,s+=`${vs[a]||a}(${t}) `),n&&(e[a]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function ws(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in i?.applyProjectionStyles(r,s),n)r.setProperty(a,n[a])}function Ms(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ss={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ht.test(t))return t;t=parseFloat(t)}return`${Ms(t,e.target.x)}% ${Ms(t,e.target.y)}%`}},xs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=St.parse(t);if(i.length>5)return s;const r=St.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Vt(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},As={borderRadius:{...Ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ss,borderTopRightRadius:Ss,borderBottomLeftRadius:Ss,borderBottomRightRadius:Ss,boxShadow:xs};function Vs(t,{layout:e,layoutId:n}){return Re.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!As[t]||"opacity"===t)}function ks(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Bn(s[e])||i&&Bn(i[e])||Vs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Cs extends ys{constructor(){super(...arguments),this.type="html",this.renderInstance=ws}readValueFromInstance(t,e){if(Re.has(e))return this.projection?.isProjecting?Fe(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pe(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(X(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ts(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return ks(t,e,n)}}class Fs extends gs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ps={offset:"stroke-dashoffset",array:"stroke-dasharray"},Es={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rs(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(Ts(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox);for(const t of Bs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ps:Es;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const Ds=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Is extends ys{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=os}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Re.has(e)){const t=Gn(e);return t&&t.default||0}return e=Ds.has(e)?e:Dn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=ks(t,e,n);for(const n in t)(Bn(t[n])||Bn(e[n]))&&(s[-1!==Be.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Rs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){ws(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ds.has(n)?n:Dn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Os(t){return"object"==typeof t&&!Array.isArray(t)}function Ns(t,e,n,s){return null==t?[]:"string"==typeof t&&Os(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function $s(t,e,n){return t*(e+1)}function Ks(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function js(e,n,s,i,r,a){!function(e,n,s){for(let i=0;i<e.length;i++){const r=e[i];r.at>n&&r.at<s&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<n.length;t++)e.push({value:n[t],at:Vt(r,a,i[t]),easing:B(s,t)})}function Ws(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Ls(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ys(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Us(t,e){return e[t]||(e[t]=[]),e[t]}function Xs(t){return Array.isArray(t)?t:[t]}function qs(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const zs=t=>"number"==typeof t,Zs=t=>t.every(zs);function _s(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=rs(t)&&!function(t){return rs(t)&&"svg"===t.tagName}(t)?new Is(e):new Cs(e);n.mount(t),ls.set(t,n)}function Hs(t){const e=new Fs({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ls.set(t,e)}function Gs(t,e,n,s){const r=[];if(function(t,e){return Bn(t)||"number"==typeof t||"string"==typeof t&&!Os(e)}(t,e))r.push(function(t,e,n){const s=Bn(t)?t:Cn(t);return s.start(Sn("",s,e,n)),s.animation}(t,Os(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=Ns(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t<o;t++){const s=a[t],i=s instanceof Element?_s:Hs;ls.has(s)||i(s);const l=ls.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),r.push(...$n(l,{...e,transition:u},{}))}}return r}function Js(t,e,n){const s=[],r=function(t,{defaultTransition:e={},...n}={},s,r){const a=e.duration||.3,o=new Map,l=new Map,u={},h=new Map;let c=0,p=0,f=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){h.set(o,p);continue}if(!Array.isArray(o)){h.set(o.name,Ks(p,o.at,c,h));continue}let[d,g,y={}]=o;void 0!==y.at&&(p=Ks(p,y.at,c,h));let v=0;const b=(t,n,s,o=0,l=0)=>{const u=Xs(t),{delay:h=0,times:c=pe(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:w=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,x=u.length,A=tn(d)?d:r?.[d||"keyframes"];if(x<=2&&A){let t=100;if(2===x&&Zs(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...T};void 0!==M&&(n.duration=m(M));const s=Lt(n,t,A);w=s.ease,M=s.duration}M??(M=a);const V=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&de(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=$s(M,g);const t=[...u],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s<g;s++){u.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),w.push(0===i?"linear":B(n,i-1))}Ws(c,g)}const C=V+M;js(s,u,w,c,V,C),v=Math.max(S+M,v),f=Math.max(C,f)};if(Bn(d))b(g,y,Us("default",Ys(d,l)));else{const t=Ns(d,g,s,u),e=t.length;for(let n=0;n<e;n++){const s=Ys(t[n],l);for(const t in g)b(g[t],qs(y,t),Us(t,s),n,e)}}c=p,p+=v}return l.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(Ls);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,f,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const h=o.get(s);h.keyframes[i]=a;const{type:c,...p}=e;h.transition[i]={...p,duration:f,ease:u,times:l,...n}}}),o}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Cn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:le});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Gs(n,t,e))}),s}function Qs(e={}){const{scope:n,reduceMotion:s}=e;return function(e,i,r){let a,o=[];if(l=e,Array.isArray(l)&&l.some(Array.isArray)){const{onComplete:t,...r}=i||{};"function"==typeof t&&(a=t),o=Js(e,void 0!==s?{reduceMotion:s,...r}:r,n)}else{const{onComplete:t,...l}=r||{};"function"==typeof t&&(a=t),o=Gs(e,i,void 0!==s?{reduceMotion:s,...l}:l,n)}var l;const u=new pn(o);return a&&u.finished.then(a),n&&(n.animations.push(u),u.finished.then(()=>{t(n.animations,u)})),u}}const ti=Qs();export{ti as animate,Qs as createScopedAnimate};
function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;function n(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const m=t=>1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,T=t=>e=>1-t(1-e),w=v(.33,1.53,.69,.99),M=T(w),S=b(M),x=t=>t>=1?1:(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),A=t=>1-Math.sin(Math.acos(t)),V=T(A),k=b(A),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),E=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return E(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:A,circInOut:k,circOut:V,backIn:M,backInOut:S,backOut:w,anticipate:x},I=t=>{if(R(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==D[t],`Invalid easing type '${t}'`,"invalid-easing-type"),D[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<O.length;e++)o[O[e]].cancel(t)},state:i,steps:o}}const{schedule:$,cancel:K,state:j}=N("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:u,!0);let W;function L(){W=void 0}const Y={now:()=>(void 0===W&&Y.set(j.isProcessing||r.useManualTiming?j.timestamp:performance.now()),W),set:t=>{W=t,queueMicrotask(L)}},U=t=>e=>"string"==typeof e&&e.startsWith(t),X=U("--"),q=U("var(--"),z=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...H,transform:t=>e(0,1,t)},J={...H,default:1},Q=t=>Math.round(1e5*t)/1e5,tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const et=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nt=(t,e)=>n=>Boolean("string"==typeof n&&et.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),st=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(tt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},it={...H,transform:t=>Math.round((t=>e(0,255,t))(t))},rt={test:nt("rgb","red"),parse:st("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+Q(G.transform(s))+")"};const at={test:nt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:rt.transform},ot=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),lt=ot("deg"),ut=ot("%"),ht=ot("px"),ct=ot("vh"),dt=ot("vw"),pt=(()=>({...ut,parse:t=>ut.parse(t)/100,transform:t=>ut.transform(100*t)}))(),mt={test:nt("hsl","hue"),parse:st("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ut.transform(Q(e))+", "+ut.transform(Q(n))+", "+Q(G.transform(s))+")"},ft={test:t=>rt.test(t)||at.test(t)||mt.test(t),parse:t=>rt.test(t)?rt.parse(t):mt.test(t)?mt.parse(t):at.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?rt.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=ft.parse(t);return e.alpha=0,ft.transform(e)}},gt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const yt="number",vt="color",bt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(bt,t=>(ft.test(t)?(s.color.push(r),i.push(vt),n.push(ft.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(yt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function wt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],void 0!==s[r]){const t=e[r];i+=t===yt?Q(s[r]):t===vt?ft.transform(s[r]):s[r]}return i}}const Mt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:ft.test(n)?ft.getAnimatableNone(n):n;var n};const St={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(tt)?.length||0)+(t.match(gt)?.length||0)>0},parse:function(t){return Tt(t).values},createTransformer:function(t){return wt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return wt(e)(e.values.map((t,n)=>Mt(t,e.split[n])))}};function xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function At(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ct=[at,rt,mt];function Ft(t){const e=(n=t,Ct.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===mt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=xt(o,s,t+1/3),r=xt(o,s,t),a=xt(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Pt=(t,e)=>{const n=Ft(t),s=Ft(e);if(!n||!s)return At(t,e);const i={...n};return t=>(i.red=kt(n.red,s.red,t),i.green=kt(n.green,s.green,t),i.blue=kt(n.blue,s.blue,t),i.alpha=Vt(n.alpha,s.alpha,t),rt.transform(i))},Et=new Set(["none","hidden"]);function Bt(t,e){return n=>Vt(t,e,n)}function Rt(t){return"number"==typeof t?Bt:"string"==typeof t?z(t)?At:ft.test(t)?Pt:Ot:Array.isArray(t)?Dt:"object"==typeof t?ft.test(t)?Pt:It:At}function Dt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Rt(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function It(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Rt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Ot=(t,e)=>{const n=St.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Et.has(t)&&!r.values.length||Et.has(e)&&!i.values.length?function(t,e){return Et.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Dt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}(i,r),r.values),n):(s(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),At(t,e))};function Nt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);return Rt(t)(t,e)}const $t=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>K(e),now:()=>j.isProcessing?j.timestamp:Y.now()}},Kt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},jt=2e4;function Wt(t){let e=0;let n=t.next(e);for(;!n.done&&e<jt;)e+=50,n=t.next(e);return e>=jt?1/0:e}function Lt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Wt(s),jt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}const Yt=100,Ut=10,Xt=1,qt=0,zt=800,Zt=.3,_t=.3,Ht={granular:.01,default:2},Gt={granular:.005,default:.5},Jt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const se=.001;const ie=["duration","bounce"],re=["stiffness","damping","mass"];function ae(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let n={velocity:qt,stiffness:Yt,damping:Ut,mass:Xt,isResolvedFromDuration:!1,...t};if(!ae(t,re)&&ae(t,ie))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Xt,stiffness:r,damping:a}}else{const i=function({duration:t=zt,bounce:n=Zt,velocity:i=qt,mass:r=Xt}){let a,o;s(t<=m(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(te,ee,l),t=e(Jt,Qt,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ne(e,l),o=Math.exp(-s);return se-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ne(Math.pow(e,2),l);return(-a(e)+se>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=m(t),isNaN(u))return{stiffness:Yt,damping:Ut,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:Xt},n.isResolvedFromDuration=!0}return n}function le(t=_t,e=Zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-f(n.velocity||0)}),g=d||0,y=u/(2*Math.sqrt(l*h)),v=a-r,b=f(Math.sqrt(l/h)),T=Math.abs(v)<5;let w,M,S,x,A,V;if(s||(s=T?Ht.granular:Ht.default),i||(i=T?Gt.granular:Gt.default),y<1)S=ne(b,y),x=(g+y*b*v)/S,w=t=>{const e=Math.exp(-y*b*t);return a-e*(x*Math.sin(S*t)+v*Math.cos(S*t))},A=y*b*x+v*S,V=y*b*v-x*S,M=t=>Math.exp(-y*b*t)*(A*Math.sin(S*t)+V*Math.cos(S*t));else if(1===y){w=t=>a-Math.exp(-b*t)*(v+(g+b*v)*t);const t=g+b*v;M=e=>Math.exp(-b*e)*(b*t*e-g)}else{const t=b*Math.sqrt(y*y-1);w=e=>{const n=Math.exp(-y*b*e),s=Math.min(t*e,300);return a-n*((g+y*b*v)*Math.sinh(s)+t*v*Math.cosh(s))/t};const e=(g+y*b*v)/t,n=y*b*e-v*t,s=y*b*v-e*t;M=e=>{const i=Math.exp(-y*b*e),r=Math.min(t*e,300);return i*(n*Math.sinh(r)+s*Math.cosh(r))}}const k={calculatedDuration:p&&c||null,velocity:t=>m(M(t)),next:t=>{if(!p&&y<1){const e=Math.exp(-y*b*t),n=Math.sin(S*t),r=Math.cos(S*t),l=a-e*(x*n+v*r),u=m(e*(A*n+V*r));return o.done=Math.abs(u)<=s&&Math.abs(a-l)<=i,o.value=o.done?a:l,o}const e=w(t);if(p)o.done=t>=c;else{const n=m(M(t));o.done=Math.abs(n)<=s&&Math.abs(a-e)<=i}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Wt(k),jt),e=Kt(e=>k.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return k}le.applyToOptions=t=>{const e=Lt(t,100,le);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function ue(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}function he({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let m=n*e;const f=c+m,g=void 0===a?f:a(f);g!==f&&(m=g-c);const y=t=>-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(T=t,w=le({keyframes:[d.value,p(d.value)],velocity:ue(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function ce(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Nt,a=t.length-1;for(let n=0;n<a;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||u:e;r=c(t,r)}s.push(r)}return s}(n,a,o),m=p.length,f=e=>{if(h&&e<t[0])return n[0];let s=0;if(m>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=d(t[s],t[s+1],e);return p[s](i)};return s?n=>f(e(t[0],t[l-1],n)):f}function de(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Vt(n,1,i))}}function pe(t){const e=[0];return de(e,t.length-1),e}function me({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=E(s)?s.map(I):I(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:pe(e),t),o=ce(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const fe=t=>null!==t;function ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(fe),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ye={decay:he,inertia:he,tween:me,keyframes:me,spring:le};function ve(t){"string"==typeof t.type&&(t.type=ye[t.type])}class be{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Te=t=>t/100;class we extends be{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Y.now()&&this.tick(Y.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ve(t);const{type:e=me,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||me;o!==me&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Te,Nt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Wt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b=this.currentTime,T=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(T=a)),b=e(0,1,s)*o}const w=v?{done:!1,value:h[0]}:T.next(b);r&&!v&&(w.value=r(w.value));let{done:M}=w;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==he&&(w.value=ge(h,this.options,g,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(Y.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=$t,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Y.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Me=t=>180*t/Math.PI,Se=t=>{const e=Me(Math.atan2(t[1],t[0]));return Ae(e)},xe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,skewX:t=>Me(Math.atan(t[1])),skewY:t=>Me(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ae=t=>((t%=360)<0&&(t+=360),t),Ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ce={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ve,scaleY:ke,scale:t=>(Ve(t)+ke(t))/2,rotateX:t=>Ae(Me(Math.atan2(t[6],t[5]))),rotateY:t=>Ae(Me(Math.atan2(-t[2],t[0]))),rotateZ:Se,rotate:Se,skewX:t=>Me(Math.atan(t[4])),skewY:t=>Me(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Fe(t){return t.includes("scale")?1:0}function Pe(t,e){if(!t||"none"===t)return Fe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ce,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=xe,i=e}if(!i)return Fe(e);const r=s[e],a=i[1].split(",").map(Ee);return"function"==typeof r?r(a):a[r]}function Ee(t){return parseFloat(t.trim())}const Be=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Re=(()=>new Set(Be))(),De=t=>t===H||t===ht,Ie=new Set(["x","y","z"]),Oe=Be.filter(t=>!Ie.has(t));const Ne={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Pe(e,"x"),y:(t,{transform:e})=>Pe(e,"y")};Ne.translateX=Ne.x,Ne.translateY=Ne.y;const $e=new Set;let Ke=!1,je=!1,We=!1;function Le(){if(je){const t=Array.from($e).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Oe.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}je=!1,Ke=!1,$e.forEach(t=>t.complete(We)),$e.clear()}function Ye(){$e.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(je=!0)})}class Ue{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?($e.add(this),Ke||(Ke=!0,$.read(Ye),$.resolveKeyframes(Le))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$e.delete(this)}cancel(){"scheduled"===this.state&&($e.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Xe(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const qe={};function ze(t,e){const n=l(t);return()=>qe[e]??n()}const Ze=ze(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),_e=ze(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),He=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:He([0,.65,.55,1]),circOut:He([.55,0,1,.45]),backIn:He([.31,.01,.66,-.59]),backOut:He([.33,1.53,.69,.99])};function Je(t,e){return t?"function"==typeof t?_e()?Kt(t,e):"ease-out":R(t)?He(t):Array.isArray(t)?t.map(t=>Je(t,e)||Ge.easeOut):Ge[t]:void 0}function Qe(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=Je(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function tn(t){return"function"==typeof t&&"applyToOptions"in t}class en extends be{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return tn(t)&&_e()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Qe(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ge(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Xe(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ze()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):s(this)}}const nn={anticipate:x,backInOut:S,circInOut:k};function sn(t){"string"==typeof t.ease&&t.ease in nn&&(t.ease=nn[t.ease])}class rn extends en{constructor(t){sn(t),ve(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new we({...a,autoplay:!1}),l=Math.max(10,Y.now()-this.startTime),u=e(0,10,l-10),h=o.sample(l).value,{name:c}=this.options;r&&c&&Xe(r,c,h),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const an=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!St.test(t)&&"0"!==t||t.startsWith("url(")));function on(t){t.duration=0,t.type="keyframes"}const ln=new Set(["opacity","clipPath","filter","transform"]),un=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class hn extends be{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Y.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ue;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Y.now();let p=!0;(function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=an(r,e),l=an(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||tn(n))&&i)})(t,a,o,l)||(p=!1,!r.instantAnimations&&h||d?.(ge(t,n,e)),t[0]=t[t.length-1],on(n),n.repeat=0);const m={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=p&&!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return un()&&n&&ln.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(m),g=m.motionValue?.owner?.current,y=f?new rn({...m,element:g}):new we(m);y.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),We=!0,Ye(),Le(),We=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class cn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return dn(this.animations,"duration")}get iterationDuration(){return dn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function dn(t,e){let n=0;for(let s=0;s<t.length;s++){const i=t[s][e];null!==i&&i>n&&(n=i)}return n}class pn extends cn{then(t,e){return this.finished.finally(t).then(()=>{})}}const mn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=mn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return z(r)?fn(r,e,n+1):r}const gn={type:"spring",stiffness:500,damping:25,restSpeed:10},yn={type:"keyframes",duration:.8},vn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bn=(t,{keyframes:e})=>e.length>2?yn:Re.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:gn:vn,Tn=t=>null!==t;function wn(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Mn(t,e){const n=t?.[e]??t?.default??t;return n!==t?wn(n,t):n}const Sn=(t,e,n,s={},i,a)=>o=>{const l=Mn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,bn(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(on(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,on(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const s=t.filter(Tn);return s[e&&"loop"!==n&&e%2==1?0:s.length-1]}(c.keyframes,l);if(void 0!==t)return void $.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new we(c):new hn(c)};function xn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function An(t,e,n,s){if("function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Vn=new Set(["width","height","top","left","right","bottom",...Be]);class kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Y.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Y.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Y.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cn(t,e){return new kn(t,e)}function Fn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Cn(n))}function Pn(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function En(t,e){const n=function(t,e){const n=t.getProps();return An(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Fn(t,e,Pn(r[e]))}}const Bn=t=>Boolean(t&&t.getVelocity);function Rn(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Bn(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function Dn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const In="data-"+Dn("framerAppearId");function On(t){return t.props[In]}function Nn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function $n(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?wn(r,l):l;const u=r?.reduceMotion;s&&(r=s);const h=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||c&&Nn(c,e))continue;const a={delay:n,...Mn(r||{},e)},l=s.get();if(void 0!==l&&!s.isAnimating&&!Array.isArray(i)&&i===l&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=On(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(a.startTime=t,d=!0)}}Rn(t,e);const p=u??t.shouldReduceMotion;s.start(Sn(e,s,i,p&&Vn.has(e)?{type:!1}:a,t,d));const m=s.animation;m&&h.push(m)}if(a){const e=()=>$.update(()=>{a&&En(t,a)});h.length?Promise.all(h).then(e):e()}return h}const Kn=t=>e=>e.test(t),jn=[H,ht,ut,lt,dt,ct,{test:t=>"auto"===t,parse:t=>t}],Wn=t=>jn.find(Kn(t));function Ln(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const Yn=new Set(["brightness","contrast","saturate","opacity"]);function Un(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(tt)||[];if(!s)return t;const i=n.replace(s,"");let r=Yn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Xn=/\b([a-z-]*)\(.*?\)/gu,qn={...St,getAnimatableNone:t=>{const e=t.match(Xn);return e?e.map(Un).join(" "):t}},zn={...St,getAnimatableNone:t=>{const e=St.parse(t);return St.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Zn={...H,transform:Math.round},_n={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,top:ht,right:ht,bottom:ht,left:ht,inset:ht,insetBlock:ht,insetBlockStart:ht,insetBlockEnd:ht,insetInline:ht,insetInlineStart:ht,insetInlineEnd:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,paddingBlock:ht,paddingBlockStart:ht,paddingBlockEnd:ht,paddingInline:ht,paddingInlineStart:ht,paddingInlineEnd:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,marginBlock:ht,marginBlockStart:ht,marginBlockEnd:ht,marginInline:ht,marginInlineStart:ht,marginInlineEnd:ht,fontSize:ht,backgroundPositionX:ht,backgroundPositionY:ht,...{rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:lt,skewX:lt,skewY:lt,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:G,originX:pt,originY:pt,originZ:ht},zIndex:Zn,fillOpacity:G,strokeOpacity:G,numOctaves:Zn},Hn={..._n,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:qn,WebkitFilter:qn,mask:zn,WebkitMask:zn},Gn=t=>Hn[t],Jn=new Set([qn,zn]);function Qn(t,e){let n=Gn(t);return Jn.has(n)||(n=St),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ts=new Set(["auto","none","0"]);class es extends Ue{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),z(s))){const i=fn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Vn.has(n)||2!==t.length)return;const[s,i]=t,r=Wn(s),a=Wn(i);if(_(s)!==_(i)&&Ne[n])this.needsMeasurement=!0;else if(r!==a)if(De(r)&&De(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ne[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ln(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!ts.has(e)&&Tt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Qn(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ne[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ne[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ns=new Set(["opacity","clipPath","filter","transform"]);const ss=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:is}=N(queueMicrotask,!1);function rs(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const as=[...jn,ft,St],os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ls=new WeakMap;const us=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function hs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||us.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const cs={current:null},ds={current:!1},ps="undefined"!=typeof window;const ms=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fs={};class gs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ue,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=Y.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,$.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=hs(e),this.isVariantNode=function(t){return Boolean(hs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&Bn(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ls.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ds.current||function(){if(ds.current=!0,ps)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cs.current=t.matches;t.addEventListener("change",e),e()}else cs.current=!1}(),this.shouldReduceMotion=cs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ns.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new en({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:m(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Re.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in fs){const e=fs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ms.length;e++){const n=ms[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Bn(i))t.addValue(s,i);else if(Bn(r))t.addValue(s,Cn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Cn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Cn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!as.find(Kn(s))&&St.test(e)&&(n=Qn(t,e))),this.setBaseTarget(t,Bn(n)?n.get():n)),Bn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=An(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Bn(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){is.render(this.render)}}class ys extends gs{constructor(){super(...arguments),this.KeyframeResolver=es}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bs=Be.length;function Ts(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Re.has(t))a=!0;else if(X(t))i[t]=n;else{const e=ss(n,_n[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<bs;r++){const a=Be[r],o=t[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);l=a.startsWith("scale")?1===t:0===t}if(!l||n){const t=ss(o,_n[a]);l||(i=!1,s+=`${vs[a]||a}(${t}) `),n&&(e[a]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function ws(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in i?.applyProjectionStyles(r,s),n)r.setProperty(a,n[a])}function Ms(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ss={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ht.test(t))return t;t=parseFloat(t)}return`${Ms(t,e.target.x)}% ${Ms(t,e.target.y)}%`}},xs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=St.parse(t);if(i.length>5)return s;const r=St.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Vt(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},As={borderRadius:{...Ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ss,borderTopRightRadius:Ss,borderBottomLeftRadius:Ss,borderBottomRightRadius:Ss,boxShadow:xs};function Vs(t,{layout:e,layoutId:n}){return Re.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!As[t]||"opacity"===t)}function ks(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Bn(s[e])||i&&Bn(i[e])||Vs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Cs extends ys{constructor(){super(...arguments),this.type="html",this.renderInstance=ws}readValueFromInstance(t,e){if(Re.has(e))return this.projection?.isProjecting?Fe(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pe(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(X(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ts(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return ks(t,e,n)}}class Fs extends gs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ps={offset:"stroke-dashoffset",array:"stroke-dasharray"},Es={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rs(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(Ts(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox);for(const t of Bs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ps:Es;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const Ds=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Is extends ys{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=os}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Re.has(e)){const t=Gn(e);return t&&t.default||0}return e=Ds.has(e)?e:Dn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=ks(t,e,n);for(const n in t)(Bn(t[n])||Bn(e[n]))&&(s[-1!==Be.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Rs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){ws(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ds.has(n)?n:Dn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Os(t){return"object"==typeof t&&!Array.isArray(t)}function Ns(t,e,n,s){return null==t?[]:"string"==typeof t&&Os(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function $s(t,e,n){return t*(e+1)}function Ks(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function js(e,n,s,i,r,a){!function(e,n,s){for(let i=0;i<e.length;i++){const r=e[i];r.at>n&&r.at<s&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<n.length;t++)e.push({value:n[t],at:Vt(r,a,i[t]),easing:B(s,t)})}function Ws(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function Ls(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ys(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Us(t,e){return e[t]||(e[t]=[]),e[t]}function Xs(t){return Array.isArray(t)?t:[t]}function qs(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const zs=t=>"number"==typeof t,Zs=t=>t.every(zs);function _s(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=rs(t)&&!function(t){return rs(t)&&"svg"===t.tagName}(t)?new Is(e):new Cs(e);n.mount(t),ls.set(t,n)}function Hs(t){const e=new Fs({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ls.set(t,e)}function Gs(t,e,n,s){const r=[];if(function(t,e){return Bn(t)||"number"==typeof t||"string"==typeof t&&!Os(e)}(t,e))r.push(function(t,e,n){const s=Bn(t)?t:Cn(t);return s.start(Sn("",s,e,n)),s.animation}(t,Os(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=Ns(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t<o;t++){const s=a[t],i=s instanceof Element?_s:Hs;ls.has(s)||i(s);const l=ls.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),r.push(...$n(l,{...e,transition:u},{}))}}return r}function Js(t,e,n){const s=[],r=function(t,{defaultTransition:e={},...n}={},s,r){const a=e.duration||.3,o=new Map,l=new Map,u={},h=new Map;let c=0,p=0,f=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){h.set(o,p);continue}if(!Array.isArray(o)){h.set(o.name,Ks(p,o.at,c,h));continue}let[d,g,y={}]=o;void 0!==y.at&&(p=Ks(p,y.at,c,h));let v=0;const b=(t,n,s,o=0,l=0)=>{const u=Xs(t),{delay:h=0,times:c=pe(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:w=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,x=u.length,A=tn(d)?d:r?.[d||"keyframes"];if(x<=2&&A){let t=100;if(2===x&&Zs(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...T};void 0!==M&&(n.duration=m(M));const s=Lt(n,t,A);w=s.ease,M=s.duration}M??(M=a);const V=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&de(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=$s(M,g);const t=[...u],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s<g;s++){u.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),w.push(0===i?"linear":B(n,i-1))}Ws(c,g)}const C=V+M;js(s,u,w,c,V,C),v=Math.max(S+M,v),f=Math.max(C,f)};if(Bn(d))b(g,y,Us("default",Ys(d,l)));else{const t=Ns(d,g,s,u),e=t.length;for(let n=0;n<e;n++){const s=Ys(t[n],l);for(const t in g)b(g[t],qs(y,t),Us(t,s),n,e)}}c=p,p+=v}return l.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(Ls);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(d(0,f,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const h=o.get(s);h.keyframes[i]=a;const{type:c,...p}=e;h.transition[i]={...p,duration:f,ease:u,times:l,...n}}}),o}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Cn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:le});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Gs(n,t,e))}),s}function Qs(e={}){const{scope:n,reduceMotion:s}=e;return function(e,i,r){let a,o=[];if(l=e,Array.isArray(l)&&l.some(Array.isArray)){const{onComplete:t,...r}=i||{};"function"==typeof t&&(a=t),o=Js(e,void 0!==s?{reduceMotion:s,...r}:r,n)}else{const{onComplete:t,...l}=r||{};"function"==typeof t&&(a=t),o=Gs(e,i,void 0!==s?{reduceMotion:s,...l}:l,n)}var l;const u=new pn(o);return a&&u.finished.then(a),n&&(n.animations.push(u),u.finished.then(()=>{t(n.animations,u)})),u}}const ti=Qs();export{ti as animate,Qs as createScopedAnimate};
//# sourceMappingURL=size-rollup-animate.js.map

@@ -1,1 +0,1 @@

const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{a=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming?r.timestamp:performance.now();s=!1,i.useManualTiming||(r.delta=n?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:g,cancel:v,state:y}=m("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let b;function w(){b=void 0}const V={now:()=>(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&C.test(t.split("/*")[0].trim()),C=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function k(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...x,transform:e=>t(0,1,e)},E={...x,default:1},B=t=>Math.round(1e5*t)/1e5,P=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const R=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&R.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(P);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...x,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+B(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),K=Y("vh"),U=Y("vw"),Z=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(B(e))+", "+X.transform(B(s))+", "+B(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||z.test(t),parse:t=>$.test(t)?$.parse(t):z.test(t)?z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===H?B(n[r]):t===_?D.transform(n[r]):n[r]}return i}}const tt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(P)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},it=t=>null!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set(yt))(),wt=t=>t===x||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,Ct=!1,kt=!1;function xt(){if(Ct){const t=Array.from(Tt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return St.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ct=!1,At=!1,Tt.forEach(t=>t.complete(kt)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ct=!0)})}function Et(){kt=!0,Ft(),xt(),kt=!1}class Bt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(xt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Tt.delete(this)}cancel(){"scheduled"===this.state&&(Tt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Pt(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Rt={};function It(t,e){const s=o(t);return()=>Rt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Pt(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}function Kt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ut(t,e,s,n){if("function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Kt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Zt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zt(t,e){return new Zt(t,e)}const Dt=t=>Boolean(t&&t.getVelocity);function qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ht="data-"+qt("framerAppearId"),_t=t=>e=>e.test(t),Gt=[x,j,X,W,U,K,{test:t=>"auto"===t,parse:t=>t}],Jt=t=>Gt.find(_t(t)),Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(P)||[];if(!n)return t;const i=s.replace(n,"");let r=Qt.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,se={...et,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ne={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ie={...x,transform:Math.round},re={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:Z,originY:Z,originZ:j},zIndex:ie,fillOpacity:F,strokeOpacity:F,numOctaves:ie},ae={...re,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:se,WebkitFilter:se,mask:ne,WebkitMask:ne},oe=t=>ae[t],he=new Set([se,ne]);function le(t,e){let s=oe(t);return he.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ue=new Set(["opacity","clipPath","filter","transform"]),ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Gt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ce={};function ke(t){Ce=t}function xe(){return Ce}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,g.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=we(e),this.isVariantNode=Ve(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Dt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,me.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ue.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ce){const e=Ce[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ae.length;e++){const s=Ae[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Dt(i))t.addValue(n,i);else if(Dt(r))t.addValue(n,zt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,zt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=zt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(_t(n))&&et.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Dt(s)?s.get():s)),Dt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ut(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Dt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Be=yt.length;function Pe(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,re[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<Be;r++){const a=yt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ce(o,re[a]);h||(i=!1,n+=`${Ee[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Re(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ie={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Re(t,e.target.x)}% ${Re(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Dt(n[e])||i&&Dt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Pe(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const Ke=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ue(t,e,s){const n=Le(t,e,s);for(const s in t)if(Dt(t[s])||Dt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ze.indexOf(t)>-1||/[A-Z]/u.test(t))}export{k as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Pt as O,Xt as P,o as Q,Bt as R,Et as S,r as T,bt as U,yt as V,at as W,zt as X,a as Y,le as Z,Jt as _,we as a,Mt as a0,wt as a1,Fe as a2,ft as a3,gt as a4,M as a5,qt as a6,fe as a7,oe as a8,be as a9,ye as aa,ve as b,$e as c,Pe as d,je as e,Ke as f,ze as g,Ve as h,Dt as i,ge as j,Ue as k,xe as l,ke as m,h as n,Ht as o,p,n as q,Ut as r,Le as s,st as t,$ as u,z as v,L as w,s as x,A as y,D as z};
const t=(t,e,s)=>s>e?e:s<t?t:s;function e(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let s=()=>{},n=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,s,n)=>{t||"undefined"==typeof console||console.warn(e(s,n))},n=(t,s,n)=>{if(!t)throw new Error(e(s,n))});const i={},r=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),a=t=>/^0[^.\s]+$/u.test(t);function o(t){let e;return()=>(void 0===e&&(e=t()),e)}const h=t=>t;class l{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const u=t=>1e3*t,c=t=>t/1e3;function d(t,e){return e?t*(1e3/e):0}const p=t=>Array.isArray(t)&&"number"==typeof t[0],f=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function m(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=f.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:g}=o,v=()=>{const a=i.useManualTiming,o=a?r.timestamp:performance.now();s=!1,a||(r.delta=n?1e3/60:Math.max(Math.min(o-r.timestamp,40),1)),r.timestamp=o,r.isProcessing=!0,h.process(r),l.process(r),u.process(r),c.process(r),d.process(r),p.process(r),m.process(r),g.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(v))};return{schedule:f.reduce((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(v)),a.schedule(e,i,o)),e},{}),cancel:t=>{for(let e=0;e<f.length;e++)o[f[e]].cancel(t)},state:r,steps:o}}const{schedule:g,cancel:v,state:y}=m("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:h,!0);let b;function w(){b=void 0}const V={now:()=>(void 0===b&&V.set(y.isProcessing||i.useManualTiming?y.timestamp:performance.now()),b),set:t=>{b=t,queueMicrotask(w)}},S=t=>e=>"string"==typeof e&&e.startsWith(t),M=S("--"),T=S("var(--"),A=t=>!!T(t)&&x.test(t.split("/*")[0].trim()),x=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function C(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},F={...k,transform:e=>t(0,1,e)},E={...k,default:1},B=t=>Math.round(1e5*t)/1e5,P=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const R=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,I=(t,e)=>s=>Boolean("string"==typeof s&&R.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),N=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match(P);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},O={...k,transform:e=>Math.round((e=>t(0,255,e))(e))},$={test:I("rgb","red"),parse:N("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+O.transform(t)+", "+O.transform(e)+", "+O.transform(s)+", "+B(F.transform(n))+")"};const L={test:I("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:$.transform},Y=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),W=Y("deg"),X=Y("%"),j=Y("px"),z=Y("vh"),K=Y("vw"),U=(()=>({...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(100*t)}))(),Z={test:I("hsl","hue"),parse:N("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+X.transform(B(e))+", "+X.transform(B(s))+", "+B(F.transform(n))+")"},D={test:t=>$.test(t)||L.test(t)||Z.test(t),parse:t=>$.test(t)?$.parse(t):Z.test(t)?Z.parse(t):L.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?$.transform(t):Z.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const H="number",_="color",G=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function J(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(G,t=>(D.test(t)?(n.color.push(r),i.push(_),s.push(D.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(H),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function Q({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===H?B(n[r]):t===_?D.transform(n[r]):n[r]}return i}}const tt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:D.test(s)?D.getAnimatableNone(s):s;var s};const et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(P)?.length||0)+(t.match(q)?.length||0)>0},parse:function(t){return J(t).values},createTransformer:function(t){return Q(J(t))},getAnimatableNone:function(t){const e=J(t);return Q(e)(e.values.map((t,s)=>tt(t,e.split[s])))}},st=(t,e,s)=>t+(e-t)*s,nt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},it=t=>null!==t;function rt(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(it),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class at{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const ot=t=>180*t/Math.PI,ht=t=>{const e=ot(Math.atan2(t[1],t[0]));return ut(e)},lt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ht,rotateZ:ht,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ut=t=>((t%=360)<0&&(t+=360),t),ct=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),dt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),pt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ct,scaleY:dt,scale:t=>(ct(t)+dt(t))/2,rotateX:t=>ut(ot(Math.atan2(t[6],t[5]))),rotateY:t=>ut(ot(Math.atan2(-t[2],t[0]))),rotateZ:ht,rotate:ht,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ft(t){return t.includes("scale")?1:0}function mt(t,e){if(!t||"none"===t)return ft(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=pt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lt,i=e}if(!i)return ft(e);const r=n[e],a=i[1].split(",").map(vt);return"function"==typeof r?r(a):a[r]}const gt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return mt(s,e)};function vt(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=(()=>new Set(yt))(),wt=t=>t===k||t===j,Vt=new Set(["x","y","z"]),St=yt.filter(t=>!Vt.has(t));const Mt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>mt(e,"x"),y:(t,{transform:e})=>mt(e,"y")};Mt.translateX=Mt.x,Mt.translateY=Mt.y;const Tt=new Set;let At=!1,xt=!1,Ct=!1;function kt(){if(xt){const t=Array.from(Tt).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return St.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}xt=!1,At=!1,Tt.forEach(t=>t.complete(Ct)),Tt.clear()}function Ft(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xt=!0)})}function Et(){Ct=!0,Ft(),kt(),Ct=!1}class Bt{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Tt.add(this),At||(At=!0,g.read(Ft),g.resolveKeyframes(kt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Tt.delete(this)}cancel(){"scheduled"===this.state&&(Tt.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function Pt(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Rt={};function It(t,e){const s=o(t);return()=>Rt[e]??s()}const Nt=It(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ot=It(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$t=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Lt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function Yt(t,e){return t?"function"==typeof t?Ot()?nt(t,e):"ease-out":p(t)?$t(t):Array.isArray(t)?t.map(t=>Yt(t,e)||Lt.easeOut):Lt[t]:void 0}function Wt(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Yt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Xt(t){return"function"==typeof t&&"applyToOptions"in t}class jt extends at{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Xt(t)&&Ot()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Wt(e,s,i,l,r),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=rt(i,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Pt(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=u(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Nt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),h):n(this)}}function zt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Kt(t,e,s,n){if("function"==typeof e){const[i,r]=zt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=zt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class Ut{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=V.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=V.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new l);const s=this.events[t].add(e);return"change"===t?()=>{s(),g.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=V.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return d(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zt(t,e){return new Ut(t,e)}const Dt=t=>Boolean(t&&t.getVelocity);function qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ht="data-"+qt("framerAppearId"),_t=t=>e=>e.test(t),Gt=[k,j,X,W,K,z,{test:t=>"auto"===t,parse:t=>t}],Jt=t=>Gt.find(_t(t)),Qt=new Set(["brightness","contrast","saturate","opacity"]);function te(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(P)||[];if(!n)return t;const i=s.replace(n,"");let r=Qt.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ee=/\b([a-z-]*)\(.*?\)/gu,se={...et,getAnimatableNone:t=>{const e=t.match(ee);return e?e.map(te).join(" "):t}},ne={...et,getAnimatableNone:t=>{const e=et.parse(t);return et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ie={...k,transform:Math.round},re={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...{rotate:W,rotateX:W,rotateY:W,rotateZ:W,scale:E,scaleX:E,scaleY:E,scaleZ:E,skew:W,skewX:W,skewY:W,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:F,originX:U,originY:U,originZ:j},zIndex:ie,fillOpacity:F,strokeOpacity:F,numOctaves:ie},ae={...re,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:se,WebkitFilter:se,mask:ne,WebkitMask:ne},oe=t=>ae[t],he=new Set([se,ne]);function le(t,e){let s=oe(t);return he.has(s)||(s=et),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const ue=new Set(["opacity","clipPath","filter","transform"]),ce=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:de}=m(queueMicrotask,!1),pe=[...Gt,D,et],fe=()=>({x:{min:0,max:0},y:{min:0,max:0}}),me=new WeakMap;function ge(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ve(t){return"string"==typeof t||Array.isArray(t)}const ye=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],be=["initial",...ye];function we(t){return ge(t.animate)||be.some(e=>ve(t[e]))}function Ve(t){return Boolean(we(t)||t.variants)}const Se={current:null},Me={current:!1},Te="undefined"!=typeof window;const Ae=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xe={};function Ce(t){xe=t}function ke(){return xe}class Fe{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=V.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,g.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=we(e),this.isVariantNode=Ve(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Dt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,me.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Me.current||function(){if(Me.current=!0,Te)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Se.current=t.matches;t.addEventListener("change",e),e()}else Se.current=!1}(),this.shouldReduceMotion=Se.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),v(this.notifyUpdate),v(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ue.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new jt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:u(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&g.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in xe){const e=xe[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ae.length;e++){const s=Ae[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Dt(i))t.addValue(n,i);else if(Dt(r))t.addValue(n,Zt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Zt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Zt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(r(s)||a(s))?s=parseFloat(s):(n=s,!pe.find(_t(n))&&et.test(e)&&(s=le(t,e))),this.setBaseTarget(t,Dt(s)?s.get():s)),Dt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Kt(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Dt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new l),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){de.render(this.render)}}const Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Be=yt.length;function Pe(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(bt.has(t))a=!0;else if(M(t))i[t]=s;else{const e=ce(s,re[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<Be;r++){const a=yt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ce(o,re[a]);h||(i=!1,n+=`${Ee[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Re(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ie={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!j.test(t))return t;t=parseFloat(t)}return`${Re(t,e.target.x)}% ${Re(t,e.target.y)}%`}},Ne={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=et.parse(t);if(i.length>5)return n;const r=et.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=st(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},Oe={borderRadius:{...Ie,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomLeftRadius:Ie,borderBottomRightRadius:Ie,boxShadow:Ne};function $e(t,{layout:e,layoutId:s}){return bt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!Oe[t]||"opacity"===t)}function Le(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Dt(n[e])||i&&Dt(i[e])||$e(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ye={offset:"stroke-dashoffset",array:"stroke-dasharray"},We={offset:"strokeDashoffset",array:"strokeDasharray"};const Xe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function je(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Pe(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of Xe)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ye:We;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const ze=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ke(t,e,s){const n=Le(t,e,s);for(const s in t)if(Dt(t[s])||Dt(e[s])){n[-1!==yt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}const Ue=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ze(t){return"string"==typeof t&&!t.includes("-")&&!!(Ue.indexOf(t)>-1||/[A-Z]/u.test(t))}export{C as $,et as A,J as B,y as C,V as D,v as E,g as F,c as G,t as H,nt as I,u as J,d as K,rt as L,i as M,jt as N,Pt as O,Xt as P,o as Q,Bt as R,Et as S,r as T,bt as U,yt as V,at as W,Zt as X,a as Y,le as Z,Jt as _,we as a,Mt as a0,wt as a1,Fe as a2,ft as a3,gt as a4,M as a5,qt as a6,fe as a7,oe as a8,be as a9,ye as aa,ve as b,$e as c,Pe as d,je as e,ze as f,Ze as g,Ve as h,Dt as i,ge as j,Ke as k,ke as l,Ce as m,h as n,Ht as o,p,n as q,Kt as r,Le as s,st as t,$ as u,Z as v,L as w,s as x,A as y,D as z};

@@ -1,1 +0,1 @@

import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as o,useContext as e,useMemo as r,Fragment as a,createElement as i,useRef as s,useInsertionEffect as u,useCallback as c,useLayoutEffect as l,useEffect as d,forwardRef as f}from"react";import{i as m,a as p,b as y,c as g,d as v,e as h,f as w,g as S,P as M,r as b,h as E,j as P,k as T,s as C,l as j,m as A,n as V,S as x,o as I,p as L,L as k}from"./size-rollup-dom-max-assets.js";const W=o({strict:!1}),H=o({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),O=o({});function D(t){const{initial:n,animate:o}=function(t,n){if(m(t)){const{initial:n,animate:o}=t;return{initial:!1===n||p(n)?n:void 0,animate:p(o)?o:void 0}}return!1!==t.inherit?n:{}}(t,e(O));return r(()=>({initial:n,animate:o}),[F(n),F(o)])}function F(t){return Array.isArray(t)?t.join(" "):t}const R=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N(t,n,o){for(const e in n)y(n[e])||g(e,o)||(t[e]=n[e])}function B(t,n){const o={};return N(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n){return r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{}};return v(o,n,t),Object.assign({},o.vars,o.style)},[n])}(t,n)),o}function q(t,n){const o={},e=B(t,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=e,o}const U=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function $(t,n,o,e){const a=r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return h(o,n,w(e),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[n]);if(t.style){const n={};N(n,t.style,t),a.style={...n,...a.style}}return a}const _=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function z(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_.has(t)}let G=t=>!z(t);try{"function"==typeof(X=require("@emotion/is-prop-valid").default)&&(G=t=>t.startsWith("on")?!z(t):X(t))}catch{}var X;function Y(t,n,o,{latestValues:e},s,u=!1,c){const l=(c??S(t)?$:q)(n,e,s,t),d=function(t,n,o){const e={};for(const r in t)"values"===r&&"object"==typeof t.values||(G(r)||!0===o&&z(r)||!n&&!z(r)||t.draggable&&r.startsWith("onDrag"))&&(e[r]=t[r]);return e}(n,"string"==typeof t,u),f=t!==a?{...d,...l,ref:o}:{},{children:m}=n,p=r(()=>y(m)?m.get():m,[m]);return i(t,{...f,children:p})}function J(t,n,o,e){const r={},a=e(t,{});for(const t in a)r[t]=b(a[t]);let{initial:i,animate:s}=t;const u=m(t),c=E(t);n&&c&&!u&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let l=!!o&&!1===o.initial;l=l||!1===i;const d=l?s:i;if(d&&"boolean"!=typeof d&&!P(d)){const n=Array.isArray(d)?d:[d];for(let o=0;o<n.length;o++){const e=T(t,n[o]);if(e){const{transitionEnd:t,transition:n,...o}=e;for(const t in o){let n=o[t];if(Array.isArray(n)){n=n[l?n.length-1:0]}null!==n&&(r[t]=n)}for(const n in t)r[n]=t[n]}}}return r}const K=t=>(n,o)=>{const r=e(O),a=e(M),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},o,e,r){return{latestValues:J(o,e,r,t),renderState:n()}}(t,n,r,a);return o?i():function(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}(i)},Q=K({scrapeMotionValuesFromProps:C,createRenderState:R}),Z=K({scrapeMotionValuesFromProps:j,createRenderState:U}),tt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let nt=!1;function ot(){return function(){if(nt)return;const t={};for(const n in tt)t[n]={isEnabled:t=>tt[n].some(n=>!!t[n])};V(t),nt=!0}(),A()}const et=Symbol.for("motionComponentSymbol");function rt(t,n,o){const e=s(o);u(()=>{e.current=o});const r=s(null);return c(o=>{o&&t.onMount?.(o);const a=e.current;if("function"==typeof a)if(o){const t=a(o);"function"==typeof t&&(r.current=t)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o);n&&(o?n.mount(o):n.unmount())},[n])}const at="undefined"!=typeof window?l:d;function it(t,n,o,r,a,i){const{visualElement:c}=e(O),l=e(W),f=e(M),m=e(H),p=m.reducedMotion,y=m.skipAnimations,g=s(null),v=s(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:n,parent:c,props:o,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:p,skipAnimations:y,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const h=g.current,w=e(x);!h||h.projection||!a||"html"!==h.type&&"svg"!==h.type||function(t,n,o,e){const{layoutId:r,layout:a,drag:i,dragConstraints:s,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=n;t.projection=new o(t.latestValues,n["data-framer-portal-id"]?void 0:st(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:Boolean(i)||s&&L(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:l,layoutScroll:u,layoutRoot:c})}(g.current,o,a,w);const S=s(!1);u(()=>{h&&S.current&&h.update(o,f)});const b=o[I],E=s(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return at(()=>{v.current=!0,h&&(S.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),E.current&&h.animationState&&h.animationState.animateChanges())}),d(()=>{h&&(!E.current&&h.animationState&&h.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),E.current=!1),h.enteringChildren=void 0)}),h}function st(t){if(t)return!1!==t.options.allowProjection?t.projection:st(t.parent)}function ut(o,{forwardMotionProps:r=!1,type:a}={},i,s){const u=a?"svg"===a:S(o),c=u?Z:Q;function l(a,i){let l;const d={...e(H),...a,layoutId:ct(a)},{isStatic:f}=d,m=D(a),p=c(a,f);if(!f&&"undefined"!=typeof window){e(W).strict;const t=function(t){const n=ot(),{drag:o,layout:e}=n;if(!o&&!e)return{};const r={...o,...e};return{MeasureLayout:o?.isEnabled(t)||e?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(d);l=t.MeasureLayout,m.visualElement=it(o,p,d,s,t.ProjectionNode,u)}return t(O.Provider,{value:m,children:[l&&m.visualElement?n(l,{visualElement:m.visualElement,...d}):null,Y(o,a,rt(p,m.visualElement,i),p,f,r,u)]})}l.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const d=f(l);return d[et]=o,d}function ct({layoutId:t}){const n=e(k).id;return n&&void 0!==t?n+"-"+t:t}function lt(t,n){return ut(t,n)}const dt=lt("div");export{dt as MotionDiv};
import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as o,useContext as e,useMemo as r,Fragment as a,createElement as i,useRef as s,useInsertionEffect as u,useCallback as c,useLayoutEffect as l,useEffect as d,forwardRef as f}from"react";import{i as m,a as p,b as y,c as g,d as v,e as h,f as w,g as S,P as M,r as b,h as E,j as P,k as T,s as C,l as j,m as A,n as V,S as x,o as I,p as L,L as k}from"./size-rollup-dom-max-assets.js";const W=o({strict:!1}),H=o({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),O=o({});function D(t){const{initial:n,animate:o}=function(t,n){if(m(t)){const{initial:n,animate:o}=t;return{initial:!1===n||p(n)?n:void 0,animate:p(o)?o:void 0}}return!1!==t.inherit?n:{}}(t,e(O));return r(()=>({initial:n,animate:o}),[F(n),F(o)])}function F(t){return Array.isArray(t)?t.join(" "):t}const R=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function N(t,n,o){for(const e in n)y(n[e])||g(e,o)||(t[e]=n[e])}function B(t,n){const o={};return N(o,t.style||{},t),Object.assign(o,function({transformTemplate:t},n){return r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{}};return v(o,n,t),Object.assign({},o.vars,o.style)},[n])}(t,n)),o}function q(t,n){const o={},e=B(t,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=e,o}const U=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function $(t,n,o,e){const a=r(()=>{const o={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return h(o,n,w(e),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[n]);if(t.style){const n={};N(n,t.style,t),a.style={...n,...a.style}}return a}const _=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function z(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_.has(t)}let G=t=>!z(t);try{"function"==typeof(X=require("@emotion/is-prop-valid").default)&&(G=t=>t.startsWith("on")?!z(t):X(t))}catch{}var X;function Y(t,n,o,{latestValues:e},s,u=!1,c){const l=(c??S(t)?$:q)(n,e,s,t),d=function(t,n,o){const e={};for(const r in t)"values"===r&&"object"==typeof t.values||y(t[r])||(G(r)||!0===o&&z(r)||!n&&!z(r)||t.draggable&&r.startsWith("onDrag"))&&(e[r]=t[r]);return e}(n,"string"==typeof t,u),f=t!==a?{...d,...l,ref:o}:{},{children:m}=n,p=r(()=>y(m)?m.get():m,[m]);return i(t,{...f,children:p})}function J(t,n,o,e){const r={},a=e(t,{});for(const t in a)r[t]=b(a[t]);let{initial:i,animate:s}=t;const u=m(t),c=E(t);n&&c&&!u&&!1!==t.inherit&&(void 0===i&&(i=n.initial),void 0===s&&(s=n.animate));let l=!!o&&!1===o.initial;l=l||!1===i;const d=l?s:i;if(d&&"boolean"!=typeof d&&!P(d)){const n=Array.isArray(d)?d:[d];for(let o=0;o<n.length;o++){const e=T(t,n[o]);if(e){const{transitionEnd:t,transition:n,...o}=e;for(const t in o){let n=o[t];if(Array.isArray(n)){n=n[l?n.length-1:0]}null!==n&&(r[t]=n)}for(const n in t)r[n]=t[n]}}}return r}const K=t=>(n,o)=>{const r=e(O),a=e(M),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},o,e,r){return{latestValues:J(o,e,r,t),renderState:n()}}(t,n,r,a);return o?i():function(t){const n=s(null);return null===n.current&&(n.current=t()),n.current}(i)},Q=K({scrapeMotionValuesFromProps:C,createRenderState:R}),Z=K({scrapeMotionValuesFromProps:j,createRenderState:U}),tt={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let nt=!1;function ot(){return function(){if(nt)return;const t={};for(const n in tt)t[n]={isEnabled:t=>tt[n].some(n=>!!t[n])};V(t),nt=!0}(),A()}const et=Symbol.for("motionComponentSymbol");function rt(t,n,o){const e=s(o);u(()=>{e.current=o});const r=s(null);return c(o=>{o&&t.onMount?.(o);const a=e.current;if("function"==typeof a)if(o){const t=a(o);"function"==typeof t&&(r.current=t)}else r.current?(r.current(),r.current=null):a(o);else a&&(a.current=o);n&&(o?n.mount(o):n.unmount())},[n])}const at="undefined"!=typeof window?l:d;function it(t,n,o,r,a,i){const{visualElement:c}=e(O),l=e(W),f=e(M),m=e(H),p=m.reducedMotion,y=m.skipAnimations,g=s(null),v=s(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:n,parent:c,props:o,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:p,skipAnimations:y,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const h=g.current,w=e(x);!h||h.projection||!a||"html"!==h.type&&"svg"!==h.type||function(t,n,o,e){const{layoutId:r,layout:a,drag:i,dragConstraints:s,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=n;t.projection=new o(t.latestValues,n["data-framer-portal-id"]?void 0:st(t.parent)),t.projection.setOptions({layoutId:r,layout:a,alwaysMeasureLayout:Boolean(i)||s&&L(s),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:l,layoutScroll:u,layoutRoot:c})}(g.current,o,a,w);const S=s(!1);u(()=>{h&&S.current&&h.update(o,f)});const b=o[I],E=s(Boolean(b)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return at(()=>{v.current=!0,h&&(S.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),E.current&&h.animationState&&h.animationState.animateChanges())}),d(()=>{h&&(!E.current&&h.animationState&&h.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),E.current=!1),h.enteringChildren=void 0)}),h}function st(t){if(t)return!1!==t.options.allowProjection?t.projection:st(t.parent)}function ut(o,{forwardMotionProps:r=!1,type:a}={},i,s){const u=a?"svg"===a:S(o),c=u?Z:Q;function l(a,i){let l;const d={...e(H),...a,layoutId:ct(a)},{isStatic:f}=d,m=D(a),p=c(a,f);if(!f&&"undefined"!=typeof window){e(W).strict;const t=function(t){const n=ot(),{drag:o,layout:e}=n;if(!o&&!e)return{};const r={...o,...e};return{MeasureLayout:o?.isEnabled(t)||e?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(d);l=t.MeasureLayout,m.visualElement=it(o,p,d,s,t.ProjectionNode,u)}return t(O.Provider,{value:m,children:[l&&m.visualElement?n(l,{visualElement:m.visualElement,...d}):null,Y(o,a,rt(p,m.visualElement,i),p,f,r,u)]})}l.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const d=f(l);return d[et]=o,d}function ct({layoutId:t}){const n=e(k).id;return n&&void 0!==t?n+"-"+t:t}function lt(t,n){return ut(t,n)}const dt=lt("div");export{dt as MotionDiv};

@@ -1,1 +0,1 @@

import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as T,M as b,W as x,L as A,N as S,O as M,P as k,Q as C,R as V,S as E,T as P,U as D,r as O,V as F,X as I,i as L,o as K,Y as R,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as H,a3 as $,a4 as G,a5 as W,d as _,s as z,a6 as Y,a7 as X,k as J,e as Z,f as Q,a8 as tt,b as et,a9 as nt,j as it,aa as st,g as rt}from"./size-rollup-dom-animation-assets.js";import{Fragment as ot}from"react";const at=(t,e)=>n=>e(t(n)),ut=(...t)=>t.reduce(at),lt=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ct=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ht(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ct(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ct(r(t),n,s)}const dt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pt=t=>e=>1-t(1-e),mt=ht(.33,1.53,.69,.99),ft=pt(mt),yt=dt(ft),vt=t=>(t*=2)<1?.5*ft(t):.5*(2-Math.pow(2,-10*(t-1))),gt=t=>1-Math.sin(Math.acos(t)),wt=pt(gt),Tt=dt(gt),bt=ht(.42,0,1,1),xt=ht(0,0,.58,1),At=ht(.42,0,.58,1),St={linear:t,easeIn:bt,easeInOut:At,easeOut:xt,circIn:gt,circInOut:Tt,circOut:wt,backIn:ft,backInOut:yt,backOut:mt,anticipate:vt},Mt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return ht(e,i,s,r)}return"string"==typeof t?(n(void 0!==St[t],`Invalid easing type '${t}'`,"invalid-easing-type"),St[t]):t};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ct(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Et=[o,s,r];function Pt(t){const e=(n=t,Et.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=kt(a,i,t+1/3),r=kt(a,i,t),o=kt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Dt=(t,e)=>{const n=Pt(t),r=Pt(e);if(!n||!r)return Ct(t,e);const o={...n};return t=>(o.red=Vt(n.red,r.red,t),o.green=Vt(n.green,r.green,t),o.blue=Vt(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},Ot=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function It(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Ct:l.test(t)?Dt:Rt:Array.isArray(t)?Lt:"object"==typeof t?l.test(t)?Dt:Kt:Ct}function Lt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Kt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=It(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Rt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ot.has(t)&&!s.values.length||Ot.has(e)&&!i.values.length?function(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):ut(Lt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(a(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ct(t,e))};function Bt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return i(t,e,n);return It(t)(t,e)}const jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},qt=2e4;function Nt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}const Ut=100,Ht=10,$t=1,Gt=0,Wt=800,_t=.3,zt=.3,Yt={granular:.01,default:2},Xt={granular:.005,default:.5},Jt=.01,Zt=10,Qt=.05,te=1;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=.001;const ie=["duration","bounce"],se=["stiffness","damping","mass"];function re(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let e={velocity:Gt,stiffness:Ut,damping:Ht,mass:$t,isResolvedFromDuration:!1,...t};if(!re(t,se)&&re(t,ie))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:$t,stiffness:s,damping:r}}else{const n=function({duration:t=Wt,bounce:e=_t,velocity:n=Gt,mass:i=$t}){let s,r;a(t<=w(Zt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(Qt,te,o),t=v(Jt,Zt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ee(e,o),u=Math.exp(-s);return ne-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ee(Math.pow(e,2),o);return(-s(e)+ne>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=w(t),isNaN(u))return{stiffness:Ut,damping:Ht,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:$t},e.isResolvedFromDuration=!0}return e}function ae(t=zt,e=_t){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,T=y(Math.sqrt(u/c)),b=Math.abs(v)<5;let x,A,S,M,k,C;if(i||(i=b?Yt.granular:Yt.default),s||(s=b?Xt.granular:Xt.default),f<1)S=ee(T,f),M=(m+f*T*v)/S,x=t=>{const e=Math.exp(-f*T*t);return o-e*(M*Math.sin(S*t)+v*Math.cos(S*t))},k=f*T*M+v*S,C=f*T*v-M*S,A=t=>Math.exp(-f*T*t)*(k*Math.sin(S*t)+C*Math.cos(S*t));else if(1===f){x=t=>o-Math.exp(-T*t)*(v+(m+T*v)*t);const t=m+T*v;A=e=>Math.exp(-T*e)*(T*t*e-m)}else{const t=T*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*T*e),i=Math.min(t*e,300);return o-n*((m+f*T*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(m+f*T*v)/t,n=f*T*e-v*t,i=f*T*v-e*t;A=e=>{const s=Math.exp(-f*T*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const V={calculatedDuration:p&&h||null,velocity:t=>w(A(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*T*t),n=Math.sin(S*t),r=Math.cos(S*t),u=o-e*(M*n+v*r),l=w(e*(k*n+C*r));return a.done=Math.abs(l)<=i&&Math.abs(o-u)<=s,a.value=a.done?o:u,a}const e=x(t);if(p)a.done=t>=h;else{const n=w(A(t));a.done=Math.abs(n)<=i&&Math.abs(o-e)<=s}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Nt(V),qt),e=g(e=>V.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return V}ae.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Nt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ae);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};function ue(t,e,n){const i=Math.max(e-5,0);return T(n-t(i),e-i)}function le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,y=void 0===o?f:o(f);y!==f&&(m=y-h);const v=t=>-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let T,b;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(T=t,b=ae({keyframes:[d.value,p(d.value)],velocity:ue(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==T||(e=!0,w(t),x(t)),void 0!==T&&t>=T?b.next(t-T):(!e&&w(t),d)}}}function ce(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||b.mix||Bt,o=e.length-1;for(let i=0;i<o;i++){let o=r(e[i],e[i+1]);if(n){const e=Array.isArray(n)?n[i]||t:n;o=ut(e,o)}s.push(o)}return s}(i,r,o),c=l.length,h=t=>{if(u&&t<e[0])return i[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=lt(e[n],e[n+1],t);return l[n](s)};return s?t=>h(v(e[0],e[a-1],t)):h}function he(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=lt(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function de({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Mt):Mt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:he(e),t),a=ce(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||At).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const pe={decay:le,inertia:le,tween:de,keyframes:de,spring:ae};function me(t){"string"==typeof t.type&&(t.type=pe[t.type])}const fe=t=>t/100;class ye extends x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=de,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||de;a!==de&&"number"!=typeof o[0]&&(this.mixKeyframes=ut(fe,Bt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Nt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),w=v(0,1,n)*o}const b=g?{done:!1,value:l[0]}:T.next(w);s&&!g&&(b.value=s(b.value));let{done:x}=b;g||null===a||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&p!==le&&(b.value=A(l,this.options,f,this.speed)),m&&m(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=jt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve={anticipate:vt,backInOut:yt,circInOut:Tt};function ge(t){"string"==typeof t.ease&&t.ease in ve&&(t.ease=ve[t.ease])}class we extends S{constructor(t){ge(t),me(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=v(0,10,a-10),l=o.sample(a).value,{name:c}=this.options;s&&c&&M(s,c,l),e.setWithVelocity(o.sample(Math.max(0,a-u)).value,l,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function be(t){t.duration=0,t.type="keyframes"}const xe=new Set(["opacity","clipPath","filter","transform"]),Ae=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Se extends x{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||V;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||k(n))&&i)}(e,r,o,u)||(!b.instantAnimations&&l||h?.(A(e,i,n)),e[0]=e[e.length-1],be(i),i.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},m=!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return Ae()&&n&&xe.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(d),f=d.motionValue?.owner?.current,y=m?new we({...d,element:f}):new ye(d);y.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),E()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Me(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ce(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return P(t)?parseFloat(t):t}return u(r)?Ce(r,e,i+1):r}const Ve={type:"spring",stiffness:500,damping:25,restSpeed:10},Ee={type:"keyframes",duration:.8},Pe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},De=(t,{keyframes:e})=>e.length>2?Ee:D.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ve:Pe,Oe=t=>null!==t;function Fe(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ie(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fe(n,t):n}const Le=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=w(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,De(t,c)),c.duration&&(c.duration=w(c.duration)),c.repeatDelay&&(c.repeatDelay=w(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(be(c),0===c.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,be(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const i=t.filter(Oe);return i[e&&"loop"!==n&&e%2==1?0:i.length-1]}(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ye(c):new Se(c)};function Ke(t,e,n){const i=t.getProps();return O(i,e,void 0!==n?n:i.custom,t)}const Re=new Set(["width","height","top","left","right","bottom",...F]),Be=t=>Array.isArray(t);function je(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,I(n))}function qe(t){return Be(t)?t[t.length-1]||0:t}function Ne(t,e){const n=t.getValue("willChange");if(i=n,Boolean(L(i)&&i.add))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ue(t){return t.props[K]}function He({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function $e(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Fe(r,u):u;const l=r?.reduceMotion;i&&(r=i);const c=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&He(h,e))continue;const o={delay:n,...Ie(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Ue(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,d=!0)}}Ne(t,e);const p=l??t.shouldReduceMotion;i.start(Le(e,i,s,p&&Re.has(e)?{type:!1}:o,t,d));const m=i.animation;m&&c.push(m)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=Ke(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)je(t,e,qe(r[e]))}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function Ge(t,e,n={}){const i=Ke(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all($e(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Ge(u,e,{...o,delay:n+("function"==typeof i?0:i)+Me(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function We(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||R(t))}const _e=new Set(["auto","none","0"]);class ze extends V{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=Ce(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Re.has(n)||2!==t.length)return;const[i,s]=t,r=j(i),o=j(s);if(q(i)!==q(s)&&N[n])this.needsMeasurement=!0;else if(r!==o)if(U(r)&&U(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else N[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||We(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!_e.has(e)&&h(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=B(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=N[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=N[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ye=!1;function Xe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Je(t){return!("touch"===t.pointerType||Ye)}function Ze(t,e,n={}){const[i,s,r]=Xe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!Je(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const Qe=(t,e)=>!!e&&(t===e||Qe(t,e.parentElement)),tn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const en=new WeakSet;function nn(t){return e=>{"Enter"===e.key&&t(e)}}function sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const on=new WeakSet;function an(t,e,n={}){const[i,s,r]=Xe(t,n),o=t=>{const i=t.currentTarget;if(!rn(t))return;if(on.has(t))return;en.add(i),n.stopPropagation&&on.add(t);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),en.has(i)&&en.delete(i),rn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Qe(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=nn(()=>{if(en.has(n))return;sn(n,"down");const t=nn(()=>{sn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>sn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return tn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class un extends H{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;L(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class hn extends un{constructor(){super(...arguments),this.type="html",this.renderInstance=cn}readValueFromInstance(t,e){if(D.has(e))return this.projection?.isProjecting?$(e):G(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){_(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return z(t,e,n)}}const dn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class pn extends un{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(D.has(e)){const t=tt(e);return t&&t.default||0}return e=dn.has(e)?e:Y(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return J(t,e,n)}build(t,e,n){Z(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){cn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dn.has(n)?n:Y(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Q(t.tagName),super.mount(t)}}const mn=nt.length;function fn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&fn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<mn;n++){const i=nt[n],s=t.props[i];(et(s)||!1===s)&&(e[i]=s)}return e}function yn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const vn=[...st].reverse(),gn=st.length;function wn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Ge(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Ge(t,e,n);else{const s="function"==typeof e?Ke(t,e,n.custom):e;i=Promise.all($e(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Tn(t){let e=wn(t),n=An(),i=!0,s=!1;const r=e=>(n,i)=>{const s=Ke(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=fn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;e<gn;e++){const p=vn[e],m=n[p],f=void 0!==a[p]?a[p]:u[p],y=et(f),v=p===o?m.isActive:null;!1===v&&(d=e);let g=f===u[p]&&f!==a[p]&&y;if(g&&(i||s)&&t.manuallyAnimateOnMount&&(g=!1),m.protectedKeys={...h},!m.isActive&&null===v||!f&&!m.prevProp||it(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==v){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const w=bn(m.prevProp,f);let T=w||p===o&&m.isActive&&!g&&y||e>d&&y,b=!1;const x=Array.isArray(f)?f:[f];let A=x.reduce(r(p),{});!1===v&&(A={});const{prevResolvedValues:S={}}=m,M={...S,...A},k=e=>{T=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=A[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Be(e)&&Be(n)?!yn(e,n):e!==n,i?null!=e?k(t):c.add(t):void 0!==e&&c.has(t)?k(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=A,m.isActive&&(h={...h,...A}),(i||s)&&t.blockInitialAnimation&&(T=!1);const C=g&&w;T&&(!C||b)&&l.push(...x.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ke(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Me(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=Ke(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=An(),s=!0}}}function bn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yn(e,t)}function xn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function An(){return{animate:xn(!0),whileInView:xn(),whileHover:xn(),whileTap:xn(),whileDrag:xn(),whileFocus:xn(),exit:xn()}}function Sn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let Mn=0;const kn={animation:{Feature:class extends ln{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();it(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ln{constructor(){super(...arguments),this.id=Mn++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Cn(t){return{point:{x:t.pageX,y:t.pageY}}}function Vn(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Cn(e)))}function En(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Cn(e)))}const Pn=new WeakMap,Dn=new WeakMap,On=t=>{const e=Pn.get(t.target);e&&e(t)},Fn=t=>{t.forEach(On)};function In(t,e,n){const i=function({root:t,...e}){const n=t||document;Dn.has(n)||Dn.set(n,{});const i=Dn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fn,{root:t,...e})),i[s]}(e);return Pn.set(t,n),i.observe(t),()=>{Pn.delete(t),i.unobserve(t)}}const Ln={some:0,all:1};const Kn={renderer:(t,e)=>e.isSVG??rt(t)?new pn(e):new hn(e,{allowProjection:t!==ot}),...kn,...{inView:{Feature:class extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ln[i]};return In(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ln{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=an(t,(t,e)=>(En(this.node,e,"Start"),(t,{success:e})=>En(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ut(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ln{mount(){const{current:t}=this.node;t&&(this.unmount=Ze(t,(t,e)=>(Vn(this.node,e,"Start"),t=>Vn(this.node,t,"End"))))}unmount(){}}}}};export{Kn as domAnimation};
import{n as t,p as e,q as n,t as i,u as s,v as r,w as o,x as a,y as u,z as l,A as c,B as h,C as d,D as p,E as m,F as f,G as y,H as v,I as g,J as w,K as T,M as b,W as x,L as A,N as S,O as M,P as k,Q as C,R as E,S as V,T as P,U as D,r as O,V as F,X as I,i as L,o as K,Y as R,Z as B,_ as j,$ as q,a0 as N,a1 as U,a2 as G,a3 as H,a4 as $,a5 as W,d as _,s as z,a6 as Y,a7 as X,k as J,e as Z,f as Q,a8 as tt,b as et,a9 as nt,j as it,aa as st,g as rt}from"./size-rollup-dom-animation-assets.js";import{Fragment as ot}from"react";const at=(t,e)=>n=>e(t(n)),ut=(...t)=>t.reduce(at),lt=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ct=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ht(e,n,i,s){if(e===n&&i===s)return t;const r=t=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=ct(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,i);return t=>0===t||1===t?t:ct(r(t),n,s)}const dt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pt=t=>e=>1-t(1-e),mt=ht(.33,1.53,.69,.99),ft=pt(mt),yt=dt(ft),vt=t=>t>=1?1:(t*=2)<1?.5*ft(t):.5*(2-Math.pow(2,-10*(t-1))),gt=t=>1-Math.sin(Math.acos(t)),wt=pt(gt),Tt=dt(gt),bt=ht(.42,0,1,1),xt=ht(0,0,.58,1),At=ht(.42,0,.58,1),St={linear:t,easeIn:bt,easeInOut:At,easeOut:xt,circIn:gt,circInOut:Tt,circOut:wt,backIn:ft,backInOut:yt,backOut:mt,anticipate:vt},Mt=t=>{if(e(t)){n(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,i,s,r]=t;return ht(e,i,s,r)}return"string"==typeof t?(n(void 0!==St[t],`Invalid easing type '${t}'`,"invalid-easing-type"),St[t]):t};function kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ct(t,e){return n=>n>0?e:t}const Et=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Vt=[o,s,r];function Pt(t){const e=(n=t,Vt.find(t=>t.test(n)));var n;if(a(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===r&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=kt(a,i,t+1/3),r=kt(a,i,t),o=kt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Dt=(t,e)=>{const n=Pt(t),r=Pt(e);if(!n||!r)return Ct(t,e);const o={...n};return t=>(o.red=Et(n.red,r.red,t),o.green=Et(n.green,r.green,t),o.blue=Et(n.blue,r.blue,t),o.alpha=i(n.alpha,r.alpha,t),s.transform(o))},Ot=new Set(["none","hidden"]);function Ft(t,e){return n=>i(t,e,n)}function It(t){return"number"==typeof t?Ft:"string"==typeof t?u(t)?Ct:l.test(t)?Dt:Rt:Array.isArray(t)?Lt:"object"==typeof t?l.test(t)?Dt:Kt:Ct}function Lt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Kt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=It(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Rt=(t,e)=>{const n=c.createTransformer(e),i=h(t),s=h(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ot.has(t)&&!s.values.length||Ot.has(e)&&!i.values.length?function(t,e){return Ot.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):ut(Lt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(i,s),s.values),n):(a(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ct(t,e))};function Bt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return i(t,e,n);return It(t)(t,e)}const jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>f.update(e,t),stop:()=>m(e),now:()=>d.isProcessing?d.timestamp:p.now()}},qt=2e4;function Nt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}const Ut=100,Gt=10,Ht=1,$t=0,Wt=800,_t=.3,zt=.3,Yt={granular:.01,default:2},Xt={granular:.005,default:.5},Jt=.01,Zt=10,Qt=.05,te=1;function ee(t,e){return t*Math.sqrt(1-e*e)}const ne=.001;const ie=["duration","bounce"],se=["stiffness","damping","mass"];function re(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let e={velocity:$t,stiffness:Ut,damping:Gt,mass:Ht,isResolvedFromDuration:!1,...t};if(!re(t,se)&&re(t,ie))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*v(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ht,stiffness:s,damping:r}}else{const n=function({duration:t=Wt,bounce:e=_t,velocity:n=$t,mass:i=Ht}){let s,r;a(t<=w(Zt),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=v(Qt,te,o),t=v(Jt,Zt,y(t)),o<1?(s=e=>{const i=e*o,s=i*t,r=i-n,a=ee(e,o),u=Math.exp(-s);return ne-r/a*u},r=e=>{const i=e*o*t,r=i*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-i),l=ee(Math.pow(e,2),o);return(-s(e)+ne>0?-1:1)*((r-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=w(t),isNaN(u))return{stiffness:Ut,damping:Gt,duration:t};{const e=Math.pow(u,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:Ht},e.isResolvedFromDuration=!0}return e}function ae(t=zt,e=_t){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-y(n.velocity||0)}),m=d||0,f=l/(2*Math.sqrt(u*c)),v=o-r,T=y(Math.sqrt(u/c)),b=Math.abs(v)<5;let x,A,S,M,k,C;if(i||(i=b?Yt.granular:Yt.default),s||(s=b?Xt.granular:Xt.default),f<1)S=ee(T,f),M=(m+f*T*v)/S,x=t=>{const e=Math.exp(-f*T*t);return o-e*(M*Math.sin(S*t)+v*Math.cos(S*t))},k=f*T*M+v*S,C=f*T*v-M*S,A=t=>Math.exp(-f*T*t)*(k*Math.sin(S*t)+C*Math.cos(S*t));else if(1===f){x=t=>o-Math.exp(-T*t)*(v+(m+T*v)*t);const t=m+T*v;A=e=>Math.exp(-T*e)*(T*t*e-m)}else{const t=T*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*T*e),i=Math.min(t*e,300);return o-n*((m+f*T*v)*Math.sinh(i)+t*v*Math.cosh(i))/t};const e=(m+f*T*v)/t,n=f*T*e-v*t,i=f*T*v-e*t;A=e=>{const s=Math.exp(-f*T*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const E={calculatedDuration:p&&h||null,velocity:t=>w(A(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*T*t),n=Math.sin(S*t),r=Math.cos(S*t),u=o-e*(M*n+v*r),l=w(e*(k*n+C*r));return a.done=Math.abs(l)<=i&&Math.abs(o-u)<=s,a.value=a.done?o:u,a}const e=x(t);if(p)a.done=t>=h;else{const n=w(A(t));a.done=Math.abs(n)<=i&&Math.abs(o-e)<=s}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Nt(E),qt),e=g(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}ae.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Nt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:y(s)}}(t,100,ae);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};function ue(t,e,n){const i=Math.max(e-5,0);return T(n-t(i),e-i)}function le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,y=void 0===o?f:o(f);y!==f&&(m=y-h);const v=t=>-m*Math.exp(-t/i),g=t=>y+v(t),w=t=>{const e=v(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?y:n};let T,b;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(T=t,b=ae({keyframes:[d.value,p(d.value)],velocity:ue(g,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return b||void 0!==T||(e=!0,w(t),x(t)),void 0!==T&&t>=T?b.next(t-T):(!e&&w(t),d)}}}function ce(e,i,{clamp:s=!0,ease:r,mixer:o}={}){const a=e.length;if(n(a===i.length,"Both input and output ranges must be the same length","range-length"),1===a)return()=>i[0];if(2===a&&i[0]===i[1])return()=>i[1];const u=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),i=[...i].reverse());const l=function(e,n,i){const s=[],r=i||b.mix||Bt,o=e.length-1;for(let i=0;i<o;i++){let o=r(e[i],e[i+1]);if(n){const e=Array.isArray(n)?n[i]||t:n;o=ut(e,o)}s.push(o)}return s}(i,r,o),c=l.length,h=t=>{if(u&&t<e[0])return i[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=lt(e[n],e[n+1],t);return l[n](s)};return s?t=>h(v(e[0],e[a-1],t)):h}function he(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=lt(0,e,s);t.push(i(n,1,r))}}(e,t.length-1),e}function de({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Mt):Mt(i),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:he(e),t),a=ce(o,e,{ease:Array.isArray(s)?s:(u=e,l=s,u.map(()=>l||At).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const pe={decay:le,inertia:le,tween:de,keyframes:de,spring:ae};function me(t){"string"==typeof t.type&&(t.type=pe[t.type])}const fe=t=>t/100;class ye extends x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==p.now()&&this.tick(p.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;me(t);const{type:e=de,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||de;a!==de&&"number"!=typeof o[0]&&(this.mixKeyframes=ut(fe,Bt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Nt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let w=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(T=r)),w=v(0,1,n)*o}const b=g?{done:!1,value:l[0]}:T.next(w);s&&!g&&(b.value=s(b.value));let{done:x}=b;g||null===a||(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&p!==le&&(b.value=A(l,this.options,f,this.speed)),m&&m(b.value),S&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return y(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+y(t)}get time(){return y(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(p.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=y(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=jt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(p.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const ve={anticipate:vt,backInOut:yt,circInOut:Tt};function ge(t){"string"==typeof t.ease&&t.ease in ve&&(t.ease=ve[t.ease])}class we extends S{constructor(t){ge(t),me(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new ye({...r,autoplay:!1}),a=Math.max(10,p.now()-this.startTime),u=v(0,10,a-10),l=o.sample(a).value,{name:c}=this.options;s&&c&&M(s,c,l),e.setWithVelocity(o.sample(Math.max(0,a-u)).value,l,u),o.stop()}}const Te=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!c.test(t)&&"0"!==t||t.startsWith("url(")));function be(t){t.duration=0,t.type="keyframes"}const xe=new Set(["opacity","clipPath","filter","transform"]),Ae=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Se extends x{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=p.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||E;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:u,delay:l,isHandoff:c,onUpdate:h}=i;this.resolvedAt=p.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Te(s,e),u=Te(r,e);return a(o===u,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!(!o||!u)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||k(n))&&i)})(e,r,o,u)||(d=!1,!b.instantAnimations&&l||h?.(A(e,i,n)),e[0]=e[e.length-1],be(i),i.repeat=0);const m={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=d&&!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return Ae()&&n&&xe.has(n)&&("transform"!==n||!l)&&!u&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}(m),y=m.motionValue?.owner?.current,v=f?new we({...m,element:y}):new ye(m);v.finished.then(()=>{this.notifyFinished()}).catch(t),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),V()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Me(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}const ke=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ce(t,e,i=1){n(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=ke.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return P(t)?parseFloat(t):t}return u(r)?Ce(r,e,i+1):r}const Ee={type:"spring",stiffness:500,damping:25,restSpeed:10},Ve={type:"keyframes",duration:.8},Pe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},De=(t,{keyframes:e})=>e.length>2?Ve:D.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ee:Pe,Oe=t=>null!==t;function Fe(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Ie(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fe(n,t):n}const Le=(t,e,n,i={},s,r)=>o=>{const a=Ie(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=w(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,De(t,c)),c.duration&&(c.duration=w(c.duration)),c.repeatDelay&&(c.repeatDelay=w(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(be(c),0===c.delay&&(h=!0)),(b.instantAnimations||b.skipAnimations||s?.shouldSkipAnimations)&&(h=!0,be(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const i=t.filter(Oe);return i[e&&"loop"!==n&&e%2==1?0:i.length-1]}(c.keyframes,a);if(void 0!==t)return void f.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new ye(c):new Se(c)};function Ke(t,e,n){const i=t.getProps();return O(i,e,void 0!==n?n:i.custom,t)}const Re=new Set(["width","height","top","left","right","bottom",...F]),Be=t=>Array.isArray(t);function je(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,I(n))}function qe(t){return Be(t)?t[t.length-1]||0:t}function Ne(t,e){const n=t.getValue("willChange");if(i=n,Boolean(L(i)&&i.add))return n.add(e);if(!n&&b.WillChange){const n=new b.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ue(t){return t.props[K]}function Ge({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function He(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?Fe(r,u):u;const l=r?.reduceMotion;i&&(r=i);const c=[],h=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||h&&Ge(h,e))continue;const o={delay:n,...Ie(r||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=Ue(t);if(n){const t=window.MotionHandoffAnimation(n,e,f);null!==t&&(o.startTime=t,d=!0)}}Ne(t,e);const p=l??t.shouldReduceMotion;i.start(Le(e,i,s,p&&Re.has(e)?{type:!1}:o,t,d));const m=i.animation;m&&c.push(m)}if(o){const e=()=>f.update(()=>{o&&function(t,e){const n=Ke(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)je(t,e,qe(r[e]))}(t,o)});c.length?Promise.all(c).then(e):e()}return c}function $e(t,e,n={}){const i=Ke(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(He(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push($e(u,e,{...o,delay:n+("function"==typeof i?0:i)+Me(t.variantChildren,u,i,s,r)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,r,o,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function We(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||R(t))}const _e=new Set(["auto","none","0"]);class ze extends E{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=Ce(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Re.has(n)||2!==t.length)return;const[i,s]=t,r=j(i),o=j(s);if(q(i)!==q(s)&&N[n])this.needsMeasurement=!0;else if(r!==o)if(U(r)&&U(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else N[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||We(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!_e.has(e)&&h(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=B(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=N[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=N[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ye=!1;function Xe(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Je(t){return!("touch"===t.pointerType||Ye)}function Ze(t,e,n={}){const[i,s,r]=Xe(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if(!Je(i))return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const Qe=(t,e)=>!!e&&(t===e||Qe(t,e.parentElement)),tn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const en=new WeakSet;function nn(t){return e=>{"Enter"===e.key&&t(e)}}function sn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!0}const on=new WeakSet;function an(t,e,n={}){const[i,s,r]=Xe(t,n),o=t=>{const i=t.currentTarget;if(!rn(t))return;if(on.has(t))return;en.add(i),n.stopPropagation&&on.add(t);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),en.has(i)&&en.delete(i),rn(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Qe(i,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",u,s)};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=nn(()=>{if(en.has(n))return;sn(n,"down");const t=nn(()=>{sn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>sn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return tn.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class un extends G{constructor(){super(...arguments),this.KeyframeResolver=ze}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;L(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}function cn(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}class hn extends un{constructor(){super(...arguments),this.type="html",this.renderInstance=cn}readValueFromInstance(t,e){if(D.has(e))return this.projection?.isProjecting?H(e):$(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){_(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return z(t,e,n)}}const dn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class pn extends un{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=X}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(D.has(e)){const t=tt(e);return t&&t.default||0}return e=dn.has(e)?e:Y(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return J(t,e,n)}build(t,e,n){Z(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){cn(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(dn.has(n)?n:Y(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Q(t.tagName),super.mount(t)}}const mn=nt.length;function fn(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&fn(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<mn;n++){const i=nt[n],s=t.props[i];(et(s)||!1===s)&&(e[i]=s)}return e}function yn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const vn=[...st].reverse(),gn=st.length;function wn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>$e(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=$e(t,e,n);else{const s="function"==typeof e?Ke(t,e,n.custom):e;i=Promise.all(He(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function Tn(t){let e=wn(t),n=An(),i=!0,s=!1;const r=e=>(n,i)=>{const s=Ke(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:a}=t,u=fn(t.parent)||{},l=[],c=new Set;let h={},d=1/0;for(let e=0;e<gn;e++){const p=vn[e],m=n[p],f=void 0!==a[p]?a[p]:u[p],y=et(f),v=p===o?m.isActive:null;!1===v&&(d=e);let g=f===u[p]&&f!==a[p]&&y;if(g&&(i||s)&&t.manuallyAnimateOnMount&&(g=!1),m.protectedKeys={...h},!m.isActive&&null===v||!f&&!m.prevProp||it(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==v){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const w=bn(m.prevProp,f);let T=w||p===o&&m.isActive&&!g&&y||e>d&&y,b=!1;const x=Array.isArray(f)?f:[f];let A=x.reduce(r(p),{});!1===v&&(A={});const{prevResolvedValues:S={}}=m,M={...S,...A},k=e=>{T=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=A[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Be(e)&&Be(n)?!yn(e,n):e!==n,i?null!=e?k(t):c.add(t):void 0!==e&&c.has(t)?k(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=A,m.isActive&&(h={...h,...A}),(i||s)&&t.blockInitialAnimation&&(T=!1);const C=g&&w;T&&(!C||b)&&l.push(...x.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ke(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=Me(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof a.initial){const n=Ke(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let p=Boolean(l.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=An(),s=!0}}}function bn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!yn(e,t)}function xn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function An(){return{animate:xn(!0),whileInView:xn(),whileHover:xn(),whileTap:xn(),whileDrag:xn(),whileFocus:xn(),exit:xn()}}function Sn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}let Mn=0;const kn={animation:{Feature:class extends ln{constructor(t){super(t),t.animationState||(t.animationState=Tn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();it(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ln{constructor(){super(...arguments),this.id=Mn++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t){const n=Ke(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Cn(t){return{point:{x:t.pageX,y:t.pageY}}}function En(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&f.postRender(()=>s(e,Cn(e)))}function Vn(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&f.postRender(()=>s(e,Cn(e)))}const Pn=new WeakMap,Dn=new WeakMap,On=t=>{const e=Pn.get(t.target);e&&e(t)},Fn=t=>{t.forEach(On)};function In(t,e,n){const i=function({root:t,...e}){const n=t||document;Dn.has(n)||Dn.set(n,{});const i=Dn.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fn,{root:t,...e})),i[s]}(e);return Pn.set(t,n),i.observe(t),()=>{Pn.delete(t),i.unobserve(t)}}const Ln={some:0,all:1};const Kn={renderer:(t,e)=>e.isSVG??rt(t)?new pn(e):new hn(e,{allowProjection:t!==ot}),...kn,...{inView:{Feature:class extends ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ln[i]};return In(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ln{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=an(t,(t,e)=>(Vn(this.node,e,"Start"),(t,{success:e})=>Vn(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ut(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ln{mount(){const{current:t}=this.node;t&&(this.unmount=Ze(t,(t,e)=>(En(this.node,e,"Start"),t=>En(this.node,t,"End"))))}unmount(){}}}}};export{Kn as domAnimation};

@@ -1,1 +0,1 @@

import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s<t?t:s;function i(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let a=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(a=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},r=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,r=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const a=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function o(e){a.has(e)&&(h.schedule(e),t()),e(r)}const h={schedule:(t,i=!1,r=!1)=>{const o=r&&n?e:s;return i&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{r=t,n?i=!0:(n=!0,[e,s]=[s,e],e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t)))}};return h}(a),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,g=()=>{const a=o.useManualTiming?i.timestamp:performance.now();s=!1,o.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,a)=>{const o=r[a];return e[a]=(e,a=!1,r=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,a,r)),e},{}),cancel:t=>{for(let e=0;e<y.length;e++)r[y[e]].cancel(t)},state:i,steps:r}}const{schedule:w,cancel:V,state:S,steps:M}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let T;function A(){T=void 0}const C={now:()=>(void 0===T&&C.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(A)}},k=t=>e=>"string"==typeof e&&e.startsWith(t),x=k("--"),F=k("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const R={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...R,transform:t=>n(0,1,t)},N={...R,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,a,r,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(r),alpha:void 0!==o?parseFloat(o):1}},X={...R,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const K={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},U=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Z=U("deg"),z=U("%"),D=U("px"),q=U("vh"),H=U("vw"),_=(()=>({...z,parse:t=>z.parse(t)/100,transform:t=>z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+z.transform(O(e))+", "+z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||K.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):K.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(st,t=>(J.test(t)?(n.color.push(a),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(a),i.push("var"),s.push(t)):(n.number.push(a),i.push(tt),s.push(parseFloat(t))),++a,"${}")).split("${}");return{values:s,split:r,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a<s;a++)if(i+=t[a],void 0!==n[a]){const t=e[a];i+=t===tt?O(n[a]):t===et?J.transform(n[a]):n[a]}return i}}const at=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const rt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>at(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},lt=t=>null!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(lt),r=i<0||e&&"loop"!==s&&e%2==1?0:a.length-1;return r&&void 0!==n?n:a[r]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const a=n[e],r=i[1].split(",").map(St);return"function"==typeof a?a(r):r[a]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set(Mt))(),At=t=>t===R||t===D,Ct=new Set(["x","y","z"]),kt=Mt.filter(t=>!Ct.has(t));const xt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};xt.translateX=xt.x,xt.translateY=xt.y;const Ft=new Set;let Et=!1,Pt=!1,Bt=!1;function Rt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return kt.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Bt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Bt=!0,It(),Rt(),Bt=!1}class Ot{constructor(t,e,s,n,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Rt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),a=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,a);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=a),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ft.delete(this)}cancel(){"scheduled"===this.state&&(Ft.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function $t(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Kt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Ut(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Ut(t,e)||Kt.easeOut):Kt[t]:void 0}function Zt(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:r="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Ut(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:a+1,direction:"reverse"===r?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=a,this.options=t,r("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Zt(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}function qt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ht(t,e,s,n){if("function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,a]=qt(n);e=e(void 0!==s?s:t.custom,i,a)}return e}class _t{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=C.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=C.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=C.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new _t(t,e)}const Jt=t=>Boolean(t&&t.getVelocity);function Qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const te="data-"+Qt("framerAppearId"),ee=t=>e=>e.test(t),se=[R,D,z,Z,H,q,{test:t=>"auto"===t,parse:t=>t}],ne=t=>se.find(ee(t)),ie=new Set(["brightness","contrast","saturate","opacity"]);function ae(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let a=ie.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const re=/\b([a-z-]*)\(.*?\)/gu,oe={...rt,getAnimatableNone:t=>{const e=t.match(re);return e?e.map(ae).join(" "):t}},he={...rt,getAnimatableNone:t=>{const e=rt.parse(t);return rt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},le={...R,transform:Math.round},ue={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:Z,skewX:Z,skewY:Z,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:le,fillOpacity:I,strokeOpacity:I,numOctaves:le},ce={...ue,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:oe,WebkitFilter:oe,mask:he,WebkitMask:he},de=t=>ce[t],pe=new Set([oe,he]);function fe(t,e){let s=de(t);return pe.has(s)||(s=rt),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const me=new Set(["opacity","clipPath","filter","transform"]),ge=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ve}=b(queueMicrotask,!1),ye=[...se,J,rt],be=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),we=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ve=new WeakMap;function Se(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Me(t){return"string"==typeof t||Array.isArray(t)}const Te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ae=["initial",...Te];function Ce(t){return Se(t.animate)||Ae.some(e=>Me(t[e]))}function ke(t){return Boolean(Ce(t)||t.variants)}const xe={current:null},Fe={current:!1},Ee="undefined"!=typeof window;const Pe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Re(t){Be=t}function Ie(){return Be}class Ne{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:a,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=C.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,w.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=r;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=Ce(e),this.isVariantNode=ke(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Jt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ve.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Fe.current||function(){if(Fe.current=!0,Ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xe.current=t.matches;t.addEventListener("change",e),e()}else xe.current=!1}(),this.shouldReduceMotion=xe.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&me.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:a,duration:r}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:a,duration:p(r)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Pe.length;e++){const s=Pe[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],a=s[n];if(Jt(i))t.addValue(n,i);else if(Jt(a))t.addValue(n,Gt(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Gt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Gt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!ye.find(ee(n))&&rt.test(e)&&(s=fe(t,e))),this.setBaseTarget(t,Jt(s)?s.get():s)),Jt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ht(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Jt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ve.render(this.render)}}const Oe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$e=Mt.length;function Le(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let r=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))r=!0;else if(x(t))i[t]=s;else{const e=ge(s,ue[t]);t.startsWith("origin")?(o=!0,a[t]=e):n[t]=e}}if(e.transform||(r||s?n.transform=function(t,e,s){let n="",i=!0;for(let a=0;a<$e;a++){const r=Mt[a],o=t[r];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(r.startsWith("scale")?1:0);else{const t=parseFloat(o);h=r.startsWith("scale")?1===t:0===t}if(!h||s){const t=ge(o,ue[r]);h||(i=!1,n+=`${Oe[r]||r}(${t}) `),s&&(e[r]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=a;n.transformOrigin=`${t} ${e} ${s}`}}function Ye(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${Ye(t,e.target.x)}% ${Ye(t,e.target.y)}%`}},Xe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=rt.parse(t);if(i.length>5)return n;const a=rt.createTransformer(t),r="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+r]/=o,i[1+r]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+r]&&(i[2+r]/=l),"number"==typeof i[3+r]&&(i[3+r]/=l),a(i)}},je={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:Xe};function Ke(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!je[t]||"opacity"===t)}function Ue(t,e,s){const n=t.style,i=e?.style,a={};if(!n)return a;for(const e in n)(Jt(n[e])||i&&Jt(i[e])||Ke(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(a[e]=n[e]);return a}const Ze={offset:"stroke-dashoffset",array:"stroke-dasharray"},ze={offset:"strokeDashoffset",array:"strokeDasharray"};const De=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qe(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:r=0,...o},h,l,u){if(Le(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of De)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?Ze:ze;t[a.offset]=""+-n,t[a.array]=`${e} ${s}`}(c,i,a,r,!1)}const He=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _e(t,e,s){const n=Ue(t,e,s);for(const s in t)if(Jt(t[s])||Jt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Ge(t){return Jt(t)?t.get():t}const Je=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qe(t){return"string"==typeof t&&!t.includes("-")&&!!(Je.indexOf(t)>-1||/[A-Z]/u.test(t))}const ts=t(null),es=t({});function ss(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Mt as $,E as A,J as B,rt as C,nt as D,S as E,C as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,ts as P,ut as Q,Dt as R,es as S,$t as T,zt as U,u as V,ct as W,Ot as X,Nt as Y,h as Z,Tt as _,Me as a,Gt as a0,l as a1,fe as a2,ne as a3,B as a4,xt as a5,At as a6,Ne as a7,bt as a8,Vt as a9,x as aa,Qt as ab,we as ac,de as ad,Ae as ae,Te as af,z as ag,D as ah,e as ai,s as aj,d as ak,M as al,ve as am,be as an,je as ao,Jt as b,Ke as c,Le as d,qe as e,He as f,Qe as g,ke as h,Ce as i,Se as j,Ht as k,_e as l,Ie as m,Re as n,te as o,ss as p,c as q,Ge as r,Ue as s,g as t,r as u,ot as v,j as w,G as x,K as y,a as z};
import{createContext as t}from"react";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const n=(t,e,s)=>s>e?e:s<t?t:s;function i(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let r=()=>{},a=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(r=(t,e,s)=>{t||"undefined"==typeof console||console.warn(i(e,s))},a=(t,e,s)=>{if(!t)throw new Error(i(e,s))});const o={},h=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t;class d{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>s(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,f=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const g=t=>Array.isArray(t)&&"number"==typeof t[0],v=t({}),y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function b(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>s=!0,a=y.reduce((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,n=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(h.schedule(e),t()),e(a)}const h={schedule:(t,i=!1,a=!1)=>{const o=a&&n?e:s;return i&&r.add(t),o.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{if(a=t,n)return void(i=!0);n=!0;const r=e;e=s,s=r,e.forEach(o),e.clear(),n=!1,i&&(i=!1,h.process(t))}};return h}(r),t),{}),{setup:h,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const r=o.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=n?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,h.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),f.process(i),m.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(g))};return{schedule:y.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(s||(s=!0,n=!0,i.isProcessing||t(g)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<y.length;e++)a[y[e]].cancel(t)},state:i,steps:a}}const{schedule:w,cancel:V,state:S,steps:M}=b("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let T;function x(){T=void 0}const A={now:()=>(void 0===T&&A.set(S.isProcessing||o.useManualTiming?S.timestamp:performance.now()),T),set:t=>{T=t,queueMicrotask(x)}},C=t=>e=>"string"==typeof e&&e.startsWith(t),k=C("--"),F=C("var(--"),E=t=>!!F(t)&&P.test(t.split("/*")[0].trim()),P=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const R={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},I={...R,transform:t=>n(0,1,t)},N={...R,default:1},O=t=>Math.round(1e5*t)/1e5,$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Y=(t,e)=>s=>Boolean("string"==typeof s&&L.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),W=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},X={...R,transform:t=>Math.round((t=>n(0,255,t))(t))},j={test:Y("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+X.transform(t)+", "+X.transform(e)+", "+X.transform(s)+", "+O(I.transform(n))+")"};const z={test:Y("#"),parse:function(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:j.transform},K=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),U=K("deg"),Z=K("%"),D=K("px"),q=K("vh"),H=K("vw"),_=(()=>({...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(100*t)}))(),G={test:Y("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+Z.transform(O(e))+", "+Z.transform(O(s))+", "+O(I.transform(n))+")"},J={test:t=>j.test(t)||z.test(t)||G.test(t),parse:t=>j.test(t)?j.parse(t):G.test(t)?G.parse(t):z.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?j.transform(t):G.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const tt="number",et="color",st=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(st,t=>(J.test(t)?(n.color.push(r),i.push(et),s.push(J.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(tt),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function it({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===tt?O(n[r]):t===et?J.transform(n[r]):n[r]}return i}}const rt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:J.test(s)?J.getAnimatableNone(s):s;var s};const at={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match($)?.length||0)+(t.match(Q)?.length||0)>0},parse:function(t){return nt(t).values},createTransformer:function(t){return it(nt(t))},getAnimatableNone:function(t){const e=nt(t);return it(e)(e.values.map((t,s)=>rt(t,e.split[s])))}},ot=(t,e,s)=>t+(e-t)*s,ht=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},lt=t=>null!==t;function ut(t,{repeat:e,repeatType:s="loop"},n,i=1){const r=t.filter(lt),a=i<0||e&&"loop"!==s&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}class ct{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const dt=t=>180*t/Math.PI,pt=t=>{const e=dt(Math.atan2(t[1],t[0]));return mt(e)},ft={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pt,rotateZ:pt,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},mt=t=>((t%=360)<0&&(t+=360),t),gt=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:gt,scaleY:vt,scale:t=>(gt(t)+vt(t))/2,rotateX:t=>mt(dt(Math.atan2(t[6],t[5]))),rotateY:t=>mt(dt(Math.atan2(-t[2],t[0]))),rotateZ:pt,rotate:pt,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bt(t){return t.includes("scale")?1:0}function wt(t,e){if(!t||"none"===t)return bt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=yt,i=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=ft,i=e}if(!i)return bt(e);const r=n[e],a=i[1].split(",").map(St);return"function"==typeof r?r(a):a[r]}const Vt=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return wt(s,e)};function St(t){return parseFloat(t.trim())}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Tt=(()=>new Set(Mt))(),xt=t=>t===R||t===D,At=new Set(["x","y","z"]),Ct=Mt.filter(t=>!At.has(t));const kt={width:({x:t},{paddingLeft:e="0",paddingRight:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},height:({y:t},{paddingTop:e="0",paddingBottom:s="0",boxSizing:n})=>{const i=t.max-t.min;return"border-box"===n?i:i-parseFloat(e)-parseFloat(s)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>wt(e,"x"),y:(t,{transform:e})=>wt(e,"y")};kt.translateX=kt.x,kt.translateY=kt.y;const Ft=new Set;let Et=!1,Pt=!1,Bt=!1;function Rt(){if(Pt){const t=Array.from(Ft).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),s=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ct.forEach(s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}(t);e.length&&(s.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=s.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Pt=!1,Et=!1,Ft.forEach(t=>t.complete(Bt)),Ft.clear()}function It(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Pt=!0)})}function Nt(){Bt=!0,It(),Rt(),Bt=!1}class Ot{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ft.add(this),Et||(Et=!0,w.read(It),w.resolveKeyframes(Rt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;if(null===t[0]){const i=n?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(s&&e){const n=s.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===i&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ft.delete(this)}cancel(){"scheduled"===this.state&&(Ft.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function $t(t,e,s){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,s):t.style[e]=s}const Lt={};function Yt(t,e){const s=u(t);return()=>Lt[e]??s()}const Wt=Yt(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xt=Yt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,zt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Kt(t,e){return t?"function"==typeof t?Xt()?ht(t,e):"ease-out":g(t)?jt(t):Array.isArray(t)?t.map(t=>Kt(t,e)||zt.easeOut):zt[t]:void 0}function Ut(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},l=void 0){const u={[e]:s};h&&(u.offset=h);const c=Kt(o,i);Array.isArray(c)&&(u.easing=c);const d={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(u,d)}function Zt(t){return"function"==typeof t&&"applyToOptions"in t}class Dt extends ct{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:h}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,a("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Zt(t)&&Xt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Ut(e,s,n,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ut(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),$t(e,s,t),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=p(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:s,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Wt()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),s&&(this.animation.rangeEnd=s),c):n(this)}}function qt(t){const e=[{},{}];return t?.values.forEach((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()}),e}function Ht(t,e,s,n){if("function"==typeof e){const[i,r]=qt(n);e=e(void 0!==s?s:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=qt(n);e=e(void 0!==s?s:t.custom,i,r)}return e}class _t{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=A.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=A.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new d);const s=this.events[t].add(e);return"change"===t?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=A.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return m(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new _t(t,e)}const Jt=t=>Boolean(t&&t.getVelocity);function Qt(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const te="data-"+Qt("framerAppearId"),ee=t=>e=>e.test(t),se=[R,D,Z,U,H,q,{test:t=>"auto"===t,parse:t=>t}],ne=t=>se.find(ee(t)),ie=new Set(["brightness","contrast","saturate","opacity"]);function re(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let r=ie.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ae=/\b([a-z-]*)\(.*?\)/gu,oe={...at,getAnimatableNone:t=>{const e=t.match(ae);return e?e.map(re).join(" "):t}},he={...at,getAnimatableNone:t=>{const e=at.parse(t);return at.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},le={...R,transform:Math.round},ue={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,inset:D,insetBlock:D,insetBlockStart:D,insetBlockEnd:D,insetInline:D,insetInlineStart:D,insetInlineEnd:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockStart:D,paddingBlockEnd:D,paddingInline:D,paddingInlineStart:D,paddingInlineEnd:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockStart:D,marginBlockEnd:D,marginInline:D,marginInlineStart:D,marginInlineEnd:D,fontSize:D,backgroundPositionX:D,backgroundPositionY:D,...{rotate:U,rotateX:U,rotateY:U,rotateZ:U,scale:N,scaleX:N,scaleY:N,scaleZ:N,skew:U,skewX:U,skewY:U,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:I,originX:_,originY:_,originZ:D},zIndex:le,fillOpacity:I,strokeOpacity:I,numOctaves:le},ce={...ue,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:oe,WebkitFilter:oe,mask:he,WebkitMask:he},de=t=>ce[t],pe=new Set([oe,he]);function fe(t,e){let s=de(t);return pe.has(s)||(s=at),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const me=new Set(["opacity","clipPath","filter","transform"]),ge=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:ve}=b(queueMicrotask,!1),ye=[...se,J,at],be=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),we=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ve=new WeakMap;function Se(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Me(t){return"string"==typeof t||Array.isArray(t)}const Te=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xe=["initial",...Te];function Ae(t){return Se(t.animate)||xe.some(e=>Me(t[e]))}function Ce(t){return Boolean(Ae(t)||t.variants)}const ke={current:null},Fe={current:!1},Ee="undefined"!=typeof window;const Pe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Be={};function Re(t){Be=t}function Ie(){return Be}class Ne{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ot,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=A.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,w.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=i,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Ae(e),this.isVariantNode=Ce(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==h[t]&&Jt(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ve.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Fe.current||function(){if(Fe.current=!0,Ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ke.current=t.matches;t.addEventListener("change",e),e()}else ke.current=!1}(),this.shouldReduceMotion=ke.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),V(this.notifyUpdate),V(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&me.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:n,times:i,ease:r,duration:a}=e.accelerate,o=new Dt({element:this.current,name:t,keyframes:n,times:i,ease:r,duration:p(a)}),h=s(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const s=Tt.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{n(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Be){const e=Be[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Pe.length;e++){const s=Pe[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const i=e[n],r=s[n];if(Jt(i))t.addValue(n,i);else if(Jt(r))t.addValue(n,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(n);t.addValue(n,Gt(void 0!==e?e:i,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return void 0===s&&void 0!==e&&(s=Gt(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(h(s)||l(s))?s=parseFloat(s):(n=s,!ye.find(ee(n))&&at.test(e)&&(s=fe(t,e))),this.setBaseTarget(t,Jt(s)?s.get():s)),Jt(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=Ht(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Jt(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new d),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ve.render(this.render)}}const Oe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$e=Mt.length;function Le(t,e,s){const{style:n,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const s=e[t];if(Tt.has(t))a=!0;else if(k(t))i[t]=s;else{const e=ge(s,ue[t]);t.startsWith("origin")?(o=!0,r[t]=e):n[t]=e}}if(e.transform||(a||s?n.transform=function(t,e,s){let n="",i=!0;for(let r=0;r<$e;r++){const a=Mt[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||s){const t=ge(o,ue[a]);h||(i=!1,n+=`${Oe[a]||a}(${t}) `),s&&(e[a]=t)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:s=0}=r;n.transformOrigin=`${t} ${e} ${s}`}}function Ye(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const We={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!D.test(t))return t;t=parseFloat(t)}return`${Ye(t,e.target.x)}% ${Ye(t,e.target.y)}%`}},Xe={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=at.parse(t);if(i.length>5)return n;const r=at.createTransformer(t),a="number"!=typeof i[0]?1:0,o=s.x.scale*e.x,h=s.y.scale*e.y;i[0+a]/=o,i[1+a]/=h;const l=ot(o,h,.5);return"number"==typeof i[2+a]&&(i[2+a]/=l),"number"==typeof i[3+a]&&(i[3+a]/=l),r(i)}},je={borderRadius:{...We,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomLeftRadius:We,borderBottomRightRadius:We,boxShadow:Xe};function ze(t,{layout:e,layoutId:s}){return Tt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!je[t]||"opacity"===t)}function Ke(t,e,s){const n=t.style,i=e?.style,r={};if(!n)return r;for(const e in n)(Jt(n[e])||i&&Jt(i[e])||ze(e,t)||void 0!==s?.getValue(e)?.liveStyle)&&(r[e]=n[e]);return r}const Ue={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ze={offset:"strokeDashoffset",array:"strokeDasharray"};const De=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qe(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},h,l,u){if(Le(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete c.transformBox);for(const t of De)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==s&&(c.y=s),void 0!==n&&(c.scale=n),void 0!==i&&function(t,e,s=1,n=0,i=!0){t.pathLength=1;const r=i?Ue:Ze;t[r.offset]=""+-n,t[r.array]=`${e} ${s}`}(c,i,r,a,!1)}const He=t=>"string"==typeof t&&"svg"===t.toLowerCase();function _e(t,e,s){const n=Ke(t,e,s);for(const s in t)if(Jt(t[s])||Jt(e[s])){n[-1!==Mt.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return n}function Ge(t){return Jt(t)?t.get():t}const Je=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Qe(t){return"string"==typeof t&&!t.includes("-")&&!!(Je.indexOf(t)>-1||/[A-Z]/u.test(t))}const ts=t(null),es=t({});function ss(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}export{Mt as $,E as A,J as B,at as C,nt as D,S as E,A as F,V as G,w as H,f as I,n as J,ht as K,v as L,p as M,m as N,o as O,ts as P,ut as Q,Dt as R,es as S,$t as T,Zt as U,u as V,ct as W,Ot as X,Nt as Y,h as Z,Tt as _,Me as a,Gt as a0,l as a1,fe as a2,ne as a3,B as a4,kt as a5,xt as a6,Ne as a7,bt as a8,Vt as a9,k as aa,Qt as ab,we as ac,de as ad,xe as ae,Te as af,Z as ag,D as ah,e as ai,s as aj,d as ak,M as al,ve as am,be as an,je as ao,Jt as b,ze as c,Le as d,qe as e,He as f,Qe as g,Ce as h,Ae as i,Se as j,Ht as k,_e as l,Ie as m,Re as n,te as o,ss as p,c as q,Ge as r,Ke as s,g as t,a as u,ot as v,j as w,G as x,z as y,r as z};

@@ -1,2 +0,2 @@

import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:r<t?t:r,m=r({}),g=r({strict:!1}),h=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,R=(t,n)=>r=>Boolean("string"==typeof r&&B.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(k);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},M={test:R("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const O={test:R("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:M.transform},P=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),A=P("deg"),W=P("%"),E=P("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:R("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>M.test(t)||O.test(t)||C.test(t),parse:t=>M.test(t)?M.parse(t):C.test(t)?C.parse(t):O.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?M.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},V=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push($),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===$?x(e[a]):t===F?j.transform(e[a]):e[a]}return o}}const H=(t,n)=>{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(k)?.length||0)+(t.match(V)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set(Z))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const q=t=>Boolean(t&&t.getVelocity);const _="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:A,rotateX:A,rotateY:A,rotateZ:A,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:A,skewX:A,skewY:A,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a<at;a++){const s=Z[a],i=t[s];if(void 0===i)continue;let l=!0;if("number"==typeof i)l=i===(s.startsWith("scale")?1:0);else{const t=parseFloat(i);l=s.startsWith("scale")?1===t:0===t}if(!l||r){const t=K(i,J[s]);l||(o=!1,e+=`${ot[s]||s}(${t}) `),r&&(n[s]=t)}}return e=e.trim(),r?e=r(n,o?"":e):o&&(e="none"),e}(n,t.transform,r):e.transform&&(e.transform="none")),i){const{originX:t="50%",originY:n="50%",originZ:r=0}=a;e.transformOrigin=`${t} ${n} ${r}`}}function it(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const lt={correct:(t,n)=>{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(q(e[n])||o&&q(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox);for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return q(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)q(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function kt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const Bt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Rt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}let Mt=t=>!It(t);try{"function"==typeof(Ot=require("@emotion/is-prop-valid").default)&&(Mt=t=>t.startsWith("on")?!It(t):Ot(t))}catch{}var Ot;const Pt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function At(t){return"string"==typeof t&&!t.includes("-")&&!!(Pt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wt(t,n,r,{latestValues:e},i,l=!1,u){const c=(u??At(t)?Rt:kt)(n,e,i,t),f=function(t,n,r){const e={};for(const o in t)"values"===o&&"object"==typeof t.values||(Mt(o)||!0===r&&It(o)||!n&&!It(o)||t.draggable&&o.startsWith("onDrag"))&&(e[o]=t[o]);return e}(n,"string"==typeof t,l),d=t!==a?{...f,...c,ref:r}:{},{children:p}=n,m=o(()=>q(p)?p.get():p,[p]);return s(t,{...d,children:m})}const Et=r(null);function Lt(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r<n.length;r++){const e=U(t,n[r]);if(e){const{transitionEnd:t,transition:n,...r}=e;for(const t in r){let n=r[t];if(Array.isArray(n)){n=n[c?n.length-1:0]}null!==n&&(o[t]=n)}for(const n in t)o[n]=t[n]}}}return o}const Ct=t=>(n,r)=>{const o=e(y),a=e(Et),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Lt(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},jt=Ct({scrapeMotionValuesFromProps:dt,createRenderState:wt}),Vt=Ct({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(q(t[r])||q(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:Bt}),$t={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ft=!1;function Xt(){if(Ft)return;const t={};for(const n in $t)t[n]={isEnabled:t=>$t[n].some(n=>!!t[n])};et=t,Ft=!0}function Yt(){return Xt(),et}const Dt=Symbol.for("motionComponentSymbol");function Ht(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r);const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r);n&&(r?n.mount(r):n.unmount())},[n])}const Nt=r({});function Zt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const zt="undefined"!=typeof window?c:f;function Ut(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Et),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Nt);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:qt(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Zt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:c,layoutScroll:l,layoutRoot:u})}(b.current,r,a,x);const k=i(!1);l(()=>{S&&k.current&&S.update(r,d)});const B=r[_],R=i(Boolean(B)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(B)&&window.MotionHasOptimisedAnimation?.(B));return zt(()=>{w.current=!0,S&&(k.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),R.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!R.current&&S.animationState&&S.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(B)}),R.current=!1),S.enteringChildren=void 0)}),S}function qt(t){if(t)return!1!==t.options.allowProjection?t.projection:qt(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:At(r),u=l?Vt:jt;function c(a,s){let c;const f={...e(h),...a,layoutId:Gt(a)},{isStatic:d}=f,p=vt(a),m=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Yt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,p.visualElement=Ut(r,m,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:p,children:[c&&p.visualElement?n(c,{visualElement:p.visualElement,...f}):null,Wt(r,a,Ht(m,p.visualElement,s),m,d,o,l)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Dt]=r,f}function Gt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Jt(t,n){return _t(t,n)}const Kt=Jt("div");export{Kt as MotionDiv};
import{jsxs as t,jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as e,useMemo as o,Fragment as a,createElement as s,useRef as i,useInsertionEffect as l,useCallback as u,useLayoutEffect as c,useEffect as f,forwardRef as d}from"react";const p=(t,n,r)=>r>n?n:r<t?t:r,m=r({}),g=r({strict:!1}),h=r({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),y=r({}),v=(t=>n=>"string"==typeof n&&n.startsWith(t))("--"),b={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},w={...b,transform:t=>p(0,1,t)},S={...b,default:1},x=t=>Math.round(1e5*t)/1e5,k=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,R=(t,n)=>r=>Boolean("string"==typeof r&&B.test(r)&&r.startsWith(t)||n&&!function(t){return null==t}(r)&&Object.prototype.hasOwnProperty.call(r,n)),T=(t,n,r)=>e=>{if("string"!=typeof e)return e;const[o,a,s,i]=e.match(k);return{[t]:parseFloat(o),[n]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==i?parseFloat(i):1}},I={...b,transform:t=>Math.round((t=>p(0,255,t))(t))},M={test:R("rgb","red"),parse:T("red","green","blue"),transform:({red:t,green:n,blue:r,alpha:e=1})=>"rgba("+I.transform(t)+", "+I.transform(n)+", "+I.transform(r)+", "+x(w.transform(e))+")"};const O={test:R("#"),parse:function(t){let n="",r="",e="",o="";return t.length>5?(n=t.substring(1,3),r=t.substring(3,5),e=t.substring(5,7),o=t.substring(7,9)):(n=t.substring(1,2),r=t.substring(2,3),e=t.substring(3,4),o=t.substring(4,5),n+=n,r+=r,e+=e,o+=o),{red:parseInt(n,16),green:parseInt(r,16),blue:parseInt(e,16),alpha:o?parseInt(o,16)/255:1}},transform:M.transform},P=t=>({test:n=>"string"==typeof n&&n.endsWith(t)&&1===n.split(" ").length,parse:parseFloat,transform:n=>`${n}${t}`}),A=P("deg"),W=P("%"),E=P("px"),L=(()=>({...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(100*t)}))(),C={test:R("hsl","hue"),parse:T("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:r,alpha:e=1})=>"hsla("+Math.round(t)+", "+W.transform(x(n))+", "+W.transform(x(r))+", "+x(w.transform(e))+")"},j={test:t=>M.test(t)||O.test(t)||C.test(t),parse:t=>M.test(t)?M.parse(t):C.test(t)?C.parse(t):O.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?M.transform(t):C.transform(t),getAnimatableNone:t=>{const n=j.parse(t);return n.alpha=0,j.transform(n)}},V=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $="number",F="color",X=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y(t){const n=t.toString(),r=[],e={color:[],number:[],var:[]},o=[];let a=0;const s=n.replace(X,t=>(j.test(t)?(e.color.push(a),o.push(F),r.push(j.parse(t))):t.startsWith("var(")?(e.var.push(a),o.push("var"),r.push(t)):(e.number.push(a),o.push($),r.push(parseFloat(t))),++a,"${}")).split("${}");return{values:r,split:s,indexes:e,types:o}}function D({split:t,types:n}){const r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===$?x(e[a]):t===F?j.transform(e[a]):e[a]}return o}}const H=(t,n)=>{return"number"==typeof t?n?.trim().endsWith("/")?t:0:"number"==typeof(r=t)?0:j.test(r)?j.getAnimatableNone(r):r;var r};const N={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(k)?.length||0)+(t.match(V)?.length||0)>0},parse:function(t){return Y(t).values},createTransformer:function(t){return D(Y(t))},getAnimatableNone:function(t){const n=Y(t);return D(n)(n.values.map((t,r)=>H(t,n.split[r])))}},Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],z=(()=>new Set(Z))();function U(t,n,r,e){if("function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}if("string"==typeof n&&(n=t.variants&&t.variants[n]),"function"==typeof n){const[r,e]=[{},{}];n=n(t.custom,r,e)}return n}const q=t=>Boolean(t&&t.getVelocity);const _="data-"+"framerAppearId".replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`);const G={...b,transform:Math.round},J={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...{rotate:A,rotateX:A,rotateY:A,rotateZ:A,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:A,skewX:A,skewY:A,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:w,originX:L,originY:L,originZ:E},zIndex:G,fillOpacity:w,strokeOpacity:w,numOctaves:G},K=(t,n)=>n&&"number"==typeof t?n.transform(t):t;function Q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function tt(t){return"string"==typeof t||Array.isArray(t)}const nt=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function rt(t){return Q(t.animate)||nt.some(n=>tt(t[n]))}let et={};const ot={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},at=Z.length;function st(t,n,r){const{style:e,vars:o,transformOrigin:a}=t;let s=!1,i=!1;for(const t in n){const r=n[t];if(z.has(t))s=!0;else if(v(t))o[t]=r;else{const n=K(r,J[t]);t.startsWith("origin")?(i=!0,a[t]=n):e[t]=n}}if(n.transform||(s||r?e.transform=function(t,n,r){let e="",o=!0;for(let a=0;a<at;a++){const s=Z[a],i=t[s];if(void 0===i)continue;let l=!0;if("number"==typeof i)l=i===(s.startsWith("scale")?1:0);else{const t=parseFloat(i);l=s.startsWith("scale")?1===t:0===t}if(!l||r){const t=K(i,J[s]);l||(o=!1,e+=`${ot[s]||s}(${t}) `),r&&(n[s]=t)}}return e=e.trim(),r?e=r(n,o?"":e):o&&(e="none"),e}(n,t.transform,r):e.transform&&(e.transform="none")),i){const{originX:t="50%",originY:n="50%",originZ:r=0}=a;e.transformOrigin=`${t} ${n} ${r}`}}function it(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const lt={correct:(t,n)=>{if(!n.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${it(t,n.target.x)}% ${it(t,n.target.y)}%`}},ut={correct:(t,{treeScale:n,projectionDelta:r})=>{const e=t,o=N.parse(t);if(o.length>5)return e;const a=N.createTransformer(t),s="number"!=typeof o[0]?1:0,i=r.x.scale*n.x,l=r.y.scale*n.y;o[0+s]/=i,o[1+s]/=l;const u=(c=i)+(l-c)*.5;var c;return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),a(o)}},ct={borderRadius:{...lt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomLeftRadius:lt,borderBottomRightRadius:lt,boxShadow:ut};function ft(t,{layout:n,layoutId:r}){return z.has(t)||t.startsWith("origin")||(n||void 0!==r)&&(!!ct[t]||"opacity"===t)}function dt(t,n,r){const e=t.style,o=n?.style,a={};if(!e)return a;for(const n in e)(q(e[n])||o&&q(o[n])||ft(n,t)||void 0!==r?.getValue(n)?.liveStyle)&&(a[n]=e[n]);return a}const pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},mt={offset:"strokeDashoffset",array:"strokeDasharray"};const gt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ht(t,{attrX:n,attrY:r,attrScale:e,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...i},l,u,c){if(st(t,i,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete f.transformBox);for(const t of gt)void 0!==f[t]&&(d[t]=f[t],delete f[t]);void 0!==n&&(f.x=n),void 0!==r&&(f.y=r),void 0!==e&&(f.scale=e),void 0!==o&&function(t,n,r=1,e=0,o=!0){t.pathLength=1;const a=o?pt:mt;t[a.offset]=""+-e,t[a.array]=`${n} ${r}`}(f,o,a,s,!1)}function yt(t){return q(t)?t.get():t}function vt(t){const{initial:n,animate:r}=function(t,n){if(rt(t)){const{initial:n,animate:r}=t;return{initial:!1===n||tt(n)?n:void 0,animate:tt(r)?r:void 0}}return!1!==t.inherit?n:{}}(t,e(y));return o(()=>({initial:n,animate:r}),[bt(n),bt(r)])}function bt(t){return Array.isArray(t)?t.join(" "):t}const wt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function St(t,n,r){for(const e in n)q(n[e])||ft(e,r)||(t[e]=n[e])}function xt(t,n){const r={};return St(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},n){return o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return st(r,n,t),Object.assign({},r.vars,r.style)},[n])}(t,n)),r}function kt(t,n){const r={},e=xt(t,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,e.userSelect=e.WebkitUserSelect=e.WebkitTouchCallout="none",e.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=e,r}const Bt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Rt(t,n,r,e){const a=o(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};var o;return ht(r,n,"string"==typeof(o=e)&&"svg"===o.toLowerCase(),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[n]);if(t.style){const n={};St(n,t.style,t),a.style={...n,...a.style}}return a}const Tt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function It(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Tt.has(t)}let Mt=t=>!It(t);try{"function"==typeof(Ot=require("@emotion/is-prop-valid").default)&&(Mt=t=>t.startsWith("on")?!It(t):Ot(t))}catch{}var Ot;const Pt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function At(t){return"string"==typeof t&&!t.includes("-")&&!!(Pt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wt(t,n,r,{latestValues:e},i,l=!1,u){const c=(u??At(t)?Rt:kt)(n,e,i,t),f=function(t,n,r){const e={};for(const o in t)"values"===o&&"object"==typeof t.values||q(t[o])||(Mt(o)||!0===r&&It(o)||!n&&!It(o)||t.draggable&&o.startsWith("onDrag"))&&(e[o]=t[o]);return e}(n,"string"==typeof t,l),d=t!==a?{...f,...c,ref:r}:{},{children:p}=n,m=o(()=>q(p)?p.get():p,[p]);return s(t,{...d,children:m})}const Et=r(null);function Lt(t,n,r,e){const o={},a=e(t,{});for(const t in a)o[t]=yt(a[t]);let{initial:s,animate:i}=t;const l=rt(t),u=function(t){return Boolean(rt(t)||t.variants)}(t);n&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=n.initial),void 0===i&&(i=n.animate));let c=!!r&&!1===r.initial;c=c||!1===s;const f=c?i:s;if(f&&"boolean"!=typeof f&&!Q(f)){const n=Array.isArray(f)?f:[f];for(let r=0;r<n.length;r++){const e=U(t,n[r]);if(e){const{transitionEnd:t,transition:n,...r}=e;for(const t in r){let n=r[t];if(Array.isArray(n)){n=n[c?n.length-1:0]}null!==n&&(o[t]=n)}for(const n in t)o[n]=t[n]}}}return o}const Ct=t=>(n,r)=>{const o=e(y),a=e(Et),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:n},r,e,o){return{latestValues:Lt(r,e,o,t),renderState:n()}}(t,n,o,a);return r?s():function(t){const n=i(null);return null===n.current&&(n.current=t()),n.current}(s)},jt=Ct({scrapeMotionValuesFromProps:dt,createRenderState:wt}),Vt=Ct({scrapeMotionValuesFromProps:function(t,n,r){const e=dt(t,n,r);for(const r in t)if(q(t[r])||q(n[r])){e[-1!==Z.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return e},createRenderState:Bt}),$t={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ft=!1;function Xt(){if(Ft)return;const t={};for(const n in $t)t[n]={isEnabled:t=>$t[n].some(n=>!!t[n])};et=t,Ft=!0}function Yt(){return Xt(),et}const Dt=Symbol.for("motionComponentSymbol");function Ht(t,n,r){const e=i(r);l(()=>{e.current=r});const o=i(null);return u(r=>{r&&t.onMount?.(r);const a=e.current;if("function"==typeof a)if(r){const t=a(r);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):a(r);else a&&(a.current=r);n&&(r?n.mount(r):n.unmount())},[n])}const Nt=r({});function Zt(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const zt="undefined"!=typeof window?c:f;function Ut(t,n,r,o,a,s){const{visualElement:u}=e(y),c=e(g),d=e(Et),p=e(h),m=p.reducedMotion,v=p.skipAnimations,b=i(null),w=i(!1);o=o||c.renderer,!b.current&&o&&(b.current=o(t,{visualState:n,parent:u,props:r,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:v,isSVG:s}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,x=e(Nt);!S||S.projection||!a||"html"!==S.type&&"svg"!==S.type||function(t,n,r,e){const{layoutId:o,layout:a,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=n;t.projection=new r(t.latestValues,n["data-framer-portal-id"]?void 0:qt(t.parent)),t.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(s)||i&&Zt(i),visualElement:t,animationType:"string"==typeof a?a:"both",initialPromotionConfig:e,crossfade:c,layoutScroll:l,layoutRoot:u})}(b.current,r,a,x);const k=i(!1);l(()=>{S&&k.current&&S.update(r,d)});const B=r[_],R=i(Boolean(B)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(B)&&window.MotionHasOptimisedAnimation?.(B));return zt(()=>{w.current=!0,S&&(k.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),R.current&&S.animationState&&S.animationState.animateChanges())}),f(()=>{S&&(!R.current&&S.animationState&&S.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(B)}),R.current=!1),S.enteringChildren=void 0)}),S}function qt(t){if(t)return!1!==t.options.allowProjection?t.projection:qt(t.parent)}function _t(r,{forwardMotionProps:o=!1,type:a}={},s,i){const l=a?"svg"===a:At(r),u=l?Vt:jt;function c(a,s){let c;const f={...e(h),...a,layoutId:Gt(a)},{isStatic:d}=f,p=vt(a),m=u(a,d);if(!d&&"undefined"!=typeof window){e(g).strict;const t=function(t){const n=Yt(),{drag:r,layout:e}=n;if(!r&&!e)return{};const o={...r,...e};return{MeasureLayout:r?.isEnabled(t)||e?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(f);c=t.MeasureLayout,p.visualElement=Ut(r,m,f,i,t.ProjectionNode,l)}return t(y.Provider,{value:p,children:[c&&p.visualElement?n(c,{visualElement:p.visualElement,...f}):null,Wt(r,a,Ht(m,p.visualElement,s),m,d,o,l)]})}c.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const f=d(c);return f[Dt]=r,f}function Gt({layoutId:t}){const n=e(m).id;return n&&void 0!==t?n+"-"+t:t}function Jt(t,n){return _t(t,n)}const Kt=Jt("div");export{Kt as MotionDiv};
//# sourceMappingURL=size-rollup-m.js.map

@@ -1,2 +0,2 @@

const e=(e,t,n)=>n>t?t:n<e?e:n;function t(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let n=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={};function o(e){return"object"==typeof e&&null!==e}const i=e=>e,a=(e,t)=>n=>t(e(n)),c=(...e)=>e.reduce(a),l=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};const u=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function f(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=u.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{i=e,r?s=!0:(r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e)))}};return c}(i),e),{}),{setup:c,read:l,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming?o.timestamp:performance.now();n=!1,s.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,c.process(o),l.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:u.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;t<u.length;t++)a[u[t]].cancel(e)},state:o,steps:a}}const{schedule:d,cancel:g,state:h}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:i,!0),p=(e=>t=>"string"==typeof t&&t.startsWith(e))("var(--"),m=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,v={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},y={...v,transform:t=>e(0,1,t)},w=e=>Math.round(1e5*e)/1e5,b=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const x=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E=(e,t)=>n=>Boolean("string"==typeof n&&x.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),W=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(b);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},L={...v,transform:t=>Math.round((t=>e(0,255,t))(t))},A={test:E("rgb","red"),parse:W("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+L.transform(e)+", "+L.transform(t)+", "+L.transform(n)+", "+w(y.transform(r))+")"};const M={test:E("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:A.transform},S=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),B={test:E("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+S.transform(w(t))+", "+S.transform(w(n))+", "+w(y.transform(r))+")"},T={test:e=>A.test(e)||M.test(e)||B.test(e),parse:e=>A.test(e)?A.parse(e):B.test(e)?B.parse(e):M.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?A.transform(e):B.transform(e),getAnimatableNone:e=>{const t=T.parse(e);return t.alpha=0,T.transform(t)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const O="number",H="color",z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function F(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(z,e=>(T.test(e)?(r.color.push(o),s.push(H),n.push(T.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push(O),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function N({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==r[o]){const e=t[o];s+=e===O?w(r[o]):e===H?T.transform(r[o]):r[o]}return s}}const k=(e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:T.test(n)?T.getAnimatableNone(n):n;var n};const P={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(b)?.length||0)+(e.match($)?.length||0)>0},parse:function(e){return F(e).values},createTransformer:function(e){return N(F(e))},getAnimatableNone:function(e){const t=F(e);return N(t)(t.values.map((e,n)=>k(e,t.split[n])))}};function R(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function q(e,t){return n=>n>0?t:e}const j=(e,t,n)=>e+(t-e)*n,U=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},V=[M,A,B];function C(e){const t=(r=e,V.find(e=>e.test(r)));var r;if(n(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(t))return!1;let s=t.parse(e);return t===B&&(s=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let s=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=R(a,r,e+1/3),o=R(a,r,e),i=R(a,r,e-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(s)),s}const I=(e,t)=>{const n=C(e),r=C(t);if(!n||!r)return q(e,t);const s={...n};return e=>(s.red=U(n.red,r.red,e),s.green=U(n.green,r.green,e),s.blue=U(n.blue,r.blue,e),s.alpha=j(n.alpha,r.alpha,e),A.transform(s))},G=new Set(["none","hidden"]);function D(e,t){return n=>j(e,t,n)}function K(e){return"number"==typeof e?D:"string"==typeof e?p(t=e)&&m.test(t.split("/*")[0].trim())?q:T.test(e)?I:Q:Array.isArray(e)?_:"object"==typeof e?T.test(e)?I:J:q;var t}function _(e,t){const n=[...e],r=n.length,s=e.map((e,n)=>K(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=s[t](e);return n}}function J(e,t){const n={...e,...t},r={};for(const s in n)void 0!==e[s]&&void 0!==t[s]&&(r[s]=K(e[s])(e[s],t[s]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Q=(e,t)=>{const r=P.createTransformer(t),s=F(e),o=F(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?G.has(e)&&!o.values.length||G.has(t)&&!s.values.length?function(e,t){return G.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):c(_(function(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],a=e.values[i]??0;n[s]=a,r[o]++}return n}(s,o),o.values),r):(n(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),q(e,t))};function X(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return j(e,t,n);return K(e)(e,t)}function Y(t,n,{clamp:o=!0,ease:a,mixer:u}={}){const f=t.length;if(r(f===n.length,"Both input and output ranges must be the same length","range-length"),1===f)return()=>n[0];if(2===f&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[f-1]&&(t=[...t].reverse(),n=[...n].reverse());const g=function(e,t,n){const r=[],o=n||s.mix||X,a=e.length-1;for(let n=0;n<a;n++){let s=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||i:t;s=c(e,s)}r.push(s)}return r}(n,a,u),h=g.length,p=e=>{if(d&&e<t[0])return n[0];let r=0;if(h>1)for(;r<t.length-2&&!(e<t[r+1]);r++);const s=l(t[r],t[r+1],e);return g[r](s)};return o?n=>p(e(t[0],t[f-1],n)):p}function Z(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=l(0,t,r);e.push(j(n,1,s))}}(t,e.length-1),t}const ee={};function te(e,t){const n=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(e);return()=>ee[t]??n()}const ne=te(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),re=te(()=>void 0!==window.ViewTimeline,"viewTimeline");function se(e){return o(e)&&"offsetHeight"in e}const oe=new WeakMap;let ie;const ae=(e,t,n)=>(r,s)=>{return s&&s[0]?s[0][e+"Size"]:o(i=r)&&"ownerSVGElement"in i&&"getBBox"in r?r.getBBox()[t]:r[n];var i},ce=ae("inline","width","offsetWidth"),le=ae("block","height","offsetHeight");function ue({target:e,borderBoxSize:t}){oe.get(e)?.forEach(n=>{n(e,{get width(){return ce(e,t)},get height(){return le(e,t)}})})}function fe(e){e.forEach(ue)}function de(e,t){ie||"undefined"!=typeof ResizeObserver&&(ie=new ResizeObserver(fe));const n=function(e){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e).filter(e=>null!=e)}(e);return n.forEach(e=>{let n=oe.get(e);n||(n=new Set,oe.set(e,n)),n.add(t),ie?.observe(e)}),()=>{n.forEach(e=>{const n=oe.get(e);n?.delete(t),n?.size||ie?.unobserve(e)})}}const ge=new Set;let he;function pe(e){return ge.add(e),he||(he=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ge.forEach(t=>t(e))},window.addEventListener("resize",he)),()=>{ge.delete(e),ge.size||"function"!=typeof he||(window.removeEventListener("resize",he),he=void 0)}}function me(e,t){let n;const r=()=>{const{currentTime:r}=t,s=(null===r?0:r.value)/100;n!==s&&e(s),n=s};return d.preUpdate(r,!0),()=>g(r)}function ve(e){return"undefined"!=typeof window&&(e?re():ne())}const ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function we(e,t,n,r){const s=n[t],{length:o,position:i}=ye[t],a=s.current,c=n.time;s.current=Math.abs(e[`scroll${i}`]),s.scrollLength=e[`scroll${o}`]-e[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=l(0,s.scrollLength,s.current);const u=r-c;var f,d;s.velocity=u>50?0:(f=s.current-a,(d=u)?f*(1e3/d):0)}const be={start:0,center:.5,end:1};function xe(e,t,n=0){let r=0;if(e in be&&(e=be[e]),"string"==typeof e){const t=parseFloat(e);e.endsWith("px")?r=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?r=t/100*document.documentElement.clientWidth:e.endsWith("vh")?r=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(r=t*e),n+r}const Ee=[0,0];function We(e,t,n,r){let s=Array.isArray(e)?e:Ee,o=0,i=0;return"number"==typeof e?s=[e,e]:"string"==typeof e&&(s=(e=e.trim()).includes(" ")?e.split(" "):[e,be[e]?e:"0"]),o=xe(s[0],n,r),i=xe(s[1],t),o-i}const Le={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ae={x:0,y:0};function Me(t,n,r){const{offset:s=Le.All}=r,{target:o=t,axis:i="y"}=r,a="y"===i?"height":"width",c=o!==t?function(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(se(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const e=r.getBoundingClientRect();r=r.parentElement;const t=r.getBoundingClientRect();n.x+=e.left-t.left,n.y+=e.top-t.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:e,y:t}=r.getBBox();n.x+=e,n.y+=t;let s=null,o=r.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=r.parentNode;r=s}}return n}(o,t):Ae,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(e){return"getBBox"in e&&"svg"!==e.tagName?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};n[i].offset.length=0;let f=!n[i].interpolate;const d=s.length;for(let e=0;e<d;e++){const t=We(s[e],u[a],l[a],c[i]);f||t===n[i].interpolatorOffsets[e]||(f=!0),n[i].offset[e]=t}f&&(n[i].interpolate=Y(n[i].offset,Z(s),{clamp:!1}),n[i].interpolatorOffsets=[...n[i].offset]),n[i].progress=e(0,1,n[i].interpolate(n[i].current))}function Se(e,t,n,r={}){return{measure:t=>{!function(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}(e,r.target,n),function(e,t,n){we(e,"x",t,n),we(e,"y",t,n),t.time=n}(e,n,t),(r.offset||r.target)&&Me(e,n,r)},notify:()=>t(n)}}const Be=new WeakMap,Te=new WeakMap,$e=new WeakMap,Oe=new WeakMap,He=new WeakMap,ze=e=>e===document.scrollingElement?window:e;function Fe(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return i;let s=$e.get(t);s||(s=new Set,$e.set(t,s));const o=Se(t,e,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},r);if(s.add(o),!Be.has(t)){const e=()=>{for(const e of s)e.measure(h.timestamp);d.preUpdate(n)},n=()=>{for(const e of s)e.notify()},r=()=>d.read(e);Be.set(t,r);const o=ze(t);window.addEventListener("resize",r),t!==document.documentElement&&Te.set(t,(c=r,"function"==typeof(a=t)?pe(a):de(a,c))),o.addEventListener("scroll",r),r()}var a,c;if(n&&!He.has(t)){const e=Be.get(t),n={width:t.scrollWidth,height:t.scrollHeight};Oe.set(t,n);const r=()=>{const r=t.scrollWidth,s=t.scrollHeight;n.width===r&&n.height===s||(e(),n.width=r,n.height=s)},s=d.read(r,!0);He.set(t,s)}const l=Be.get(t);return d.read(l,!1,!0),()=>{g(l);const e=$e.get(t);if(!e)return;if(e.delete(o),e.size)return;const n=Be.get(t);Be.delete(t),n&&(ze(t).removeEventListener("scroll",n),Te.get(t)?.(),window.removeEventListener("resize",n));const r=He.get(t);r&&(g(r),He.delete(t)),Oe.delete(t)}}const Ne=[[Le.Enter,"entry"],[Le.Exit,"exit"],[Le.Any,"cover"],[Le.All,"contain"]];function ke(e,t){if(2!==e.length)return!1;for(let n=0;n<2;n++){const r=e[n],s=t[n];if(!Array.isArray(r)||2!==r.length||r[0]!==s[0]||r[1]!==s[1])return!1}return!0}function Pe(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of Ne)if(ke(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Re=new Map;function qe(e){const t={value:0},n=Fe(n=>{t.value=100*n[e.axis].progress},e);return{currentTime:t,cancel:n}}function je({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=Re.get(t);s||(s=new Map,Re.set(t,s));const o=n.target??"self";let i=s.get(o);i||(i={},s.set(o,i));const a=r+(n.offset??[]).join(",");if(!i[a])if(n.target&&ve(n.target)){const e=Pe(n.offset);i[a]=e?new ViewTimeline({subject:n.target,axis:r}):qe({container:t,...n})}else ve()?i[a]=new ScrollTimeline({source:t,axis:r}):i[a]=qe({container:t,...n});return i[a]}function Ue(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return i;const s={axis:t,container:n,...r};return"function"==typeof e?function(e,t){return function(e){return 2===e.length}(e)?Fe(n=>{e(n[t.axis].progress,n)},t):me(e,je(t))}(e,s):function(e,t){const n=je(t),r=t.target?Pe(t.offset):void 0,s=t.target?ve(t.target)&&!!r:ve();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:e=>(e.pause(),me(t=>{e.time=e.iterationDuration*t},n))})}(e,s)}export{Ue as scroll};
const e=(e,t,n)=>n>t?t:n<e?e:n;function t(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let n=()=>{},r=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(e,n,r)=>{e||"undefined"==typeof console||console.warn(t(n,r))},r=(e,n,r)=>{if(!e)throw new Error(t(n,r))});const s={};function o(e){return"object"==typeof e&&null!==e}const i=e=>e,a=(e,t)=>n=>t(e(n)),c=(...e)=>e.reduce(a),l=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};const u=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function f(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=u.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){o.has(t)&&(c.schedule(t),e()),t(i)}const c={schedule:(e,s=!1,i=!1)=>{const a=i&&r?t:n;return s&&o.add(e),a.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(i=e,r)return void(s=!0);r=!0;const o=t;t=n,n=o,t.forEach(a),t.clear(),r=!1,s&&(s=!1,c.process(e))}};return c}(i),e),{}),{setup:c,read:l,resolveKeyframes:f,preUpdate:d,update:g,preRender:h,render:p,postRender:m}=a,v=()=>{const i=s.useManualTiming,a=i?o.timestamp:performance.now();n=!1,i||(o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1)),o.timestamp=a,o.isProcessing=!0,c.process(o),l.process(o),f.process(o),d.process(o),g.process(o),h.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(v))};return{schedule:u.reduce((t,s)=>{const i=a[s];return t[s]=(t,s=!1,a=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(v)),i.schedule(t,s,a)),t},{}),cancel:e=>{for(let t=0;t<u.length;t++)a[u[t]].cancel(e)},state:o,steps:a}}const{schedule:d,cancel:g,state:h}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:i,!0),p=(e=>t=>"string"==typeof t&&t.startsWith(e))("var(--"),m=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,v={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},y={...v,transform:t=>e(0,1,t)},w=e=>Math.round(1e5*e)/1e5,b=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const x=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E=(e,t)=>n=>Boolean("string"==typeof n&&x.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),W=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[s,o,i,a]=r.match(b);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},L={...v,transform:t=>Math.round((t=>e(0,255,t))(t))},A={test:E("rgb","red"),parse:W("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+L.transform(e)+", "+L.transform(t)+", "+L.transform(n)+", "+w(y.transform(r))+")"};const S={test:E("#"),parse:function(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:A.transform},M=(e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}))("%"),B={test:E("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+M.transform(w(t))+", "+M.transform(w(n))+", "+w(y.transform(r))+")"},T={test:e=>A.test(e)||S.test(e)||B.test(e),parse:e=>A.test(e)?A.parse(e):B.test(e)?B.parse(e):S.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?A.transform(e):B.transform(e),getAnimatableNone:e=>{const t=T.parse(e);return t.alpha=0,T.transform(t)}},$=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const O="number",H="color",z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function F(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const i=t.replace(z,e=>(T.test(e)?(r.color.push(o),s.push(H),n.push(T.parse(e))):e.startsWith("var(")?(r.var.push(o),s.push("var"),n.push(e)):(r.number.push(o),s.push(O),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:s}}function N({split:e,types:t}){const n=e.length;return r=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],void 0!==r[o]){const e=t[o];s+=e===O?w(r[o]):e===H?T.transform(r[o]):r[o]}return s}}const k=(e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:T.test(n)?T.getAnimatableNone(n):n;var n};const P={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(b)?.length||0)+(e.match($)?.length||0)>0},parse:function(e){return F(e).values},createTransformer:function(e){return N(F(e))},getAnimatableNone:function(e){const t=F(e);return N(t)(t.values.map((e,n)=>k(e,t.split[n])))}};function R(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function q(e,t){return n=>n>0?t:e}const V=(e,t,n)=>e+(t-e)*n,j=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},U=[S,A,B];function C(e){const t=(r=e,U.find(e=>e.test(r)));var r;if(n(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(t))return!1;let s=t.parse(e);return t===B&&(s=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let s=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;s=R(a,r,e+1/3),o=R(a,r,e),i=R(a,r,e-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(s)),s}const G=(e,t)=>{const n=C(e),r=C(t);if(!n||!r)return q(e,t);const s={...n};return e=>(s.red=j(n.red,r.red,e),s.green=j(n.green,r.green,e),s.blue=j(n.blue,r.blue,e),s.alpha=V(n.alpha,r.alpha,e),A.transform(s))},I=new Set(["none","hidden"]);function D(e,t){return n=>V(e,t,n)}function K(e){return"number"==typeof e?D:"string"==typeof e?p(t=e)&&m.test(t.split("/*")[0].trim())?q:T.test(e)?G:Q:Array.isArray(e)?_:"object"==typeof e?T.test(e)?G:J:q;var t}function _(e,t){const n=[...e],r=n.length,s=e.map((e,n)=>K(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=s[t](e);return n}}function J(e,t){const n={...e,...t},r={};for(const s in n)void 0!==e[s]&&void 0!==t[s]&&(r[s]=K(e[s])(e[s],t[s]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Q=(e,t)=>{const r=P.createTransformer(t),s=F(e),o=F(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?I.has(e)&&!o.values.length||I.has(t)&&!s.values.length?function(e,t){return I.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):c(_(function(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],i=e.indexes[o][r[o]],a=e.values[i]??0;n[s]=a,r[o]++}return n}(s,o),o.values),r):(n(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),q(e,t))};function X(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return V(e,t,n);return K(e)(e,t)}function Y(t,n,{clamp:o=!0,ease:a,mixer:u}={}){const f=t.length;if(r(f===n.length,"Both input and output ranges must be the same length","range-length"),1===f)return()=>n[0];if(2===f&&n[0]===n[1])return()=>n[1];const d=t[0]===t[1];t[0]>t[f-1]&&(t=[...t].reverse(),n=[...n].reverse());const g=function(e,t,n){const r=[],o=n||s.mix||X,a=e.length-1;for(let n=0;n<a;n++){let s=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||i:t;s=c(e,s)}r.push(s)}return r}(n,a,u),h=g.length,p=e=>{if(d&&e<t[0])return n[0];let r=0;if(h>1)for(;r<t.length-2&&!(e<t[r+1]);r++);const s=l(t[r],t[r+1],e);return g[r](s)};return o?n=>p(e(t[0],t[f-1],n)):p}function Z(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=l(0,t,r);e.push(V(n,1,s))}}(t,e.length-1),t}const ee={};function te(e,t){const n=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(e);return()=>ee[t]??n()}const ne=te(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),re=te(()=>void 0!==window.ViewTimeline,"viewTimeline");function se(e){return o(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const oe=new WeakMap;let ie;const ae=(e,t,n)=>(r,s)=>{return s&&s[0]?s[0][e+"Size"]:o(i=r)&&"ownerSVGElement"in i&&"getBBox"in r?r.getBBox()[t]:r[n];var i},ce=ae("inline","width","offsetWidth"),le=ae("block","height","offsetHeight");function ue({target:e,borderBoxSize:t}){oe.get(e)?.forEach(n=>{n(e,{get width(){return ce(e,t)},get height(){return le(e,t)}})})}function fe(e){e.forEach(ue)}function de(e,t){ie||"undefined"!=typeof ResizeObserver&&(ie=new ResizeObserver(fe));const n=function(e){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e).filter(e=>null!=e)}(e);return n.forEach(e=>{let n=oe.get(e);n||(n=new Set,oe.set(e,n)),n.add(t),ie?.observe(e)}),()=>{n.forEach(e=>{const n=oe.get(e);n?.delete(t),n?.size||ie?.unobserve(e)})}}const ge=new Set;let he;function pe(e){return ge.add(e),he||(he=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ge.forEach(t=>t(e))},window.addEventListener("resize",he)),()=>{ge.delete(e),ge.size||"function"!=typeof he||(window.removeEventListener("resize",he),he=void 0)}}function me(e,t){let n;const r=()=>{const{currentTime:r}=t,s=(null===r?0:r.value)/100;n!==s&&e(s),n=s};return d.preUpdate(r,!0),()=>g(r)}function ve(e){return"undefined"!=typeof window&&(e?re():ne())}const ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function we(e,t,n,r){const s=n[t],{length:o,position:i}=ye[t],a=s.current,c=n.time;s.current=Math.abs(e[`scroll${i}`]),s.scrollLength=e[`scroll${o}`]-e[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=l(0,s.scrollLength,s.current);const u=r-c;var f,d;s.velocity=u>50?0:(f=s.current-a,(d=u)?f*(1e3/d):0)}const be={start:0,center:.5,end:1};function xe(e,t,n=0){let r=0;if(e in be&&(e=be[e]),"string"==typeof e){const t=parseFloat(e);e.endsWith("px")?r=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?r=t/100*document.documentElement.clientWidth:e.endsWith("vh")?r=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(r=t*e),n+r}const Ee=[0,0];function We(e,t,n,r){let s=Array.isArray(e)?e:Ee,o=0,i=0;return"number"==typeof e?s=[e,e]:"string"==typeof e&&(s=(e=e.trim()).includes(" ")?e.split(" "):[e,be[e]?e:"0"]),o=xe(s[0],n,r),i=xe(s[1],t),o-i}const Le={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ae={x:0,y:0};function Se(t,n,r){const{offset:s=Le.All}=r,{target:o=t,axis:i="y"}=r,a="y"===i?"height":"width",c=o!==t?function(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(se(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const e=r.getBoundingClientRect();r=r.parentElement;const t=r.getBoundingClientRect();n.x+=e.left-t.left,n.y+=e.top-t.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:e,y:t}=r.getBBox();n.x+=e,n.y+=t;let s=null,o=r.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=r.parentNode;r=s}}return n}(o,t):Ae,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(e){return"getBBox"in e&&"svg"!==e.tagName?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}(o),u={width:t.clientWidth,height:t.clientHeight};n[i].offset.length=0;let f=!n[i].interpolate;const d=s.length;for(let e=0;e<d;e++){const t=We(s[e],u[a],l[a],c[i]);f||t===n[i].interpolatorOffsets[e]||(f=!0),n[i].offset[e]=t}f&&(n[i].interpolate=Y(n[i].offset,Z(s),{clamp:!1}),n[i].interpolatorOffsets=[...n[i].offset]),n[i].progress=e(0,1,n[i].interpolate(n[i].current))}function Me(e,t,n,r={}){return{measure:t=>{!function(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}(e,r.target,n),function(e,t,n){we(e,"x",t,n),we(e,"y",t,n),t.time=n}(e,n,t),(r.offset||r.target)&&Se(e,n,r)},notify:()=>t(n)}}const Be=new WeakMap,Te=new WeakMap,$e=new WeakMap,Oe=new WeakMap,He=new WeakMap,ze=e=>e===document.scrollingElement?window:e;function Fe(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return i;let s=$e.get(t);s||(s=new Set,$e.set(t,s));const o=Me(t,e,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},r);if(s.add(o),!Be.has(t)){const e=()=>{for(const e of s)e.measure(h.timestamp);d.preUpdate(n)},n=()=>{for(const e of s)e.notify()},r=()=>d.read(e);Be.set(t,r);const o=ze(t);window.addEventListener("resize",r),t!==document.documentElement&&Te.set(t,(c=r,"function"==typeof(a=t)?pe(a):de(a,c))),o.addEventListener("scroll",r),r()}var a,c;if(n&&!He.has(t)){const e=Be.get(t),n={width:t.scrollWidth,height:t.scrollHeight};Oe.set(t,n);const r=()=>{const r=t.scrollWidth,s=t.scrollHeight;n.width===r&&n.height===s||(e(),n.width=r,n.height=s)},s=d.read(r,!0);He.set(t,s)}const l=Be.get(t);return d.read(l,!1,!0),()=>{g(l);const e=$e.get(t);if(!e)return;if(e.delete(o),e.size)return;const n=Be.get(t);Be.delete(t),n&&(ze(t).removeEventListener("scroll",n),Te.get(t)?.(),window.removeEventListener("resize",n));const r=He.get(t);r&&(g(r),He.delete(t)),Oe.delete(t)}}const Ne=[[Le.Enter,"entry"],[Le.Exit,"exit"],[Le.Any,"cover"],[Le.All,"contain"]];function ke(e,t){if(2!==e.length)return!1;for(let n=0;n<2;n++){const r=e[n],s=t[n];if(!Array.isArray(r)||2!==r.length||r[0]!==s[0]||r[1]!==s[1])return!1}return!0}function Pe(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of Ne)if(ke(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Re=new Map;function qe(e){const t={value:0},n=Fe(n=>{t.value=100*n[e.axis].progress},e);return{currentTime:t,cancel:n}}function Ve({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=Re.get(t);s||(s=new Map,Re.set(t,s));const o=n.target??"self";let i=s.get(o);i||(i={},s.set(o,i));const a=r+(n.offset??[]).join(",");if(!i[a])if(n.target&&ve(n.target)){const e=Pe(n.offset);i[a]=e?new ViewTimeline({subject:n.target,axis:r}):qe({container:t,...n})}else ve()?i[a]=new ScrollTimeline({source:t,axis:r}):i[a]=qe({container:t,...n});return i[a]}function je(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return i;const s={axis:t,container:n,...r};return"function"==typeof e?function(e,t){return function(e){return 2===e.length}(e)?Fe(n=>{e(n[t.axis].progress,n)},t):me(e,Ve(t))}(e,s):function(e,t){const n=Ve(t),r=t.target?Pe(t.offset):void 0,s=t.target?ve(t.target)&&!!r:ve();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:e=>(e.pause(),me(t=>{e.time=e.iterationDuration*t},n))})}(e,s)}export{je as scroll};
//# sourceMappingURL=size-rollup-scroll.js.map

@@ -861,2 +861,3 @@ /// <reference types="react" />

type UseSpringOptions = SpringOptions & Pick<FollowValueOptions, "skipInitialAnimation">;
/**

@@ -881,6 +882,6 @@ * Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.

*/
declare function useSpring(source: MotionValue<string>, options?: SpringOptions): MotionValue<string>;
declare function useSpring(source: string, options?: SpringOptions): MotionValue<string>;
declare function useSpring(source: MotionValue<number>, options?: SpringOptions): MotionValue<number>;
declare function useSpring(source: number, options?: SpringOptions): MotionValue<number>;
declare function useSpring(source: MotionValue<string>, options?: UseSpringOptions): MotionValue<string>;
declare function useSpring(source: string, options?: UseSpringOptions): MotionValue<string>;
declare function useSpring(source: MotionValue<number>, options?: UseSpringOptions): MotionValue<number>;
declare function useSpring(source: number, options?: UseSpringOptions): MotionValue<number>;

@@ -887,0 +888,0 @@ declare function useTime(): motion_dom.MotionValue<number>;

{
"name": "framer-motion",
"version": "12.35.2",
"version": "12.36.0",
"description": "A simple and powerful JavaScript animation library",

@@ -91,4 +91,4 @@ "main": "dist/cjs/index.js",

"dependencies": {
"motion-dom": "^12.35.2",
"motion-utils": "^12.29.2",
"motion-dom": "^12.36.0",
"motion-utils": "^12.36.0",
"tslib": "^2.4.0"

@@ -148,3 +148,3 @@ },

],
"gitHead": "df9913cd4f28edcf1cad1db597d678ffb786b264"
"gitHead": "cb86cf385a9c4a9b1202646577ba67800e72cde4"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display