@mks2508/waapi-animation-primitives 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -30
- package/dist/index.cjs +49 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +207 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +1308 -401
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1308 -401
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -63
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/styles/injectStyles.ts","../src/components/SlidingNumber.tsx","../src/components/SlidingText.tsx","../src/components/AnimatedTokens.tsx","../src/hooks/useListFormat.ts","../src/components/AnimatedTokensV2.tsx","../src/hooks/useWAAPIAnimations.ts","../src/contexts/DebugContext.tsx","../src/utils/choreographyTracker.ts","../src/core/types.ts","../src/core/useElementRegistry.ts","../src/core/usePositionCapture.ts","../src/core/useFLIPAnimation.ts","../src/core/useAnimationOrchestrator.ts","../src/primitives/reorder/types.ts","../src/primitives/reorder/useReorder.ts","../src/primitives/reorder/useReorderPresence.ts","../src/primitives/reorder/Reorder.tsx","../src/primitives/morph/types.ts","../src/primitives/morph/MorphContext.tsx","../src/primitives/morph/useMorph.ts","../src/primitives/morph/Morph.tsx","../src/primitives/morph/techniques/useFLIPClipPath.ts","../src/primitives/morph/techniques/useCSSGridMorph.ts","../src/primitives/morph/techniques/useViewTransitions.ts","../src/utils/animationUtils.ts","../src/styles/cssTokens.ts","../src/styles/slidingText.styles.ts","../src/styles/animatedTokens.styles.ts","../src/utils/debugCapture.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAWa,cAAA,kBAaZ,EAAA,GAAA,GAAA,IAAA;AAMD;AAcA;;;cAda;AC1Bb;AASA;AA4FA;;AAEE,cD/DW,oBC+DX,EAAA,GAAA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BAAA,CzBzDmE,EAAA,EyByD3C,WzBzD2C,CAAA,EyByD7B,MzBzD6B,CAAA,MAAA,EAAA,MAAA,CAAA;;;;AASlE,iByBmED,eAAA,CzBjEP,EAAA,EyBiE2B,WzBhE1B,CAAA,EyBgEwC,ezBhEzB;AAIzB;AAsCA;;iByBuCgB,qBAAA,KAA0B,cAAc;;AxBvGxD;AAKA;AACU,iBwB8GM,sBAAA,CxB9GN,MAAA,EwB+GA,exB/GA,EAAA,KAAA,EwBgHD,exBhHC,CAAA,EAAA;EASG,MAAA,EAAA,MAAA;EACC,MAAA,EAAA,MAAA;EAAe,UAAA,EAAA,MAAA;EAqChB,WAAA,EAAA,MAySZ;;;;;AC/VuB;AAuBX,iBuBkHG,aAAA,CvBsef,QAAA,EuBreW,MvBqeX,CAAA,MAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EuBpeK,WvBoeL,CAAA,EuBneE,evBmeF,EAAA;;;;;AA/gB4D,iBuByH7C,oBAAA,CvBzH6C,gBAAA,EAAA,MAAA,CAAA,EuByHG,cvBzHH;;;;iBuBmJ7C,kBAAA,SAA2B;;;AtBvP3C;AAUiB,iBsB0PD,oBAAA,CtB1PU,SAAA,EsB0PsB,StB1PtB,CAAA,EsB0PkC,MtB1PlC,CAAA,MAAA,EAAA,OAAA,CAAA;AAQ1B;AAUA;AASA;AA+GiB,iBsBiID,wBAAA,CtBjIW,EAAA,EsBiIkB,WtBjIlB,CAAA,EsBiIgC,MtBjIhC,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,74 +1,60 @@
|
|
|
1
|
-
import {createContext,useMemo,useRef,useEffect,useLayoutEffect,useState,useCallback,useContext}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function vt(n,t){let e=t?.locale||"en-US",r={style:t?.style||"decimal",minimumFractionDigits:t?.minimumFractionDigits,maximumFractionDigits:t?.maximumFractionDigits,useGrouping:t?.useGrouping??true};t?.style==="currency"&&t?.currency&&(r.currency=t.currency);let s=new Intl.NumberFormat(e,r).formatToParts(n),p=[],h=0;s.forEach(a=>{a.type==="integer"&&(h+=a.value.length);});let g=h,x=0,l=0;return s.forEach((a,d)=>{if(a.type==="integer")for(let f of a.value)p.push({char:f,key:`int-${g}`,isDigit:true,position:g}),g--;else if(a.type==="fraction")for(let f of a.value)x++,p.push({char:f,key:`frac-${x}`,isDigit:true,position:-x});else a.type==="decimal"?p.push({char:a.value,key:"decimal",isDigit:false,position:0}):a.type==="group"?(l++,p.push({char:a.value,key:`group-${l}`,isDigit:false,position:0})):a.type==="currency"?p.push({char:a.value,key:`currency-${d}`,isDigit:false,position:0}):a.type==="percentSign"?p.push({char:a.value,key:"percent",isDigit:false,position:0}):p.push({char:a.value,key:`symbol-${d}`,isDigit:false,position:0});}),p}function rt({value:n,duration:t=700,fontSize:e="3rem",fontWeight:r="700",color:o="#000",digitHeight:s=60,stagger:p=30,motionBlur:h=true,format:g,trend:x=0,animationConfig:l}){let a=useMemo(()=>{if(l){let{overshoot:i=1,stiffness:u=1,mass:y=1}=l,m=.34*u,T=1+.56*i,_=.64/y;return `cubic-bezier(${Math.min(m,1).toFixed(2)}, ${Math.min(T,2).toFixed(2)}, ${Math.min(_,1).toFixed(2)}, 1)`}return "cubic-bezier(0.34, 1.56, 0.64, 1)"},[l]),d=useMemo(()=>vt(n,g),[n,g]),f=useRef(new Set),c=useRef(true),A=useMemo(()=>{if(c.current)return new Set;let i=new Set;return d.forEach(u=>{f.current.has(u.key)||i.add(u.key);}),i},[d]);useEffect(()=>{c.current=false,f.current=new Set(d.map(i=>i.key));},[d]);let D=i=>(Math.abs(i)-1)*p;return jsx("div",{style:{display:"inline-flex",alignItems:"center",fontSize:e,fontWeight:r,color:o,fontVariantNumeric:"tabular-nums",fontFamily:"system-ui, -apple-system, sans-serif",overflow:"hidden"},children:d.map(i=>{let u=A.has(i.key);return i.isDigit?jsx(_t,{digit:Number.parseInt(i.char),duration:t,digitHeight:s,delay:D(i.position),motionBlur:h,easing:a,isEntering:u,trend:x},i.key):jsx(At,{char:i.char,isEntering:u,duration:t,easing:a},i.key)})})}function At({char:n,isEntering:t,duration:e,easing:r}){let o=useRef(null),s=useRef(false);return useLayoutEffect(()=>{!o.current||!t||s.current||(s.current=true,o.current.animate([{opacity:0,transform:"scale(0.8)"},{opacity:1,transform:"scale(1)"}],{duration:e*.3,easing:r,fill:"forwards"}));},[t,e,r]),jsx("span",{ref:o,style:{display:"inline-block",whiteSpace:"pre",opacity:t?0:1},children:n})}function _t({digit:n,duration:t,digitHeight:e,delay:r,motionBlur:o,easing:s,isEntering:p,trend:h}){let g=useRef(null),x=useRef(null),l=useRef(null),a=useRef(`blur-${Math.random().toString(36).slice(2,9)}`).current,d=useRef(null),f=useRef(n),c=useRef(false),A=useMemo(()=>{let i=[];for(let u=-1;u<=1;u++)for(let y=0;y<=9;y++)i.push(y);return i},[]);useLayoutEffect(()=>{if(!c.current){c.current=true;let i=-(n+10)*e;d.current=i,f.current=n,g.current&&(g.current.style.transform=`translateY(${i}px)`);}},[n,e]),useLayoutEffect(()=>{!x.current||!p||x.current.animate([{opacity:0,transform:"scale(0.5) translateY(-20px)"},{opacity:1,transform:"scale(1) translateY(0)"}],{duration:t*.4,easing:s,fill:"forwards"});},[p,t,s]),useEffect(()=>{if(f.current=n,!c.current)return;let i=d.current!==null?((Math.round(-d.current/e)-10)%10+10)%10:n;n===i&&d.current!==null||D(n);},[n,e]);let D=i=>{if(!g.current||!x.current)return;if(l.current){let w=getComputedStyle(g.current),B=new DOMMatrix(w.transform);d.current=B.m42,l.current.cancel(),l.current=null,g.current.style.transform=`translateY(${d.current}px)`;}let u=d.current!==null?-d.current/e:i+10,m=((Math.round(u)-10)%10+10)%10;if(i===m&&d.current!==null){let w=-(i+10)*e;if(g.current){let B=l.current;B&&B.cancel(),g.current.style.transform=`translateY(${w}px)`;}d.current=w;return}let T;h===1?T=i>=m?i-m:10-m+i:h===-1?T=i<=m?i-m:i-m-10:(T=i-m,T>5?T-=10:T<-5&&(T+=10));let _=d.current??-(m+10)*e,E=_-T*e,S=document.getElementById(a)?.querySelector("feGaussianBlur");if(o&&S){let w=Math.min(Math.abs(T)*1.2,6);S.setAttribute("stdDeviation",`0,${w}`),x.current.style.filter=`url(#${a})`;}let U=g.current.animate([{transform:`translateY(${_}px)`},{transform:`translateY(${E}px)`}],{duration:t,delay:r,easing:s,fill:"forwards"});l.current=U,U.onfinish=()=>{let w=-(i+10)*e;g.current&&(U.cancel(),g.current.style.transform=`translateY(${w}px)`),d.current=w,x.current&&(x.current.style.filter="none"),S&&S.setAttribute("stdDeviation","0,0"),l.current=null,f.current!==i&&requestAnimationFrame(()=>{D(f.current);});},U.oncancel=()=>{l.current=null;};};return jsxs(Fragment,{children:[jsx("svg",{style:{position:"absolute",width:0,height:0},"aria-hidden":"true",children:jsx("defs",{children:jsx("filter",{id:a,children:jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"0,0"})})})}),jsx("div",{ref:x,style:{position:"relative",height:`${e}px`,overflow:"hidden",width:"0.65em",textAlign:"center",opacity:p?0:1},children:jsx("div",{ref:g,style:{position:"absolute",left:0,right:0,willChange:"transform"},children:A.map((i,u)=>jsx("div",{style:{height:`${e}px`,display:"flex",alignItems:"center",justifyContent:"center"},children:i},u))})})]})}var q=n=>typeof window>"u"?n:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:window.innerWidth<768?Math.round(n*.6):n,ot=n=>typeof window>"u"?n:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:window.innerWidth<768?Math.round(n*.5):n,b={ENTER_DURATION:200,EXIT_DURATION:180,COLLAPSE_DURATION:200,FLIP_DURATION:300,ENTER_STAGGER:15,EXIT_STAGGER:0,COLLAPSE_DELAY:30,FLIP_DELAY_PERCENT:.25,MIN_DELTA_PX:1},F={OFFSET_Y_ENTER:8,OFFSET_Y_EXIT:-8,OFFSET_X:16,SCALE_EXIT:.95,ROTATE_EXIT:0},X={BLUR_ENTER:4,BLUR_EXIT:2},N={EASE_OUT_CUBIC:"cubic-bezier(0.33, 1, 0.68, 1)",EASE_IN_CUBIC:"cubic-bezier(0.32, 0, 0.67, 0)",EASE_IN_OUT:"cubic-bezier(0.42, 0, 0.58, 1)",EASE_OUT_EXPO:"cubic-bezier(0.16, 1, 0.3, 1)",EASE_FLIP:"cubic-bezier(0.2, 0, 0.2, 1)",SPRING_GENTLE:"linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)",SPRING_SNAPPY:"linear(0, 0.006, 0.024 2%, 0.096 4.2%, 0.397 9.3%, 0.861 15.8%, 1.002 18.7%, 1.093 21.4%, 1.143 24%, 1.156, 1.149 28.3%, 1.115 31.5%, 1.022 40%, 0.988 47.1%, 0.984 55.1%, 0.998 72.3%, 1.001 85.4%, 1)"},Dt={tokenEnter:{get duration(){return q(b.ENTER_DURATION)},get stagger(){return ot(b.ENTER_STAGGER)},easing:N.EASE_OUT_CUBIC,blur:X.BLUR_ENTER,offsetY:F.OFFSET_Y_ENTER},tokenExit:{get duration(){return q(b.EXIT_DURATION)},get stagger(){return ot(b.EXIT_STAGGER)},easing:N.EASE_IN_CUBIC,blur:X.BLUR_EXIT,offsetY:F.OFFSET_Y_EXIT,scale:F.SCALE_EXIT},collapse:{get duration(){return q(b.COLLAPSE_DURATION)},delay:b.COLLAPSE_DELAY,easing:N.EASE_IN_OUT},flip:{get duration(){return q(b.FLIP_DURATION)},delayPercent:b.FLIP_DELAY_PERCENT,easing:N.SPRING_GENTLE}},I={DURATION_ENTER:b.ENTER_DURATION,DURATION_EXIT:b.EXIT_DURATION,DURATION_FLIP:b.FLIP_DURATION,STAGGER_DELAY:b.ENTER_STAGGER,OFFSET_VERTICAL:F.OFFSET_Y_ENTER,OFFSET_HORIZONTAL:F.OFFSET_X,BLUR_AMOUNT:X.BLUR_ENTER,EASING_ENTER:N.EASE_OUT_CUBIC,EASING_EXIT:N.EASE_IN_CUBIC,EASING_FLIP:N.SPRING_GENTLE,SPRING_EASING:N.SPRING_GENTLE},wt={tokenEnter:{duration:b.ENTER_DURATION,stagger:b.ENTER_STAGGER,easing:N.EASE_OUT_CUBIC,blur:X.BLUR_ENTER,offsetY:F.OFFSET_Y_ENTER},tokenExit:{duration:b.EXIT_DURATION,stagger:b.EXIT_STAGGER,easing:N.EASE_IN_CUBIC,blur:X.BLUR_EXIT,offsetY:F.OFFSET_Y_EXIT,scale:F.SCALE_EXIT},collapse:{duration:b.COLLAPSE_DURATION,delay:b.COLLAPSE_DELAY,easing:N.EASE_IN_OUT},flip:{duration:b.FLIP_DURATION,delayPercent:b.FLIP_DELAY_PERCENT,easing:N.SPRING_GENTLE}},z={newToken:{mode:"character",direction:"vertical",staggerDelay:15,blur:true,widthAnimation:true,duration:200,initial:"initial"},existingToken:{mode:"none",blur:false,widthAnimation:false,initial:false},placeholder:{mode:"word",direction:"vertical",blur:true,widthAnimation:false,duration:150},separator:{duration:100,widthAnimation:true}};var $={container:{"--duration-enter":"200ms","--duration-exit":"200ms","--easing-enter":"cubic-bezier(0.25, 0.46, 0.45, 0.94)","--easing-exit":"cubic-bezier(0.55, 0.06, 0.68, 0.19)","--offset-vertical":"8px","--offset-horizontal":"16px","--blur-amount":"4px",display:"inline-flex",overflow:"hidden",verticalAlign:"bottom",willChange:"width"},content:{display:"inline-flex",whiteSpace:"pre"},token:{display:"inline-block",willChange:"transform, opacity, filter",backfaceVisibility:"hidden",fontWeight:"500"},enterFrom:{opacity:0,filter:"blur(var(--blur-amount))"},enterTo:{opacity:1,transform:"translate(0, 0)",filter:"blur(0)"},exitActive:{opacity:0,filter:"blur(var(--blur-amount))"},verticalEnterFrom:{transform:"translateY(var(--offset-vertical))"},verticalExitActive:{transform:"translateY(calc(var(--offset-vertical) * -1))"},horizontalEnterFrom:{transform:"translateX(var(--offset-horizontal))"},horizontalExitActive:{transform:"translateX(calc(var(--offset-horizontal) * -1))"}},at=(n,t)=>{let e={...$.token};return n==="enter-from"?(Object.assign(e,$.enterFrom),t==="vertical"?Object.assign(e,$.verticalEnterFrom):Object.assign(e,$.horizontalEnterFrom)):n==="enter-to"?Object.assign(e,$.enterTo):n==="exit-active"&&(Object.assign(e,$.exitActive),t==="vertical"?Object.assign(e,$.verticalExitActive):Object.assign(e,$.horizontalExitActive)),e};var J=({text:n,mode:t="word",direction:e="vertical",staggerDelay:r=I.STAGGER_DELAY,duration:o=I.DURATION_ENTER,easing:s=I.EASING_ENTER,blur:p=true,widthAnimation:h=false,initial:g="initial",exit:x,className:l="",style:a})=>{let d=useRef(null),f=useRef(null),c=useRef(false),[A,D]=useState(g!=="initial");useEffect(()=>{g==="initial"&&!c.current&&(c.current=true,requestAnimationFrame(()=>{D(true);}));},[g]);let i=x==="exit"?"exit":A?"animate":"initial",u=t==="character"?n.split(""):[n];useLayoutEffect(()=>{if(!h||!d.current||!f.current)return;let m=d.current,T=f.current;if(i==="initial")m.style.width="0px";else if(i==="animate")if(CSS.supports("interpolate-size","allow-keywords"))m.style.width="auto",m.style.transition=`width ${o}ms ${s}`;else {let E=T.scrollWidth;m.style.width=`${E}px`,m.style.transition=`width ${o}ms ${s}`;let S=setTimeout(()=>{m.style.width="auto";},o);return ()=>clearTimeout(S)}else if(i==="exit"){let _=m.getBoundingClientRect().width;m.style.width=`${_}px`,m.getBoundingClientRect(),m.style.width="0px",m.style.transition=`width ${I.DURATION_EXIT}ms ${I.EASING_EXIT}`;}},[i,h,o,s,n]);let y=m=>{let T=m*r,_=i==="exit",E=_?I.DURATION_EXIT:o,S=_?I.EASING_EXIT:s;return {transition:`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
transform var(--duration-enter) var(--ease-enter)
|
|
8
|
-
`},separatorExitActive:{opacity:0,transform:"translateY(-8px)",transition:`
|
|
9
|
-
opacity var(--duration-exit) var(--ease-exit),
|
|
10
|
-
transform var(--duration-exit) var(--ease-exit)
|
|
11
|
-
`},overflow:{display:"inline-flex",alignItems:"center",marginLeft:"4px",opacity:1,transform:"translateY(0)",willChange:"transform, opacity",transition:`
|
|
12
|
-
opacity var(--duration-enter) var(--ease-enter),
|
|
13
|
-
transform var(--duration-enter) var(--ease-enter)
|
|
14
|
-
`},overflowExiting:{opacity:0,transform:"translateY(-8px)",transition:`
|
|
15
|
-
opacity var(--duration-exit) var(--ease-exit),
|
|
16
|
-
transform var(--duration-exit) var(--ease-exit)
|
|
17
|
-
`}},ut=()=>{if(typeof window>"u")return H.container;let n=window.innerWidth<768,t=window.matchMedia("(prefers-reduced-motion: reduce)").matches,e=window.matchMedia("(prefers-contrast: high)").matches;return t?{...H.container,"--duration-enter":"0ms","--duration-exit":"0ms","--duration-collapse":"0ms","--duration-flip":"0ms","--stagger-enter":"0ms","--stagger-exit":"0ms","--blur-enter":"0px","--blur-exit":"0px","--offset-y-enter":"0px","--offset-y-exit":"0px","--scale-exit":"1"}:e?{...H.container,"--blur-enter":"0px","--blur-exit":"0px"}:n?{...H.container,"--duration-enter":"120ms","--duration-exit":"100ms","--duration-collapse":"120ms","--duration-flip":"180ms","--stagger-enter":"8ms","--blur-enter":"2px","--blur-exit":"1px","--offset-y-enter":"4px","--offset-y-exit":"-4px"}:H.container};var gt="waapi-animation-primitives-styles",Pt=`
|
|
18
|
-
/* AnimatedTokens critical animation styles */
|
|
19
|
-
.token-wrapper {
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
margin-right: 4px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.token-wrapper:last-child {
|
|
26
|
-
margin-right: 0;
|
|
27
|
-
}
|
|
1
|
+
import e,{Children as t,cloneElement as n,createContext as r,forwardRef as i,isValidElement as a,useCallback as o,useContext as s,useEffect as c,useImperativeHandle as l,useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import './index.css';
|
|
2
|
+
const _=e=>typeof window>`u`?e:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:window.innerWidth<768?Math.round(e*.6):e,v=e=>typeof window>`u`?e:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:window.innerWidth<768?Math.round(e*.5):e,y={ENTER_DURATION:200,EXIT_DURATION:180,COLLAPSE_DURATION:200,FLIP_DURATION:300,ENTER_STAGGER:15,EXIT_STAGGER:0,COLLAPSE_DELAY:30,FLIP_DELAY_PERCENT:.25,MIN_DELTA_PX:1},b={OFFSET_Y_ENTER:8,OFFSET_Y_EXIT:-8,OFFSET_X:16,SCALE_ENTER:.85,SCALE_EXIT:.85,ROTATE_EXIT:0},x={BLUR_ENTER:4,BLUR_EXIT:2},S={MATERIAL_DECELERATE:`cubic-bezier(0, 0, 0.2, 1)`,MATERIAL_ACCELERATE:`cubic-bezier(0.4, 0, 1, 1)`,MATERIAL_STANDARD:`cubic-bezier(0.4, 0, 0.2, 1)`,EASE_REORDER:`cubic-bezier(0.215, 0.61, 0.355, 1)`,EASE_OUT_CUBIC:`cubic-bezier(0.33, 1, 0.68, 1)`,EASE_IN_CUBIC:`cubic-bezier(0.32, 0, 0.67, 0)`,EASE_IN_OUT:`cubic-bezier(0.42, 0, 0.58, 1)`,EASE_OUT_EXPO:`cubic-bezier(0.16, 1, 0.3, 1)`,EASE_FLIP:`cubic-bezier(0.2, 0, 0.2, 1)`,SPRING_GENTLE:`linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.099 24.3%, 1.108 26%, 1.100, 1.078 30.1%, 1.049 32.5%, 0.994 37.3%, 0.981 40.2%, 0.974 43.4%, 0.975 50.2%, 0.997 62.5%, 1.001 74.7%, 1)`,SPRING_SNAPPY:`linear(0, 0.006, 0.024 2%, 0.096 4.2%, 0.397 9.3%, 0.861 15.8%, 1.002 18.7%, 1.093 21.4%, 1.143 24%, 1.156, 1.149 28.3%, 1.115 31.5%, 1.022 40%, 0.988 47.1%, 0.984 55.1%, 0.998 72.3%, 1.001 85.4%, 1)`},C={tokenEnter:{get duration(){return _(y.ENTER_DURATION)},get stagger(){return v(y.ENTER_STAGGER)},easing:S.MATERIAL_DECELERATE,blur:x.BLUR_ENTER,offsetY:b.OFFSET_Y_ENTER,scale:b.SCALE_ENTER},tokenExit:{get duration(){return _(y.EXIT_DURATION)},get stagger(){return v(y.EXIT_STAGGER)},easing:S.MATERIAL_ACCELERATE,blur:x.BLUR_EXIT,offsetY:b.OFFSET_Y_EXIT,scale:b.SCALE_EXIT},collapse:{get duration(){return _(y.COLLAPSE_DURATION)},delay:y.COLLAPSE_DELAY,easing:S.MATERIAL_STANDARD},flip:{get duration(){return _(y.FLIP_DURATION)},delayPercent:y.FLIP_DELAY_PERCENT,easing:S.EASE_REORDER}},w={DURATION_ENTER:y.ENTER_DURATION,DURATION_EXIT:y.EXIT_DURATION,DURATION_FLIP:y.FLIP_DURATION,STAGGER_DELAY:y.ENTER_STAGGER,OFFSET_VERTICAL:b.OFFSET_Y_ENTER,OFFSET_HORIZONTAL:b.OFFSET_X,BLUR_AMOUNT:x.BLUR_ENTER,EASING_ENTER:S.EASE_OUT_CUBIC,EASING_EXIT:S.EASE_IN_CUBIC,EASING_FLIP:S.SPRING_GENTLE,SPRING_EASING:S.SPRING_GENTLE},T={tokenEnter:{duration:y.ENTER_DURATION,stagger:y.ENTER_STAGGER,easing:S.MATERIAL_DECELERATE,blur:x.BLUR_ENTER,offsetY:b.OFFSET_Y_ENTER,scale:b.SCALE_ENTER},tokenExit:{duration:y.EXIT_DURATION,stagger:y.EXIT_STAGGER,easing:S.MATERIAL_ACCELERATE,blur:x.BLUR_EXIT,offsetY:b.OFFSET_Y_EXIT,scale:b.SCALE_EXIT},collapse:{duration:y.COLLAPSE_DURATION,delay:y.COLLAPSE_DELAY,easing:S.MATERIAL_STANDARD},flip:{duration:y.FLIP_DURATION,delayPercent:y.FLIP_DELAY_PERCENT,easing:S.EASE_REORDER}},E={newToken:{mode:`character`,direction:`vertical`,staggerDelay:15,blur:!0,widthAnimation:!0,duration:200,initial:`initial`},existingToken:{mode:`none`,blur:!1,widthAnimation:!1,initial:!1},placeholder:{mode:`word`,direction:`vertical`,blur:!0,widthAnimation:!1,duration:150},separator:{duration:100,widthAnimation:!0}},D=[{name:`--waapi-duration-exit`,syntax:`<time>`,inherits:!0,initialValue:`${y.EXIT_DURATION}ms`},{name:`--waapi-duration-enter`,syntax:`<time>`,inherits:!0,initialValue:`${y.ENTER_DURATION}ms`},{name:`--waapi-duration-flip`,syntax:`<time>`,inherits:!0,initialValue:`${y.FLIP_DURATION}ms`},{name:`--waapi-duration-collapse`,syntax:`<time>`,inherits:!0,initialValue:`${y.COLLAPSE_DURATION}ms`},{name:`--waapi-stagger-enter`,syntax:`<time>`,inherits:!0,initialValue:`${y.ENTER_STAGGER}ms`},{name:`--waapi-stagger-exit`,syntax:`<time>`,inherits:!0,initialValue:`${y.EXIT_STAGGER}ms`},{name:`--waapi-offset-y-enter`,syntax:`<length>`,inherits:!0,initialValue:`${b.OFFSET_Y_ENTER}px`},{name:`--waapi-offset-y-exit`,syntax:`<length>`,inherits:!0,initialValue:`${b.OFFSET_Y_EXIT}px`},{name:`--waapi-offset-x`,syntax:`<length>`,inherits:!0,initialValue:`${b.OFFSET_X}px`},{name:`--waapi-scale-exit`,syntax:`<number>`,inherits:!0,initialValue:`${b.SCALE_EXIT}`},{name:`--waapi-scale-enter`,syntax:`<number>`,inherits:!0,initialValue:`${b.SCALE_ENTER}`},{name:`--waapi-blur-enter`,syntax:`<length>`,inherits:!0,initialValue:`${x.BLUR_ENTER}px`},{name:`--waapi-blur-exit`,syntax:`<length>`,inherits:!0,initialValue:`${x.BLUR_EXIT}px`},{name:`--waapi-stagger-index`,syntax:`<integer>`,inherits:!1,initialValue:`0`}],O=()=>D.map(e=>`@property ${e.name} {
|
|
3
|
+
syntax: '${e.syntax}';
|
|
4
|
+
inherits: ${e.inherits};
|
|
5
|
+
initial-value: ${e.initialValue};
|
|
6
|
+
}`).join(`
|
|
28
7
|
|
|
29
|
-
.token-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
8
|
+
`),k={durationEnter:`--waapi-duration-enter`,durationExit:`--waapi-duration-exit`,durationCollapse:`--waapi-duration-collapse`,durationFlip:`--waapi-duration-flip`,staggerEnter:`--waapi-stagger-enter`,staggerExit:`--waapi-stagger-exit`,offsetYEnter:`--waapi-offset-y-enter`,offsetYExit:`--waapi-offset-y-exit`,offsetX:`--waapi-offset-x`,scaleExit:`--waapi-scale-exit`,blurEnter:`--waapi-blur-enter`,blurExit:`--waapi-blur-exit`,easeEnter:`--waapi-ease-enter`,easeExit:`--waapi-ease-exit`,easeCollapse:`--waapi-ease-collapse`,easeFlip:`--waapi-ease-flip`,separatorDuration:`--waapi-separator-duration`,separatorDelay:`--waapi-separator-delay`,separatorEasing:`--waapi-separator-easing`},A={[k.durationEnter]:`${y.ENTER_DURATION}ms`,[k.durationExit]:`${y.EXIT_DURATION}ms`,[k.durationCollapse]:`${y.COLLAPSE_DURATION}ms`,[k.durationFlip]:`${y.FLIP_DURATION}ms`,[k.staggerEnter]:`${y.ENTER_STAGGER}ms`,[k.staggerExit]:`${y.EXIT_STAGGER}ms`,[k.offsetYEnter]:`${b.OFFSET_Y_ENTER}px`,[k.offsetYExit]:`${b.OFFSET_Y_EXIT}px`,[k.offsetX]:`${b.OFFSET_X}px`,[k.scaleExit]:`${b.SCALE_EXIT}`,[k.blurEnter]:`${x.BLUR_ENTER}px`,[k.blurExit]:`${x.BLUR_EXIT}px`,[k.easeEnter]:S.EASE_OUT_CUBIC,[k.easeExit]:S.EASE_IN_CUBIC,[k.easeCollapse]:S.EASE_IN_OUT,[k.easeFlip]:S.EASE_FLIP,[k.separatorDuration]:`${y.FLIP_DURATION}ms`,[k.separatorDelay]:`${Math.round(y.EXIT_DURATION*y.FLIP_DELAY_PERCENT)}ms`,[k.separatorEasing]:S.EASE_FLIP},j=e=>`var(${e})`,M={...A},N={container:{...M,display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:0},placeholder:{color:`var(--muted-foreground)`,fontStyle:`italic`},tokenWrapper:{display:`inline-flex`,alignItems:`center`},tokenWrapperExitCompleted:{position:`absolute`,opacity:0,pointerEvents:`none`},separator:{display:`inline`,whiteSpace:`pre`,marginLeft:`0.25em`,willChange:`transform, opacity`},separatorExitCoordinated:{opacity:0,transform:`translateY(-8px) scale(${b.SCALE_EXIT})`},separatorExitCompleted:{opacity:0,position:`absolute`,pointerEvents:`none`,width:0,overflow:`hidden`},overflow:{display:`inline-flex`,alignItems:`center`,whiteSpace:`nowrap`}},P={container:{...M,display:`inline-flex`,overflow:`hidden`,verticalAlign:`bottom`,willChange:`width`},content:{display:`inline-flex`,whiteSpace:`pre`},token:{display:`inline-block`,willChange:`transform, opacity, filter`,backfaceVisibility:`hidden`,fontWeight:500},enterFrom:{opacity:0,filter:`blur(${j(k.blurEnter)})`},enterTo:{opacity:1,transform:`translate(0, 0)`,filter:`blur(0)`},exitActive:{opacity:0,filter:`blur(${j(k.blurExit)})`},verticalEnterFrom:{transform:`translateY(${j(k.offsetYEnter)})`},verticalExitActive:{transform:`translateY(${j(k.offsetYExit)})`},horizontalEnterFrom:{transform:`translateX(${j(k.offsetX)})`},horizontalExitActive:{transform:`translateX(calc(${j(k.offsetX)} * -1))`}},F={mobile:{[k.durationEnter]:`120ms`,[k.durationExit]:`100ms`,[k.durationCollapse]:`120ms`,[k.durationFlip]:`180ms`,[k.staggerEnter]:`8ms`,[k.blurEnter]:`2px`,[k.blurExit]:`1px`,[k.offsetYEnter]:`4px`,[k.offsetYExit]:`-4px`},smallMobile:{[k.durationEnter]:`80ms`,[k.durationExit]:`60ms`,[k.durationFlip]:`120ms`,[k.staggerEnter]:`4ms`,[k.blurEnter]:`1px`,[k.blurExit]:`0px`,[k.offsetYEnter]:`2px`,[k.offsetYExit]:`-2px`},reducedMotion:{[k.durationEnter]:`0ms`,[k.durationExit]:`0ms`,[k.durationCollapse]:`0ms`,[k.durationFlip]:`0ms`,[k.staggerEnter]:`0ms`,[k.staggerExit]:`0ms`,[k.blurEnter]:`0px`,[k.blurExit]:`0px`,[k.offsetYEnter]:`0px`,[k.offsetYExit]:`0px`,[k.scaleExit]:`1`},highContrast:{[k.blurEnter]:`0px`,[k.blurExit]:`0px`}},I=()=>{if(typeof window>`u`)return A;if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return{...A,...F.reducedMotion};if(window.matchMedia(`(prefers-contrast: high)`).matches)return{...A,...F.highContrast};let e=window.innerWidth;return e<=480?{...A,...F.smallMobile}:e<=768?{...A,...F.mobile}:A},L=()=>`:root {\n${Object.entries(A).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
9
|
+
`)}\n}`,R=()=>`
|
|
10
|
+
/* ============================================
|
|
11
|
+
@property DEFINITIONS (Modern CSS 2024)
|
|
12
|
+
Enables typed, animatable CSS custom properties
|
|
13
|
+
Baseline: July 2024 - All major browsers
|
|
14
|
+
============================================ */
|
|
15
|
+
${O()}
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
17
|
+
/* ============================================
|
|
18
|
+
CSS VARIABLES (derived from animationUtils.ts SSOT)
|
|
19
|
+
============================================ */
|
|
20
|
+
${L()}
|
|
40
21
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
@media (max-width: 768px) {
|
|
23
|
+
:root {
|
|
24
|
+
${Object.entries(F.mobile).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
25
|
+
`)}
|
|
26
|
+
}
|
|
45
27
|
}
|
|
46
28
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
@media (max-width: 480px) {
|
|
30
|
+
:root {
|
|
31
|
+
${Object.entries(F.smallMobile).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
32
|
+
`)}
|
|
33
|
+
}
|
|
51
34
|
}
|
|
52
35
|
|
|
53
|
-
/* Reduced motion support */
|
|
54
36
|
@media (prefers-reduced-motion: reduce) {
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
animation: none !important;
|
|
60
|
-
transition: none !important;
|
|
61
|
-
transform: none !important;
|
|
62
|
-
}
|
|
37
|
+
:root {
|
|
38
|
+
${Object.entries(F.reducedMotion).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
39
|
+
`)}
|
|
40
|
+
}
|
|
63
41
|
}
|
|
64
42
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
43
|
+
@media (prefers-contrast: high) {
|
|
44
|
+
:root {
|
|
45
|
+
${Object.entries(F.highContrast).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
46
|
+
`)}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`.trim(),z=`waapi-animation-primitives-vars`;let B=!1;const V=()=>{if(typeof document>`u`||B)return;if(document.getElementById(z)){B=!0;return}let e=document.createElement(`style`);e.id=z,e.textContent=R(),document.head.appendChild(e),B=!0},H=()=>{if(typeof document>`u`)return;let e=document.getElementById(z);e&&(e.remove(),B=!1)},U=()=>{H(),V()};typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,V):V());function ee(e,t){let n=t?.locale||`en-US`,r={style:t?.style||`decimal`,minimumFractionDigits:t?.minimumFractionDigits,maximumFractionDigits:t?.maximumFractionDigits,useGrouping:t?.useGrouping??!0};t?.style===`currency`&&t?.currency&&(r.currency=t.currency);let i=new Intl.NumberFormat(n,r).formatToParts(e),a=[],o=0;i.forEach(e=>{e.type===`integer`&&(o+=e.value.length)});let s=o,c=0,l=0;return i.forEach((e,t)=>{if(e.type===`integer`)for(let t of e.value)a.push({char:t,key:`int-${s}`,isDigit:!0,position:s}),s--;else if(e.type===`fraction`)for(let t of e.value)c++,a.push({char:t,key:`frac-${c}`,isDigit:!0,position:-c});else e.type===`decimal`?a.push({char:e.value,key:`decimal`,isDigit:!1,position:0}):e.type===`group`?(l++,a.push({char:e.value,key:`group-${l}`,isDigit:!1,position:0})):e.type===`currency`?a.push({char:e.value,key:`currency-${t}`,isDigit:!1,position:0}):e.type===`percentSign`?a.push({char:e.value,key:`percent`,isDigit:!1,position:0}):a.push({char:e.value,key:`symbol-${t}`,isDigit:!1,position:0})}),a}function W({value:e,duration:t=700,fontSize:n=`3rem`,fontWeight:r=`700`,color:i=`#000`,digitHeight:a=60,stagger:o=30,motionBlur:s=!0,format:l,trend:u=0,animationConfig:p}){let m=d(()=>{if(p){let{overshoot:e=1,stiffness:t=1,mass:n=1}=p,r=.34*t,i=1+.56*e,a=.64/n;return`cubic-bezier(${Math.min(r,1).toFixed(2)}, ${Math.min(i,2).toFixed(2)}, ${Math.min(a,1).toFixed(2)}, 1)`}return`cubic-bezier(0.34, 1.56, 0.64, 1)`},[p]),g=d(()=>ee(e,l),[e,l]),_=f(new Set),v=f(!0),y=d(()=>{if(v.current)return new Set;let e=new Set;return g.forEach(t=>{_.current.has(t.key)||e.add(t.key)}),e},[g]);c(()=>{v.current=!1,_.current=new Set(g.map(e=>e.key))},[g]);let b=e=>(Math.abs(e)-1)*o;return h(`div`,{style:{display:`inline-flex`,alignItems:`center`,fontSize:n,fontWeight:r,color:i,fontVariantNumeric:`tabular-nums`,fontFamily:`system-ui, -apple-system, sans-serif`,overflow:`hidden`},children:g.map(e=>{let n=y.has(e.key);return e.isDigit?h(ne,{digit:Number.parseInt(e.char),duration:t,digitHeight:a,delay:b(e.position),motionBlur:s,easing:m,isEntering:n,trend:u},e.key):h(te,{char:e.char,isEntering:n,duration:t,easing:m},e.key)})})}function te({char:e,isEntering:t,duration:n,easing:r}){let i=f(null),a=f(!1);return u(()=>{!i.current||!t||a.current||(a.current=!0,i.current.animate([{opacity:0,transform:`scale(0.8)`},{opacity:1,transform:`scale(1)`}],{duration:n*.3,easing:r,fill:`forwards`}))},[t,n,r]),h(`span`,{ref:i,style:{display:`inline-block`,whiteSpace:`pre`,opacity:t?0:1},children:e})}function ne({digit:e,duration:t,digitHeight:n,delay:r,motionBlur:i,easing:a,isEntering:o,trend:s}){let l=f(null),p=f(null),_=f(null),v=f(`blur-${Math.random().toString(36).slice(2,9)}`).current,y=f(null),b=f(e),x=f(!1),S=d(()=>{let e=[];for(let t=-1;t<=1;t++)for(let t=0;t<=9;t++)e.push(t);return e},[]);u(()=>{if(!x.current){x.current=!0;let t=-(e+10)*n;y.current=t,b.current=e,l.current&&(l.current.style.transform=`translateY(${t}px)`)}},[e,n]),u(()=>{!p.current||!o||p.current.animate([{opacity:0,transform:`scale(0.5) translateY(-20px)`},{opacity:1,transform:`scale(1) translateY(0)`}],{duration:t*.4,easing:a,fill:`forwards`})},[o,t,a]),c(()=>{b.current=e,x.current&&(e===(y.current===null?e:((Math.round(-y.current/n)-10)%10+10)%10)&&y.current!==null||C(e))},[e,n]);let C=e=>{if(!l.current||!p.current)return;if(_.current){let e=getComputedStyle(l.current);y.current=new DOMMatrix(e.transform).m42,_.current.cancel(),_.current=null,l.current.style.transform=`translateY(${y.current}px)`}let o=y.current===null?e+10:-y.current/n,c=((Math.round(o)-10)%10+10)%10;if(e===c&&y.current!==null){let t=-(e+10)*n;if(l.current){let e=_.current;e&&e.cancel(),l.current.style.transform=`translateY(${t}px)`}y.current=t;return}let u;s===1?u=e>=c?e-c:10-c+e:s===-1?u=e<=c?e-c:e-c-10:(u=e-c,u>5?u-=10:u<-5&&(u+=10));let d=y.current??-(c+10)*n,f=d-u*n,m=document.getElementById(v)?.querySelector(`feGaussianBlur`);if(i&&m){let e=Math.min(Math.abs(u)*1.2,6);m.setAttribute(`stdDeviation`,`0,${e}`),p.current.style.filter=`url(#${v})`}let h=l.current.animate([{transform:`translateY(${d}px)`},{transform:`translateY(${f}px)`}],{duration:t,delay:r,easing:a,fill:`forwards`});_.current=h,h.onfinish=()=>{let t=-(e+10)*n;l.current&&(h.cancel(),l.current.style.transform=`translateY(${t}px)`),y.current=t,p.current&&(p.current.style.filter=`none`),m&&m.setAttribute(`stdDeviation`,`0,0`),_.current=null,b.current!==e&&requestAnimationFrame(()=>{C(b.current)})},h.oncancel=()=>{_.current=null}};return g(m,{children:[h(`svg`,{style:{position:`absolute`,width:0,height:0},"aria-hidden":`true`,children:h(`defs`,{children:h(`filter`,{id:v,children:h(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`0,0`})})})}),h(`div`,{ref:p,style:{position:`relative`,height:`${n}px`,overflow:`hidden`,width:`0.65em`,textAlign:`center`,opacity:o?0:1},children:h(`div`,{ref:l,style:{position:`absolute`,left:0,right:0,willChange:`transform`},children:S.map((e,t)=>h(`div`,{style:{height:`${n}px`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e},t))})})]})}const re=r(null),G=()=>{let e=s(re);if(!e)throw Error(`useDebug must be used within DebugProvider`);return e},ie=({children:e})=>{let[t,n]=p([]),[r,i]=p(!0),[a,s]=p(!1),l=f(r),u=f([]),m=f(null);f([]);let g=f(!1);l.current=r,g.current=a;let _=o(()=>{if(u.current.length===0)return;let e=[...u.current];u.current=[],m.current=null,n(t=>[...t,...e])},[]);c(()=>()=>{m.current!==null&&(cancelAnimationFrame(m.current),u.current.length>0&&(n(e=>[...e,...u.current]),u.current=[]))},[]);let v=o(e=>{},[_]),y=o(()=>{},[]),b=o(()=>{},[]),x=o(()=>{},[]),S=o(()=>{},[]),C=o(()=>{},[]),w=o(()=>[],[]),T=o(()=>{},[_]),E=o(()=>``,[t]),D=o(()=>``,[t]),O=d(()=>({events:[],isEnabled:!1,isCollecting:!1,enableDebug:b,disableDebug:x,toggleDebug:S,logEvent:v,clearEvents:y,getEventLog:D,exportToCSV:E,startCollecting:C,stopCollecting:w,flushEvents:T}),[t,r,a,b,x,S,v,y,D,E,C,w,T]);return h(re.Provider,{value:O,children:e})};function K(e){let t=getComputedStyle(e);return{opacity:t.opacity,transform:t.transform,filter:t.filter,width:t.width,height:t.height,marginRight:t.marginRight,marginLeft:t.marginLeft,position:t.position,visibility:t.visibility,pointerEvents:t.pointerEvents}}function ae(e){let t=K(e);return{opacity:t.opacity,transform:t.transform===`none`?`none`:t.transform,filter:t.filter===`none`?`none`:t.filter,width:t.width,marginRight:t.marginRight,position:t.position}}function q(e){let t=e.getBoundingClientRect();return{x:Math.round(t.x*100)/100,y:Math.round(t.y*100)/100,width:Math.round(t.width*100)/100,height:Math.round(t.height*100)/100,top:Math.round(t.top*100)/100,left:Math.round(t.left*100)/100,right:Math.round(t.right*100)/100,bottom:Math.round(t.bottom*100)/100}}function oe(e){let t=q(e);return{x:t.x,y:t.y,w:t.width,h:t.height}}function se(e,t){return{deltaX:Math.round((e.left-t.left)*100)/100,deltaY:Math.round((e.top-t.top)*100)/100,deltaWidth:Math.round((e.width-t.width)*100)/100,deltaHeight:Math.round((e.height-t.height)*100)/100}}function ce(e,t){let n=K(t);return Object.entries(e).map(([e,t])=>{let r=n[e]||``;return{property:e,expected:t,actual:r,matches:le(e,t)===le(e,r)}})}function le(e,t){if(!t)return``;if(e===`opacity`)return parseFloat(t).toString();if(e===`transform`){if(t===`none`)return`none`;let e=t.match(/matrix\(([^)]+)\)/);if(e&&e[1]){let t=e[1].split(`,`).map(e=>parseFloat(e.trim())),n=t[4],r=t[5];if(n!==void 0&&r!==void 0)return`translate(${Math.round(n)}px, ${Math.round(r)}px)`}return t}if(e===`width`||e===`height`||e.includes(`margin`)){let e=parseFloat(t);if(!isNaN(e))return`${Math.round(e)}px`}if(e===`filter`){if(t===`none`)return`none`;let e=t.match(/blur\(([^)]+)\)/);if(e&&e[1]){let t=parseFloat(e[1]);return`blur(${Math.round(t)}px)`}}return t}function J(e){let t=performance.now();return{start:t,expectedDuration:e,end:()=>{let n=performance.now(),r=n-t,i=r-e;return{startTime:Math.round(t*100)/100,endTime:Math.round(n*100)/100,expectedDuration:e,actualDuration:Math.round(r*100)/100,deviation:Math.round(i*100)/100,deviationPercent:Math.round(i/e*1e4)/100}}}}function ue(e){let t=e.deviation>=0?`+`:``,n=Math.abs(e.deviation)<10?`✅`:`⚠️`;return`Expected: ${e.expectedDuration}ms | Actual: ${e.actualDuration}ms | Deviation: ${t}${e.deviation}ms ${n}`}function de(e){let t=e.effect?.getTiming?.();return{id:e.id,playState:e.playState,currentTime:e.currentTime,playbackRate:e.playbackRate,pending:e.pending,duration:t?.duration,easing:t?.easing,fill:t?.fill}}function fe(e){return e.getAnimations().map(de)}const Y=new class{constructor(){this.activeAnimations=new Map,this.timeline=[],this.completedAnimations=[],this.sessionStartTime=0}startSession(){}getRelativeTime(){return Math.round((performance.now()-this.sessionStartTime)*100)/100}startAnimation(e,t,n,r){}endAnimation(e){}detectOverlaps(e){let t=[];return this.activeAnimations.forEach((n,r)=>{r!==e&&t.push(`${n.type}:${n.elementId}`)}),t}getOverlaps(){return[]}getTimeline(){return[]}getActiveCount(){return 0}getActiveAnimations(){return[]}getCompletedAnimations(){return[]}getSummary(){return{totalAnimations:0,totalDuration:0,overlaps:[],timeline:[],activeAnimations:[]}}getTimelineForVisualization(){return[]}},X=({text:e,mode:t=`word`,direction:n=`vertical`,staggerDelay:r=w.STAGGER_DELAY,duration:i=w.DURATION_ENTER,easing:a=w.EASING_ENTER,blur:o=!0,widthAnimation:s=!1,initial:l=`initial`,exit:d,className:m=``,style:g})=>{let _=f(null),v=f(null),{logEvent:y}=G(),b=f(null),x=f(null),S=f(!1),[C,T]=p(l!==`initial`);c(()=>{l===`initial`&&!S.current&&(S.current=!0,requestAnimationFrame(()=>{T(!0)}))},[l]);let E=d===`exit`?`exit`:C?`animate`:`initial`,D=t===`character`?e.split(``):[e],O=i+(D.length-1)*r;c(()=>{if(E===`animate`&&_.current){let c=_.current;b.current=J(O),x.current=`enter-${e.slice(0,10)}-${Date.now()}`,Y.startAnimation(x.current,`enter`,e,O);let l=q(c);y({type:`text-enter-start`,source:`SlidingText`,message:`Enter animation starting for: "${e}"`,timing:{startTime:b.current.start,expectedDuration:O},position:{element:e,x:l.x,y:l.y,width:l.width,height:l.height},animation:{name:`enter`,phase:`start`,easing:a,fill:`forwards`},data:{text:e,charCount:D.length,mode:t,direction:n,staggerDelay:r,duration:i,totalDuration:O,blur:o,widthAnimation:s}});let u=setTimeout(()=>{if(b.current&&x.current&&_.current){let t=b.current.end();Y.endAnimation(x.current);let n=q(_.current);y({type:`text-enter-complete`,source:`SlidingText`,message:`Enter animation complete for: "${e}"`,timing:{startTime:t.startTime,endTime:t.endTime,expectedDuration:t.expectedDuration,actualDuration:t.actualDuration,deviation:t.deviation,deviationPercent:t.deviationPercent},position:{element:e,x:n.x,y:n.y,width:n.width,height:n.height},animation:{name:`enter`,phase:`complete`,progress:1,easing:a,fill:`forwards`},data:{text:e,deviationStatus:Math.abs(t.deviation)<10?`OK`:`WARNING`}})}},O+50);return()=>clearTimeout(u)}},[E,e,t,n,r,i,a,o,s,O,D.length,y]),u(()=>{if(!s||!_.current||!v.current)return;let e=_.current,t=v.current;if(E===`initial`)e.style.width=`0px`;else if(E===`animate`)if(CSS.supports(`interpolate-size`,`allow-keywords`))e.style.width=`auto`,e.style.transition=`width ${i}ms ${a}`;else{let n=t.scrollWidth;e.style.width=`${n}px`,e.style.transition=`width ${i}ms ${a}`;let r=setTimeout(()=>{e.style.width=`auto`},i);return()=>clearTimeout(r)}else if(E===`exit`){let t=e.getBoundingClientRect().width;e.style.width=`${t}px`,e.getBoundingClientRect(),e.style.width=`0px`,e.style.transition=`width ${w.DURATION_EXIT}ms ${w.EASING_EXIT}`}},[E,s,i,a,e]);let k=e=>{let t=e*r,s=E===`exit`,c=s?w.DURATION_EXIT:i,l=s?w.EASING_EXIT:a;return{transition:`
|
|
50
|
+
opacity ${c}ms ${l} ${t}ms,
|
|
51
|
+
transform ${c}ms ${l} ${t}ms,
|
|
52
|
+
filter ${c}ms ${l} ${t}ms
|
|
53
|
+
`,"--blur-amount":o?`${w.BLUR_AMOUNT}px`:`0px`,"--offset":n===`vertical`?`${w.OFFSET_VERTICAL}px`:`${w.OFFSET_HORIZONTAL}px`}};return h(`div`,{ref:_,className:`waapi-sliding-text-container ${m}`,style:g,children:h(`div`,{ref:v,className:`waapi-sliding-text-content waapi-direction-${n}`,children:D.map((e,t)=>h(`span`,{className:`waapi-sliding-text-token ${E===`initial`?`enter-from`:E===`animate`?`enter-to`:`exit-active`}`,style:k(t),children:e},t))})})},pe=e=>{let{logEvent:t}=G(),n=f(t);c(()=>{n.current=t},[t]);let r=f(e);c(()=>{r.current=e},[e]);let i=f(new Map),a=f(new Map),s=f({animatingIds:new Set,positions:new Map,separatorStates:new Map}),l=f(new Map),u=o((e,t)=>{t?i.current.set(e,t):i.current.delete(e)},[]),d=o(e=>{let t=new Map;return i.current.forEach((n,r)=>{if(!e.has(r)){let e=n.getBoundingClientRect();e.width>0&&e.height>0&&t.set(r,e)}}),s.current.positions=t,t},[]),p=o(e=>{let t=l.current.get(e);t&&(t.forEach(e=>e.cancel()),l.current.delete(e))},[]),m=o((e,t)=>{s.current.separatorStates.has(e)||s.current.separatorStates.set(e,{tokenId:e,isVisible:!0,isAnimating:!1,animationPhase:`idle`}),t?a.current.set(e,t):a.current.delete(e)},[]),h=o(e=>s.current.separatorStates.get(e),[]),g=o(async e=>{let t=a.current.get(e),i=s.current.separatorStates.get(e);if(!t){if(i){n.current({type:`separator-animation-state-only`,source:`useWAAPIAnimations.startSeparatorAnimation`,message:`Separator state exists but no DOM element for token: ${e} - marking as completed`,data:{tokenId:e,reason:`state-no-element`}}),i.animationPhase=`completed`,i.isVisible=!1;return}n.current({type:`separator-animation-skipped`,source:`useWAAPIAnimations.startSeparatorAnimation`,message:`No separator element found for token: ${e} - skipping animation`,data:{tokenId:e,reason:`no-separator-element`}});return}let o=r.current.exitDuration||y.EXIT_DURATION,c=r.current.exitEasing||S.EASE_IN_CUBIC,l={tokenId:e,isVisible:!0,isAnimating:!0,animationPhase:`exit-coordinated`,startTime:performance.now(),expectedEndTime:performance.now()+o};s.current.separatorStates.set(e,l);let u=`separator-${e}-${Date.now()}`;Y.startAnimation(u,`separator-exit`,e,o),n.current({type:`separator-animation-start`,source:`useWAAPIAnimations.startSeparatorAnimation`,message:`Separator animation starting for token: ${e}`,timing:{startTime:l.startTime||Date.now(),expectedDuration:o},data:{tokenId:e,duration:o}}),t.classList.add(`exit-coordinated`);let d=t.animate([{opacity:1,transform:`translateY(0) scale(1)`},{opacity:0,transform:`translateY(${b.OFFSET_Y_EXIT}px) scale(${b.SCALE_EXIT})`}],{duration:o,easing:c,fill:`forwards`});try{await d.finished}catch{return}l.animationPhase=`completed`,l.isVisible=!1,t.classList.add(`exit-completed`),Y.endAnimation(u),n.current({type:`separator-animation-complete`,source:`useWAAPIAnimations.startSeparatorAnimation`,message:`Separator animation complete for token: ${e}`,data:{tokenId:e,duration:o}})},[]),_=o(e=>{Array.from(s.current.separatorStates.keys()).forEach(t=>{e.has(t)||(s.current.separatorStates.delete(t),n.current({type:`separator-state-cleanup`,source:`useWAAPIAnimations.cleanupSeparatorStates`,message:`Removed separator state for non-existent token: ${t}`,data:{tokenId:t}}))})},[]),v=o(async(e,t)=>{let a=i.current.get(e);if(!a||s.current.animatingIds.has(e))return;s.current.animatingIds.add(e),d(new Set([e])),new Set([e,...t||[]]).forEach(e=>{g(e)});let o=r.current.exitDuration||y.EXIT_DURATION,c=r.current.exitEasing||S.EASE_IN_CUBIC,u=r.current.flipDuration||y.FLIP_DURATION,f=b.OFFSET_Y_EXIT,p=b.SCALE_EXIT,m=x.BLUR_EXIT,h=y.EXIT_STAGGER,_=a.getBoundingClientRect(),v=getComputedStyle(a),C=parseFloat(v.marginRight)||0,w=J(o),T=J(o+u),E=K(a),D=q(a),O=`exit-${e}-${Date.now()}`;Y.startAnimation(O,`exit-fade`,e,o);let k=`width-${e}-${Date.now()}`;Y.startAnimation(k,`width-collapse`,e,o),n.current({type:`animation-start-detailed`,source:`useWAAPIAnimations.startExit`,message:`Exit animation starting for: ${e}`,timing:{startTime:w.start,expectedDuration:o},styles:Object.entries(E).map(([e,t])=>({property:e,expected:t,actual:t,matches:!0})),position:{element:e,x:D.x,y:D.y,width:D.width,height:D.height},animation:{name:`exit`,phase:`start`,easing:c,fill:`forwards`},data:{id:e,capturedPositions:s.current.positions.size,wrapperWidth:_.width,marginRight:C,expectedFinalStyles:{opacity:`0`,transform:`translateY(${f}px) scale(${p})`,filter:`blur(${m}px)`,width:`0px`,marginRight:`0px`}}});let A=[],j=[],M=!1,N=a.querySelectorAll(`.sliding-text-token`);if(N.length>0)N.forEach((e,t)=>{let n=t*h,r=e.animate([{opacity:1,transform:`translateY(0) scale(1)`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${f}px) scale(${p})`,filter:`blur(${m}px)`}],{duration:o,easing:c,delay:n,fill:`forwards`});A.push(r)});else{let e=a.animate([{opacity:1,transform:`translateY(0) scale(1)`},{opacity:0,transform:`translateY(${f}px) scale(${p})`}],{duration:o,easing:c,fill:`forwards`});A.push(e)}a.style.overflow=`hidden`;let P=a.animate([{width:`${_.width}px`,marginRight:`${C}px`},{width:`0px`,marginRight:`0px`}],{duration:o,easing:c,fill:`forwards`});A.push(P),l.current.set(e,A);let F=o*y.FLIP_DELAY_PERCENT,I=()=>{if(!M){if(M=!0,a.style.position=`absolute`,a.style.opacity=`0`,a.style.pointerEvents=`none`,Array.from(i.current.entries()).filter(([t])=>t!==e).length===0){n.current({type:`flip-skipped`,source:`useWAAPIAnimations.startExit`,message:`No remaining elements to FLIP - skipping animation`,data:{id:e}});return}i.current.forEach((t,r)=>{if(r===e)return;let i=s.current.positions.get(r);if(!i)return;let a=t.getBoundingClientRect(),o=i.left-a.left,c=i.top-a.top;if(Math.abs(o)<1&&Math.abs(c)<1)return;let l=`flip-${r}-${Date.now()}`;Y.startAnimation(l,`flip`,r,u),n.current({type:`flip-animation`,source:`useWAAPIAnimations.startExit`,message:`FLIP animation for: ${r}`,timing:{startTime:performance.now(),expectedDuration:u},position:{element:r,x:a.left,y:a.top,width:a.width,height:a.height,delta:{x:o,y:c}},animation:{name:`flip`,phase:`start`,easing:S.SPRING_GENTLE,fill:`none`},data:{id:r,deltaX:Math.round(o*100)/100,deltaY:Math.round(c*100)/100,prevPosition:{x:i.left,y:i.top,width:i.width,height:i.height},newPosition:{x:a.left,y:a.top,width:a.width,height:a.height}}});let d=t.animate([{transform:`translate3d(${o}px, ${c}px, 0)`},{transform:`translate3d(0, 0, 0)`}],{duration:u,easing:S.SPRING_GENTLE});d.onfinish=()=>{Y.endAnimation(l),n.current({type:`flip-animation-complete`,source:`useWAAPIAnimations.startExit`,message:`FLIP complete for: ${r}`,animation:{name:`flip`,phase:`complete`,progress:1},data:{id:r}})},j.push(d)})}},L=setTimeout(I,F);try{let t=A.filter(e=>e!==P),r=P.finished;await Promise.all(t.map(e=>e.finished));let i=w.end();n.current({type:`exit-fade-complete`,source:`useWAAPIAnimations.startExit`,message:`Exit fade complete for: ${e}`,timing:{startTime:i.startTime,endTime:i.endTime,expectedDuration:i.expectedDuration,actualDuration:i.actualDuration,deviation:i.deviation,deviationPercent:i.deviationPercent},animation:{name:`exit-fade`,phase:`complete`,progress:1,easing:c},data:{id:e}}),I(),await Promise.all([...j.map(e=>e.finished.catch(()=>{})),r])}catch{clearTimeout(L),s.current.animatingIds.delete(e);return}Y.endAnimation(O),Y.endAnimation(k);let R=T.end(),z=q(a),B=ce({opacity:`0`,width:`0px`,marginRight:`0px`},a);n.current({type:`orchestration-complete`,source:`useWAAPIAnimations.startExit`,message:`Orchestration complete for: ${e}`,timing:{startTime:R.startTime,endTime:R.endTime,expectedDuration:R.expectedDuration,actualDuration:R.actualDuration,deviation:R.deviation,deviationPercent:R.deviationPercent},styles:B,position:{element:e,x:z.x,y:z.y,width:z.width,height:z.height},animation:{name:`orchestration`,phase:`complete`,progress:1,easing:c,fill:`forwards`},data:{id:e,choreographySummary:Y.getSummary(),deviationStatus:Math.abs(R.deviation)<100?`OK`:`WARNING`,styleMatchCount:B.filter(e=>e.matches).length,styleMismatchCount:B.filter(e=>!e.matches).length}}),n.current({type:`animation-timing`,source:`useWAAPIAnimations.startExit`,message:`Orchestration timing for: ${e}`,timing:{startTime:R.startTime,endTime:R.endTime,expectedDuration:R.expectedDuration,actualDuration:R.actualDuration,deviation:R.deviation,deviationPercent:R.deviationPercent},animation:{name:`orchestration`,phase:`complete`},data:{id:e,status:Math.abs(R.deviation)<100?`✅ ON TIME`:`⚠️ SLOW`}}),s.current.animatingIds.delete(e),l.current.delete(e),i.current.delete(e),r.current.onComplete(e)},[d]),C=o(e=>e?s.current.animatingIds.has(e):s.current.animatingIds.size>0,[]);return c(()=>()=>{l.current.forEach(e=>{e.forEach(e=>e.cancel())}),l.current.clear()},[]),{registerElement:u,startExit:v,isAnimating:C,cancelAnimations:p,registerSeparator:m,getSeparatorState:h,startSeparatorAnimation:g,cleanupSeparatorStates:_}},me=({tokens:e,placeholder:t=`No tokens`,maxVisible:n,textAnimationMode:r=`character`,textDirection:i=`vertical`,textStaggerDelay:a=15,separator:s=`, `,enableWidthAnimation:l=!1,className:u=``,tokenClassName:d=``,placeholderClassName:m=``,separatorClassName:_=``})=>{let{logEvent:v}=G(),y=f(!0),b=f(v);c(()=>{b.current=v},[v]),c(()=>(y.current=!0,b.current({type:`render`,source:`AnimatedTokens.mount`,message:`AnimatedTokens mounted`,data:{tokenCount:e.length}}),()=>{b.current({type:`component-unmounted`,source:`AnimatedTokens.unmount`,message:`AnimatedTokens UNMOUNTING`,data:{timestamp:Date.now()}}),y.current=!1}),[]);let[x,S]=p(e),C=f(new Set),{registerElement:T,startExit:D,isAnimating:O,registerSeparator:k,getSeparatorState:A,cleanupSeparatorStates:j}=pe({onComplete:o(e=>{y.current&&(b.current({type:`token-dom-remove`,source:`AnimatedTokens.onComplete`,message:`Token removed from DOM: ${e}`,data:{id:e}}),C.current.delete(e),S(t=>t.filter(t=>t.id!==e)))},[])}),M=f(D),N=f(A),P=f(j);c(()=>{M.current=D,N.current=A,P.current=j},[D,A,j]);let F=x.filter(e=>!C.current.has(e.id)||!O(e.id)),I=n?x.slice(0,n):x,L=n?Math.max(0,F.length-n):0,R=(e,t)=>{if(t>=I.length-1)return!1;let n=N.current?.(e);if(!n)return!0;switch(n.animationPhase){case`idle`:case`exit-coordinated`:case`flip-coordinated`:return!0;case`completed`:return!1;default:return!0}};c(()=>{let t=new Set(e.map(e=>e.id)),r=new Set(x.map(e=>e.id)),i=new Set(I.map(e=>e.id));P.current?.(i);let a=x.filter(e=>!t.has(e.id)&&!C.current.has(e.id)),o=e.filter(e=>!r.has(e.id));if(!(a.length===0&&o.length===0)&&(b.current({type:`render`,source:`AnimatedTokens.useEffect`,message:`Token sync`,data:{currentTokens:e.map(e=>e.id),displayTokens:x.map(e=>e.id),removed:a.map(e=>e.id),added:o.map(e=>e.id),animating:Array.from(C.current)}}),a.forEach(e=>{let t=x.findIndex(t=>t.id===e.id);if(n!==void 0&&t>=n)b.current({type:`overflow-token-remove`,source:`AnimatedTokens.useEffect`,message:`Removing overflow token without animation`,data:{id:e.id}}),S(t=>t.filter(t=>t.id!==e.id));else{let t=[],r=x.slice(0,n),i=r.findIndex(t=>t.id===e.id),a=i<r.length-1;if(i===r.length-1&&i>0){let e=r[i-1];e&&t.push(e.id)}b.current({type:`token-remove`,source:`AnimatedTokens.useEffect`,message:`Token marked for exit: ${e.text}`,data:{id:e.id,text:e.text,additionalSeparators:t,shouldAnimateOwnSeparator:a,wasLastVisible:i===r.length-1}}),C.current.add(e.id);let o=a?[e.id,...t]:t;M.current(e.id,o)}}),o.length>0)){o.forEach(e=>{b.current({type:`token-add`,source:`AnimatedTokens.useEffect`,message:`New token detected: ${e.text}`,data:{id:e.id,text:e.text}})}),o.forEach(t=>{let r=e.findIndex(e=>e.id===t.id);(n?r<Math.min(n,e.length)-1:r<e.length-1)&&k(t.id,null)});let r=x.filter(e=>!t.has(e.id)),i=[...e];r.forEach(e=>{let t=x.findIndex(t=>t.id===e.id);t!==-1&&t<=i.length&&i.splice(t,0,e)}),JSON.stringify(i.map(e=>e.id))!==JSON.stringify(x.map(e=>e.id))&&S(i)}},[e,n]);let z=f(0),B=L>0&&z.current===0,V=L===0&&z.current>0;c(()=>{z.current=L},[L]);let H=x.length===0&&!O()&&!!t;return g(`div`,{className:`waapi-animated-tokens-container ${u}`,children:[H&&h(X,{text:t,mode:E.placeholder.mode,direction:E.placeholder.direction,blur:E.placeholder.blur,duration:E.placeholder.duration,initial:`initial`,animate:`animate`,className:`waapi-token-placeholder ${m}`},`placeholder`),I.map((e,t)=>{let n=C.current.has(e.id),o=R(e.id,t);return g(`div`,{className:`waapi-token-wrapper ${d} ${n?`exit-active`:``}`,ref:t=>T(e.id,t),children:[h(X,{text:e.text,mode:n?`none`:r,direction:i,staggerDelay:a,duration:w.DURATION_ENTER,blur:E.newToken.blur,widthAnimation:!n&&l,initial:n?!1:`initial`,animate:`animate`}),o&&h(`span`,{className:`waapi-token-separator ${_}`,ref:t=>k(e.id,t),children:s})]},e.id)}),(L>0||V)&&g(`div`,{className:`waapi-token-overflow ${d} ${B?`entering`:``} ${V?`exiting`:``}`,ref:e=>T(`overflow-counter`,e),children:[I.length>0&&h(`span`,{className:`waapi-token-separator ${_}`,children:s}),h(`span`,{className:`waapi-token-separator ${_}`,children:`+`}),h(W,{value:L,duration:w.DURATION_ENTER,fontSize:`inherit`,fontWeight:`inherit`,color:`inherit`}),h(X,{text:` more`,mode:r,direction:i,staggerDelay:a,duration:V?w.DURATION_EXIT:w.DURATION_ENTER,blur:E.newToken.blur,initial:B?`initial`:!1,animate:`animate`})]})]})};function he(e){let t=f(new Map),n=f(e);return c(()=>{n.current=e},[e]),{register:o((e,r)=>{r?(t.current.set(e,r),n.current?.onRegister?.(e,r)):t.current.has(e)&&(t.current.delete(e),n.current?.onUnregister?.(e))},[]),unregister:o(e=>{t.current.has(e)&&(t.current.delete(e),n.current?.onUnregister?.(e))},[]),get:o(e=>t.current.get(e),[]),getAll:o(()=>new Map(t.current),[]),has:o(e=>t.current.has(e),[]),clear:o(()=>{let e=Array.from(t.current.keys());t.current.clear(),e.forEach(e=>n.current?.onUnregister?.(e))},[]),get size(){return t.current.size}}}const ge=y.MIN_DELTA_PX;function _e(e,t){let n=f(new Map),r=t?.minDeltaPx??ge;return{capture:o(t=>{let r=new Map;return e().forEach((e,n)=>{if(t?.has(n))return;let i=e.getBoundingClientRect();i.width>0&&i.height>0&&r.set(n,i)}),n.current=r,r},[e]),getPosition:o(e=>n.current.get(e),[]),calculateDeltas:o((e,t)=>{let n=new Map;return t.forEach((t,i)=>{let a=e.get(i);if(!a)return;let o=a.left-t.left,s=a.top-t.top,c=a.width-t.width,l=a.height-t.height,u=Math.abs(o)>=r||Math.abs(s)>=r||Math.abs(c)>=r||Math.abs(l)>=r;n.set(i,{id:i,deltaX:o,deltaY:s,deltaWidth:c,deltaHeight:l,isSignificant:u})}),n},[r]),getLastCapture:o(()=>new Map(n.current),[]),clear:o(()=>{n.current.clear()},[])}}const ve=y.FLIP_DURATION,ye=S.SPRING_GENTLE;function be(){let e=f(new Map),t=f(new Set),n=o((n,r,i)=>{let a=i?.duration??ve,o=i?.easing??ye;e.current.has(r.id)&&e.current.get(r.id)?.cancel(),t.current.add(r.id),i?.onStart?.(r.id);let s=n.animate([{transform:`translate3d(${r.deltaX}px, ${r.deltaY}px, 0)`},{transform:`translate3d(0, 0, 0)`}],{duration:a,easing:o});return e.current.set(r.id,s),s.onfinish=()=>{t.current.delete(r.id),e.current.delete(r.id),i?.onComplete?.(r.id)},s.oncancel=()=>{t.current.delete(r.id),e.current.delete(r.id)},s},[]),r=o(async(e,t,r)=>{let i=[];t.forEach((t,a)=>{if(!t.isSignificant)return;let o=e.get(a);if(!o)return;let s=n(o,t,r);i.push(s)}),i.length!==0&&await Promise.all(i.map(e=>e.finished.catch(()=>{})))},[n]),i=o(n=>{let r=e.current.get(n);r&&(r.cancel(),e.current.delete(n),t.current.delete(n))},[]),a=o(()=>{e.current.forEach(e=>e.cancel()),e.current.clear(),t.current.clear()},[]),s=o(e=>e?t.current.has(e):t.current.size>0,[]);c(()=>()=>{a()},[a]);let l=f({animate:n,animateAll:r,cancel:i,cancelAll:a,isAnimating:s});return l.current.animate=n,l.current.animateAll=r,l.current.cancel=i,l.current.cancelAll=a,l.current.isAnimating=s,l.current}function xe(e){let t=f(e);c(()=>{t.current=e},[e]);let{logEvent:n}=G(),r=f(n);c(()=>{r.current=n},[n]);let i=f({animatingIds:new Set,positions:new Map,activeAnimations:new Map}),a=he(),s=_e(a.getAll,{minDeltaPx:e?.minDeltaPx??y.MIN_DELTA_PX}),l=be(),u=e?.exitDuration??y.EXIT_DURATION,d=e?.flipDuration??y.FLIP_DURATION,p=e?.exitEasing??S.EASE_IN_CUBIC,m=o(e=>{let t=i.current.activeAnimations.get(e);t&&(t.forEach(e=>e.cancel()),i.current.activeAnimations.delete(e)),i.current.animatingIds.delete(e),l.cancel(e)},[l]),h=o(()=>{i.current.activeAnimations.forEach(e=>{e.forEach(e=>e.cancel())}),i.current.activeAnimations.clear(),i.current.animatingIds.clear(),l.cancelAll()},[l]),g=e?.flipBehavior??`all`,_=e?.exitPositionStrategy??`absolute-fixed`,v=o(async(e,n)=>{let r=a.get(e);if(!r||i.current.animatingIds.has(e))return;i.current.animatingIds.add(e);let o=n?.duration??u,s=n?.easing??p,c=a.getAll(),l=new Map,f=r.getBoundingClientRect();l.set(e,f),c.forEach((t,n)=>{if(n!==e){let e=t.getBoundingClientRect();e.width>0&&e.height>0&&l.set(n,e)}});let m=r.parentElement;r.dataset.reorderState=`exiting`,_===`absolute-fixed`&&(r.dataset.exitPosition=`absolute`);let h=m?.getBoundingClientRect()||{left:0,top:0},v=f.left-h.left,C=f.top-h.top;_===`absolute-fixed`&&(r.style.position=`absolute`,r.style.left=`${v}px`,r.style.top=`${C}px`,r.style.width=`${f.width}px`,r.style.height=`${f.height}px`,r.style.margin=`0`);let w=m?.getBoundingClientRect()||{left:0,top:0},T=w.left-h.left,E=w.top-h.top;(Math.abs(T)>.5||Math.abs(E)>.5)&&(r.style.transform=`translate(${-T}px, ${-E}px)`);let D=new Map;c.forEach((t,n)=>{if(n!==e){let e=t.getBoundingClientRect();e.width>0&&e.height>0&&D.set(n,e)}});let O=[];if(g!==`none`){let t=[];if(g===`all`)t=[...D.keys()];else if(g===`siblings-after`){let n=Array.from(c.entries());n.sort((e,t)=>{let n=e[1],r=t[1];return n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1});let r=n.map(([e])=>e),i=r.indexOf(e);i!==-1&&(t=r.slice(i+1).filter(e=>D.has(e)))}t.forEach(e=>{let t=l.get(e),n=D.get(e);if(!t||!n)return;let r=t.left-n.left,i=t.top-n.top;if(Math.abs(r)>1||Math.abs(i)>1){let t=c.get(e);if(t){t.dataset.reorderState=`flipping`,t.style.transform=`translate(${r}px, ${i}px)`;let e=t.animate([{transform:`translate(${r}px, ${i}px)`},{transform:`none`}],{duration:d,easing:S.MATERIAL_DECELERATE,fill:`forwards`});O.push(e),e.finished.then(()=>{t.style.transform=``,t.dataset.reorderState=`idle`}).catch(()=>{t.style.transform=``,t.dataset.reorderState=`idle`})}}})}let k=[],A=r.querySelectorAll(`.sliding-text-token`);if(A.length>0)A.forEach((e,t)=>{let n=t*y.EXIT_STAGGER,r=e.animate([{opacity:1,transform:`translateY(0) scale(1)`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${b.OFFSET_Y_EXIT}px) scale(${b.SCALE_EXIT})`,filter:`blur(${x.BLUR_EXIT}px)`}],{duration:o,easing:s,delay:n,fill:`forwards`});k.push(r)});else{let e=r.animate([{opacity:1,transform:`scale(1)`},{opacity:0,transform:`scale(${b.SCALE_EXIT})`}],{duration:o,easing:s,fill:`forwards`});k.push(e)}i.current.activeAnimations.set(e,[...k,...O]);try{await Promise.all([...k.map(e=>e.finished),...O.map(e=>e.finished)])}catch{i.current.animatingIds.delete(e),i.current.activeAnimations.delete(e);return}i.current.animatingIds.delete(e),i.current.activeAnimations.delete(e),r.dataset.reorderState=`completed`,_===`absolute-fixed`&&(r.style.removeProperty(`position`),r.style.removeProperty(`left`),r.style.removeProperty(`top`),r.style.removeProperty(`width`),r.style.removeProperty(`height`),r.style.removeProperty(`margin`)),delete r.dataset.exitPosition,a.unregister(e),n?.onComplete?.(),t.current?.onExitComplete?.(e)},[a,u,p,d,g,_]),C=o(async(e,n)=>{let r=a.get(e);if(!r)return;r.dataset.reorderState||(r.dataset.reorderState=`entering`);let i=t.current?.enterDuration??y.ENTER_DURATION,o=t.current?.enterEasing??S.MATERIAL_DECELERATE,s=n?.duration??i,c=n?.easing??o,l=n?.stagger??y.ENTER_STAGGER,u=r.querySelectorAll(`.sliding-text-token`),d=[],f={opacity:0,transform:`translateY(-8px) scale(0.95)`},p={opacity:1,transform:`none`};if(u.length>0)u.forEach((e,t)=>{let n=t*l;e.dataset.reorderIndex=String(t);let r=e.animate([{...f,filter:`blur(${x.BLUR_ENTER}px)`},{...p,filter:`blur(0px)`}],{duration:s,easing:c,delay:n,fill:`forwards`});d.push(r)});else{let e=r.animate([f,p],{duration:s,easing:c,fill:`forwards`});d.push(e)}try{await Promise.all(d.map(e=>e.finished))}catch{r.dataset.reorderState=`idle`;return}r.dataset.reorderState=`idle`,n?.onComplete?.(),t.current?.onEnterComplete?.(e)},[a]),w=o(e=>e?i.current.animatingIds.has(e):i.current.animatingIds.size>0,[]),T=o(e=>s.capture(e),[s]);return c(()=>()=>{h()},[h]),{registry:a,positions:s,flip:l,registerElement:a.register,startExit:v,startEnter:C,isAnimating:w,cancelAnimation:m,cancelAllAnimations:h,capturePositions:T}}function Z(e){let{logEvent:t}=G(),n=f(t);c(()=>{n.current=t},[t]);let r=xe({enterDuration:e?.enterDuration,exitDuration:e?.exitDuration,flipDuration:e?.flipDuration,enterEasing:e?.enterEasing,exitEasing:e?.exitEasing,flipEasing:e?.flipEasing,flipBehavior:e?.flipBehavior,onExitComplete:e?.onComplete});return c(()=>()=>{},[]),{...r,registerElement:r.registerElement,startItemExit:r.startExit,startItemEnter:r.startEnter}}function Se(e,r={}){let{autoAnimate:i=!0,stagger:s,enterDuration:l,exitDuration:p,flipDuration:m,enterEasing:h,exitEasing:g,flipEasing:_}=r,{logEvent:v}=G(),y=f(v);c(()=>{y.current=v},[v]);let b=f(r);c(()=>{b.current=r},[r]);let x=f(new Set),S=f(new Set),C=f(new Set),w=o((e,t)=>s?typeof s==`number`?s*e:(s[t]??0)*e:0,[s]),T=Z({enterDuration:l,exitDuration:p,flipDuration:m,enterEasing:h,exitEasing:g,flipEasing:_,onComplete:o(e=>{x.current.delete(e),b.current.onAnimationComplete?.(e)},[])}),E=d(()=>{let n=new Set;return t.forEach(e,e=>{a(e)&&e.key!=null&&n.add(String(e.key))}),n},[e]);u(()=>{let e=C.current,t=[];E.forEach(n=>{!e.has(n)&&!S.current.has(n)&&t.push(n)}),t.length>0&&t.forEach((e,t)=>{let n=w(t,`enter`),r=()=>{S.current.add(e),b.current.onItemEnter?.(e),requestAnimationFrame(()=>{T.startItemEnter(e).then(()=>{S.current.delete(e)})})};n>0?setTimeout(r,n):r()}),C.current=new Set(E)},[E,i,T,w]);let D=o(e=>{x.current.has(e)||T.registry.has(e)&&(x.current.add(e),b.current.onItemExit?.(e),T.startItemExit(e))},[T]),O=o(e=>x.current.has(e),[]),k=o(e=>S.current.has(e),[]),A=o(()=>Array.from(x.current),[]),j=o(()=>Array.from(S.current),[]),M=d(()=>{let r=[];return t.forEach(e,e=>{if(!a(e)){r.push(e);return}let t=e.key==null?null:String(e.key);t!=null&&x.current.has(t)?r.push(n(e,{"data-reorder-state":`exiting`})):r.push(e)}),r},[e]);return c(()=>()=>{},[]),{presentChildren:M,triggerExit:D,isExiting:O,isEntering:k,exitingIds:A(),enteringIds:j(),reorder:T}}function Ce(e,t){if(e!==void 0)return typeof e==`number`?e:e[t]}const we={auto:{position:`relative`},horizontal:{display:`flex`,flexDirection:`row`,flexWrap:`wrap`,alignItems:`center`,position:`relative`},vertical:{display:`flex`,flexDirection:`column`,position:`relative`},grid:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(100px, 1fr))`,gap:`8px`,position:`relative`}},Q=i(({children:e,autoAnimate:r=!0,stagger:i,duration:s,layout:u=`auto`,className:m=``,flipBehavior:g,exitPositionStrategy:_,onItemExit:v,onItemEnter:y},b)=>{let{logEvent:x}=G(),S=f(x);c(()=>{S.current=x},[x]);let C=f(v),w=f(y);c(()=>{C.current=v,w.current=y},[v,y]);let T=o(e=>{j(t=>t.filter(t=>t.key!==e))},[]),E=Z({enterDuration:Ce(s,`enter`),exitDuration:Ce(s,`exit`),flipBehavior:g,exitPositionStrategy:_,onComplete:T});l(b,()=>({startItemExit:E.startItemExit,startItemEnter:E.startItemEnter,isAnimating:E.isAnimating}),[E.startItemExit,E.startItemEnter,E.isAnimating]);let D=f(E.startItemExit),O=f(E.startItemEnter);c(()=>{D.current=E.startItemExit,O.current=E.startItemEnter},[E.startItemExit,E.startItemEnter]);let k=d(()=>{let n=[];return t.forEach(e,e=>{a(e)&&e.key!=null&&n.push({key:String(e.key),element:e})}),n},[e]),[A,j]=p(k),M=f(new Set),N=o((e,t)=>i?typeof i==`number`?i*e:(i[t]??0)*e:0,[i]);c(()=>{let e=new Set(k.map(e=>e.key)),t=new Set(A.map(e=>e.key)),n=A.filter(t=>!e.has(t.key)&&!M.current.has(t.key)),r=k.filter(e=>!t.has(e.key));if(n.length===0&&r.length===0){k.some(e=>{let t=A.find(t=>t.key===e.key);return t&&t.element!==e.element})&&j(e=>e.map(e=>M.current.has(e.key)?e:k.find(t=>t.key===e.key)??e));return}if(n.forEach((e,t)=>{let n=N(t,`exit`);M.current.add(e.key);let r=()=>{C.current?.(e.key),D.current(e.key).finally(()=>{M.current.delete(e.key)})};n>0?setTimeout(r,n):r()}),r.length>0){let t=A.filter(t=>!e.has(t.key)),n=[...k];t.forEach(e=>{let t=A.findIndex(t=>t.key===e.key);t!==-1&&t<=n.length&&n.splice(t,0,e)}),j(n),r.forEach((e,t)=>{let n=N(t,`enter`),r=()=>{w.current?.(e.key)};n>0?setTimeout(r,n):r()})}},[k,A,N]);let P=d(()=>{let e=new Set(k.map(e=>e.key));return A.map(({key:t,element:r})=>{let i=!!e.has(t),a=M.current.has(t);return n(r,{ref:e=>{e?(E.registerElement(t,e),!e.dataset.reorderState&&i&&!a&&(e.dataset.reorderState=`entering`,O.current(t))):E.registerElement(t,null);let n=r.ref;typeof n==`function`?n(e):n&&typeof n==`object`&&(n.current=e)},"data-reorder-id":t})})},[A,k,E.registerElement]);return h(`div`,{className:`waapi-reorder-container reorder ${u===`auto`?``:`reorder--${u}`} ${m}`,style:we[u],children:P})});Q.displayName=`Reorder`;const Te=()=>typeof navigator<`u`&&navigator.language?navigator.language:`en`;function Ee(e,t={}){let{locale:n,type:r=`conjunction`,style:i=`long`,separator:a}=t;return d(()=>{if(e.length===0)return[];if(a!==void 0){let t=[];return e.forEach((n,r)=>{t.push({type:`element`,value:n,index:r}),r<e.length-1&&t.push({type:`literal`,value:a,index:r})}),t}let t=n??Te();try{let n=new Intl.ListFormat(t,{type:r,style:i}).formatToParts(e),a=0;return n.map(e=>e.type===`element`?{type:`element`,value:e.value,index:a++}:{type:`literal`,value:e.value,index:Math.max(0,a-1)})}catch{let t=[];return e.forEach((n,r)=>{t.push({type:`element`,value:n,index:r}),r<e.length-1&&t.push({type:`literal`,value:`, `,index:r})}),t}},[e,n,r,i,a])}const De=({tokens:e,placeholder:t=`No tokens`,maxVisible:n,textAnimationMode:r=`character`,textDirection:i=`vertical`,textStaggerDelay:a=15,locale:s,listType:l=`conjunction`,listStyle:u=`long`,separator:p,enableWidthAnimation:m=!1,className:_=``,tokenClassName:v=``,placeholderClassName:x=``,separatorClassName:C=``})=>{let{logEvent:T}=G(),D=f(T);c(()=>{D.current=T},[T]);let O=f(new Set),k=f(new Map),A=f(new Map),j=d(()=>n?e.slice(0,n):e,[e,n]),M=d(()=>n?Math.max(0,e.length-n):0,[e.length,n]),N=Ee(j.map(e=>e.text),{locale:s,type:l,style:u,separator:p}),P=f(0),F=M>0&&P.current===0,I=M===0&&P.current>0;c(()=>{P.current=M},[M]);let L=o((e,t)=>{if(t>=j.length-1)return!1;let n=k.current.get(e);if(!n)return!0;switch(n.animationPhase){case`idle`:case`exit-coordinated`:case`flip-coordinated`:return!0;case`completed`:return!1;default:return!0}},[j.length]);c(()=>{let e=new Set(j.map(e=>e.id)),t=k.current;for(let n of t.keys())e.has(n)||k.current.delete(n);j.forEach((e,t)=>{t<j.length-1&&!k.current.has(e.id)&&k.current.set(e.id,{animationPhase:`idle`})})},[j]);let R=o(e=>{let t=A.current.get(e);t&&(k.current.set(e,{animationPhase:`exit-coordinated`}),t.dataset.separatorState=`exiting`,t.animate([{opacity:1,transform:`translateY(0) scale(1)`},{opacity:0,transform:`translateY(${b.OFFSET_Y_EXIT}px) scale(${b.SCALE_EXIT})`}],{duration:y.EXIT_DURATION,easing:S.EASE_IN_CUBIC,fill:`forwards`}).finished.then(()=>{k.current.set(e,{animationPhase:`completed`}),t.dataset.separatorState=`completed`}).catch(()=>{k.current.delete(e)}))},[]),z=o(e=>{O.current.add(e);let t=[],n=j.findIndex(t=>t.id===e);if(n===j.length-1&&n>0){let e=j[n-1];e&&t.push(e.id)}R(e),t.forEach(e=>R(e)),D.current({type:`token-remove`,source:`AnimatedTokensV2`,message:`Token exiting: ${e}`,data:{id:e,additionalSeparators:t}})},[j,R]),B=o(e=>{D.current({type:`token-add`,source:`AnimatedTokensV2`,message:`Token entering: ${e}`,data:{id:e}})},[]),V=e.length===0&&!!t,H=d(()=>N.map((e,t)=>{if(e.type===`element`){let t=j[e.index];if(!t)return null;let n=O.current.has(t.id);return h(`span`,{className:`waapi-token-wrapper ${v}`,"data-reorder-id":t.id,children:h(X,{text:t.text,mode:n?`none`:r,direction:i,staggerDelay:a,duration:w.DURATION_ENTER,blur:E.newToken.blur,widthAnimation:!n&&m,initial:n?!1:`initial`,animate:`animate`})},t.id)}let n=j[e.index];if(!n)return null;let o=j.findIndex(e=>e.id===n.id);return L(n.id,o)?h(`span`,{ref:e=>{e?A.current.set(n.id,e):A.current.delete(n.id)},className:`waapi-token-separator ${C}`,"data-separator-state":k.current.get(n.id)?.animationPhase??`idle`,children:e.value},`sep-${n.id}-${t}`):null}).filter(Boolean),[N,j,v,r,i,a,m,C,L]),U=d(()=>p===void 0?[...N].reverse().find(e=>e.type===`literal`)?.value??`, `:p,[N,p]),ee=d(()=>M===0&&!I?null:g(`div`,{"data-reorder-id":`overflow-counter`,className:`waapi-token-overflow ${v} ${F?`entering`:``} ${I?`exiting`:``}`,children:[j.length>0&&h(`span`,{className:`waapi-token-separator ${C}`,children:U}),h(`span`,{className:`waapi-token-separator ${C}`,children:`+`}),h(W,{value:M,duration:w.DURATION_ENTER,fontSize:`inherit`,fontWeight:`inherit`,color:`inherit`}),h(X,{text:` more`,mode:r,direction:i,staggerDelay:a,duration:I?w.DURATION_EXIT:w.DURATION_ENTER,blur:E.newToken.blur,initial:F?`initial`:!1,animate:`animate`})]},`overflow-counter`),[M,F,I,v,j.length,U,C,r,i,a]);return g(`div`,{role:`text`,className:`waapi-animated-tokens-container waapi-v2 ${_}`,children:[V&&h(X,{text:t,mode:E.placeholder.mode,direction:E.placeholder.direction,blur:E.placeholder.blur,duration:E.placeholder.duration,initial:`initial`,animate:`animate`,className:`waapi-token-placeholder ${x}`},`placeholder`),g(Q,{layout:`horizontal`,onItemExit:z,onItemEnter:B,children:[H,ee]})]})},$=r(null);function Oe(){let e=s($);if(!e)throw Error(`useMorphContext must be used within a <Morph> component. Wrap your morphable components with <Morph>.`);return e}const ke=y.FLIP_DURATION,Ae=S.EASE_OUT_CUBIC;function je(e){let[t,n]=p(!1),r=f([]),i=f(e);c(()=>{i.current=e},[e]);let a=o(()=>{r.current.forEach(e=>e.cancel()),r.current=[],n(!1)},[]),s=o(async(e,o)=>{t&&a(),n(!0);let s=i.current?.duration??ke,c=i.current?.easing??Ae,l=e.getBoundingClientRect(),u=o.getBoundingClientRect(),d=l.left-u.left,f=l.top-u.top,p=l.width/u.width,m=l.height/u.height,h=getComputedStyle(e).borderRadius,g=getComputedStyle(o).borderRadius,_=i.current?.clipPathStart||Me(h,l),v=i.current?.clipPathEnd||Me(g,u),y={position:e.style.position,opacity:e.style.opacity,pointerEvents:e.style.pointerEvents},b={position:o.style.position,opacity:o.style.opacity,transform:o.style.transform,clipPath:o.style.clipPath};e.style.position=`absolute`,e.style.pointerEvents=`none`,o.style.position=`relative`,o.style.transform=`translate(${d}px, ${f}px) scale(${p}, ${m})`,o.style.clipPath=_,o.style.opacity=`0`;let x=e.animate([{opacity:1},{opacity:0}],{duration:s*.5,easing:c,fill:`forwards`}),S=o.animate([{opacity:0},{opacity:1}],{duration:s*.5,delay:s*.25,easing:c,fill:`forwards`}),C=o.animate([{transform:`translate(${d}px, ${f}px) scale(${p}, ${m})`,clipPath:_},{transform:`translate(0, 0) scale(1, 1)`,clipPath:v}],{duration:s,easing:c,fill:`forwards`});r.current=[x,S,C];try{await Promise.all([x.finished,S.finished,C.finished])}catch{Object.assign(e.style,y),Object.assign(o.style,b),n(!1);return}Object.assign(e.style,y),o.style.transform=``,o.style.clipPath=``,o.style.opacity=`1`,r.current=[],n(!1)},[t,a]);return c(()=>()=>{a()},[a]),{isMorphing:t,morph:s,cancel:a}}function Me(e,t){let n=parseFloat(e)||0;return`inset(0 round ${n/t.width*100}% ${n/t.height*100}%)`}const Ne=y.FLIP_DURATION,Pe=S.MATERIAL_STANDARD;function Fe(e){let[t,n]=p(!1),r=f(null),i=f(e),a=i.current?.duration??Ne,s=i.current?.easing??Pe,c=o(()=>{r.current&&(r.current.style.transition=`grid-template-rows ${a}ms ${s}`)},[a,s]),l=o(()=>{c(),r.current&&(r.current.style.gridTemplateRows=`1fr`),n(!0)},[c]),u=o(()=>{c(),r.current&&(r.current.style.gridTemplateRows=`0fr`),n(!1)},[c]);return{isExpanded:t,expand:l,collapse:u,toggle:o(()=>{t?u():l()},[t,l,u]),containerRef:r}}function Ie(e){let t=f(e),n=f(e?.types||[]),r=d(()=>typeof document>`u`?!1:`startViewTransition`in document,[]),i=o(e=>{n.current=e},[]);return{isSupported:r,startTransition:o(async e=>{if(!document.startViewTransition){await e();return}let n=t.current?.name,r=(()=>{if(n){let e=document.createElement(`style`);return e.id=`view-transition-${n}`,e.textContent=`
|
|
54
|
+
::view-transition-old(${n}),
|
|
55
|
+
::view-transition-new(${n}) {
|
|
56
|
+
animation-duration: 300ms;
|
|
57
|
+
animation-timing-function: ease-out;
|
|
58
|
+
}
|
|
59
|
+
`,document.head.appendChild(e),()=>{e.remove()}}return()=>{}})();try{await document.startViewTransition(e).finished}finally{r()}},[]),setTypes:i}}function Le(e){let t=e?.technique??`flip-clip-path`,n=f(e);c(()=>{n.current=e},[e]);let r=je({duration:e?.duration,easing:e?.easing}),i=Fe({duration:e?.duration,easing:e?.easing}),a=Ie(),s=r.isMorphing,l=o(async(e,t)=>{switch(n.current?.onMorphStart?.(),n.current?.technique??`flip-clip-path`){case`flip-clip-path`:await r.morph(e,t);break;case`view-transitions`:a.isSupported?await a.startTransition(()=>{e.style.opacity=`0`,t.style.opacity=`1`}):await r.morph(e,t);break;case`css-grid`:i.toggle();break}n.current?.onMorphEnd?.()},[r,a,i]),u=o(()=>{r.cancel()},[r]);return{isMorphing:s,technique:t,isViewTransitionsSupported:a.isSupported,morph:l,cancel:u,flipClipPath:r,cssGrid:i,viewTransitions:a}}function Re({children:e,technique:t=`flip-clip-path`,duration:n,easing:r,className:i=``,onMorphStart:a,onMorphEnd:o}){let s=Le({technique:t,duration:n,easing:r,onMorphStart:a,onMorphEnd:o}),c=d(()=>({morph:s}),[s]);return h($.Provider,{value:c,children:h(`div`,{className:`morph-container ${i}`,children:e})})}const ze=P,Be=(e,t)=>{let n={...P.token};return e===`enter-from`?(Object.assign(n,P.enterFrom),t===`vertical`?Object.assign(n,P.verticalEnterFrom):Object.assign(n,P.horizontalEnterFrom)):e===`enter-to`?Object.assign(n,P.enterTo):e===`exit-active`&&(Object.assign(n,P.exitActive),t===`vertical`?Object.assign(n,P.verticalExitActive):Object.assign(n,P.horizontalExitActive)),n},Ve=()=>{let e=I();return{...P.container,...e}},He=N,Ue=()=>{let e=I();return{...N.container,...e}};export{T as ANIMATION_CONFIGS,w as ANIMATION_DEFAULTS,me as AnimatedTokens,De as AnimatedTokensV2,De as TextFlow,k as CSS_VAR_NAMES,A as CSS_VAR_VALUES,ie as DebugProvider,S as EASINGS,x as EFFECTS,Re as Morph,$ as MorphContext,E as PRESETS,C as RESPONSIVE_CONFIGS,Q as Reorder,W as SlidingNumber,X as SlidingText,y as TIMING,b as TRANSFORMS,N as animatedTokensBaseStyles,He as animatedTokensStyles,se as calculatePositionDelta,de as captureAnimationInfo,K as captureComputedStyles,fe as captureElementAnimations,q as capturePosition,oe as capturePositionForLog,ae as captureStylesForLog,Y as choreographyTracker,ce as compareStyles,J as createAnimationTimer,j as cssVar,ue as formatTimingResult,L as generateCSSVariables,R as generateResponsiveCSS,Ue as getResponsiveAnimatedTokensStyle,_ as getResponsiveDuration,Ve as getResponsiveSlidingTextStyle,v as getResponsiveStagger,I as getResponsiveTokenStyles,Be as getSlidingTextTokenStyle,V as injectCSSVariables,U as reinjectCSSVariables,H as removeCSSVariables,F as responsiveOverrides,P as slidingTextBaseStyles,ze as slidingTextStyles,xe as useAnimationOrchestrator,Fe as useCSSGridMorph,G as useDebug,he as useElementRegistry,be as useFLIPAnimation,je as useFLIPClipPath,Ee as useListFormat,Le as useMorph,Oe as useMorphContext,_e as usePositionCapture,Z as useReorder,Se as useReorderPresence,Ie as useViewTransitions,pe as useWAAPIAnimations};
|
|
74
60
|
//# sourceMappingURL=index.js.map
|