{"version":3,"file":"static/chunks/2877-076ef46150d8eb91.js","mappings":"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","sources":["webpack://_N_E/./node_modules/framer-motion/dist/es/utils/wrap.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/animate/resolve-subjects.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/utils/calc-repeat-duration.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/utils/normalize-times.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/sequence/create.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/object/ObjectVisualElement.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/animate/subject.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/animate/sequence.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/animation/animate/index.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/render/dom/viewport/index.mjs","webpack://_N_E/./node_modules/framer-motion/dist/es/utils/use-in-view.mjs"],"sourcesContent":["const wrap = (min, max, v) => {\n const rangeSize = max - min;\n return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;\n};\n\nexport { wrap };\n","import { wrap } from '../../utils/wrap.mjs';\nimport { isEasingArray } from './is-easing-array.mjs';\n\nfunction getEasingForSegment(easing, i) {\n return isEasingArray(easing) ? easing[wrap(0, easing.length, i)] : easing;\n}\n\nexport { getEasingForSegment };\n","function isDOMKeyframes(keyframes) {\n return typeof keyframes === \"object\" && !Array.isArray(keyframes);\n}\n\nexport { isDOMKeyframes };\n","import { resolveElements } from 'motion-dom';\nimport { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';\n\nfunction resolveSubjects(subject, keyframes, scope, selectorCache) {\n if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n return resolveElements(subject, scope, selectorCache);\n }\n else if (subject instanceof NodeList) {\n return Array.from(subject);\n }\n else if (Array.isArray(subject)) {\n return subject;\n }\n else {\n return [subject];\n }\n}\n\nexport { resolveSubjects };\n","function calculateRepeatDuration(duration, repeat, _repeatDelay) {\n return duration * (repeat + 1);\n}\n\nexport { calculateRepeatDuration };\n","/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nfunction calcNextTime(current, next, prev, labels) {\n var _a;\n if (typeof next === \"number\") {\n return next;\n }\n else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n return Math.max(0, current + parseFloat(next));\n }\n else if (next === \"<\") {\n return prev;\n }\n else {\n return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;\n }\n}\n\nexport { calcNextTime };\n","import { getEasingForSegment } from '../../../easing/utils/get-easing-for-segment.mjs';\nimport { removeItem } from '../../../utils/array.mjs';\nimport { mixNumber } from '../../../utils/mix/number.mjs';\n\nfunction eraseKeyframes(sequence, startTime, endTime) {\n for (let i = 0; i < sequence.length; i++) {\n const keyframe = sequence[i];\n if (keyframe.at > startTime && keyframe.at < endTime) {\n removeItem(sequence, keyframe);\n // If we remove this item we have to push the pointer back one\n i--;\n }\n }\n}\nfunction addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) {\n /**\n * Erase every existing value between currentTime and targetTime,\n * this will essentially splice this timeline into any currently\n * defined ones.\n */\n eraseKeyframes(sequence, startTime, endTime);\n for (let i = 0; i < keyframes.length; i++) {\n sequence.push({\n value: keyframes[i],\n at: mixNumber(startTime, endTime, offset[i]),\n easing: getEasingForSegment(easing, i),\n });\n }\n}\n\nexport { addKeyframes, eraseKeyframes };\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n */\nfunction normalizeTimes(times, repeat) {\n for (let i = 0; i < times.length; i++) {\n times[i] = times[i] / (repeat + 1);\n }\n}\n\nexport { normalizeTimes };\n","function compareByTime(a, b) {\n if (a.at === b.at) {\n if (a.value === null)\n return 1;\n if (b.value === null)\n return -1;\n return 0;\n }\n else {\n return a.at - b.at;\n }\n}\n\nexport { compareByTime };\n","import { isGenerator, createGeneratorEasing } from 'motion-dom';\nimport { progress, secondsToMilliseconds, invariant } from 'motion-utils';\nimport { getEasingForSegment } from '../../easing/utils/get-easing-for-segment.mjs';\nimport { defaultOffset } from '../../utils/offsets/default.mjs';\nimport { fillOffset } from '../../utils/offsets/fill.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { resolveSubjects } from '../animate/resolve-subjects.mjs';\nimport { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs';\nimport { calcNextTime } from './utils/calc-time.mjs';\nimport { addKeyframes } from './utils/edit.mjs';\nimport { normalizeTimes } from './utils/normalize-times.mjs';\nimport { compareByTime } from './utils/sort.mjs';\n\nconst defaultSegmentEasing = \"easeInOut\";\nconst MAX_REPEAT = 20;\nfunction createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {\n const defaultDuration = defaultTransition.duration || 0.3;\n const animationDefinitions = new Map();\n const sequences = new Map();\n const elementCache = {};\n const timeLabels = new Map();\n let prevTime = 0;\n let currentTime = 0;\n let totalDuration = 0;\n /**\n * Build the timeline by mapping over the sequence array and converting\n * the definitions into keyframes and offsets with absolute time values.\n * These will later get converted into relative offsets in a second pass.\n */\n for (let i = 0; i < sequence.length; i++) {\n const segment = sequence[i];\n /**\n * If this is a timeline label, mark it and skip the rest of this iteration.\n */\n if (typeof segment === \"string\") {\n timeLabels.set(segment, currentTime);\n continue;\n }\n else if (!Array.isArray(segment)) {\n timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));\n continue;\n }\n let [subject, keyframes, transition = {}] = segment;\n /**\n * If a relative or absolute time value has been specified we need to resolve\n * it in relation to the currentTime.\n */\n if (transition.at !== undefined) {\n currentTime = calcNextTime(currentTime, transition.at, prevTime, timeLabels);\n }\n /**\n * Keep track of the maximum duration in this definition. This will be\n * applied to currentTime once the definition has been parsed.\n */\n let maxDuration = 0;\n const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {\n const valueKeyframesAsList = keyframesAsList(valueKeyframes);\n const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = \"keyframes\", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;\n let { ease = defaultTransition.ease || \"easeOut\", duration } = valueTransition;\n /**\n * Resolve stagger() if defined.\n */\n const calculatedDelay = typeof delay === \"function\"\n ? delay(elementIndex, numSubjects)\n : delay;\n /**\n * If this animation should and can use a spring, generate a spring easing function.\n */\n const numKeyframes = valueKeyframesAsList.length;\n const createGenerator = isGenerator(type)\n ? type\n : generators === null || generators === void 0 ? void 0 : generators[type];\n if (numKeyframes <= 2 && createGenerator) {\n /**\n * As we're creating an easing function from a spring,\n * ideally we want to generate it using the real distance\n * between the two keyframes. However this isn't always\n * possible - in these situations we use 0-100.\n */\n let absoluteDelta = 100;\n if (numKeyframes === 2 &&\n isNumberKeyframesArray(valueKeyframesAsList)) {\n const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];\n absoluteDelta = Math.abs(delta);\n }\n const springTransition = { ...remainingTransition };\n if (duration !== undefined) {\n springTransition.duration = secondsToMilliseconds(duration);\n }\n const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);\n ease = springEasing.ease;\n duration = springEasing.duration;\n }\n duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);\n const startTime = currentTime + calculatedDelay;\n /**\n * If there's only one time offset of 0, fill in a second with length 1\n */\n if (times.length === 1 && times[0] === 0) {\n times[1] = 1;\n }\n /**\n * Fill out if offset if fewer offsets than keyframes\n */\n const remainder = times.length - valueKeyframesAsList.length;\n remainder > 0 && fillOffset(times, remainder);\n /**\n * If only one value has been set, ie [1], push a null to the start of\n * the keyframe array. This will let us mark a keyframe at this point\n * that will later be hydrated with the previous value.\n */\n valueKeyframesAsList.length === 1 &&\n valueKeyframesAsList.unshift(null);\n /**\n * Handle repeat options\n */\n if (repeat) {\n invariant(repeat < MAX_REPEAT, \"Repeat count too high, must be less than 20\");\n duration = calculateRepeatDuration(duration, repeat);\n const originalKeyframes = [...valueKeyframesAsList];\n const originalTimes = [...times];\n ease = Array.isArray(ease) ? [...ease] : [ease];\n const originalEase = [...ease];\n for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {\n valueKeyframesAsList.push(...originalKeyframes);\n for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {\n times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));\n ease.push(keyframeIndex === 0\n ? \"linear\"\n : getEasingForSegment(originalEase, keyframeIndex - 1));\n }\n }\n normalizeTimes(times, repeat);\n }\n const targetTime = startTime + duration;\n /**\n * Add keyframes, mapping offsets to absolute time.\n */\n addKeyframes(valueSequence, valueKeyframesAsList, ease, times, startTime, targetTime);\n maxDuration = Math.max(calculatedDelay + duration, maxDuration);\n totalDuration = Math.max(targetTime, totalDuration);\n };\n if (isMotionValue(subject)) {\n const subjectSequence = getSubjectSequence(subject, sequences);\n resolveValueSequence(keyframes, transition, getValueSequence(\"default\", subjectSequence));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope, elementCache);\n const numSubjects = subjects.length;\n /**\n * For every element in this segment, process the defined values.\n */\n for (let subjectIndex = 0; subjectIndex < numSubjects; subjectIndex++) {\n /**\n * Cast necessary, but we know these are of this type\n */\n keyframes = keyframes;\n transition = transition;\n const thisSubject = subjects[subjectIndex];\n const subjectSequence = getSubjectSequence(thisSubject, sequences);\n for (const key in keyframes) {\n resolveValueSequence(keyframes[key], getValueTransition(transition, key), getValueSequence(key, subjectSequence), subjectIndex, numSubjects);\n }\n }\n }\n prevTime = currentTime;\n currentTime += maxDuration;\n }\n /**\n * For every element and value combination create a new animation.\n */\n sequences.forEach((valueSequences, element) => {\n for (const key in valueSequences) {\n const valueSequence = valueSequences[key];\n /**\n * Arrange all the keyframes in ascending time order.\n */\n valueSequence.sort(compareByTime);\n const keyframes = [];\n const valueOffset = [];\n const valueEasing = [];\n /**\n * For each keyframe, translate absolute times into\n * relative offsets based on the total duration of the timeline.\n */\n for (let i = 0; i < valueSequence.length; i++) {\n const { at, value, easing } = valueSequence[i];\n keyframes.push(value);\n valueOffset.push(progress(0, totalDuration, at));\n valueEasing.push(easing || \"easeOut\");\n }\n /**\n * If the first keyframe doesn't land on offset: 0\n * provide one by duplicating the initial keyframe. This ensures\n * it snaps to the first keyframe when the animation starts.\n */\n if (valueOffset[0] !== 0) {\n valueOffset.unshift(0);\n keyframes.unshift(keyframes[0]);\n valueEasing.unshift(defaultSegmentEasing);\n }\n /**\n * If the last keyframe doesn't land on offset: 1\n * provide one with a null wildcard value. This will ensure it\n * stays static until the end of the animation.\n */\n if (valueOffset[valueOffset.length - 1] !== 1) {\n valueOffset.push(1);\n keyframes.push(null);\n }\n if (!animationDefinitions.has(element)) {\n animationDefinitions.set(element, {\n keyframes: {},\n transition: {},\n });\n }\n const definition = animationDefinitions.get(element);\n definition.keyframes[key] = keyframes;\n definition.transition[key] = {\n ...defaultTransition,\n duration: totalDuration,\n ease: valueEasing,\n times: valueOffset,\n ...sequenceTransition,\n };\n }\n });\n return animationDefinitions;\n}\nfunction getSubjectSequence(subject, sequences) {\n !sequences.has(subject) && sequences.set(subject, {});\n return sequences.get(subject);\n}\nfunction getValueSequence(name, sequences) {\n if (!sequences[name])\n sequences[name] = [];\n return sequences[name];\n}\nfunction keyframesAsList(keyframes) {\n return Array.isArray(keyframes) ? keyframes : [keyframes];\n}\nfunction getValueTransition(transition, key) {\n return transition && transition[key]\n ? {\n ...transition,\n ...transition[key],\n }\n : { ...transition };\n}\nconst isNumber = (keyframe) => typeof keyframe === \"number\";\nconst isNumberKeyframesArray = (keyframes) => keyframes.every(isNumber);\n\nexport { createAnimationsFromSequence, getValueTransition };\n","import { createBox } from '../../projection/geometry/models.mjs';\nimport { VisualElement } from '../VisualElement.mjs';\n\nfunction isObjectKey(key, object) {\n return key in object;\n}\nclass ObjectVisualElement extends VisualElement {\n constructor() {\n super(...arguments);\n this.type = \"object\";\n }\n readValueFromInstance(instance, key) {\n if (isObjectKey(key, instance)) {\n const value = instance[key];\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n }\n return undefined;\n }\n getBaseTargetFromProps() {\n return undefined;\n }\n removeValueFromRenderState(key, renderState) {\n delete renderState.output[key];\n }\n measureInstanceViewportBox() {\n return createBox();\n }\n build(renderState, latestValues) {\n Object.assign(renderState.output, latestValues);\n }\n renderInstance(instance, { output }) {\n Object.assign(instance, output);\n }\n sortInstanceNodePosition() {\n return 0;\n }\n}\n\nexport { ObjectVisualElement };\n","import { isSVGElement } from '../../render/dom/utils/is-svg-element.mjs';\nimport { SVGVisualElement } from '../../render/svg/SVGVisualElement.mjs';\nimport { HTMLVisualElement } from '../../render/html/HTMLVisualElement.mjs';\nimport { visualElementStore } from '../../render/store.mjs';\nimport { ObjectVisualElement } from '../../render/object/ObjectVisualElement.mjs';\n\nfunction createDOMVisualElement(element) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n transform: {},\n transformOrigin: {},\n style: {},\n vars: {},\n attrs: {},\n },\n latestValues: {},\n },\n };\n const node = isSVGElement(element)\n ? new SVGVisualElement(options)\n : new HTMLVisualElement(options);\n node.mount(element);\n visualElementStore.set(element, node);\n}\nfunction createObjectVisualElement(subject) {\n const options = {\n presenceContext: null,\n props: {},\n visualState: {\n renderState: {\n output: {},\n },\n latestValues: {},\n },\n };\n const node = new ObjectVisualElement(options);\n node.mount(subject);\n visualElementStore.set(subject, node);\n}\n\nexport { createDOMVisualElement, createObjectVisualElement };\n","import { invariant } from 'motion-utils';\nimport { visualElementStore } from '../../render/store.mjs';\nimport { isMotionValue } from '../../value/utils/is-motion-value.mjs';\nimport { animateTarget } from '../interfaces/visual-element-target.mjs';\nimport { createDOMVisualElement, createObjectVisualElement } from '../utils/create-visual-element.mjs';\nimport { isDOMKeyframes } from '../utils/is-dom-keyframes.mjs';\nimport { resolveSubjects } from './resolve-subjects.mjs';\nimport { animateSingleValue } from './single-value.mjs';\n\nfunction isSingleValue(subject, keyframes) {\n return (isMotionValue(subject) ||\n typeof subject === \"number\" ||\n (typeof subject === \"string\" && !isDOMKeyframes(keyframes)));\n}\n/**\n * Implementation\n */\nfunction animateSubject(subject, keyframes, options, scope) {\n const animations = [];\n if (isSingleValue(subject, keyframes)) {\n animations.push(animateSingleValue(subject, isDOMKeyframes(keyframes)\n ? keyframes.default || keyframes\n : keyframes, options ? options.default || options : options));\n }\n else {\n const subjects = resolveSubjects(subject, keyframes, scope);\n const numSubjects = subjects.length;\n invariant(Boolean(numSubjects), \"No valid elements provided.\");\n for (let i = 0; i < numSubjects; i++) {\n const thisSubject = subjects[i];\n const createVisualElement = thisSubject instanceof Element\n ? createDOMVisualElement\n : createObjectVisualElement;\n if (!visualElementStore.has(thisSubject)) {\n createVisualElement(thisSubject);\n }\n const visualElement = visualElementStore.get(thisSubject);\n const transition = { ...options };\n /**\n * Resolve stagger function if provided.\n */\n if (\"delay\" in transition &&\n typeof transition.delay === \"function\") {\n transition.delay = transition.delay(i, numSubjects);\n }\n animations.push(...animateTarget(visualElement, { ...keyframes, transition }, {}));\n }\n }\n return animations;\n}\n\nexport { animateSubject };\n","import { spring } from '../generators/spring/index.mjs';\nimport { createAnimationsFromSequence } from '../sequence/create.mjs';\nimport { animateSubject } from './subject.mjs';\n\nfunction animateSequence(sequence, options, scope) {\n const animations = [];\n const animationDefinitions = createAnimationsFromSequence(sequence, options, scope, { spring });\n animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n animations.push(...animateSubject(subject, keyframes, transition));\n });\n return animations;\n}\n\nexport { animateSequence };\n","import { GroupPlaybackControls } from 'motion-dom';\nimport { animateSequence } from './sequence.mjs';\nimport { animateSubject } from './subject.mjs';\n\nfunction isSequence(value) {\n return Array.isArray(value) && Array.isArray(value[0]);\n}\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nfunction createScopedAnimate(scope) {\n /**\n * Implementation\n */\n function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {\n let animations = [];\n if (isSequence(subjectOrSequence)) {\n animations = animateSequence(subjectOrSequence, optionsOrKeyframes, scope);\n }\n else {\n animations = animateSubject(subjectOrSequence, optionsOrKeyframes, options, scope);\n }\n const animation = new GroupPlaybackControls(animations);\n if (scope) {\n scope.animations.push(animation);\n }\n return animation;\n }\n return scopedAnimate;\n}\nconst animate = createScopedAnimate();\n\nexport { animate, createScopedAnimate };\n","import { resolveElements } from 'motion-dom';\n\nconst thresholds = {\n some: 0,\n all: 1,\n};\nfunction inView(elementOrSelector, onStart, { root, margin: rootMargin, amount = \"some\" } = {}) {\n const elements = resolveElements(elementOrSelector);\n const activeIntersections = new WeakMap();\n const onIntersectionChange = (entries) => {\n entries.forEach((entry) => {\n const onEnd = activeIntersections.get(entry.target);\n /**\n * If there's no change to the intersection, we don't need to\n * do anything here.\n */\n if (entry.isIntersecting === Boolean(onEnd))\n return;\n if (entry.isIntersecting) {\n const newOnEnd = onStart(entry);\n if (typeof newOnEnd === \"function\") {\n activeIntersections.set(entry.target, newOnEnd);\n }\n else {\n observer.unobserve(entry.target);\n }\n }\n else if (onEnd) {\n onEnd(entry);\n activeIntersections.delete(entry.target);\n }\n });\n };\n const observer = new IntersectionObserver(onIntersectionChange, {\n root,\n rootMargin,\n threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n });\n elements.forEach((element) => observer.observe(element));\n return () => observer.disconnect();\n}\n\nexport { inView };\n","import { useState, useEffect } from 'react';\nimport { inView } from '../render/dom/viewport/index.mjs';\n\nfunction useInView(ref, { root, margin, amount, once = false } = {}) {\n const [isInView, setInView] = useState(false);\n useEffect(() => {\n if (!ref.current || (once && isInView))\n return;\n const onEnter = () => {\n setInView(true);\n return once ? undefined : () => setInView(false);\n };\n const options = {\n root: (root && root.current) || undefined,\n margin,\n amount,\n };\n return inView(ref.current, onEnter, options);\n }, [root, ref, margin, once, amount]);\n return isInView;\n}\n\nexport { useInView };\n"],"names":[],"sourceRoot":"","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]}