react-ui-animate 5.2.0 → 5.3.0-next.1

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.
Files changed (34) hide show
  1. package/README.md +651 -114
  2. package/dist/index.d.ts +651 -5
  3. package/dist/index.mjs +1 -0
  4. package/package.json +34 -24
  5. package/dist/animation/Config.d.ts +0 -63
  6. package/dist/animation/descriptors.d.ts +0 -7
  7. package/dist/animation/drivers.d.ts +0 -4
  8. package/dist/animation/helpers.d.ts +0 -3
  9. package/dist/animation/hooks/index.d.ts +0 -2
  10. package/dist/animation/hooks/useMount.d.ts +0 -16
  11. package/dist/animation/hooks/useValue.d.ts +0 -9
  12. package/dist/animation/index.d.ts +0 -5
  13. package/dist/animation/modules/Mount.d.ts +0 -17
  14. package/dist/animation/modules/index.d.ts +0 -1
  15. package/dist/animation/to.d.ts +0 -2
  16. package/dist/animation/types.d.ts +0 -42
  17. package/dist/gestures/controllers/DragGesture.d.ts +0 -47
  18. package/dist/gestures/controllers/Gesture.d.ts +0 -13
  19. package/dist/gestures/controllers/MoveGesture.d.ts +0 -30
  20. package/dist/gestures/controllers/ScrollGesture.d.ts +0 -29
  21. package/dist/gestures/controllers/WheelGesture.d.ts +0 -28
  22. package/dist/gestures/hooks/index.d.ts +0 -4
  23. package/dist/gestures/hooks/useDrag.d.ts +0 -5
  24. package/dist/gestures/hooks/useMove.d.ts +0 -8
  25. package/dist/gestures/hooks/useRecognizer.d.ts +0 -13
  26. package/dist/gestures/hooks/useScroll.d.ts +0 -11
  27. package/dist/gestures/hooks/useWheel.d.ts +0 -8
  28. package/dist/hooks/events/useOutsideClick.d.ts +0 -2
  29. package/dist/hooks/index.d.ts +0 -2
  30. package/dist/hooks/observers/useInView.d.ts +0 -5
  31. package/dist/hooks/observers/useScrollProgress.d.ts +0 -23
  32. package/dist/index.js +0 -2
  33. package/dist/index.js.map +0 -1
  34. package/dist/utils/index.d.ts +0 -4
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{createContext as t,useRef as n,useState as i,useMemo as s,Children as e,isValidElement as o,useLayoutEffect as r,useEffect as a,useCallback as c,useContext as l,forwardRef as u,createElement as h}from"react";import{jsx as f,Fragment as d}from"react/jsx-runtime";function p(t,n){var i={};for(var s in t)({}).hasOwnProperty.call(t,s)&&0>n.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var e=0;for(s=Object.getOwnPropertySymbols(t);e<s.length;e++)0>n.indexOf(s[e])&&{}.propertyIsEnumerable.call(t,s[e])&&(i[s[e]]=t[s[e]])}return i}"function"==typeof SuppressedError&&SuppressedError;const m=.01,v=["inset","normal","italic","bold","thin","medium","thick"],y=["translate","rotate","scale","skew","matrix","perspective"],g={transparent:"#00000000",black:"#000000ff",white:"#ffffffff",red:"#ff0000ff",green:"#008000ff",blue:"#0000ffff",yellow:"#ffff00ff",cyan:"#00ffffff",magenta:"#ff00ffff",gray:"#808080ff",grey:"#808080ff",darkgray:"#a9a9a9ff",darkgrey:"#a9a9a9ff",lightgray:"#d3d3d3ff",lightgrey:"#d3d3d3ff",dimgray:"#696969ff",dimgrey:"#696969ff",slategray:"#708090ff",slategrey:"#708090ff",darkslategray:"#2f4f4fff",darkslategrey:"#2f4f4fff",orange:"#ffa500ff",purple:"#800080ff",pink:"#ffc0cbff",brown:"#a52a2aff",navy:"#000080ff",teal:"#008080ff",silver:"#c0c0c0ff",gold:"#ffd700ff",aqua:"#00ffffff",fuchsia:"#ff00ffff",lime:"#00ff00ff",maroon:"#800000ff",olive:"#808000ff",rebeccapurple:"#663399ff"},b=/-?\d+(\.\d+)?/g,w=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,x=/^rgba?\(\s*-?\d+(\.\d+)?%?(?:\s*,\s*-?\d+(\.\d+)?%?){2}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/i,O=/^hsl\(\s*\d+(\.\d+)?(?:\s*,\s*\d+(\.\d+)?%){2}\s*\)$/i,j=/^hsla\(\s*\d+(\.\d+)?(?:\s*,\s*\d+(\.\d+)?%){2}\s*,\s*(0|1|0?\.\d+)\s*\)$/i,M=/^\s*(linear|radial|conic)-gradient\s*\(/i,$=/^([a-zA-Z$_][\w$]*)\((-?\d*\.?\d+)([a-zA-Z%]*)\)$/,F=/^(-?\d+(\.\d+)?)([a-zA-Z%]*)$/,E=/(\s+|[(),])/g;function k(t){const n=t.trim().toLowerCase();if(w.test(n)||void 0!==g[n])return!0;if(x.test(n)){const t=n.includes("%"),i=[...n.matchAll(b)].map((t=>+t[0])),[s,e,o,r=1]=i;return t?!(0>s||s>100||0>e||e>100||0>o||o>100||0>r||r>1):!(0>s||s>255||0>e||e>255||0>o||o>255||0>r||r>1)}if(O.test(n)){const t=[...n.matchAll(b)].map((t=>+t[0])),[i,s,e]=t;return!(0>i||i>360||0>s||s>100||0>e||e>100)}if(j.test(n)){const t=[...n.matchAll(b)].map((t=>+t[0])),[i,s,e,o]=t;return!(0>i||i>360||0>s||s>100||0>e||e>100||0>o||o>1)}return!1}function S(t){let n=t.trim().toLowerCase();if(g[n]&&(n=g[n]),w.test(n)){let t=n.slice(1);3===t.length?t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:4===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const i=8===t.length,s=parseInt(t,16);return[s>>(i?24:16)&255,s>>(i?16:8)&255,s>>(i?8:0)&255,i?(255&s)/255:1]}if(x.test(n)){const t=n.includes("%"),i=[...n.matchAll(b)].map((t=>+t[0]));let[s,e,o,r=1]=i;return t&&(s=Math.round(s/100*255),e=Math.round(e/100*255),o=Math.round(o/100*255)),[s,e,o,r]}const i=n.match(/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)%\s*,\s*(\d+(?:\.\d+)?)%\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)/i);if(i){const t=parseFloat(i[1])%360,n=parseFloat(i[2])/100,s=parseFloat(i[3])/100,e=void 0!==i[4]?parseFloat(i[4]):1,[o,r,a]=function(t,n,i){const s=(1-Math.abs(2*i-1))*n,e=s*(1-Math.abs(t/60%2-1)),o=i-s/2;let r=0,a=0,c=0;return t>=0&&60>t?[r,a,c]=[s,e,0]:t>=60&&120>t?[r,a,c]=[e,s,0]:t>=120&&180>t?[r,a,c]=[0,s,e]:t>=180&&240>t?[r,a,c]=[0,e,s]:t>=240&&300>t?[r,a,c]=[e,0,s]:t>=300&&360>t&&([r,a,c]=[s,0,e]),[Math.round(255*(r+o)),Math.round(255*(a+o)),Math.round(255*(c+o))]}(t,n,s);return[o,r,a,e]}throw Error("Unrecognized CSS color: "+t)}function A(t){return t.toFixed(3).replace(/\.?0+$/,"")}function C(t){if(!t.includes(","))return!1;if(!t.includes("(")&&!t.includes(")"))return!0;if(/\)\s*,/.test(t))return!0;let n=0;for(let i=0;i<t.length;i++)if("("===t[i])n++;else if(")"===t[i])n--;else if(","===t[i]&&0===n)return!0;return!1}function I(t){if(!t.includes(","))return[t];const n=[];let i="",s=0;for(let e=0;e<t.length;e++){const o=t[e];"("===o?(s++,i+=o):")"===o?(s--,i+=o):","===o&&0===s?(n.push(i.trim()),i=""):i+=o}return i.trim()&&n.push(i.trim()),n.length>0?n:[t]}function T(t){const n=t.match(M);if(!n)return null;const i=n[1].toLowerCase(),s=n[0].length;let e=1,o=s;for(let r=s;r<t.length&&e>0;r++)if("("===t[r]?e++:")"===t[r]&&e--,0===e){o=r;break}return 0!==e?null:{type:i,content:t.substring(s,o)}}function L(t){let n=0,i=-1;for(let s=0;s<t.length;s++)if("("===t[s])n++;else if(")"===t[s])n--;else if(","===t[s]&&0===n){i=s;break}return-1===i?{firstParam:"",colorStops:t.trim()}:{firstParam:t.substring(0,i).trim(),colorStops:t.substring(i+1).trim()}}function q(t){return y.some((n=>t.toLowerCase().includes(n)))}function N(t,n){if(!q(t)||!q(n))return!1;const i=t.split(E).filter((t=>""!==t)),s=n.split(E).filter((t=>""!==t));if(i.length!==s.length)return!0;const e=t.toLowerCase().includes("matrix"),o=n.toLowerCase().includes("matrix"),r=["translate","rotate","scale","skew"].some((n=>t.toLowerCase().includes(n))),a=["translate","rotate","scale","skew"].some((t=>n.toLowerCase().includes(t)));return e&&a||o&&r}function Y(t,n,i){const s=T(t),e=T(n);return s&&e?function(t,n,i){const s=m>i?t.type:n.type,e=L(t.content),o=L(n.content);let r;if(t.type===n.type)if(e.firstParam&&o.firstParam)try{r=P(e.firstParam,o.firstParam,i)}catch(c){r=m>i?e.firstParam:o.firstParam}else r=m>i?e.firstParam:o.firstParam;else r=m>i?e.firstParam:o.firstParam;const a=P(e.colorStops,o.colorStops,i).replace(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/g,"rgba($1,$2,$3,1.000)");return`${s}-gradient(${r?`${r}, ${a}`:a})`}(s,e,i):(s||e||N(t,n),m>i?t:n)}function z(t){const n=t.match(/^(\S+\s+)?(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?\s+(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?\s+(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?(?:\s+(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?)?\s+(.+)$/);if(n){const t=n[1]||"",i=[];return n[2]&&i.push({num:n[2],unit:n[3]||""}),n[4]&&i.push({num:n[4],unit:n[5]||""}),n[6]&&i.push({num:n[6],unit:n[7]||""}),n[8]&&i.push({num:n[8],unit:n[9]||""}),{keyword:t,values:i,color:n[10]}}return null}function H(t){const n=z(t);if(n){const{keyword:t,values:i,color:s}=n,e=i.map((t=>t.unit?"0"+t.unit:"0")),o=s.replace(/rgba?\([^)]+\)/gi,(t=>t.toLowerCase().includes("rgba")||t.toLowerCase().includes("rgb")?"rgba(0,0,0,0)":t));return`${t}${e.join(" ")} ${o}`}return""}function P(t,n,i){var s,e;if(!t||""===t.trim()){const s=H(n);return s?P(s,n,i):m>i?t||"":n}if(!n||""===n.trim()){const s=H(t);if(s){const n=P(t,s,Math.min(2*i,1));if(i>=.5){const t=2*(i-.5),s=n.match(/^(\S+\s+)?(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?\s+(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?\s+(-?\d+(?:\.\d+)?)(px|rem|em|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)?\s+(.+)$/);if(s){const n=Math.abs(parseFloat(s[2])),i=Math.abs(parseFloat(s[4])),e=Math.abs(parseFloat(s[6])),o=s[8].match(/rgba?\((\d+),\s*(\d+),\s*(\d+),\s*([-\d.]+)\)/),r=o?Math.abs(parseFloat(o[4])):0;if(.01>n&&.01>i&&.01>e&&.01>r&&t>.9)return""}return n}return n}return m>i?t:n||""}const o=t.match($),r=n.match($);if(o&&r&&o[1]===r[1]&&o[3]===r[3]){const t=parseFloat(o[2])+(parseFloat(r[2])-parseFloat(o[2]))*i;return`${o[1]}(${A(t)}${o[3]})`}if(k(t)&&k(n)){const[s,e,o,r]=S(t),[a,c,l,u]=S(n),h=Math.round(s+(a-s)*i),f=Math.round(e+(c-e)*i),d=Math.round(o+(l-o)*i),p=r+(u-r)*i,m=A(p);return 1>p?`rgba(${h},${f},${d},${m})`:`rgb(${h},${f},${d})`}const a=t.trim().match(M),c=n.trim().match(M);if(a||c)return Y(t.trim(),n.trim(),i);if(N(t,n))return Y(t,n,i);if((t.includes(",")||n.includes(","))&&(C(t)||C(n)))return function(t,n,i){const s=I(t),e=I(n),o=Math.max(s.length,e.length),r=[];for(let a=0;o>a;a++){const t=s[a]||s[s.length-1]||s[0],n=e[a]||e[e.length-1]||e[0];r.push(P(t,n,i))}return r.join(", ")}(t,n,i);const l=t.trim().split(/\s+/),u=n.trim().split(/\s+/),h=null===(s=l[0])||void 0===s?void 0:s.toLowerCase(),f=null===(e=u[0])||void 0===e?void 0:e.toLowerCase(),d=h&&v.includes(h),p=f&&v.includes(f);if(d||p){const s=m>i?d?h:"":p?f:"",e=P(d?l.slice(1).join(" "):t,p?u.slice(1).join(" "):n,i);return s?`${s} ${e}`:e}const y=z(t),g=z(n);if(y&&g){const t=Math.max(y.values.length,g.values.length),n=(t,n)=>{if(!t)return null;const{keyword:i,values:s,color:e}=t;if(3===s.length&&4===n){const t=s[2].unit||"px";return{keyword:i,values:[...s,{num:"0",unit:t}],color:e}}return{keyword:i,values:s,color:e}},s=n(y,t),e=n(g,t);if(s&&e){const n=s.values.map(((t,n)=>{const s=e.values[n];if(!s)return t;if(t.unit===s.unit){const n=parseFloat(t.num);return{num:A(n+(parseFloat(s.num)-n)*i),unit:t.unit}}return m>i?t:s}));let o=s.color;if(s.color!==e.color)try{o=P(s.color,e.color,i)}catch(x){o=m>i?s.color:e.color}return`${m>i?s.keyword||e.keyword:e.keyword||s.keyword}${(4===t?n:n.slice(0,3)).map((t=>t.unit?`${t.num}${t.unit}`:t.num)).join(" ")} ${o}`}}const b=t.split(E).filter((t=>""!==t)),w=n.split(E).filter((t=>""!==t));if(b.length!==w.length){if(function(t,n){const i=t.match(M),s=n.match(M);return!(!i||!s)||N(t,n)}(t,n))return Y(t,n,i);throw Error(`interpolate: template mismatch:\n "${t}"\n vs "${n}"`)}return b.map(((t,n)=>{const s=w[n];if(t===s&&/\s+/.test(t))return()=>t;const e=t.match(F),o=s.match(F);if(e&&o&&e[3]===o[3]){const t=parseFloat(e[1])+(parseFloat(o[1])-parseFloat(e[1]))*i;return()=>`${A(t)}${e[3]}`}if(k(t)&&k(s))return()=>P(t,s,i);if(t===s)return()=>t;if(/^[a-zA-Z-]+$/.test(t)&&/^[a-zA-Z-]+$/.test(s)&&!(n+1<b.length&&"("===b[n+1]||n+1<w.length&&"("===w[n+1]))return()=>m>i?t:s;throw Error(`interpolate: cannot interpolate tokens "${t}" vs "${s}"`)})).map((t=>t())).join("")}function D(t,n,i){var s,e,o,r;const a=t.length;if(2>a||n.length!==a)throw Error("interpolate: inRange and outRange must be arrays of the same length >= 2");const c=null!==(e=null!==(s=null==i?void 0:i.extrapolateLeft)&&void 0!==s?s:null==i?void 0:i.extrapolate)&&void 0!==e?e:"extend",l=null!==(r=null!==(o=null==i?void 0:i.extrapolateRight)&&void 0!==o?o:null==i?void 0:i.extrapolate)&&void 0!==r?r:"extend",u=n.map((t=>"string"==typeof t?function(t){const n=Object.keys(g).map((t=>t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"))).join("|"),i=RegExp(`(#(?:[0-9A-Fa-f]{3,4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})\\b|rgba?\\([^)]*\\)|hsla?\\([^)]*\\)|\\b(?:${n})\\b)`,"gi");return t.replace(i,(t=>{try{const[n,i,s,e]=S(t);return`rgba(${Math.round(n)},${Math.round(i)},${Math.round(s)},${parseFloat(e.toFixed(3)).toString()})`}catch(s){return t}}))}(t):t));return n=>{let s=n;n<t[0]&&"clamp"===c?s=t[0]:n>t[a-1]&&"clamp"===l&&(s=t[a-1]);let e=0;if(s>t[0])if(s<t[a-1]){for(let i=0;a-1>i;i++)if(s>=t[i]&&s<=t[i+1]){e=i;break}}else e=a-2;else e=0;const o=t[e];let r=(s-o)/(t[e+1]-o);(null==i?void 0:i.easing)&&(r=i.easing(r));const h=u[e],f=u[e+1];return"number"==typeof h&&"number"==typeof f?h+(f-h)*r:P(h+"",f+"",r)}}class R{constructor(t){this.subscribers=new Set,this.t=t,this.i=t}get current(){return this.t}get initial(){return this.i}set(t){var n;null===(n=this.controller)||void 0===n||n.cancel(),this.controller=void 0,this.o(t)}o(t){if(t!==this.t){this.t=t;for(const n of this.subscribers)n(t)}}subscribe(t){return this.subscribers.add(t),t(this.t),()=>{this.subscribers.delete(t)}}reset(){this.set(this.i)}destroy(){var t;this.subscribers.clear(),null===(t=this.controller)||void 0===t||t.cancel(),this.controller=void 0}to(t,n,i){if("function"==typeof t){const n=t,i=new R(n(this.t));return this.subscribe((t=>i.set(n(t)))),i}const s=D(t,n,i),e=new R(s(this.current));return this.subscribe((t=>e.set(s(t)))),e}setAnimationController(t){var n;null===(n=this.controller)||void 0===n||n.cancel(),this.controller=t}getAnimationController(){return this.controller}}function X(t){return t instanceof R}const U=new Set(["borderImageOutset","borderImageSlice","borderImageWidth","fontWeight","lineHeight","opacity","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridColumn","order","lineClamp"]),W=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","skewX","skewY","perspective"];function V(t,n,i){const s="number"!=typeof i||U.has(n)?i+"":i+"px";t.style[n]=s}function Z(t){return W.includes(t)}function _(t,n){const i=[];for(const[s,e]of Object.entries(n))X(e)?i.push(e.subscribe((n=>V(t,s,n)))):V(t,s,e);return i}function B(t,n){const i=[];for(const[s,e]of Object.entries(n)){const n=n=>{n?t.setAttribute(s,""):t.removeAttribute(s)},o=n=>{t.setAttribute(s,n+"")};X(e)?i.push(e.subscribe((i=>{"boolean"==typeof i?n(i):"string"==typeof i||"number"==typeof i?o(i):t.removeAttribute(s)}))):"boolean"==typeof e?n(e):("string"==typeof e||"number"==typeof e)&&o(e)}return i}function G(t,n){return function(t,n){const i=Object.keys(n).filter(Z),s=i.length>0,e=()=>{if(s){const s=i.map((t=>function(t,n){const i=n&&"function"==typeof n.subscribe?n.current:n;if(Array.isArray(i))return`${t}(${i.join(",")})`;const s=i+"",{value:e,unit:o}=function(t){var n,i,s,e;return{value:+(null!==(i=null===(n=t.match(/-?\d+(\.\d+)?/))||void 0===n?void 0:n[0])&&void 0!==i?i:"0"),unit:null!==(e=null===(s=t.match(/px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax/))||void 0===s?void 0:s[0])&&void 0!==e?e:""}}(s),r=o||function(t){return"perspective"===t||t.startsWith("translate")?"px":t.startsWith("rotate")||t.startsWith("skew")?"deg":""}(t);return`${t}(${e}${r})`}(t,n[t])));t.style.transform=s.join(" ")}else"string"==typeof n.transform&&(t.style.transform=n.transform)};e();const o=[];if(s)for(const r of i){const t=n[r];t&&"function"==typeof t.subscribe&&o.push(t.subscribe(e))}return o}(t,n)}function J(t,n,i){return Math.min(Math.max(t,n),i)}function K(t,n,i){return 0===n||Infinity===Math.abs(n)?function(t,n){return Math.pow(t,5*n)}(t,i):t*n*i/(n+i*t)}function Q(t,n,i,s=.15){return 0===s?J(t,n,i):n>t?-K(n-t,i-n,s)+n:t>i?+K(t-i,i-n,s)+i:t}function tt(t,n,i){const s=t+.2*n,e=t=>Math.abs(t-s),o=i.map(e),r=Math.min(...o);return i.reduce((function(t,n){return e(n)===r?n:t}))}function nt(t,n,i){const s=t[n],e=t.length,o=n-i;if(o>0)return[...t.slice(0,i),s,...t.slice(i,n),...t.slice(n+1,e)];if(0>o){const o=i+1;return[...t.slice(0,n),...t.slice(n+1,o),s,...t.slice(o,e)]}return t}class it{constructor(t,n,i,s){this.value=t,this.velocity=n,this.deceleration=i,this.hooks=s,this.restSpeed=.01,this.isPaused=!1,this.isCancelled=!1,this.pausedAt=0,this.animate=t=>{var n,i,s,e,o,r;if(this.isCancelled||this.isPaused)return;const a=t-this.startTime,c=1-this.deceleration,l=this.velocity*Math.exp(-c*a);if(this.position=this.from+this.velocity/c*(1-Math.exp(-c*a)),this.clampBounds){const[t,n]=this.clampBounds;void 0!==this.elasticConstant?this.position=Q(this.position,t,n,this.elasticConstant):this.position<t?this.position=t:this.position>n&&(this.position=n)}this.value.o(this.position),null===(i=(n=this.hooks).onChange)||void 0===i||i.call(n,this.position),Math.abs(l)>this.restSpeed?this.frameId=requestAnimationFrame(this.animate):(cancelAnimationFrame(this.frameId),null===(e=(s=this.hooks).onChange)||void 0===e||e.call(s,this.position),null===(r=(o=this.hooks).onComplete)||void 0===r||r.call(o))},this.clampBounds=s.clamp,!0===s.elastic?this.elasticConstant=.15:"number"==typeof s.elastic&&(this.elasticConstant=s.elastic)}start(){var t,n;const i=this.value.getAnimationController();i instanceof it&&(this.velocity=i.velocity,this.deceleration=i.deceleration),null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.value.setAnimationController(this),this.isPaused=!1,this.isCancelled=!1,this.from=this.position=this.value.current,this.startTime=performance.now(),this.frameId=requestAnimationFrame(this.animate)}pause(){var t,n;this.isCancelled||this.isPaused||(this.isPaused=!0,this.pausedAt=performance.now(),cancelAnimationFrame(this.frameId),null===(n=(t=this.hooks).onPause)||void 0===n||n.call(t))}resume(){var t,n;if(this.isCancelled||!this.isPaused)return;const i=performance.now();this.startTime+=i-this.pausedAt,this.isPaused=!1,null===(n=(t=this.hooks).onResume)||void 0===n||n.call(t),this.frameId=requestAnimationFrame(this.animate)}cancel(){this.isCancelled=!0,cancelAnimationFrame(this.frameId)}reset(){this.cancel(),this.isPaused=!1,this.pausedAt=0,this.startTime=0}setOnComplete(t){this.hooks.onComplete=t}}function st(t,n,i={}){const{decay:s=.998}=i,e=p(i,["decay"]);return new it(t,n,s,e)}class et{constructor(t,n,i,s,e,o){this.value=t,this.target=n,this.stiffness=i,this.damping=s,this.mass=e,this.hooks=o,this.velocity=0,this.restDisplacement=.001,this.restSpeed=.001,this.isPaused=!1,this.isCancelled=!1,this.animate=()=>{var t,n,i,s,e,o;if(this.isCancelled||this.isPaused)return;const r=Date.now(),a=Math.min(r-this.startTime,64);this.startTime=r;const c=this.damping,l=this.mass,u=this.stiffness,h=-this.velocity,f=this.target-this.position,d=c/(2*Math.sqrt(u*l)),p=Math.sqrt(u/l),m=p*Math.sqrt(1-d**2),v=a/1e3,y=Math.sin(m*v),g=Math.cos(m*v),b=Math.exp(-d*p*v),w=b*(y*((h+d*p*f)/m)+f*g),x=this.target-w,O=d*p*w-b*(g*(h+d*p*f)-m*f*y),j=Math.exp(-p*v),M=this.target-j*(f+(h+p*f)*v),$=j*(h*(v*p-1)+v*f*p*p);this.value.o(this.position),null===(n=(t=this.hooks).onChange)||void 0===n||n.call(t,this.position);const F=Math.abs(this.velocity)<this.restSpeed,E=0===this.stiffness||Math.abs(this.target-this.position)<this.restDisplacement;if(1>d?(this.position=x,this.velocity=O):(this.position=M,this.velocity=$),F&&E)return this.velocity=0,this.position=this.target,this.value.o(this.position),null===(s=(i=this.hooks).onChange)||void 0===s||s.call(i,this.position),void(null===(o=(e=this.hooks).onComplete)||void 0===o||o.call(e));this.frameId=requestAnimationFrame(this.animate)},this.explicitFrom=o.from}start(){var t,n;if(void 0!==this.explicitFrom)this.position=this.startPosition=this.explicitFrom,this.value.o(this.explicitFrom),this.velocity=0,this.startTime=Date.now();else{const t=this.value.getAnimationController();t instanceof et?(this.position=t.position,this.velocity=t.velocity,this.startTime=t.startTime):(this.position=this.startPosition=this.value.current,this.velocity=0,this.startTime=Date.now())}null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.value.setAnimationController(this),this.isPaused=!1,this.isCancelled=!1,this.frameId=requestAnimationFrame(this.animate)}pause(){var t,n;this.isCancelled||this.isPaused||(this.isPaused=!0,cancelAnimationFrame(this.frameId),null===(n=(t=this.hooks).onPause)||void 0===n||n.call(t))}resume(){var t,n;!this.isCancelled&&this.isPaused&&(this.isPaused=!1,null===(n=(t=this.hooks).onResume)||void 0===n||n.call(t),this.frameId=requestAnimationFrame(this.animate))}cancel(){this.isCancelled=!0,cancelAnimationFrame(this.frameId)}reset(){this.cancel(),this.isPaused=!1,this.velocity=0,this.position=this.startPosition,this.startTime=Date.now()}setOnComplete(t){this.hooks.onComplete=t}}function ot(t,n,i={}){return function(t,n,i,s){if("number"==typeof t.current&&"number"==typeof n)return s(t,n,i);if("string"==typeof t.current&&"string"==typeof n)try{const e=new R(0),o=e.to([0,1],[t.current,n]),r=s(e,1,i);return t.setAnimationController(r),e.subscribe((()=>{t.getAnimationController()===r&&t.o(o.current)})),r}catch(e){throw Error(`[spring] Cannot animate from "${t.current}" to "${n}": ${e.message}`)}throw Error(`[spring] Unsupported type: ${typeof t.current} → ${typeof n}`)}(t,n,i,((t,n,i)=>{const{stiffness:s=170,damping:e=14,mass:o=1,from:r}=i,a=p(i,["stiffness","damping","mass","from"]);return new et(t,n,s,e,o,Object.assign(Object.assign({},a),{from:r}))}))}var rt=.1,at="function"==typeof Float32Array;function ct(t,n){return 1-3*n+3*t}function lt(t,n){return 3*n-6*t}function ut(t){return 3*t}function ht(t,n,i){return((ct(n,i)*t+lt(n,i))*t+ut(n))*t}function ft(t,n,i){return 3*ct(n,i)*t*t+2*lt(n,i)*t+ut(n)}function dt(t){return t}class pt{static step0(t){return t>0?1:0}static step1(t){return 1>t?0:1}static linear(t){return t}static ease(t){return mt(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return n=>Math.pow(n,t)}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){return 1-Math.sqrt(1-t*t)}static exp(t){return Math.pow(2,10*(t-1))}static elastic(t=1){var n=t*Math.PI;return t=>1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*n)}static back(t){return void 0===t&&(t=1.70158),n=>n*n*((t+1)*n-t)}static bounce(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bezier(t,n,i,s){return function(t,n,i,s){if(0>t||t>1||0>i||i>1)throw Error("bezier x values must be in [0, 1] range");if(t===n&&i===s)return dt;for(var e=at?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)e[o]=ht(o*rt,t,i);return function(o){return 0===o||1===o?o:ht(function(n){for(var s=0,o=1;10!==o&&e[o]<=n;++o)s+=rt;--o;var r=s+(n-e[o])/(e[o+1]-e[o])*rt,a=ft(r,t,i);return.001>a?0===a?r:function(t,n,i,s,e){var o,r,a=0;do{(o=ht(r=n+(i-n)/2,s,e)-t)>0?i=r:n=r}while(Math.abs(o)>1e-7&&10>++a);return r}(n,s,s+rt,t,i):function(t,n,i,s){for(var e=0;4>e;++e){var o=ft(n,i,s);if(0===o)return n;n-=(ht(n,i,s)-t)/o}return n}(n,r,t,i)}(o),n,s)}}(t,n,i,s)}static in(t){return t}static out(t){return n=>1-t(1-n)}static inOut(t){return n=>.5>n?t(2*n)/2:1-t(2*(1-n))/2}}var mt=pt.bezier(.42,0,1,1);class vt{constructor(t,n,i=300,s=pt.linear,e){this.value=t,this.target=n,this.duration=i,this.easing=s,this.hooks=e,this.isPaused=!1,this.isCancelled=!1,this.pausedAt=null,this.elapsedBeforePause=0,this.animate=t=>{var n,i,s,e,o,r;if(this.isCancelled||this.isPaused)return;let a=(this.elapsedBeforePause+(t-this.startTime))/this.duration;Number.isFinite(a)||(a=Infinity===a?1:0);const c=Math.min(1,Math.max(0,a));1>c?(this.position=this.fromValue+(this.target-this.fromValue)*this.easing(c),this.value.o(this.position),null===(i=(n=this.hooks).onChange)||void 0===i||i.call(n,this.position),this.frameId=requestAnimationFrame(this.animate)):(this.position=this.target,this.value.o(this.position),null===(e=(s=this.hooks).onChange)||void 0===e||e.call(s,this.position),null===(r=(o=this.hooks).onComplete)||void 0===r||r.call(o))},this.explicitFrom=e.from}start(){var t,n;if(void 0!==this.explicitFrom)this.fromValue=this.position=this.explicitFrom,this.value.o(this.explicitFrom),this.startTime=performance.now();else{const t=this.value.getAnimationController();t instanceof vt&&!t.isCancelled&&t.target===this.target&&t.startTime?(this.fromValue=t.fromValue,this.startTime=t.startTime):(this.fromValue=this.position=this.value.current,this.startTime=performance.now())}null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.value.setAnimationController(this),this.isPaused=!1,this.isCancelled=!1,this.pausedAt=null,this.elapsedBeforePause=0,this.frameId=requestAnimationFrame(this.animate)}pause(){var t,n;this.isCancelled||this.isPaused||(this.isPaused=!0,this.pausedAt=performance.now(),this.elapsedBeforePause+=this.pausedAt-this.startTime,this.startTime=0,cancelAnimationFrame(this.frameId),null===(n=(t=this.hooks).onPause)||void 0===n||n.call(t))}resume(){var t,n;!this.isCancelled&&this.isPaused&&(this.isPaused=!1,null===(n=(t=this.hooks).onResume)||void 0===n||n.call(t),this.startTime=performance.now(),this.pausedAt=null,this.frameId=requestAnimationFrame(this.animate))}cancel(){this.isCancelled=!0,cancelAnimationFrame(this.frameId)}reset(){this.cancel(),this.isPaused=!1,this.pausedAt=null,this.elapsedBeforePause=0,cancelAnimationFrame(this.frameId)}setOnComplete(t){this.hooks.onComplete=t}}function yt(t,n,i={}){return function(t,n,i,s){if("number"==typeof t.current&&"number"==typeof n)return s(t,n,i);if("string"==typeof t.current&&"string"==typeof n)try{const e=new R(0),o=e.to([0,1],[t.current,n]),r=s(e,1,i);return t.setAnimationController(r),e.subscribe((()=>{t.getAnimationController()===r&&t.o(o.current)})),r}catch(e){throw Error(`[timing] Cannot animate from "${t.current}" to "${n}": ${e.message}`)}throw Error(`[timing] Unsupported type: ${typeof t.current} → ${typeof n}`)}(t,n,i,((t,n,i)=>{const{duration:s=300,easing:e=pt.linear,from:o}=i,r=p(i,["duration","easing","from"]);return new vt(t,n,s,e,Object.assign(Object.assign({},r),{from:o}))}))}class gt{constructor(t,n={}){this.controllers=t,this.hooks=n,this.completedCount=0,this.isPaused=!1,this.isCancelled=!1,this.originalCompletes=t.map((t=>{var n;return null===(n=null==t?void 0:t.hooks)||void 0===n?void 0:n.onComplete}))}start(){var t,n;this.completedCount=0,this.isPaused=!1,this.isCancelled=!1,null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.controllers.forEach(((t,n)=>{var i;const s=this.originalCompletes[n];null===(i=t.setOnComplete)||void 0===i||i.call(t,(()=>{null==s||s(),this.handleComplete()})),t.start()}))}handleComplete(){var t,n,i;this.isCancelled||(this.completedCount+=1,this.completedCount===this.controllers.length&&(this.completedCount=0,null===(n=(t=this.hooks).onComplete)||void 0===n||n.call(t),null===(i=this.onComplete)||void 0===i||i.call(this)))}pause(){var t,n;this.isCancelled||this.isPaused||(this.isPaused=!0,null===(n=(t=this.hooks).onPause)||void 0===n||n.call(t),this.controllers.forEach((t=>t.pause())))}resume(){var t,n;!this.isCancelled&&this.isPaused&&(this.isPaused=!1,null===(n=(t=this.hooks).onResume)||void 0===n||n.call(t),this.controllers.forEach((t=>t.resume())))}cancel(){this.isCancelled||(this.isCancelled=!0,this.controllers.forEach((t=>t.cancel())))}reset(){this.isCancelled=!1,this.isPaused=!1,this.completedCount=0,this.controllers.forEach((t=>{var n;return null===(n=t.reset)||void 0===n?void 0:n.call(t)}))}setOnComplete(t){this.onComplete=t}}class bt{constructor(t,n={}){this.controllers=t,this.hooks=n,this.index=0,this.isPaused=!1,this.isCancelled=!1,this.current=null,this.originalCompletes=t.map((t=>{var n;return null===(n=null==t?void 0:t.hooks)||void 0===n?void 0:n.onComplete}))}runNext(){var t,n,i,s;if(this.isCancelled||this.isPaused)return;const e=this.index++,o=this.controllers[e];if(!o)return null===(t=this.onComplete)||void 0===t||t.call(this),void(null===(i=(n=this.hooks).onComplete)||void 0===i||i.call(n));this.current=o;const r=this.originalCompletes[e];null===(s=o.setOnComplete)||void 0===s||s.call(o,(()=>{null==r||r(),this.runNext()})),o.start()}start(){var t,n;this.index=0,this.isPaused=!1,this.isCancelled=!1,null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.runNext()}pause(){var t,n,i;this.isCancelled||(this.isPaused=!0,null===(t=this.current)||void 0===t||t.pause(),null===(i=(n=this.hooks).onPause)||void 0===i||i.call(n))}resume(){var t,n,i;!this.isCancelled&&this.isPaused&&(this.isPaused=!1,null===(t=this.current)||void 0===t||t.resume(),null===(i=(n=this.hooks).onResume)||void 0===i||i.call(n))}cancel(){var t;this.isCancelled=!0,null===(t=this.current)||void 0===t||t.cancel()}reset(){this.isCancelled=!1,this.isPaused=!1,this.index=0,this.controllers.forEach((t=>{var n;return null===(n=t.reset)||void 0===n?void 0:n.call(t)}))}setOnComplete(t){this.onComplete=t}}class wt{constructor(t,n,i={}){var s;this.controller=t,this.iterations=n,this.hooks=i,this.count=0,this.isCancelled=!1,this.isPaused=!1,this.handleIterationComplete=()=>{var t,n,i,s,e,o;this.count++,null===(t=this.originalComplete)||void 0===t||t.call(this),this.count<this.iterations?(null===(i=(n=this.controller).reset)||void 0===i||i.call(n),this.runIteration()):(null===(s=this.onComplete)||void 0===s||s.call(this),null===(o=(e=this.hooks).onComplete)||void 0===o||o.call(e))},this.originalComplete=null===(s=null==t?void 0:t.hooks)||void 0===s?void 0:s.onComplete}runIteration(){var t,n;this.isCancelled||this.isPaused||(null===(n=(t=this.controller).setOnComplete)||void 0===n||n.call(t,this.handleIterationComplete),this.controller.start())}start(){var t,n;this.isCancelled=!1,this.isPaused=!1,this.count=0,this.controller.reset(),null===(n=(t=this.hooks).onStart)||void 0===n||n.call(t),this.runIteration()}pause(){var t,n;this.isPaused=!0,this.controller.pause(),null===(n=(t=this.hooks).onPause)||void 0===n||n.call(t)}resume(){var t,n;!this.isCancelled&&this.isPaused&&(this.isPaused=!1,this.controller.resume(),null===(n=(t=this.hooks).onResume)||void 0===n||n.call(t))}cancel(){this.isCancelled=!0,this.controller.cancel()}reset(){var t,n;this.isCancelled=!1,this.isPaused=!1,this.count=0,null===(n=(t=this.controller).reset)||void 0===n||n.call(t)}setOnComplete(t){this.onComplete=t}}class xt{constructor(t){this.duration=t}start(){this.timerId=window.setTimeout((()=>{var t;null===(t=this.onComplete)||void 0===t||t.call(this)}),this.duration)}pause(){}resume(){}cancel(){this.timerId&&clearTimeout(this.timerId)}reset(){this.cancel()}setOnComplete(t){this.onComplete=t}}function Ot(t,n={}){return new gt(t,n)}function jt(t,n={}){return new bt(t,n)}function Mt(t,n,i={}){return new wt(t,n,i)}function $t(t){return new xt(t)}function Ft(t={},n){if(n)return t;const{onStart:i,onChange:s,onComplete:e}=t;return p(t,["onStart","onChange","onComplete"])}function Et(t){return"object"==typeof t&&null!==t&&"type"in t&&"string"==typeof t.type}function kt(t,{type:n,to:i,options:s={}}){var e,o,r,a,c,l,u;switch(n){case"spring":return ot(t,i,s);case"timing":return yt(t,i,s);case"decay":return st(t,null!==(e=s.velocity)&&void 0!==e?e:0,s);case"delay":return $t(null!==(o=s.delay)&&void 0!==o?o:0);case"sequence":return jt((null!==(r=s.animations)&&void 0!==r?r:[]).map((n=>kt(t,n))),s);case"loop":{const n=s.animation;if(!n)return{start(){},pause(){},resume(){},cancel(){},reset(){}};let i;const e=t.initial;if("sequence"===n.type){const s=(null!==(c=null===(a=n.options)||void 0===a?void 0:a.animations)&&void 0!==c?c:[]).map(((n,i)=>{var s;if(0===i&&("spring"===n.type||"timing"===n.type)){const i=null===(s=n.options)||void 0===s?void 0:s.from;return kt(t,Object.assign(Object.assign({},n),{options:Object.assign(Object.assign({},n.options),{from:null!=i?i:e})}))}return kt(t,n)}));i=jt(s,n.options)}else if("spring"===n.type||"timing"===n.type){const s=null===(l=n.options)||void 0===l?void 0:l.from;i=kt(t,Object.assign(Object.assign({},n),{options:Object.assign(Object.assign({},n.options),{from:null!=s?s:e})}))}else i=kt(t,n);return Mt(i,null!==(u=s.iterations)&&void 0!==u?u:0,s)}default:return{start(){},pause(){},resume(){},cancel(){},reset(){}}}}function St(t,n){return Ot(Object.entries(t).filter((([t])=>"decay"===n.type||"delay"===n.type||void 0!==n.to[t])).map((([t,i],s)=>kt(i,{type:n.type,to:"decay"===n.type||"delay"===n.type?n.to:n.to[t],options:Ft(n.options,0===s)}))))}const At=t(null);function Ct(){const t=l(At);return t?[!t.isExiting,t.onExitComplete]:[!0,()=>{}]}function It(){const t=l(At);return!t||!t.isExiting}function Tt({children:t,isExiting:n,mode:s}){const[e,o]=i(!1);return r((()=>{n&&!e&&o(!0)}),[n,e]),"popLayout"===s&&n?f("div",{style:{position:"absolute"},children:t}):t}function Lt({children:t,initial:l=!0,onExitComplete:u,mode:h="sync"}){const p=n(!0),[m,v]=i((()=>new Map)),y=n(0),g=s((()=>{const n=[];return e.forEach(t,(t=>{var i;if(o(t)){const s=null!==(i=t.key)&&void 0!==i?i:"default";n.push({key:s,element:t})}})),n}),[t]),b=s((()=>new Set(g.map((t=>t.key)))),[g]);r((()=>{v((t=>{const n=new Map,i=new Map(g.map((({key:t,element:n})=>[t,n])));for(const[s,e]of t)i.has(s)?(e.isExiting&&y.current--,n.set(s,{key:s,element:i.get(s),isExiting:!1})):(e.isExiting||y.current++,n.set(s,Object.assign(Object.assign({},e),{isExiting:!0})));for(const{key:s,element:e}of g)t.has(s)||n.set(s,{key:s,element:e,isExiting:!1});return n}))}),[g,b]),a((()=>{p.current&&(p.current=!1)}),[]);const w=c((t=>{v((n=>{const i=new Map(n);return i.delete(t),i})),y.current--,0===y.current&&u&&u()}),[u]),x=s((()=>{const t=[],n=Array.from(m.values()).some((t=>t.isExiting)),i="wait"===h&&n;for(const[s,e]of m){if(i&&!e.isExiting)continue;const n={isInitialMount:p.current&&l,isExiting:e.isExiting,onExitComplete:()=>w(s)};t.push(f(At.Provider,{value:n,children:f(Tt,{isExiting:e.isExiting,mode:h,children:e.element})},s))}return t}),[m,l,h,w]);return f(d,{children:x})}function qt(t){return"opacity"===t||"scale"===t||"scaleX"===t||"scaleY"===t?1:t.startsWith("translate")||t.startsWith("rotate")?0:["boxShadow","textShadow","background","backgroundImage","backgroundPosition","backgroundSize","border","borderColor","borderImage","borderRadius","color","fill","stroke","filter","backdropFilter","clipPath","mask","maskImage"].includes(t)?"":0}function Nt(t){return/\d+(px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)$/i.test(t)}function Yt(t,n,i,s){const e=function(t){return!!Z(t)||"opacity"===t||"zIndex"===t}(t),o=function(t,n){if(!t||!(n in t))return null;const i=t[n];if(null==i)return null;if(i&&"object"==typeof i&&"subscribe"in i)return null;if("number"==typeof i)return i;if("string"==typeof i){if([/\s/,/rgba?\(/,/hsla?\(/,/#[0-9a-fA-F]/,/linear-gradient|radial-gradient|conic-gradient/,/calc\(|var\(/].some((t=>t.test(i))))return i;if(/\d+(px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax)$/i.test(i))return i;const t=parseFloat(i);return isNaN(t)?i:t}return null}(n,t);if(null!==o){if(e&&"string"==typeof o){const n=parseFloat(o);return isNaN(n)?qt(t):n}return o}const r=i.style[t];if(r){if(e){const n=parseFloat(r);return isNaN(n)?qt(t):n}if(Nt(r))return r;const n=parseFloat(r);return isNaN(n)?r:n}const a=s.getPropertyValue(t.replace(/([A-Z])/g,"-$1").toLowerCase());if(a){const n=a.trim();if(e){const i=parseFloat(n);return isNaN(i)?qt(t):i}if("none"===n&&["boxShadow","textShadow","background","backgroundImage","backgroundPosition","backgroundSize","border","borderColor","borderImage","borderRadius","color","fill","stroke","filter","backdropFilter","clipPath","mask","maskImage"].includes(t))return"";if(Nt(n))return n;const i=parseFloat(n);return isNaN(i)?n:i}return qt(t)}function zt(t,n,i){if(!t)return;const{node:s,style:e,computedStyle:o,animateValues:r,initialValues:a,stateControllers:c,cleanup:l}=i;c.forEach((t=>t.cancel())),c.length=0;const u=[];for(const[h,f]of Object.entries(t)){let t=r[h];if(t)h in a||(a[h]=t.current);else{const n=Yt(h,e,s,o);if(t=new R(n),r[h]=t,a[h]=n,Z(h)){const n=()=>{const t=Object.keys(r).filter(Z);if(t.length>0){const n=t.map((t=>{var n,i,s,e;const o=r[t];if(!o)return"";const a=o.current+"",c=null!==(i=null===(n=a.match(/-?\d+(\.\d+)?/))||void 0===n?void 0:n[0])&&void 0!==i?i:"0";let l=null!==(e=null===(s=a.match(/px|rem|em|ex|%|cm|mm|in|pt|pc|ch|vh|vw|vmin|vmax|deg/))||void 0===s?void 0:s[0])&&void 0!==e?e:"";return l||("perspective"===t||t.startsWith("translate")?l="px":(t.startsWith("rotate")||t.startsWith("skew"))&&(l="deg")),`${t}(${c}${l})`}));s.style.transform=n.join(" ")}};u.push(t.subscribe(n)),n()}else u.push(t.subscribe((t=>{const n="number"!=typeof t||["opacity","zIndex","fontWeight","lineHeight"].includes(h)?t+"":t+"px";s.style[h]=n})))}const i="number"==typeof f||"string"==typeof f;if(n)if(i){const n=kt(t,{type:"spring",to:f,options:{}});c.push(n),n.start()}else{const n=kt(t,f);c.push(n),n.start()}else{const n=a[h];if(i){const i=kt(t,{type:"spring",to:n,options:{}});c.push(i),i.start()}else{const i=kt(t,{type:"spring",to:n,options:{}});c.push(i),i.start()}}}l.push(...u)}function Ht(...t){return n=>{for(const i of t)i&&("function"==typeof i?i(n):"current"in i&&(i.current=n))}}function Pt(t,n={}){const{root:s,rootMargin:e,threshold:o,once:r=!1}=n,[c,l]=i(!1);return a((()=>{const n=t.current;if(!n)return;const i=new IntersectionObserver((([t])=>{t.isIntersecting?(l(!0),r&&(i.unobserve(t.target),i.disconnect())):r||l(!1)}),{root:null!=s?s:null,rootMargin:e,threshold:o});return i.observe(n),()=>i.disconnect()}),[t,s,e,o,r]),c}function Dt(t){const i=u(((i,s)=>{const e=n(null),o=n(i),c=n(!1);o.current=i;const u=n({}),f=n([]);(function(t,i,s,e,o){const a=l(At),c=n([]),u=n([]),h=n(null),f=n(!1);r((()=>{var t;h.current=null!==(t=null==a?void 0:a.onExitComplete)&&void 0!==t?t:null})),r((()=>{var n;const{exit:r,style:l={}}=i.current,d=t.current,p=null!==(n=null==a?void 0:a.isExiting)&&void 0!==n&&n,m=f.current;if(f.current=p,p){if(!s.current&&r&&d)return!m&&p&&(s.current=!0,o.current.forEach((t=>t.cancel())),o.current=[],u.current.forEach((t=>t())),u.current=[],u.current=function(t){const{exitProp:n,animateValues:i,controllers:s,onExitComplete:e,node:o,style:r}=t;let a=0;const c=Object.keys(n).length,l=[],u=()=>{a++,c>a||e()},h=window.getComputedStyle(o);for(const m of Object.keys(n))if(!i[m]){const t=Yt(m,r,o,h);i[m]=new R(t)}const f=Object.assign({},r);for(const m of Object.keys(i))f[m]=i[m];const d={},p={};for(const[m,v]of Object.entries(f))v&&"object"==typeof v&&"subscribe"in v&&((Z(m)?p:d)[m]=v);l.push(..._(o,d)),l.push(...G(o,p));for(const[m,v]of Object.entries(n)){const t=i[m];if(!t){u();continue}const n="number"==typeof v||"string"==typeof v?{type:"spring",to:v,options:{}}:v,e=kt(t,Object.assign(Object.assign({},n),{options:Object.assign(Object.assign({},n.options),{onComplete:()=>{var t,i;null===(i=null===(t=n.options)||void 0===t?void 0:t.onComplete)||void 0===i||i.call(t),u()}})}));s.push(e),e.start()}return l}({exitProp:r,animateValues:e.current,controllers:c.current,onExitComplete:()=>{s.current&&h.current&&(u.current.forEach((t=>t())),u.current=[],s.current=!1,h.current())},node:d,style:l})),()=>{s.current&&(c.current.forEach((t=>t.cancel())),c.current=[],u.current.forEach((t=>t())),u.current=[])}}else s.current&&(s.current=!1,c.current.forEach((t=>t.cancel())),c.current=[],u.current.forEach((t=>t())),u.current=[])}),[null==a?void 0:a.isExiting])})(e,o,c,u,f),function(t,i,s,e,o,c,u){const h=l(At),f=n([]),d=n(!1),m=n(""),v=n(!1);r((()=>{var n;const e=t.current,r=null!==(n=null==h?void 0:h.isExiting)&&void 0!==n&&n,a=v.current&&!r;if(v.current=r,!e||r||o.current)return;const l=i.current,{style:y={}}=l,g=p(l,["style"]),b=!d.current,w=function(t){if(!t)return"";const n=t;return Object.keys(n).sort().map((t=>{const i=n[t];if("number"==typeof i||"string"==typeof i)return`${t}:${i}`;if("object"==typeof i&&null!==i&&"type"in i){const n=i;return`${t}:${n.type}:${JSON.stringify(n.to||"")}`}return t+":unknown"})).join("|")}(s),x=m.current!==w;if((b||x||a)&&(u.current.forEach((t=>t.cancel())),u.current=[],s)){const t=window.getComputedStyle(e);if(b){const n={};for(const i of Object.keys(s)){const s=Yt(i,y,e,t);n[i]=new R(s)}c.current=n}else c.current=function(t,n,i,s,e){const o={};for(const r of Object.keys(t))if(e[r]){const t=Yt(r,n,i,s);e[r].set(t),o[r]=e[r]}else{const t=Yt(r,n,i,s);o[r]=new R(t)}return o}(s,y,e,t,c.current);!function(t,n,i){for(const[s,e]of Object.entries(t)){const t=n[s];if(!t)continue;const o=kt(t,"number"==typeof e||"string"==typeof e?{type:"spring",to:e,options:{}}:e);i.push(o),o.start()}}(s,c.current,u.current)}return m.current=w,f.current.forEach((t=>t())),f.current=function(t,n,i,s){const e=Object.assign({},n);for(const a of Object.keys(i))e[a]=i[a];const o={},r={};for(const[a,c]of Object.entries(e))(Z(a)?r:o)[a]=c;return[..._(t,o),...G(t,e),...B(t,s)]}(e,y,c.current,g),d.current=!0,()=>{f.current.forEach((t=>t())),f.current=[]}}),[e,s,null==h?void 0:h.isExiting]),a((()=>()=>{u.current.forEach((t=>t.cancel())),u.current=[]}),[])}(e,o,i.animate,i.style,c,u,f),function(t,i,s,e,o,r){const c=n([]),l=n({}),u=n({isHovered:!1,isTapped:!1,isFocused:!1}),h=(n,s)=>{if(!n)return;const e=t.current;if(!e)return;const o=window.getComputedStyle(e),{style:a={}}=i.current;zt(n,s,{node:e,style:a,computedStyle:o,animateValues:r.current,initialValues:l.current,stateControllers:c.current,cleanup:[]})};a((()=>{const n=t.current;if(!n)return;const i=()=>{u.current.isHovered||(u.current.isHovered=!0,h(s,!0))},r=()=>{u.current.isHovered&&(u.current.isHovered=!1,h(s,!1))},a=()=>{u.current.isTapped||(u.current.isTapped=!0,h(e,!0))},l=()=>{u.current.isTapped&&(u.current.isTapped=!1,h(e,!1),u.current.isHovered&&s&&h(s,!0))},f=()=>{u.current.isTapped&&(u.current.isTapped=!1,h(e,!1),u.current.isHovered&&s&&h(s,!0))},d=()=>{u.current.isFocused||(u.current.isFocused=!0,h(o,!0))},p=()=>{u.current.isFocused&&(u.current.isFocused=!1,h(o,!1))};return s&&(n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",r)),e&&(n.addEventListener("mousedown",a),n.addEventListener("mouseup",l),n.addEventListener("mouseleave",f),n.addEventListener("touchstart",a),n.addEventListener("touchend",l),n.addEventListener("touchcancel",f)),o&&function(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement||null!==t.getAttribute("tabindex")}(n)&&(n.addEventListener("focus",d),n.addEventListener("blur",p)),()=>{s&&(n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",r)),e&&(n.removeEventListener("mousedown",a),n.removeEventListener("mouseup",l),n.removeEventListener("mouseleave",f),n.removeEventListener("touchstart",a),n.removeEventListener("touchend",l),n.removeEventListener("touchcancel",f)),o&&(n.removeEventListener("focus",d),n.removeEventListener("blur",p)),c.current.forEach((t=>t.cancel())),c.current=[]}}),[s,e,o]),a((()=>()=>{c.current.forEach((t=>t.cancel())),c.current=[]}),[])}(e,o,i.hover,i.press,i.focus,u),function(t,i,s,e,o){const r=n([]),c=n({}),l=Pt(t,e||{});a((()=>{if(s)return(n=>{if(!s)return;const e=t.current;if(!e)return;const a=window.getComputedStyle(e),{style:l={}}=i.current,u={node:e,style:l,computedStyle:a,animateValues:o.current,initialValues:c.current,stateControllers:r.current,cleanup:[]};zt(s,n,u)})(l),()=>{r.current.forEach((t=>t.cancel())),r.current=[]}}),[l,s]),a((()=>()=>{r.current.forEach((t=>t.cancel())),r.current=[]}),[])}(e,o,i.view,i.viewOptions,u);const{animate:d,exit:m,hover:v,press:y,focus:g,view:b,viewOptions:w,style:x}=i,O=p(i,["animate","exit","hover","press","focus","view","viewOptions","style"]),j={},M=new Set([...Object.keys(u.current),...i.animate?Object.keys(i.animate):[]]);if(x)for(const[t,n]of Object.entries(x))Z(t)||M.has(t)||n&&"object"==typeof n&&"subscribe"in n||(j[t]=n);return h(t,Object.assign(Object.assign({},O),{style:j,ref:Ht(e,s)}))}));return i.displayName="string"==typeof t?"Animated."+t:`Animated(${t.displayName||t.name||"Component"})`,i}const Rt=new Map,Xt=new Proxy({},{get:(t,n)=>(Rt.has(n)||Rt.set(n,Dt(n)),Rt.get(n))});function Ut(t,n){const i=t.map((t=>t.current)),s=new R(n(...i));return t.forEach((i=>i.subscribe((()=>(()=>{const i=t.map((t=>t.current));s.set(n(...i))})())))),s}function Wt(t,n,i,s){return D(n,i,s)(t)}const Vt={Timing:{BOUNCE:{duration:500,easing:pt.bounce},EASE_IN:{duration:500,easing:pt.in(pt.ease)},EASE_OUT:{duration:500,easing:pt.out(pt.ease)},EASE_IN_OUT:{duration:500,easing:pt.inOut(pt.ease)},POWER1:{duration:500,easing:pt.bezier(.17,.42,.51,.97)},POWER2:{duration:500,easing:pt.bezier(.07,.11,.13,1)},POWER3:{duration:500,easing:pt.bezier(.09,.7,.16,1.04)},POWER4:{duration:500,easing:pt.bezier(.05,.54,0,1.03)},LINEAR:{duration:500,easing:pt.linear}},Spring:{ELASTIC:{mass:1,damping:18,stiffness:250},EASE:{mass:1,damping:20,stiffness:158},STIFF:{mass:1,damping:18,stiffness:350},WOBBLE:{mass:1,damping:8,stiffness:250}}},Zt=(t,n)=>{var i,s,e;return{type:"spring",to:t,options:{stiffness:null!==(i=null==n?void 0:n.stiffness)&&void 0!==i?i:Vt.Spring.EASE.stiffness,damping:null!==(s=null==n?void 0:n.damping)&&void 0!==s?s:Vt.Spring.EASE.damping,mass:null!==(e=null==n?void 0:n.mass)&&void 0!==e?e:Vt.Spring.EASE.mass,from:null==n?void 0:n.from,onStart:null==n?void 0:n.onStart,onChange:null==n?void 0:n.onChange,onComplete:null==n?void 0:n.onComplete}}},_t=(t,n)=>({type:"timing",to:t,options:{duration:null==n?void 0:n.duration,easing:null==n?void 0:n.easing,from:null==n?void 0:n.from,onStart:null==n?void 0:n.onStart,onChange:null==n?void 0:n.onChange,onComplete:null==n?void 0:n.onComplete}}),Bt=(t,n)=>({type:"decay",options:{velocity:t,clamp:null==n?void 0:n.clamp,elastic:null==n?void 0:n.elastic,onStart:null==n?void 0:n.onStart,onChange:null==n?void 0:n.onChange,onComplete:null==n?void 0:n.onComplete}}),Gt=t=>({type:"delay",options:{delay:t}}),Jt=(t,n)=>({type:"sequence",options:{animations:t,onStart:null==n?void 0:n.onStart,onComplete:null==n?void 0:n.onComplete}}),Kt=(t,n=Infinity,i)=>({type:"loop",options:{animation:t,iterations:n,onStart:null==i?void 0:i.onStart,onComplete:null==i?void 0:i.onComplete}});function Qt(t){const i=n(null),e=s((()=>Array.isArray(t)?t.map((t=>new R(t))):"object"==typeof t?Object.fromEntries(Object.entries(t).map((([t,n])=>[t,new R(n)]))):new R(t)),[]);return[e,function(n){let s=null;s=Array.isArray(t)?function(t,n){var i,s;if(!Et(n))return n.forEach(((n,i)=>{var s;null===(s=t[i])||void 0===s||s.set(n)})),null;const e=n,o=Object.fromEntries(t.map(((t,n)=>[n.toString(),t])));switch(e.type){case"sequence":{const t=e.options.animations.map((t=>{var n,i;return"delay"===t.type?$t(null!==(i=null===(n=t.options)||void 0===n?void 0:n.delay)&&void 0!==i?i:0):St(o,Object.assign(Object.assign({},t),{to:Array.isArray(t.to)?Object.fromEntries(t.to.map(((t,n)=>[n.toString(),t]))):t.to}))}));return jt(t,e.options)}case"loop":{const t=e.options.animation;return"sequence"===t.type?Mt(jt(t.options.animations.map((t=>St(o,Object.assign(Object.assign({},t),{to:Array.isArray(t.to)?Object.fromEntries(t.to.map(((t,n)=>[n.toString(),t]))):t.to})))),Ft(t.options,!0)),null!==(i=e.options.iterations)&&void 0!==i?i:0,Ft(e.options,!0)):Mt(St(o,t),null!==(s=e.options.iterations)&&void 0!==s?s:0,Ft(e.options,!0))}default:return St(o,e)}}(e,n):"object"==typeof t?function(t,n){var i,s;if(Et(n))switch(n.type){case"sequence":{const i=n.options.animations.map((n=>{var i;return"delay"===n.type?$t(null!==(i=n.options.delay)&&void 0!==i?i:0):St(t,n)}));return jt(i,n.options)}case"loop":{const e=n.options.animation;return"sequence"===e.type?Mt(jt(e.options.animations.map((n=>St(t,n))),Ft(e.options,!0)),null!==(i=n.options.iterations)&&void 0!==i?i:0,Ft(n.options,!0)):Mt(St(t,e),null!==(s=n.options.iterations)&&void 0!==s?s:0,Ft(n.options,!0))}default:return St(t,n)}return Object.entries(n).forEach((([n,i])=>{var s;null===(s=t[n])||void 0===s||s.set(i)})),null}(e,n):function(t,n){var i,s,e,o,r,a,c,l,u;if("number"==typeof n||"string"==typeof n)return t.set(n),null;if("sequence"===n.type)return jt((null!==(s=null===(i=n.options)||void 0===i?void 0:i.animations)&&void 0!==s?s:[]).map((n=>kt(t,n))),n.options);if("loop"===n.type){const i=null===(e=n.options)||void 0===e?void 0:e.animation;return i?"sequence"===i.type?Mt(jt((null!==(r=null===(o=i.options)||void 0===o?void 0:o.animations)&&void 0!==r?r:[]).map((n=>kt(t,n)))),null!==(c=null===(a=n.options)||void 0===a?void 0:a.iterations)&&void 0!==c?c:0,n.options):Mt(kt(t,i),null!==(u=null===(l=n.options)||void 0===l?void 0:l.iterations)&&void 0!==u?u:0,n.options):null}return kt(t,n)}(e,n),i.current=s,s&&s.start()},{start:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.start()},pause:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.pause()},resume:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.resume()},cancel:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.cancel()},reset:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.reset()}}]}const tn={opacity:Zt(1,{stiffness:100,damping:15})},nn={opacity:Zt(0,{stiffness:100,damping:15})},sn={opacity:Zt(1,{stiffness:100,damping:15}),translateY:Zt(0,{stiffness:100,damping:15})},en={opacity:Zt(1,{stiffness:100,damping:15}),translateY:Zt(0,{stiffness:100,damping:15})},on={opacity:Zt(1,{stiffness:100,damping:15}),translateX:Zt(0,{stiffness:100,damping:15})},rn={opacity:Zt(1,{stiffness:100,damping:15}),translateX:Zt(0,{stiffness:100,damping:15})},an={translateY:Zt(0,{stiffness:100,damping:15})},cn={translateY:Zt(0,{stiffness:100,damping:15})},ln={translateX:Zt(0,{stiffness:100,damping:15})},un={translateX:Zt(0,{stiffness:100,damping:15})},hn={translateY:Zt(-100,{stiffness:100,damping:15})},fn={translateY:Zt(100,{stiffness:100,damping:15})},dn={translateX:Zt(-100,{stiffness:100,damping:15})},pn={translateX:Zt(100,{stiffness:100,damping:15})},mn={scale:Zt(1,{stiffness:200,damping:20}),opacity:Zt(1,{stiffness:100,damping:15})},vn={scale:Zt(0,{stiffness:200,damping:20}),opacity:Zt(0,{stiffness:100,damping:15})},yn={scale:Zt(1.1,{stiffness:150,damping:15})},gn={scale:Zt(.9,{stiffness:150,damping:15})},bn={scale:Zt(1,{stiffness:300,damping:10}),opacity:Zt(1,{stiffness:100,damping:15})},wn={scale:Zt(0,{stiffness:300,damping:10}),opacity:Zt(0,{stiffness:100,damping:15})},xn={rotate:Zt(0,{stiffness:100,damping:15}),opacity:Zt(1,{stiffness:100,damping:15})},On={rotate:Zt(180,{stiffness:100,damping:15}),opacity:Zt(0,{stiffness:100,damping:15})},jn={rotate:Zt(360,{stiffness:50,damping:10})},Mn={scale:Zt(1,{stiffness:200,damping:20}),opacity:Zt(1,{stiffness:100,damping:15})},$n={scale:Zt(0,{stiffness:200,damping:20}),opacity:Zt(0,{stiffness:100,damping:15})},Fn={rotateX:Zt(0,{stiffness:150,damping:15})},En={rotateY:Zt(0,{stiffness:150,damping:15})},kn={opacity:Zt(1,{stiffness:100,damping:15}),translateY:Zt(0,{stiffness:100,damping:15})},Sn={opacity:Zt(0,{stiffness:100,damping:15}),translateY:Zt(20,{stiffness:100,damping:15})},An={scale:Zt(1,{stiffness:200,damping:20}),opacity:Zt(1,{stiffness:100,damping:15})},Cn={scale:Zt(.8,{stiffness:200,damping:20}),opacity:Zt(0,{stiffness:100,damping:15})},In={scale:Zt(1.05,{stiffness:300,damping:20})},Tn={translateY:Zt(-5,{stiffness:300,damping:20}),scale:Zt(1.02,{stiffness:300,damping:20})},Ln={scale:Zt(1.05,{stiffness:300,damping:20}),opacity:Zt(.9,{stiffness:300,damping:20})},qn={scale:Zt(.95,{stiffness:400,damping:25})},Nn={translateY:Zt(2,{stiffness:400,damping:25}),scale:Zt(.98,{stiffness:400,damping:25})},Yn={opacity:Zt(0,{stiffness:100,damping:15})},zn={opacity:Zt(0,{stiffness:100,damping:15}),translateY:Zt(-20,{stiffness:100,damping:15})},Hn={opacity:Zt(0,{stiffness:100,damping:15}),translateY:Zt(20,{stiffness:100,damping:15})},Pn={scale:Zt(.8,{stiffness:200,damping:20}),opacity:Zt(0,{stiffness:100,damping:15})},Dn={fadeIn:tn,fadeOut:nn,fadeInUp:sn,fadeInDown:en,fadeInLeft:on,fadeInRight:rn,slideInUp:an,slideInDown:cn,slideInLeft:ln,slideInRight:un,slideOutUp:hn,slideOutDown:fn,slideOutLeft:dn,slideOutRight:pn,scaleIn:mn,scaleOut:vn,scaleUp:yn,scaleDown:gn,bounceIn:bn,bounceOut:wn,rotateIn:xn,rotateOut:On,spin:jn,zoomIn:Mn,zoomOut:$n,flipX:Fn,flipY:En,slideFadeIn:kn,slideFadeOut:Sn,scaleFadeIn:An,scaleFadeOut:Cn,hoverScale:In,hoverLift:Tn,hoverGlow:Ln,pressScale:qn,pressDown:Nn,exitFade:Yn,exitSlideUp:zn,exitSlideDown:Hn,exitScale:Pn};function Rn(t,i,s=[]){const e=n(i);a((()=>{e.current=i}),[i,...s]),a((()=>{function n(n){const i=t.current,s=n.target;i&&s&&s.isConnected&&i.isConnected&&(i.contains(s)||e.current(n))}return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[t])}class Xn{constructor(){this.changeListeners=new Set,this.endListeners=new Set}onChange(t){return this.changeListeners.add(t),this}onEnd(t){return this.endListeners.add(t),this}emitChange(t){this.changeListeners.forEach((n=>n(t)))}emitEnd(t){this.endListeners.forEach((n=>n(t)))}}Xn.VELOCITY_LIMIT=20;class Un extends Xn{constructor(t={}){super(),this.prev={x:0,y:0},this.lastTime=0,this.movement={x:0,y:0},this.velocity={x:0,y:0},this.start={x:0,y:0},this.offset={x:0,y:0},this.pointerCaptured=!1,this.activePointerId=null,this.attachedEls=new Set,this.activeEl=null,this.pointerDownPos={x:0,y:0},this.thresholdPassed=!1,this.config=t}attach(t){if(t===window)return()=>{};const n=Array.isArray(t)?t:[t],i=this.onDown.bind(this),s=this.onMove.bind(this),e=this.onUp.bind(this);return n.forEach((t=>{this.attachedEls.add(t),t.addEventListener("pointerdown",i,{passive:!1})})),window.addEventListener("pointermove",s,{passive:!1}),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e),()=>{n.forEach((t=>{t.removeEventListener("pointerdown",i),this.attachedEls.delete(t)})),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)}}onDown(t){var n,i,s;if(0!==t.button)return;const e=t.currentTarget;this.attachedEls.has(e)&&(this.activeEl=e,this.activePointerId=t.pointerId,this.pointerCaptured=!1,this.start=!1===this.thresholdPassed&&0===this.start.x&&0===this.start.y?null!==(s=null===(i=(n=this.config).initial)||void 0===i?void 0:i.call(n))&&void 0!==s?s:{x:0,y:0}:Object.assign({},this.offset),this.offset=Object.assign({},this.start),this.movement={x:0,y:0},this.velocity={x:0,y:0},this.pointerDownPos={x:t.clientX,y:t.clientY},this.thresholdPassed=!1,this.prev={x:t.clientX,y:t.clientY},this.lastTime=t.timeStamp,this.emitChange({down:!0,movement:{x:0,y:0},offset:Object.assign({},this.offset),velocity:{x:0,y:0},event:t,cancel:this.cancel.bind(this)}))}onMove(t){var n;if(this.activePointerId!==t.pointerId||!this.activeEl)return;const i=null!==(n=this.config.threshold)&&void 0!==n?n:0;if(!this.thresholdPassed){const n=t.clientX-this.pointerDownPos.x,s=t.clientY-this.pointerDownPos.y;if(i>Math.hypot(n,s))return;this.thresholdPassed=!0,this.activeEl.setPointerCapture(t.pointerId),this.pointerCaptured=!0}this.pointerCaptured&&t.preventDefault();const s=Math.max((t.timeStamp-this.lastTime)/1e3,1e-6);this.lastTime=t.timeStamp;const e=(t.clientX-this.prev.x)/s/1e3,o=(t.clientY-this.prev.y)/s/1e3;this.velocity={x:J(e,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT),y:J(o,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT)};const r={x:t.clientX-this.pointerDownPos.x,y:t.clientY-this.pointerDownPos.y};this.movement={x:"y"===this.config.axis?0:r.x,y:"x"===this.config.axis?0:r.y},this.offset={x:this.start.x+this.movement.x,y:this.start.y+this.movement.y},this.prev={x:t.clientX,y:t.clientY},this.emitChange({down:!0,movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:this.cancel.bind(this)})}onUp(t){this.activePointerId===t.pointerId&&this.activeEl&&(this.activeEl.releasePointerCapture(t.pointerId),this.emitEnd({down:!1,movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:this.cancel.bind(this)}),this.activePointerId=null,this.pointerCaptured=!1)}cancel(){this.activeEl&&null!==this.activePointerId&&(this.activeEl.releasePointerCapture(this.activePointerId),this.activePointerId=null,this.activeEl=null)}}function Wn(t,i,s,e){const o=Vn(s),r=Vn(e);if(i===window){const s=n();if(!s.current){const n=new t(r.current),i=t=>o.current(Object.assign(Object.assign({},t),{index:0}));n.onChange(i).onEnd(i),s.current=n}return void a((()=>{const t=s.current.attach(window);return()=>{t()}}),[i])}const c=Array.isArray(i)?i:[i],l=n([]),u=n([]),h=n(c.length);l.current.length!==c.length&&(l.current=c.map(((n,i)=>{const s=new t(r.current),e=t=>o.current(Object.assign(Object.assign({},t),{index:i}));return s.onChange(e).onEnd(e),s})),h.current=c.length),a((()=>{u.current.forEach((t=>t())),u.current=[];const t=[];return c.forEach(((n,i)=>{const s=n.current;if(s&&l.current[i]){const n=l.current[i].attach(s);t.push(n)}})),u.current=t,()=>{t.forEach((t=>t())),u.current=[]}}),[c])}function Vn(t){const i=n(t);return a((()=>{i.current=t}),[t]),i}function Zn(t,n,i){return Wn(Un,t,n,i)}class _n extends Xn{constructor(){super(...arguments),this.attachedEls=new Set,this.prev={x:0,y:0},this.lastTime=0,this.movement={x:0,y:0},this.offset={x:0,y:0},this.velocity={x:0,y:0},this.startPos=null}attach(t){const n=Array.isArray(t)?t:[t],i=this.onMove.bind(this),s=this.onLeave.bind(this);return n.forEach((t=>{this.attachedEls.add(t),t.addEventListener("pointermove",i,{passive:!1}),t.addEventListener("pointerleave",s)})),()=>{n.forEach((t=>{t.removeEventListener("pointermove",i),t.removeEventListener("pointerleave",s),this.attachedEls.delete(t)}))}}cancel(){}onMove(t){const n=t.timeStamp;null===this.startPos&&(this.startPos={x:t.clientX,y:t.clientY},this.prev={x:t.clientX,y:t.clientY},this.lastTime=n);const i=Math.max((n-this.lastTime)/1e3,1e-6);this.lastTime=n;const s=t.clientX-this.prev.x,e=t.clientY-this.prev.y;this.prev={x:t.clientX,y:t.clientY},this.movement={x:t.clientX-this.startPos.x,y:t.clientY-this.startPos.y};const o=t.currentTarget,r=o instanceof HTMLElement?o.getBoundingClientRect():{left:0,top:0};this.offset={x:t.clientX-r.left,y:t.clientY-r.top};const a=s/i/1e3,c=e/i/1e3;this.velocity={x:J(a,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT),y:J(c,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT)},this.emitChange({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>this.onLeave(t)})}onLeave(t){this.emitEnd({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>{}})}}function Bn(t,n){return Wn(_n,t,n)}class Gn extends Xn{constructor(){super(...arguments),this.attachedEls=new Set,this.movement={x:0,y:0},this.offset={x:0,y:0},this.velocity={x:0,y:0},this.prevScroll={x:0,y:0},this.lastTime=0}attach(t){const n=Array.isArray(t)?t:[t],i=this.onScroll.bind(this);return n.forEach((t=>{this.attachedEls.add(t),t.addEventListener("scroll",i,{passive:!0})})),()=>{n.forEach((t=>{t.removeEventListener("scroll",i),this.attachedEls.delete(t)})),null!=this.endTimeout&&(clearTimeout(this.endTimeout),this.endTimeout=void 0)}}cancel(){}onScroll(t){const n=Date.now(),i=Math.max((n-this.lastTime)/1e3,1e-6);this.lastTime=n;const s=t.currentTarget,e=s instanceof HTMLElement?s.scrollLeft:window.scrollX,o=s instanceof HTMLElement?s.scrollTop:window.scrollY,r=e-this.prevScroll.x,a=o-this.prevScroll.y;this.prevScroll={x:e,y:o},this.movement={x:r,y:a},this.offset={x:e,y:o};const c=r/i/1e3,l=a/i/1e3;this.velocity={x:J(c,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT),y:J(l,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT)},this.emitChange({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>{null!=this.endTimeout&&clearTimeout(this.endTimeout)}}),null!=this.endTimeout&&clearTimeout(this.endTimeout),this.endTimeout=window.setTimeout((()=>{this.emitEnd({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>{}})}),150)}}function Jn(t,{target:i,axis:s="y",offset:e=["start start","end end"],animate:o=!0,toDescriptor:r=(t=>Zt(t))}={}){const[c,l]=Qt(0),[u,h]=Qt(0),f=n([0,0]);return a((()=>{var n;const o=t instanceof Window?window:t.current,r=null!==(n=null==i?void 0:i.current)&&void 0!==n?n:document.documentElement;f.current=function([t,n],i,s,e){return[Qn(t,i,s,e),Qn(n,i,s,e)]}(e,r,o,s)}),[t,i,s,e]),Wn(Gn,t,(t=>{const n="y"===s?t.offset.y:t.offset.x,[i,e]=f.current,a=Math.min(Math.max(e===i?i>n?0:1:(n-i)/(e-i),0),1),c=o?r:t=>t;"y"===s?(l(c(a)),h(0)):(h(c(a)),l(0))})),{scrollYProgress:c,scrollXProgress:u}}function Kn(t,n){return t instanceof HTMLElement?"y"===n?t.clientHeight:t.clientWidth:"y"===n?window.innerHeight:window.innerWidth}function Qn(t,n,i,s){const[e,o=e]=t.trim().split(/\s+/);if(i instanceof HTMLElement){const t=n.getBoundingClientRect(),r=i.getBoundingClientRect(),a=function(t,n){return t instanceof HTMLElement?"y"===n?t.scrollTop:t.scrollLeft:"y"===n?window.scrollY:window.scrollX}(i,s),c=("y"===s?t.top-r.top:t.left-r.left)+a,l="y"===s?t.height:t.width,u=Kn(i,s);return ti(e,c,l,u)-ti(o,0,u,u)}return ni(e,s,n,!1)-ni(o,s,window,!0)}function ti(t,n,i,s){if("start"===t)return n;if("center"===t)return n+i/2;if("end"===t)return n+i;const e=t.match(/^(-?\d+(?:\.\d+)?)(px|%|vw|vh)?$/);if(!e)throw Error(`Invalid edge marker “${t}”`);const o=parseFloat(e[1]);switch(e[2]){case"px":return n+o;case"%":return n+o/100*i;case"vw":case"vh":return n+o/100*s;default:return n+o*i}}function ni(t,n,i,s){const e=i;return ti(t,s?0:(()=>{if(!(i instanceof HTMLElement))throw Error("Expected HTMLElement for element-relative edge");const t=i.getBoundingClientRect(),s="y"===n?window.pageYOffset||window.scrollY:window.pageXOffset||window.scrollX;return("y"===n?t.top:t.left)+s})(),s?Kn(i,n):(()=>{if(!(i instanceof HTMLElement))throw Error();const t=i.getBoundingClientRect();return"y"===n?t.height:t.width})(),Kn(e,n))}function ii(t,n){return"function"==typeof n?Wn(Gn,t,n):Jn(t,n)}class si extends Xn{constructor(){super(...arguments),this.attachedEls=new Set,this.movement={x:0,y:0},this.offset={x:0,y:0},this.velocity={x:0,y:0},this.lastTime=0}attach(t){const n=Array.isArray(t)?t:[t],i=this.onWheel.bind(this);return n.forEach((t=>{this.attachedEls.add(t),t.addEventListener("wheel",i,{passive:!1})})),()=>{n.forEach((t=>{t.removeEventListener("wheel",i),this.attachedEls.delete(t)})),null!=this.endTimeout&&(clearTimeout(this.endTimeout),this.endTimeout=void 0)}}cancel(){}onWheel(t){t.preventDefault();const n=t.timeStamp,i=Math.max((n-this.lastTime)/1e3,1e-6);this.lastTime=n;const s=t.deltaX,e=t.deltaY;this.movement={x:s,y:e},this.offset.x+=s,this.offset.y+=e;const o=s/i/1e3,r=e/i/1e3;this.velocity={x:J(o,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT),y:J(r,-Xn.VELOCITY_LIMIT,Xn.VELOCITY_LIMIT)},this.emitChange({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>{null!=this.endTimeout&&clearTimeout(this.endTimeout)}}),null!=this.endTimeout&&clearTimeout(this.endTimeout),this.endTimeout=window.setTimeout((()=>{this.emitEnd({movement:Object.assign({},this.movement),offset:Object.assign({},this.offset),velocity:Object.assign({},this.velocity),event:t,cancel:()=>{}})}),150)}}function ei(t,n){return Wn(si,t,n)}export{R as AnimateValue,Vt as Config,pt as Easing,Lt as Presence,At as PresenceContext,Xt as animate,bn as bounceIn,wn as bounceOut,J as clamp,Ut as combine,st as decay,$t as delay,Yn as exitFade,Pn as exitScale,Hn as exitSlideDown,zn as exitSlideUp,tn as fadeIn,en as fadeInDown,on as fadeInLeft,rn as fadeInRight,sn as fadeInUp,nn as fadeOut,Fn as flipX,En as flipY,Ln as hoverGlow,Tn as hoverLift,In as hoverScale,X as isAnimateValue,Mt as loop,Dt as makeAnimated,nt as move,Ot as parallel,Nn as pressDown,qn as pressScale,Dn as recipes,xn as rotateIn,On as rotateOut,Q as rubberClamp,gn as scaleDown,An as scaleFadeIn,Cn as scaleFadeOut,mn as scaleIn,vn as scaleOut,yn as scaleUp,jt as sequence,kn as slideFadeIn,Sn as slideFadeOut,cn as slideInDown,ln as slideInLeft,un as slideInRight,an as slideInUp,fn as slideOutDown,dn as slideOutLeft,pn as slideOutRight,hn as slideOutUp,tt as snapTo,jn as spin,ot as spring,yt as timing,Wt as to,Zn as useDrag,Pt as useInView,It as useIsPresent,Bn as useMove,Rn as useOutsideClick,Ct as usePresence,Wn as useRecognizer,ii as useScroll,Jn as useScrollProgress,Qt as useValue,ei as useWheel,Bt as withDecay,Gt as withDelay,Kt as withLoop,Jt as withSequence,Zt as withSpring,_t as withTiming,Mn as zoomIn,$n as zoomOut};
package/package.json CHANGED
@@ -1,42 +1,52 @@
1
1
  {
2
2
  "name": "react-ui-animate",
3
- "version": "5.2.0",
3
+ "version": "5.3.0-next.1",
4
4
  "description": "React library for gestures and animation",
5
- "main": "dist/index.js",
6
- "peerDependencies": {
7
- "react": ">=16.8.0 || >=17.0.0 || >=18.0.0"
5
+ "type": "module",
6
+ "main": "dist/index.mjs",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.mjs",
16
+ "types": "./dist/index.d.ts"
17
+ }
8
18
  },
9
- "dependencies": {
10
- "@raidipesh78/re-motion": "^5.4.2"
19
+ "peerDependencies": {
20
+ "react": ">=16.8.0 || >=17.0.0 || >=18.0.0 || >=19.0.0"
11
21
  },
12
22
  "devDependencies": {
13
23
  "@rollup/plugin-terser": "^0.4.4",
14
- "@semantic-release/commit-analyzer": "^13.0.1",
15
- "@semantic-release/git": "^10.0.1",
16
- "@semantic-release/github": "^11.0.3",
17
- "@semantic-release/npm": "^12.0.2",
18
- "@semantic-release/release-notes-generator": "^14.0.3",
19
- "@types/jest": "^29.5.12",
20
- "@types/node": "^20.14.9",
21
- "@types/react": "^18.3.3",
22
- "@types/react-dom": "^18.3.0",
24
+ "@testing-library/jest-dom": "^6.1.5",
25
+ "@testing-library/react": "^16.3.1",
26
+ "@types/jest": "^29.5.14",
27
+ "@types/node": "^20.19.27",
28
+ "@types/react": "^18.3.27",
29
+ "@types/react-dom": "^18.3.7",
23
30
  "@types/resize-observer-browser": "^0.1.11",
24
- "babel-core": "^5.8.38",
25
- "babel-runtime": "^6.26.0",
31
+ "jest": "^29.7.0",
32
+ "jest-environment-jsdom": "^29.7.0",
26
33
  "react": "^18.3.1",
27
34
  "react-dom": "^18.3.1",
28
- "rimraf": "^6.0.1",
29
- "rollup": "^4.18.0",
35
+ "rimraf": "^6.1.2",
36
+ "rollup": "^4.54.0",
37
+ "rollup-plugin-dts": "^6.3.0",
30
38
  "rollup-plugin-typescript2": "^0.36.0",
31
- "semantic-release": "^24.2.6",
32
- "typescript": "^5.5.2"
39
+ "ts-jest": "^29.1.2",
40
+ "typescript": "^5.9.3"
33
41
  },
34
42
  "scripts": {
35
- "clean": "rimraf -rf dist",
36
- "build": "npm run clean && rollup -c",
43
+ "clean": "rimraf -rf dist .dts-temp",
44
+ "build": "npm run clean && rollup -c && rimraf -rf .dts-temp",
37
45
  "start": "npm run clean && rollup -c -w",
38
46
  "start:dev": "cd example && npm start",
39
- "test": "echo \"Error: no test specified\" && exit 1",
47
+ "test": "jest",
48
+ "test:watch": "jest --watch",
49
+ "test:coverage": "jest --coverage",
40
50
  "version:minor": "npm version minor",
41
51
  "version:major": "npm version major",
42
52
  "version:patch": "npm version patch",
@@ -1,63 +0,0 @@
1
- import { Easing } from '@raidipesh78/re-motion';
2
- export declare const Config: {
3
- Timing: {
4
- BOUNCE: {
5
- duration: number;
6
- easing: typeof Easing.bounce;
7
- };
8
- EASE_IN: {
9
- duration: number;
10
- easing: (t: number) => number;
11
- };
12
- EASE_OUT: {
13
- duration: number;
14
- easing: (t: number) => number;
15
- };
16
- EASE_IN_OUT: {
17
- duration: number;
18
- easing: (t: number) => number;
19
- };
20
- POWER1: {
21
- duration: number;
22
- easing: (t: number) => number;
23
- };
24
- POWER2: {
25
- duration: number;
26
- easing: (t: number) => number;
27
- };
28
- POWER3: {
29
- duration: number;
30
- easing: (t: number) => number;
31
- };
32
- POWER4: {
33
- duration: number;
34
- easing: (t: number) => number;
35
- };
36
- LINEAR: {
37
- duration: number;
38
- easing: typeof Easing.linear;
39
- };
40
- };
41
- Spring: {
42
- ELASTIC: {
43
- mass: number;
44
- damping: number;
45
- stiffness: number;
46
- };
47
- EASE: {
48
- mass: number;
49
- damping: number;
50
- stiffness: number;
51
- };
52
- STIFF: {
53
- mass: number;
54
- damping: number;
55
- stiffness: number;
56
- };
57
- WOBBLE: {
58
- mass: number;
59
- damping: number;
60
- stiffness: number;
61
- };
62
- };
63
- };
@@ -1,7 +0,0 @@
1
- import { Callbacks, DecayOptions, Descriptor, SpringOptions, TimingOptions } from './types';
2
- export declare const withSpring: (to: Descriptor["to"], opts?: SpringOptions & Callbacks) => Descriptor;
3
- export declare const withTiming: (to: Descriptor["to"], opts?: TimingOptions & Callbacks) => Descriptor;
4
- export declare const withDecay: (velocity: number, opts?: DecayOptions & Callbacks) => Descriptor;
5
- export declare const withDelay: (ms: number) => Descriptor;
6
- export declare const withSequence: (animations: Descriptor[], opts?: Omit<Callbacks, "onChange">) => Descriptor;
7
- export declare const withLoop: (animation: Descriptor, iterations?: number, opts?: Omit<Callbacks, "onChange">) => Descriptor;
@@ -1,4 +0,0 @@
1
- import { MotionValue, timing } from '@raidipesh78/re-motion';
2
- import type { Primitive, Descriptor } from './types';
3
- export declare function buildAnimation(mv: MotionValue<Primitive>, { type, to, options }: Descriptor): ReturnType<typeof timing>;
4
- export declare function buildParallel(mvMap: Record<string, MotionValue<Primitive>>, step: Descriptor): import("@raidipesh78/re-motion/dist/drivers/AnimationController").AnimationController;
@@ -1,3 +0,0 @@
1
- import type { Descriptor } from './types';
2
- export declare function filterCallbackOptions(options: Record<string, any> | undefined, attach: boolean): Record<string, any>;
3
- export declare function isDescriptor(x: unknown): x is Descriptor;
@@ -1,2 +0,0 @@
1
- export { useValue } from './useValue';
2
- export { useMount } from './useMount';
@@ -1,16 +0,0 @@
1
- import { MotionValue } from '@raidipesh78/re-motion';
2
- import type { Primitive, Descriptor } from '../types';
3
- export type ConfigSingle<T extends Primitive> = {
4
- from?: T;
5
- enter?: T | Descriptor;
6
- exit?: T | Descriptor;
7
- };
8
- export type ConfigMulti<I extends Record<string, Primitive>> = {
9
- from: I;
10
- enter?: I | Descriptor;
11
- exit?: I | Descriptor;
12
- };
13
- export declare function useMount<T extends Primitive = number>(isOpen: boolean, config?: ConfigSingle<T>): (fn: (value: MotionValue<T>, mounted: boolean) => React.ReactNode) => React.ReactNode;
14
- export declare function useMount<I extends Record<string, Primitive>>(isOpen: boolean, config: ConfigMulti<I>): (fn: (values: {
15
- [K in keyof I]: MotionValue<I[K]>;
16
- }, mounted: boolean) => React.ReactNode) => React.ReactNode;
@@ -1,9 +0,0 @@
1
- import { MotionValue } from '@raidipesh78/re-motion';
2
- import type { Primitive, Descriptor, Controls } from '../types';
3
- type Widen<T> = T extends number ? number : T extends string ? string : T;
4
- type ValueReturn<T> = T extends Primitive ? MotionValue<Widen<T>> : T extends Primitive[] ? MotionValue<Widen<Primitive>>[] : {
5
- [K in keyof T]: MotionValue<Widen<T[K]>>;
6
- };
7
- type Base = Primitive | Primitive[] | Record<string, Primitive>;
8
- export declare function useValue<T extends Base>(initial: T): [ValueReturn<T>, (to: Base | Descriptor) => void, Controls];
9
- export {};
@@ -1,5 +0,0 @@
1
- export * from './hooks';
2
- export * from './modules';
3
- export * from './descriptors';
4
- export * from './Config';
5
- export * from './to';
@@ -1,17 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import type { MotionValue } from '@raidipesh78/re-motion';
3
- import type { Primitive } from '../types';
4
- import { type ConfigMulti, type ConfigSingle } from '../hooks/useMount';
5
- interface MountPropsSingle<T extends Primitive> extends Partial<ConfigSingle<T>> {
6
- state: boolean;
7
- children: (animation: MotionValue<T>) => ReactNode;
8
- }
9
- interface MountPropsMulti<I extends Record<string, Primitive>> extends ConfigMulti<I> {
10
- state: boolean;
11
- children: (animation: {
12
- [K in keyof I]: MotionValue<I[K]>;
13
- }) => ReactNode;
14
- }
15
- export declare function Mount<T extends Primitive = number>(props: MountPropsSingle<T>): JSX.Element;
16
- export declare function Mount<I extends Record<string, Primitive>>(props: MountPropsMulti<I>): JSX.Element;
17
- export {};
@@ -1 +0,0 @@
1
- export { Mount } from './Mount';
@@ -1,2 +0,0 @@
1
- import { type ExtrapolateConfig } from '@raidipesh78/re-motion';
2
- export declare function to(input: number, inRange: number[], outRange: (number | string)[], config?: ExtrapolateConfig): number | string;
@@ -1,42 +0,0 @@
1
- export type Primitive = number | string;
2
- export interface Callbacks {
3
- onStart?: () => void;
4
- onChange?: (v: number) => void;
5
- onComplete?: () => void;
6
- }
7
- export interface SpringOptions {
8
- stiffness?: number;
9
- damping?: number;
10
- mass?: number;
11
- }
12
- export interface TimingOptions {
13
- duration?: number;
14
- easing?: (t: number) => number;
15
- }
16
- export interface DecayOptions {
17
- velocity?: number;
18
- clamp?: [number, number];
19
- }
20
- export interface SequenceOptions {
21
- animations?: Descriptor[];
22
- }
23
- export interface DelayOptions {
24
- delay?: number;
25
- }
26
- export interface LoopOptions {
27
- iterations?: number;
28
- animation?: Descriptor;
29
- }
30
- export type DriverType = 'spring' | 'timing' | 'decay' | 'delay' | 'sequence' | 'loop';
31
- export interface Descriptor {
32
- type: DriverType;
33
- to?: Primitive | Primitive[] | Record<string, Primitive>;
34
- options?: SpringOptions & TimingOptions & DecayOptions & SequenceOptions & DelayOptions & LoopOptions & Callbacks;
35
- }
36
- export interface Controls {
37
- start(): void;
38
- pause(): void;
39
- resume(): void;
40
- cancel(): void;
41
- reset(): void;
42
- }
@@ -1,47 +0,0 @@
1
- import { Gesture } from './Gesture';
2
- export interface DragEvent {
3
- down: boolean;
4
- movement: {
5
- x: number;
6
- y: number;
7
- };
8
- offset: {
9
- x: number;
10
- y: number;
11
- };
12
- velocity: {
13
- x: number;
14
- y: number;
15
- };
16
- event: PointerEvent;
17
- cancel: () => void;
18
- }
19
- export interface DragConfig {
20
- threshold?: number;
21
- axis?: 'x' | 'y';
22
- initial?: () => {
23
- x: number;
24
- y: number;
25
- };
26
- }
27
- export declare class DragGesture extends Gesture<DragEvent> {
28
- private config;
29
- private prev;
30
- private lastTime;
31
- private movement;
32
- private velocity;
33
- private start;
34
- private offset;
35
- private pointerCaptured;
36
- private activePointerId;
37
- private attachedEls;
38
- private activeEl;
39
- private pointerDownPos;
40
- private thresholdPassed;
41
- constructor(config?: DragConfig);
42
- attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
43
- private onDown;
44
- private onMove;
45
- private onUp;
46
- cancel(): void;
47
- }
@@ -1,13 +0,0 @@
1
- type Listener<E> = (event: E) => void;
2
- export declare abstract class Gesture<E> {
3
- static readonly VELOCITY_LIMIT = 20;
4
- private changeListeners;
5
- private endListeners;
6
- onChange(listener: Listener<E>): this;
7
- onEnd(listener: Listener<E>): this;
8
- protected emitChange(event: E): void;
9
- protected emitEnd(event: E): void;
10
- abstract attach(elements: HTMLElement | HTMLElement | Window): () => void;
11
- abstract cancel(): void;
12
- }
13
- export {};
@@ -1,30 +0,0 @@
1
- import { Gesture } from './Gesture';
2
- export interface MoveEvent {
3
- movement: {
4
- x: number;
5
- y: number;
6
- };
7
- offset: {
8
- x: number;
9
- y: number;
10
- };
11
- velocity: {
12
- x: number;
13
- y: number;
14
- };
15
- event: PointerEvent;
16
- cancel?: () => void;
17
- }
18
- export declare class MoveGesture extends Gesture<MoveEvent> {
19
- private attachedEls;
20
- private prev;
21
- private lastTime;
22
- private movement;
23
- private offset;
24
- private velocity;
25
- private startPos;
26
- attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
27
- cancel(): void;
28
- private onMove;
29
- private onLeave;
30
- }
@@ -1,29 +0,0 @@
1
- import { Gesture } from './Gesture';
2
- export interface ScrollEvent {
3
- movement: {
4
- x: number;
5
- y: number;
6
- };
7
- offset: {
8
- x: number;
9
- y: number;
10
- };
11
- velocity: {
12
- x: number;
13
- y: number;
14
- };
15
- event: Event;
16
- cancel?: () => void;
17
- }
18
- export declare class ScrollGesture extends Gesture<ScrollEvent> {
19
- private attachedEls;
20
- private movement;
21
- private offset;
22
- private velocity;
23
- private prevScroll;
24
- private lastTime;
25
- private endTimeout?;
26
- attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
27
- cancel(): void;
28
- private onScroll;
29
- }
@@ -1,28 +0,0 @@
1
- import { Gesture } from './Gesture';
2
- export interface WheelEvent {
3
- movement: {
4
- x: number;
5
- y: number;
6
- };
7
- offset: {
8
- x: number;
9
- y: number;
10
- };
11
- velocity: {
12
- x: number;
13
- y: number;
14
- };
15
- event: globalThis.WheelEvent;
16
- cancel?: () => void;
17
- }
18
- export declare class WheelGesture extends Gesture<WheelEvent> {
19
- private attachedEls;
20
- private movement;
21
- private offset;
22
- private velocity;
23
- private lastTime;
24
- private endTimeout?;
25
- attach(elements: HTMLElement | HTMLElement[] | Window): () => void;
26
- cancel(): void;
27
- private onWheel;
28
- }
@@ -1,4 +0,0 @@
1
- export { useDrag } from './useDrag';
2
- export { useMove } from './useMove';
3
- export { useScroll } from './useScroll';
4
- export { useWheel } from './useWheel';
@@ -1,5 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { type DragConfig, type DragEvent } from '../controllers/DragGesture';
3
- export declare function useDrag<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onDrag: (e: DragEvent & {
4
- index: number;
5
- }) => void, config?: DragConfig): void;
@@ -1,8 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { type MoveEvent } from '../controllers/MoveGesture';
3
- export declare function useMove(refs: Window, onMove: (e: MoveEvent & {
4
- index: 0;
5
- }) => void): void;
6
- export declare function useMove<T extends HTMLElement>(refs: RefObject<T> | Array<RefObject<T>>, onMove: (e: MoveEvent & {
7
- index: number;
8
- }) => void): void;
@@ -1,13 +0,0 @@
1
- import { RefObject } from 'react';
2
- interface GestureInstance<E> {
3
- onChange(handler: (event: E) => void): this;
4
- onEnd(handler: (event: E) => void): this;
5
- attach(target: Window | HTMLElement): () => void;
6
- }
7
- interface GestureConstructor<C, E> {
8
- new (config?: C): GestureInstance<E>;
9
- }
10
- export declare function useRecognizer<T extends HTMLElement, C, E>(GestureClass: GestureConstructor<C, E>, refs: Window | RefObject<T> | Array<RefObject<T>>, onEvent: (e: E & {
11
- index: number;
12
- }) => void, config?: C): void;
13
- export {};
@@ -1,11 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { MotionValue } from '@raidipesh78/re-motion';
3
- import { type ScrollEvent } from '../controllers/ScrollGesture';
4
- import { type UseScrollProgressOptions } from '../../hooks/observers/useScrollProgress';
5
- export declare function useScroll<T extends HTMLElement>(refs: Window | RefObject<T> | RefObject<T>[], onScroll: (e: ScrollEvent & {
6
- index: number;
7
- }) => void): void;
8
- export declare function useScroll<T extends HTMLElement>(refs: Window | RefObject<T> | RefObject<T>[], options?: UseScrollProgressOptions): {
9
- scrollYProgress: MotionValue<number>;
10
- scrollXProgress: MotionValue<number>;
11
- };