{"version":3,"file":"index.cjs","names":[],"sources":["../src/lib/components/useFonts.js","../src/lib/utils.js","../src/lib/components/TextSwap.jsx","../src/lib/components/constants.js","../src/lib/components/index.jsx","../src/lib/index.js"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Wait for an embedded font to load before reporting ready.\n *\n * Resolves immediately when no font is named, when there is no DOM (SSR), or\n * when the browser has no `document.fonts`. Seeding state with `!fontName`\n * means the server renders real markup instead of nothing in the common case.\n *\n * @param {string} [fontName] Font family name to await.\n * @returns {boolean} Whether it is safe to measure and animate.\n */\nexport default function useFonts(fontName) {\n    const [isLoaded, setIsLoaded] = useState(!fontName);\n\n    useEffect(() => {\n        // `typeof document` and not `!document`: a bare `document` reference\n        // is a ReferenceError under Node, not a falsy value.\n        if (!fontName || typeof document === 'undefined' || !document.fonts) {\n            setIsLoaded(true);\n\n            return undefined;\n        }\n\n        let cancelled = false;\n        const done = () => {\n            if (!cancelled) {\n                setIsLoaded(true);\n            }\n        };\n\n        // Both handlers are `done` on purpose. `document.fonts.load` rejects on\n        // an unparseable font shorthand, and leaving `isLoaded` false would\n        // render nothing forever with no clue why. Degrade to animating.\n        document.fonts.load(`16px \"${fontName}\"`).then(done, done);\n\n        return () => {\n            cancelled = true;\n        };\n    }, [fontName]);\n\n    return isLoaded;\n}\n","/**\n * Get a random number between `min` and `max`\n * @param {number} min The minimum number you want to include in the random output\n * @param {number} max The maximum number you want to include in the random output\n * @returns {number} A random number including and between the `min` and `max`\n */\nexport function randomMinMax(min = 0, max = 100) {\n    return Math.floor(Math.random() * (max - min)) + min;\n}\n","/*\n * Index-based keys are correct in this file: within a given word pair the\n * letter arrays are fixed length and never reordered, so the index is the\n * stable identity. The letter is appended only to keep keys readable.\n */\n/* eslint-disable react/no-array-index-key */\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { randomMinMax } from '../utils';\n\n/**\n * The only styles this component cannot live without. Everything cosmetic\n * (color, font, size, casing) is deliberately left to the consumer's own CSS,\n * which can target the `text-swap-*` class names with no specificity fight.\n */\nconst STYLES = {\n    // A single-cell grid stacks all three layers on top of each other. It is\n    // what gives the component a real width and height: the animated letters\n    // are absolutely positioned and contribute no size of their own, so\n    // without the measurement words sharing their cell the whole element\n    // would collapse to zero height and overlap whatever sits next to it.\n    // It also means all three layers share one origin, which is what makes\n    // the offsets below directly comparable.\n    root: { position: 'relative', display: 'grid' },\n    word: { position: 'relative', gridArea: '1 / 1' },\n    // `visibility: hidden` and NOT `display: none`: the measurement words must\n    // still participate in layout or offsetLeft/offsetTop return 0 and the\n    // whole animation collapses.\n    //\n    // Deliberately NOT offset off-screen, unlike react-anagram-animation. That\n    // package animates by a relative delta and so is immune to where the\n    // measured words sit; this one positions letters absolutely, which needs\n    // the measurement words to share an origin with the animation layer.\n    hidden: { visibility: 'hidden' },\n    letter: { whiteSpace: 'pre', display: 'inline-block', zIndex: 10 },\n    // The animated letters are absolutely positioned rather than in flow,\n    // because a letter changes glyph mid-flight and an in-flow span would\n    // reflow every letter after it when 'i' became 'W'.\n    animatedLetter: { whiteSpace: 'pre', display: 'inline-block', position: 'absolute', zIndex: 10 },\n};\n\n// Measuring must happen before paint, or the letters visibly pop in a frame\n// late. Falling back to useEffect on the server avoids React's \"useLayoutEffect\n// does nothing on the server\" warning in every SSR consumer's logs.\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n/**\n * The `typeof window.matchMedia === 'function'` check is not optional: jsdom\n * has no matchMedia, so omitting it breaks every consumer's test suite.\n */\nfunction prefersReducedMotion() {\n    return typeof window !== 'undefined'\n        && typeof window.matchMedia === 'function'\n        && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\nconst isSpace = (character) => character === ' ';\n\n/**\n * Render and animate from one word to another word and back again.\n *\n * @param {string} word1 The word to animate from, already padded to word2's length.\n * @param {string} word2 The word to animate to.\n * @param {AnimationOptions} animationOptions Timing options for when to start, how fast forward/backwards, and when to loop.\n * @returns {JSX.Element}\n */\nexport default function TextSwap({ word1, word2, animationOptions, className, style, ...rest }) {\n    const [swapAnimations, setAnimations] = useState([]);\n    const [isDegraded, setIsDegraded] = useState(false);\n    const rootRef = useRef(null);\n    const word1Ref = useRef(null);\n    const word2Ref = useRef(null);\n    const updateAnimation = useCallback((i, update = {}) => {\n        setAnimations((prevState) => {\n            const newState = [\n                ...prevState,\n            ];\n            newState[i] = {\n                ...prevState[i],\n                ...update,\n            };\n\n            return newState;\n        });\n    }, [setAnimations]);\n\n    const {\n        randomStartMin,\n        randomStartMax,\n        randomReverseMin,\n        randomReverseMax,\n        loopAnimation,\n        waitToStart,\n        transitionDuration,\n        timingFunction,\n    } = animationOptions;\n\n    useIsomorphicLayoutEffect(() => {\n        /**\n         * Pair every source letter with an unused destination letter, in three\n         * tiers, and record where each end sits:\n         *\n         * 1. the same character, so the letter simply moves;\n         * 2. failing that, a space, so the letter travels there and fades out;\n         * 3. failing that, any free slot, so the letter morphs into another.\n         *\n         * The words are padded to equal length before they reach here, so a\n         * complete pairing always exists and tier 3 cannot run out. Returning\n         * null is defence for this component being used directly with\n         * unequal-length words.\n         */\n        const buildSwaps = () => {\n            const srcElements = word1Ref.current.children;\n            const destElements = word2Ref.current.children;\n            const destChars = [...word2];\n            const destPaired = [];\n            const swaps = [];\n            const isFree = (destIndex) => destPaired[destIndex] !== true;\n\n            for (const [i, letter] of [...word1].entries()) {\n                let destLetterIndex = destChars.findIndex((destLetter, destIndex) => {\n                    return destLetter.toLowerCase() === letter.toLowerCase() && isFree(destIndex);\n                });\n\n                if (destLetterIndex === -1) {\n                    destLetterIndex = destChars.findIndex((destLetter, destIndex) => {\n                        return isSpace(destLetter) && isFree(destIndex);\n                    });\n                }\n\n                if (destLetterIndex === -1) {\n                    destLetterIndex = destChars.findIndex((destLetter, destIndex) => isFree(destIndex));\n                }\n\n                if (destLetterIndex === -1) {\n                    return null;\n                }\n\n                destPaired[destLetterIndex] = true; // mark this destination used\n\n                const srcElement = srcElements[i];\n                const destElement = destElements[destLetterIndex];\n\n                swaps.push({\n                    letter, // the currently displayed glyph\n                    playing: false, // is this letter animating towards the destination\n                    disappear: false, // should this letter currently be faded out\n                    destIndex: destLetterIndex, // needed to re-measure on resize\n                    src: {\n                        letter,\n                        offsetLeft: srcElement.offsetLeft,\n                        offsetTop: srcElement.offsetTop,\n                    },\n                    dest: {\n                        letter: destChars[destLetterIndex],\n                        offsetLeft: destElement.offsetLeft,\n                        offsetTop: destElement.offsetTop,\n                    },\n                });\n            }\n\n            return swaps;\n        };\n\n        const swaps = buildSwaps();\n\n        if (swaps === null) {\n            console.error(\n                '[react-text-swap-animation] Cannot animate because there were more '\n                + `letters in \"${word1}\" than slots in \"${word2}\". Rendering the first `\n                + 'word without animation.',\n            );\n            setIsDegraded(true);\n\n            return undefined;\n        }\n\n        setIsDegraded(false);\n        setAnimations(swaps);\n\n        // Purely decorative motion, so honour the OS setting unconditionally\n        // and leave the letters at rest.\n        if (prefersReducedMotion()) {\n            return undefined;\n        }\n\n        let cancelled = false;\n        const timers = new Set();\n        // Every timer is registered so it can be cancelled, and self-prunes on\n        // fire so the set stays bounded despite the endless loop.\n        const later = (fn, ms) => {\n            const id = setTimeout(() => {\n                timers.delete(id);\n\n                if (!cancelled) {\n                    fn();\n                }\n            }, ms);\n            timers.add(id);\n        };\n\n        // Change the glyph at the midpoint of the journey. This used to be a\n        // hardcoded 500ms, which swapped the letter long before it arrived\n        // whenever transitionDuration was larger.\n        const midpoint = transitionDuration / 2;\n\n        const animateFunc = () => {\n            swaps.forEach((swap, i) => {\n                const vanishesOnTheWayOut = !isSpace(swap.src.letter) && isSpace(swap.dest.letter);\n                const vanishesOnTheWayBack = !isSpace(swap.dest.letter) && isSpace(swap.src.letter);\n\n                // Out to the destination.\n                const forwardStartTime = randomMinMax(randomStartMin, randomStartMax);\n                later(() => {\n                    updateAnimation(i, { playing: true, disappear: vanishesOnTheWayOut });\n                }, forwardStartTime);\n\n                // Halfway there, become the destination glyph. A letter on its\n                // way out keeps its own glyph, invisibly, ready for the return.\n                if (!vanishesOnTheWayOut) {\n                    later(() => updateAnimation(i, { letter: swap.dest.letter }), forwardStartTime + midpoint);\n                }\n\n                // ...and back again. Appearing and disappearing are the same\n                // mechanism run in opposite directions.\n                const reverseStartTime = randomMinMax(randomReverseMin, randomReverseMax);\n                later(() => {\n                    updateAnimation(i, { playing: false, disappear: vanishesOnTheWayBack });\n                }, reverseStartTime);\n\n                if (!vanishesOnTheWayBack) {\n                    later(() => updateAnimation(i, { letter: swap.src.letter }), reverseStartTime + midpoint);\n                }\n            });\n\n            // Repeat forever. Registering the recursion is what makes it\n            // cancellable.\n            later(animateFunc, loopAnimation);\n        };\n\n        // Start the process\n        later(animateFunc, waitToStart);\n\n        // Offsets are captured once, so a viewport resize, an orientation\n        // change or a late webfont swap would leave every letter flying to a\n        // stale coordinate. Re-measure in place, preserving playing/disappear\n        // so a transition already in flight simply retargets.\n        const remeasure = () => {\n            const srcElements = word1Ref.current.children;\n            const destElements = word2Ref.current.children;\n\n            setAnimations((previous) => previous.map((swap, i) => ({\n                ...swap,\n                src: {\n                    ...swap.src,\n                    offsetLeft: srcElements[i].offsetLeft,\n                    offsetTop: srcElements[i].offsetTop,\n                },\n                dest: {\n                    ...swap.dest,\n                    offsetLeft: destElements[swap.destIndex].offsetLeft,\n                    offsetTop: destElements[swap.destIndex].offsetTop,\n                },\n            })));\n        };\n\n        let frame = 0;\n        // jsdom has no ResizeObserver, so this must stay optional.\n        const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => {\n            cancelAnimationFrame(frame);\n            frame = requestAnimationFrame(remeasure);\n        });\n\n        observer?.observe(rootRef.current);\n\n        // Without this the loop outlived unmount, and React 18/19 StrictMode\n        // double-invocation left two permanently out-of-phase animations.\n        return () => {\n            cancelled = true;\n            timers.forEach(clearTimeout);\n            timers.clear();\n            observer?.disconnect();\n            cancelAnimationFrame(frame);\n        };\n    }, [word1, word2, updateAnimation, loopAnimation, randomReverseMax, randomReverseMin, randomStartMax, randomStartMin, waitToStart, transitionDuration]);\n\n    return (\n        <div\n            className={className ? `text-swap ${className}` : 'text-swap'}\n            style={{ ...STYLES.root, ...style }}\n            ref={rootRef}\n            {...rest}\n        >\n            <div className=\"text-swap-word text-swap-word-1\" style={{ ...STYLES.word, ...STYLES.hidden }} aria-hidden=\"true\" ref={word1Ref}>\n                {\n                    [...word1].map((letter, i) => {\n                        return <span className=\"text-swap-letter\" style={STYLES.letter} key={`${i}-${letter}`}>{letter}</span>;\n                    })\n                }\n            </div>\n            <div className=\"text-swap-word text-swap-word-2\" style={{ ...STYLES.word, ...STYLES.hidden }} aria-hidden=\"true\" ref={word2Ref}>\n                {\n                    [...word2].map((letter, i) => {\n                        return <span className=\"text-swap-letter\" style={STYLES.letter} key={`${i}-${letter}`}>{letter}</span>;\n                    })\n                }\n            </div>\n            <div className=\"text-swap-word text-swap-word-animation\" style={STYLES.word}>\n                {\n                    isDegraded\n                        ? <span className=\"text-swap-letter\" style={STYLES.letter}>{word1}</span>\n                        : swapAnimations.map((renderedLetter, i) => {\n                            const { letter, playing, disappear, src, dest } = renderedLetter;\n                            // offsetLeft/offsetTop, not getBoundingClientRect().x.\n                            // The rect is viewport-relative, but these are set on an\n                            // absolutely positioned child of .text-swap, so the old\n                            // code shifted every instance by its own left inset and\n                            // moved with horizontal page scroll. top was never set\n                            // at all, which collapsed wrapped phrases onto one line.\n                            const { offsetLeft, offsetTop } = playing ? dest : src;\n\n                            const letterStyles = {\n                                ...STYLES.animatedLetter,\n                                // opacity has to be in the transition list, or the\n                                // fade this package exists for simply pops.\n                                transition: `left ${transitionDuration}ms ${timingFunction}, top ${transitionDuration}ms ${timingFunction}, opacity ${transitionDuration}ms ${timingFunction}`,\n                                left: `${offsetLeft}px`,\n                                top: `${offsetTop}px`,\n                            };\n\n                            if (disappear) {\n                                letterStyles.opacity = 0;\n                            }\n\n                            return (\n                                <span key={`${i}-${letter}`} className=\"text-swap-letter\" style={letterStyles}>\n                                    {letter}\n                                </span>\n                            );\n                        })\n                }\n            </div>\n        </div>\n    );\n}\n","export const DEFAULT_WORDS = ['Text Swap Animation', 'Antitoxin Swamp Tea'];\n\n/**\n * @typedef AnimationOptions Timing options for when to start, how fast to animate forwards, backwards, and when to loop.\n * @property {number} randomStartMin The minimum amount of time to randomly wait before starting to animate each letter.\n * @property {number} randomStartMax The maximum amount of time to randomly wait before starting to animate each letter. Should be `>= randomStartMin`.\n * @property {number} randomReverseMin The minimum amount of time to randomly wait before starting to animate each letter in reverse.\n * @property {number} randomReverseMax The maximum amount of time to randomly wait before starting to animate each letter in reverse. Should be `>= randomReverseMin`.\n * @property {number} loopAnimation The amount of time to wait before starting the next full loop of the animation. Should be `>= randomReverseMax + transitionDuration`.\n * @property {number} waitToStart The amount of time to wait before beginning the animation on start up the first time.\n * @property {number} transitionDuration How long should it take for a letter to move to its next position. Should be `<= randomReverseMin - randomStartMax`.\n * @property {string} timingFunction What [timing function](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function) should be used for the animation.\n */\n\n/** @type AnimationOptions */\nexport const DEFAULT_ANIMATION_OPTIONS = {\n    randomStartMin: 0,\n    randomStartMax: 3000,\n    randomReverseMin: 6000,\n    randomReverseMax: 9000,\n    loopAnimation: 12000,\n    waitToStart: 0,\n    transitionDuration: 1000,\n    timingFunction: 'ease-in-out',\n};\n","import useFonts from './useFonts';\nimport TextSwap from './TextSwap';\nimport { DEFAULT_ANIMATION_OPTIONS, DEFAULT_WORDS } from './constants';\n\n/**\n * Render and animate from one word to another word and back again.\n * @param {[string, string]} [words] The 2 words or phrases to animate between.\n * @param {AnimationOptions} [animationOptions] Timing options for when to start, how fast to animate forwards, backwards, and when to loop.\n * @param {string} [fontToObserve] The name of an embedded font to wait for before measuring.\n * @returns {JSX.Element|null}\n */\nexport default function Loader({ words = DEFAULT_WORDS, animationOptions = {}, fontToObserve, ...rest }) {\n    const isFontLoaded = useFonts(fontToObserve);\n\n    // Pad to equal length so every letter has a slot to pair with. A letter\n    // with no counterpart is therefore paired with a padding space, which is\n    // what makes \"disappear\" and \"appear\" fall out of the same mechanism.\n    const maxLength = Math.max(words[0].length, words[1].length);\n\n    // Passed as two strings rather than an array: an array literal built here\n    // would be a new reference on every render, and the child depends on it.\n    return isFontLoaded ? (\n        <TextSwap\n            word1={words[0].padEnd(maxLength, ' ')}\n            word2={words[1].padEnd(maxLength, ' ')}\n            animationOptions={{\n                ...DEFAULT_ANIMATION_OPTIONS,\n                ...animationOptions,\n            }}\n            {...rest}\n        />\n    ) : null;\n}\n","import TextSwap from './components/index';\nimport { DEFAULT_ANIMATION_OPTIONS } from './components/constants';\n\nexport { DEFAULT_ANIMATION_OPTIONS };\nexport default TextSwap;\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAwB,SAAS,UAAU;CACvC,MAAM,CAAC,UAAU,gBAAA,GAAe,MAAA,SAAA,CAAS,CAAC,QAAQ;CAElD,CAAA,GAAA,MAAA,UAAA,OAAgB;EAGZ,IAAI,CAAC,YAAY,OAAO,aAAa,eAAe,CAAC,SAAS,OAAO;GACjE,YAAY,IAAI;GAEhB;EACJ;EAEA,IAAI,YAAY;EAChB,MAAM,aAAa;GACf,IAAI,CAAC,WACD,YAAY,IAAI;EAExB;EAKA,SAAS,MAAM,KAAK,SAAS,SAAS,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI;EAEzD,aAAa;GACT,YAAY;EAChB;CACJ,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO;AACX;;;;;;;;;ACpCA,SAAgB,aAAa,MAAM,GAAG,MAAM,KAAK;CAC7C,OAAO,KAAK,MAAM,KAAK,OAAO,KAAK,MAAM,IAAI,IAAI;AACrD;;;;;;;;ACMA,IAAM,SAAS;CAQX,MAAM;EAAE,UAAU;EAAY,SAAS;CAAO;CAC9C,MAAM;EAAE,UAAU;EAAY,UAAU;CAAQ;CAShD,QAAQ,EAAE,YAAY,SAAS;CAC/B,QAAQ;EAAE,YAAY;EAAO,SAAS;EA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