framer-motion 7.10.0 → 7.10.2

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/dist/index.d.ts CHANGED
@@ -4037,7 +4037,7 @@ interface WillChange extends MotionValue {
4037
4037
 
4038
4038
  declare function useWillChange(): WillChange;
4039
4039
 
4040
- declare function useMotionValueEvent<V, EventName extends keyof MotionValueEventCallbacks<V>>(value: MotionValue, event: EventName, callback: MotionValueEventCallbacks<V>[EventName]): void;
4040
+ declare function useMotionValueEvent<V, EventName extends keyof MotionValueEventCallbacks<V>>(value: MotionValue<V>, event: EventName, callback: MotionValueEventCallbacks<V>[EventName]): void;
4041
4041
 
4042
4042
  /**
4043
4043
  * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.
@@ -725,18 +725,11 @@
725
725
  const circOut = reverseEasing(circIn);
726
726
  const circInOut = mirrorEasing(circOut);
727
727
 
728
- const createBackIn = (power = 1.525) => (p) => p * p * ((power + 1) * p - power);
729
- const backIn = createBackIn();
730
- const backOut = reverseEasing(backIn);
728
+ const backOut = cubicBezier(0.33, 1.53, 0.69, 0.99);
729
+ const backIn = reverseEasing(backOut);
731
730
  const backInOut = mirrorEasing(backIn);
732
731
 
733
- const createAnticipate = (power) => {
734
- const backEasing = createBackIn(power);
735
- return (p) => (p *= 2) < 1
736
- ? 0.5 * backEasing(p)
737
- : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
738
- };
739
- const anticipate = createAnticipate();
732
+ const anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
740
733
 
741
734
  const easingLookup = {
742
735
  linear: noop,
@@ -1189,33 +1182,34 @@
1189
1182
  driverControls.stop();
1190
1183
  },
1191
1184
  sample: (t) => {
1192
- return animation.next(Math.max(0, t)).value;
1185
+ return animation.next(Math.max(0, t));
1193
1186
  },
1194
1187
  };
1195
1188
  }
1196
1189
 
1197
- /**
1198
- * Convert camelCase to dash-case properties.
1199
- */
1200
- const camelToDash = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1201
-
1202
- const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
1203
- const validWaapiEasing = new Set([
1204
- "linear",
1205
- "ease-in",
1206
- "ease-out",
1207
- "ease-in-out",
1208
- ]);
1209
- function mapEasingName(easingName) {
1210
- const name = camelToDash(easingName);
1211
- return validWaapiEasing.has(name) ? name : "ease";
1190
+ function isWaapiSupportedEasing(easing) {
1191
+ return (!easing || // Default easing
1192
+ Array.isArray(easing) || // Bezier curve
1193
+ (typeof easing === "string" && supportedWaapiEasing[easing]));
1212
1194
  }
1195
+ const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
1196
+ const supportedWaapiEasing = {
1197
+ linear: "linear",
1198
+ ease: "ease",
1199
+ easeIn: "ease-in",
1200
+ easeOut: "ease-out",
1201
+ easeInOut: "ease-in-out",
1202
+ circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),
1203
+ circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),
1204
+ backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
1205
+ backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
1206
+ };
1213
1207
  function mapEasingToNativeEasing(easing) {
1214
1208
  if (!easing)
1215
1209
  return undefined;
1216
1210
  return Array.isArray(easing)
1217
1211
  ? cubicBezierAsString(easing)
1218
- : mapEasingName(easing);
1212
+ : supportedWaapiEasing[easing];
1219
1213
  }
1220
1214
 
1221
1215
  function animateStyle(element, valueName, keyframes, { delay = 0, duration, repeat = 0, repeatType = "loop", ease, times, } = {}) {
@@ -1238,23 +1232,19 @@
1238
1232
  function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
1239
1233
  let { keyframes, duration = 0.3, elapsed = 0, ease } = options;
1240
1234
  /**
1241
- * If this is a spring animation, pre-generate keyframes and
1242
- * record duration.
1243
- *
1244
- * TODO: When introducing support for values beyond opacity it
1245
- * might be better to use `animate.sample()`
1235
+ * If this animation needs pre-generated keyframes then generate.
1246
1236
  */
1247
- if (options.type === "spring") {
1248
- const springAnimation = spring(options);
1237
+ if (options.type === "spring" || !isWaapiSupportedEasing(options.ease)) {
1238
+ const sampleAnimation = animate$1(options);
1249
1239
  let state = { done: false, value: keyframes[0] };
1250
- const springKeyframes = [];
1240
+ const pregeneratedKeyframes = [];
1251
1241
  let t = 0;
1252
1242
  while (!state.done) {
1253
- state = springAnimation.next(t);
1254
- springKeyframes.push(state.value);
1243
+ state = sampleAnimation.sample(t);
1244
+ pregeneratedKeyframes.push(state.value);
1255
1245
  t += sampleDelta;
1256
1246
  }
1257
- keyframes = springKeyframes;
1247
+ keyframes = pregeneratedKeyframes;
1258
1248
  duration = t - sampleDelta;
1259
1249
  ease = "linear";
1260
1250
  }
@@ -1299,7 +1289,7 @@
1299
1289
  const { currentTime } = animation;
1300
1290
  if (currentTime) {
1301
1291
  const sampleAnimation = animate$1(options);
1302
- value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta), sampleAnimation.sample(currentTime), sampleDelta);
1292
+ value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta).value, sampleAnimation.sample(currentTime).value, sampleDelta);
1303
1293
  }
1304
1294
  sync.update(() => animation.cancel());
1305
1295
  };
@@ -1787,7 +1777,6 @@
1787
1777
  !options.repeatDelay &&
1788
1778
  options.repeatType !== "mirror" &&
1789
1779
  options.damping !== 0 &&
1790
- typeof options.ease !== "function" &&
1791
1780
  visualElement &&
1792
1781
  element instanceof HTMLElement &&
1793
1782
  !visualElement.getProps().onUpdate;
@@ -1876,7 +1865,7 @@
1876
1865
  * This will be replaced by the build step with the latest version number.
1877
1866
  * When MotionValues are provided to motion components, warn if versions are mixed.
1878
1867
  */
1879
- this.version = "7.10.0";
1868
+ this.version = "7.10.2";
1880
1869
  /**
1881
1870
  * Duration, in milliseconds, since last updating frame.
1882
1871
  *
@@ -5019,7 +5008,7 @@
5019
5008
  * and warn against mismatches.
5020
5009
  */
5021
5010
  {
5022
- warnOnce(nextValue.version === "7.10.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.0 may not work as expected.`);
5011
+ warnOnce(nextValue.version === "7.10.2", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.10.2 may not work as expected.`);
5023
5012
  }
5024
5013
  }
5025
5014
  else if (isMotionValue(prevValue)) {
@@ -1 +1 @@
1
- import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as o}from"react";import{P as s,q as i,t as a,u,v as l,w as c,x as p,y as h,z as d,A as f,B as m,C as v,D as g,E as y,F as w,r as V,G as b,d as A,H as C,I as M,n as x,J as S,c as E,i as T,K as P,f as F,b as k,m as I,a as O,L as D,g as N,p as R,M as B,N as j,s as U,h as L,o as z,j as $,k as q}from"./size-rollup-dom-animation-assets.js";function H(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const W=t=>/^0[^.\s]+$/.test(t),K={delta:0,timestamp:0},Y="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),X="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Y()),1/60*1e3);let G=!0,Z=!1,J=!1;const _=["read","update","preRender","render","postRender"],Q=_.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const u=a&&o,l=u?e:n;return s&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&o&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}o=!1,s&&(s=!1,a.process(u))}}};return a}(()=>Z=!0),t),{}),tt=_.reduce((t,e)=>{const n=Q[e];return t[e]=(t,e=!1,r=!1)=>(Z||ot(),n.schedule(t,e,r)),t},{}),et=_.reduce((t,e)=>(t[e]=Q[e].cancel,t),{});_.reduce((t,e)=>(t[e]=()=>Q[e].process(K),t),{});const nt=t=>Q[t].process(K),rt=t=>{Z=!1,K.delta=G?1/60*1e3:Math.max(Math.min(t-K.timestamp,40),1),K.timestamp=t,J=!0,_.forEach(nt),J=!1,Z&&(G=!1,X(rt))},ot=()=>{Z=!0,G=!0,J||X(rt)};class st{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function it(t,e){return e?t*(1e3/e):0}class at{constructor(t,e={}){var n;this.version="7.10.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=K;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,tt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>tt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){return this.events[t]||(this.events[t]=new st),this.events[t].add(e)}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?it(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop()}}function ut(t,e){return new at(t,e)}const lt=(t,e)=>n=>Boolean(i(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>r=>{if(!i(r))return r;const[o,s,a,l]=r.match(u);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(a),alpha:void 0!==l?parseFloat(l):1}},pt={...p,transform:t=>Math.round((t=>h(0,255,t))(t))},ht={test:lt("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+l(c.transform(r))+")"};const dt={test:lt("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:ht.transform},ft={test:lt("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+d.transform(l(e))+", "+d.transform(l(n))+", "+l(c.transform(r))+")"},mt={test:t=>ht.test(t)||dt.test(t)||ft.test(t),parse:t=>ht.test(t)?ht.parse(t):ft.test(t)?ft.parse(t):dt.parse(t),transform:t=>i(t)?t:t.hasOwnProperty("red")?ht.transform(t):ft.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,r=0;const o=t.match(f);o&&(n=o.length,t=t.replace(f,"${c}"),e.push(...o.map(mt.parse)));const s=t.match(u);return s&&(r=s.length,t=t.replace(u,"${n}"),e.push(...s.map(p.parse))),{values:e,numColors:n,numNumbers:r,tokenised:t}}function gt(t){return vt(t).values}function yt(t){const{values:e,numColors:n,tokenised:r}=vt(t),o=e.length;return t=>{let e=r;for(let r=0;r<o;r++)e=e.replace(r<n?"${c}":"${n}",r<n?mt.transform(t[r]):l(t[r]));return e}}const wt=t=>"number"==typeof t?0:t;const Vt={test:function(t){var e,n;return isNaN(t)&&i(t)&&((null===(e=t.match(u))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(f))||void 0===n?void 0:n.length)||0)>0},parse:gt,createTransformer:yt,getAnimatableNone:function(t){const e=gt(t);return yt(t)(e.map(wt))}},bt=new Set(["brightness","contrast","saturate","opacity"]);function At(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(u)||[];if(!r)return t;const o=n.replace(r,"");let s=bt.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const Ct=/([a-z-]*)\(.*?\)/g,Mt={...Vt,getAnimatableNone:t=>{const e=t.match(Ct);return e?e.map(At).join(" "):t}},xt={...m,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Mt,WebkitFilter:Mt},St=t=>xt[t];function Et(t,e){var n;let r=St(t);return r!==Mt&&(r=Vt),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Tt=t=>e=>e.test(t),Pt=[p,v,d,g,y,w,{test:t=>"auto"===t,parse:t=>t}],Ft=t=>Pt.find(Tt(t)),kt=[...Pt,mt,Vt],It=t=>kt.find(Tt(t));function Ot(t,e,n){const r=t.getProps();return V(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Dt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ut(n))}function Nt(t,e){if(!e)return;return(e[t]||e.default||e).from}function Rt(t){return Boolean(A(t)&&t.add)}function Bt(t,e){const{MotionAppearAnimations:n}=window,r=((t,e)=>`${t}: ${e}`)(t,C.has(e)?"transform":e),o=n&&n.get(r);return o?(tt.render(()=>{try{o.cancel(),n.delete(r)}catch(t){}}),o.currentTime||0):0}const jt="data-"+M("framerAppearId");const Ut=t=>1e3*t,Lt=!1,zt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$t=t=>e=>1-t(1-e),qt=t=>t*t,Ht=$t(qt),Wt=zt(qt),Kt=(t,e,n)=>-n*t+n*e+t;function Yt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Xt=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},Gt=[dt,ht,ft];function Zt(t){const e=(n=t,Gt.find(t=>t.test(n)));var n;let r=e.parse(t);return e===ft&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,s=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=Yt(a,r,t+1/3),s=Yt(a,r,t),i=Yt(a,r,t-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}(r)),r}const Jt=(t,e)=>{const n=Zt(t),r=Zt(e),o={...n};return t=>(o.red=Xt(n.red,r.red,t),o.green=Xt(n.green,r.green,t),o.blue=Xt(n.blue,r.blue,t),o.alpha=Kt(n.alpha,r.alpha,t),ht.transform(o))},_t=(t,e)=>n=>e(t(n)),Qt=(...t)=>t.reduce(_t);function te(t,e){return"number"==typeof t?n=>Kt(t,e,n):mt.test(t)?Jt(t,e):re(t,e)}const ee=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>te(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},ne=(t,e)=>{const n={...t,...e},r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=te(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}},re=(t,e)=>{const n=Vt.createTransformer(e),r=vt(t),o=vt(e);return r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Qt(ee(r.values,o.values),n):n=>""+(n>0?e:t)},oe=(t,e)=>n=>Kt(t,e,n);function se(t,e,n){const r=[],o=n||("number"==typeof(s=t[0])?oe:"string"==typeof s?mt.test(s)?Jt:re:Array.isArray(s)?ee:"object"==typeof s?ne:oe);var s;const i=t.length-1;for(let n=0;n<i;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=Qt(t,s)}r.push(s)}return r}function ie(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=se(e,r,o),a=i.length,u=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=((t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r})(t[n],t[n+1],e);return i[n](r)};return n?e=>u(h(t[0],t[s-1],e)):u}const ae=t=>t,ue=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function le(t,e,n,r){if(t===e&&n===r)return ae;const o=e=>function(t,e,n,r,o){let s,i,a=0;do{i=e+(n-e)/2,s=ue(i,r,o)-t,s>0?n=i:e=i}while(Math.abs(s)>1e-7&&++a<12);return i}(e,0,1,t,n);return t=>0===t||1===t?t:ue(o(t),e,r)}const ce=t=>1-Math.sin(Math.acos(t)),pe=$t(ce),he=zt(pe),de=(t=1.525)=>e=>e*e*((t+1)*e-t),fe=de(),me=$t(fe),ve=zt(fe),ge=(t=>{const e=de(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(),ye={linear:ae,easeIn:qt,easeInOut:Wt,easeOut:Ht,circIn:ce,circInOut:he,circOut:pe,backIn:fe,backInOut:ve,backOut:me,anticipate:ge},we=t=>{if(Array.isArray(t)){t.length;const[e,n,r,o]=t;return le(e,n,r,o)}return"string"==typeof t?ye[t]:t};function Ve({keyframes:t,ease:e=Wt,times:n,duration:r=300}){t=[...t];const o=Ve[0],s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(we):we(e),i={done:!1,value:o},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===Ve.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),r);function u(){return ie(a,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||Wt).splice(0,e.length-1))});var e,n}let l=u();return{next:t=>(i.value=l(t),i.done=t>=r,i),flipTarget:()=>{t.reverse(),l=u()}}}function be({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,s,i=1-e;i=h(.05,1,i),t=h(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/Ae(e,i)*Math.exp(-o)},s=e=>{const r=e*i*t,s=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=Ae(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((s-a)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function Ae(t,e){return t*Math.sqrt(1-e*e)}const Ce=["duration","bounce"],Me=["stiffness","damping","mass"];function xe(t,e){return e.some(e=>void 0!==t[e])}function Se({keyframes:t,restSpeed:e=2,restDelta:n=.01,...r}){let o=t[0],s=t[t.length-1];const i={done:!1,value:o},{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!xe(t,Me)&&xe(t,Ce)){const n=be(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r);let d=Ee,f=c?-c/1e3:0;const m=u/(2*Math.sqrt(a*l));function v(){const t=s-o,e=Math.sqrt(a/l)/1e3;if(void 0===n&&(n=Math.min(Math.abs(s-o)/100,.4)),m<1){const n=Ae(e,m);d=r=>{const o=Math.exp(-m*e*r);return s-o*((f+m*e*t)/n*Math.sin(n*r)+t*Math.cos(n*r))}}else if(1===m)d=n=>s-Math.exp(-e*n)*(t+(f+e*t)*n);else{const n=e*Math.sqrt(m*m-1);d=r=>{const o=Math.exp(-m*e*r),i=Math.min(n*r,300);return s-o*((f+m*e*t)*Math.sinh(i)+n*t*Math.cosh(i))/n}}}return v(),{next:t=>{const r=d(t);if(h)i.done=t>=p;else{let o=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);o=it(r-d(e),t-e)}else o=0;const a=Math.abs(o)<=e,u=Math.abs(s-r)<=n;i.done=a&&u}return i.value=i.done?s:r,i},flipTarget:()=>{f=-f,[o,s]=[s,o],v()}}}Se.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Ee=t=>0;const Te={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:s}){const i=t[0],a={done:!1,value:i};let u=n*e;const l=i+u,c=void 0===s?l:s(l);return c!==l&&(u=c-i),{next:t=>{const e=-u*Math.exp(-t/r);return a.done=!(e>o||e<-o),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:Ve,tween:Ve,spring:Se};function Pe(t,e,n=0){return t-e-n}const Fe=t=>{const e=({delta:e})=>t(e);return{start:()=>tt.update(e,!0),stop:()=>et.update(e)}};function ke({duration:t,driver:e=Fe,elapsed:n=0,repeat:r=0,repeatType:o="loop",repeatDelay:s=0,keyframes:i,autoplay:a=!0,onPlay:u,onStop:l,onComplete:c,onRepeat:p,onUpdate:h,type:d="keyframes",...f}){var m,v;let g,y,w,V=0,b=t,A=!1,C=!0;const M=Te[i.length>2?"keyframes":d],x=i[0],S=i[i.length-1];(null===(v=(m=M).needsInterpolation)||void 0===v?void 0:v.call(m,x,S))&&(w=ie([0,100],[x,S],{clamp:!1}),i=[0,100]);const E=M({...f,duration:t,keyframes:i});function T(){V++,"reverse"===o?(C=V%2==0,n=function(t,e=0,n=0,r=!0){return r?Pe(e+-t,e,n):e-(t-e)+n}(n,b,s,C)):(n=Pe(n,b,s),"mirror"===o&&E.flipTarget()),A=!1,p&&p()}function P(t){if(C||(t=-t),n+=t,!A){const t=E.next(Math.max(0,n));y=t.value,w&&(y=w(y)),A=C?t.done:n<=0}h&&h(y),A&&(0===V&&(b=void 0!==b?b:n),V<r?function(t,e,n,r){return r?t>=e+n:t<=-n}(n,b,s,C)&&T():(g.stop(),c&&c()))}return a&&(u&&u(),g=e(P),g.start()),{stop:()=>{l&&l(),g.stop()},sample:t=>E.next(Math.max(0,t)).value}}const Ie=new Set(["linear","ease-in","ease-out","ease-in-out"]);function Oe(t){if(t)return Array.isArray(t)?(([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`)(t):function(t){const e=M(t);return Ie.has(e)?e:"ease"}(t)}function De(t,e,{onUpdate:n,onComplete:r,...o}){let{keyframes:s,duration:i=.3,elapsed:a=0,ease:u}=o;if("spring"===o.type){const t=Se(o);let e={done:!1,value:s[0]};const n=[];let r=0;for(;!e.done;)e=t.next(r),n.push(e.value),r+=10;s=n,i=r-10,u="linear"}const l=function(t,e,n,{delay:r=0,duration:o,repeat:s=0,repeatType:i="loop",ease:a,times:u}={}){return t.animate({[e]:n,offset:u},{delay:r,duration:o,easing:Oe(a),fill:"both",iterations:s+1,direction:"reverse"===i?"alternate":"normal"})}(t.owner.current,e,s,{...o,delay:-a,duration:i,ease:u});return l.onfinish=()=>{t.set(s[s.length-1]),r&&r()},()=>{const{currentTime:e}=l;if(e){const n=ke(o);t.setWithVelocity(n.sample(e-10),n.sample(e),10)}tt.update(()=>l.cancel())}}function Ne({keyframes:t,elapsed:e,onUpdate:n,onComplete:r}){const o=()=>(n&&n(t[t.length-1]),r&&r(),()=>{});return e?function(t,e){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(et.read(r),t(s-e))};return tt.read(r,!0),()=>et.read(r)}(o,-e):o()}const Re=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Be=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),je=()=>({type:"keyframes",ease:"linear",duration:.3}),Ue={type:"keyframes",duration:.8},Le={x:Re,y:Re,z:Re,rotate:Re,rotateX:Re,rotateY:Re,rotateZ:Re,scaleX:Be,scaleY:Be,scale:Be,opacity:je,backgroundColor:je,color:je,default:Be},ze=(t,{keyframes:e})=>{if(e.length>2)return Ue;return(Le[t]||Le.default)(e[1])},$e=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Vt.test(e)||e.startsWith("url(")));function qe(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function He(t){return"number"==typeof t?0:Et("",t)}const We={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Ke={},Ye={};for(const t in We)Ye[t]=()=>(void 0===Ke[t]&&(Ke[t]=We[t]()),Ke[t]);const Xe=new Set(["opacity"]),Ge=(t,e,n,r={})=>o=>{const s=function(t,e){return t[e]||t.default||t}(r,t)||{},i=s.delay||r.delay||0;let{elapsed:a=0}=r;a-=Ut(i);const u=function(t,e,n,r){const o=$e(e,n);let s=void 0!==r.from?r.from:t.get();return"none"===s&&o&&"string"==typeof n?s=Et(e,n):qe(s)&&"string"==typeof n?s=He(n):!Array.isArray(n)&&qe(n)&&"string"==typeof s&&(n=He(s)),Array.isArray(n)?(null===n[0]&&(n[0]=s),n):[s,n]}(e,t,n,s),l=u[0],c=u[u.length-1],p=$e(t,l),h=$e(t,c);let d={keyframes:u,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:t=>{e.set(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{o(),s.onComplete&&s.onComplete()}};if(!p||!h||Lt||!1===s.type)return Ne(d);if("inertia"===s.type){const t=function({keyframes:t,velocity:e=0,min:n,max:r,power:o=.8,timeConstant:s=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:h,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==r&&t>r}function g(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function y(t){null==m||m.stop(),m=ke({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:d})}function w(t){y({type:"spring",stiffness:i,damping:a,restDelta:u,...t})}if(v(f))w({velocity:e,keyframes:[f,g(f)]});else{let t=o*e+f;void 0!==l&&(t=l(t));const r=g(t),i=r===n?-1:1;let a,c;const p=t=>{a=c,c=t,e=it(t-a,K.delta),(1===i&&t>r||-1===i&&t<r)&&w({keyframes:[t,r],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:s,power:o,restDelta:u,modifyTarget:l,onUpdate:v(t)?p:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(d);return()=>t.stop()}(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length})(s)||(d={...d,...ze(t,d)}),d.duration&&(d.duration=Ut(d.duration)),d.repeatDelay&&(d.repeatDelay=Ut(d.repeatDelay));const f=e.owner,m=f&&f.current;if(Ye.waapi()&&Xe.has(t)&&!d.repeatDelay&&"mirror"!==d.repeatType&&0!==d.damping&&"function"!=typeof d.ease&&f&&m instanceof HTMLElement&&!f.getProps().onUpdate)return De(e,t,d);{const t=ke(d);return()=>t.stop()}};function Ze(t,e,n={}){var r;const o=Ot(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Je(t,o,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,o=1,s){const i=[],a=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(_e).forEach((t,r)=>{i.push(Ze(t,e,{...s,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function Je(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const r=t.getValue(e),o=u[e];if(!r||void 0===o||p&&Qe(p,e))continue;let s={delay:n,elapsed:0,...i};if(t.shouldReduceMotion&&C.has(e)&&(s={...s,type:!1,delay:0}),!r.hasAnimated){const n=t.getProps()[jt];n&&(s.elapsed=Bt(n,e))}let a=r.start(Ge(e,r,o,s));Rt(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Ot(t,e);let{transitionEnd:r={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const e in s){Dt(t,e,b(s[e]))}}(t,a)})}function _e(t,e){return t.sortNodePosition(e)}function Qe({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var tn;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(tn||(tn={}));const en=[tn.Animate,tn.InView,tn.Focus,tn.Hover,tn.Tap,tn.Drag,tn.Exit],nn=[...en].reverse(),rn=en.length;function on(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Ze(t,e,n));r=Promise.all(o)}else if("string"==typeof e)r=Ze(t,e,n);else{const o="function"==typeof e?Ot(t,e,n.custom):e;r=Je(t,o,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function sn(t){let e=on(t);const n={[tn.Animate]:un(!0),[tn.InView]:un(),[tn.Hover]:un(),[tn.Tap]:un(),[tn.Drag]:un(),[tn.Focus]:un(),[tn.Exit]:un()};let r=!0;const o=(e,n)=>{const r=Ot(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function s(s,i){const a=t.getProps(),u=t.getVariantContext(!0)||{},l=[],c=new Set;let p={},h=1/0;for(let e=0;e<rn;e++){const d=nn[e],f=n[d],m=void 0!==a[d]?a[d]:u[d],v=E(m),g=d===i?f.isActive:null;!1===g&&(h=e);let y=m===u[d]&&m!==a[d]&&v;if(y&&r&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...p},!f.isActive&&null===g||!m&&!f.prevProp||x(m)||"boolean"==typeof m)continue;const w=an(f.prevProp,m);let V=w||d===i&&f.isActive&&!y&&v||e>h&&v;const b=Array.isArray(m)?m:[m];let A=b.reduce(o,{});!1===g&&(A={});const{prevResolvedValues:C={}}=f,M={...C,...A},T=t=>{V=!0,c.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=A[t],n=C[t];p.hasOwnProperty(t)||(e!==n?S(e)&&S(n)?!H(e,n)||w?T(t):f.protectedKeys[t]=!0:void 0!==e?T(t):c.add(t):void 0!==e&&c.has(t)?T(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=A,f.isActive&&(p={...p,...A}),r&&t.blockInitialAnimation&&(V=!1),V&&!y&&l.push(...b.map(t=>({animation:t,options:{type:d,...s}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),l.push({animation:e})}let d=Boolean(l.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),r=!1,d?e(l):Promise.resolve()}return{animateChanges:s,setActive:function(e,r,o){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function an(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!H(e,t)}function un(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const ln=t=>e=>(t(e),null),cn={animation:ln(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=sn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:ln(r=>{const{custom:o,visualElement:i}=r,[a,u]=function(){const r=t(s);if(null===r)return[!0,null];const{isPresent:o,onExitComplete:i,register:a}=r,u=e();return n(()=>a(u),[]),!o&&i?[!1,()=>i&&i(u)]:[!0]}(),l=t(s);n(()=>{i.isPresent=a;const t=i.animationState&&i.animationState.setActive(tn.Exit,!a,{custom:l&&l.custom||o});t&&!a&&t.then(u)},[a])})};function pn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function hn(t,e,r,o){n(()=>{const n=t.current;if(r&&n)return pn(n,e,r,o)},[t,e,r,o])}function dn(t){return!!t.touches}const fn={pageX:0,pageY:0};function mn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||fn;return{x:n[e+"X"],y:n[e+"Y"]}}function vn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const gn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:dn(t)?mn(t,e):vn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},yn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},wn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Vn(t){return T&&null===window.onpointerdown?t:T&&null===window.ontouchstart?wn[t]:T&&null===window.onmousedown?yn[t]:t}function bn(t,e,n,r){return pn(t,Vn(e),gn(n,"pointerdown"===e),r)}function An(t,e,n,r){return hn(t,Vn(e),n&&gn(n,"pointerdown"===e),r)}function Cn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Mn=Cn("dragHorizontal"),xn=Cn("dragVertical");function Sn(){const t=function(t){let e=!1;if("y"===t)e=xn();else if("x"===t)e=Mn();else{const t=Mn(),n=xn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function En(t,e,n){return(r,o)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!Sn()&&(t.animationState&&t.animationState.setActive(tn.Hover,e),n&&n(r,o))}}const Tn=(t,e)=>!!e&&(t===e||Tn(t,e.parentElement));const Pn=("undefined"==typeof process||process.env,"production"),Fn=new Set;const kn=new WeakMap,In=new WeakMap,On=t=>{const e=kn.get(t.target);e&&e(t)},Dn=t=>{t.forEach(On)};function Nn(t,e,n){const r=function({root:t,...e}){const n=t||document;In.has(n)||In.set(n,{});const r=In.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Dn,{root:t,...e})),r[o]}(e);return kn.set(t,n),r.observe(t),()=>{kn.delete(t),r.unobserve(t)}}const Rn={some:0,all:1};function Bn(t,e,r,{root:o,margin:s,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof i?i:Rn[i]};return Nn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(tn.InView,n);const o=r.getProps(),s=n?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,i])}function jn(t,e,r,{fallback:o=!0}){n(()=>{var n,s;t&&o&&("production"!==Pn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Fn.has(n)||(console.warn(n),s&&console.warn(s),Fn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(tn.InView,!0)}))},[t])}const Un={inView:ln((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:o,viewport:s={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||o);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?jn:Bn)(a,i.current,t,s)})),tap:ln((function({onTap:t,onTapStart:e,onTapCancel:o,whileTap:s,visualElement:i}){const a=t||e||o||s,u=r(!1),l=r(null),c={passive:!(e||t||o||m)};function p(){l.current&&l.current(),l.current=null}function h(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(tn.Tap,!1),!Sn()}function d(e,n){h()&&(Tn(i.current,e.target)?t&&t(e,n):o&&o(e,n))}function f(t,e){h()&&o&&o(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=Qt(bn(window,"pointerup",d,c),bn(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(tn.Tap,!0),e&&e(t,n))}var v;An(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:ln((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;hn(e,"focus",t?()=>{n&&n.setActive(tn.Focus,!0)}:void 0),hn(e,"blur",t?()=>{n&&n.setActive(tn.Focus,!1)}:void 0)})),hover:ln((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){An(r,"pointerenter",t||n?En(r,!0,t):void 0,{passive:!t}),An(r,"pointerleave",e||n?En(r,!1,e):void 0,{passive:!e})}))};function Ln(t){return"string"==typeof t&&t.startsWith("var(--")}const zn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function $n(t,e,n=1){const[r,o]=function(t){const e=zn.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);return s?s.trim():Ln(o)?$n(o,e,n+1):o}const qn=new Set(["width","height","top","left","right","bottom","x","y"]),Hn=t=>qn.has(t),Wn=(t,e)=>{t.set(e,!1),t.set(e)},Kn=t=>t===p||t===v;var Yn;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Yn||(Yn={}));const Xn=(t,e)=>parseFloat(t.split(", ")[e]),Gn=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return Xn(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?Xn(e[1],t):0}},Zn=new Set(["x","y","z"]),Jn=P.filter(t=>!Zn.has(t));const _n={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Gn(4,13),y:Gn(5,14)},Qn=(t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(Hn);let s=[],i=!1;const a=[];if(o.forEach(o=>{const u=t.getValue(o);if(!t.hasValue(o))return;let l=n[o],c=Ft(l);const p=e[o];let h;if(S(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=Ft(l);for(let n=e;n<t;n++)h?Ft(p[n]):h=Ft(p[n])}else h=Ft(p);if(c!==h)if(Kn(c)&&Kn(h)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&h===v&&(e[o]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===l||0===p)?0===l?u.set(h.transform(l)):e[o]=c.transform(p):(i||(s=function(t){const e=[];return Jn.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Wn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:i}=s,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=_n[t](r,s)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Wn(r,a[n]),t[n]=_n[n](u,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),T&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}};function tr(t,e,n,r){return(t=>Object.keys(t).some(Hn))(e)?Qn(t,e,n,r):{target:e,transitionEnd:r}}const er=(t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Ln(e))return;const n=$n(e,r);n&&t.set(n)});for(const t in e){const o=e[t];if(!Ln(o))continue;const s=$n(o,r);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return tr(t,e=o.target,n,r=o.transitionEnd)},nr={current:null},rr={current:!1};const or=Object.keys(F),sr=or.length,ir=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const ar=["initial",...en],ur=ar.length;class lr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>tt.render(this.render,!1,!0);const{latestValues:s,renderState:i}=r;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=k(e),this.isVariantNode=I(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==s[t]&&A(e)&&(e.set(s[t],!1),Rt(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),rr.current||function(){if(rr.current=!0,T)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>nr.current=t.matches;t.addListener(e),e()}else nr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||nr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),et.update(this.notifyUpdate),et.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=C.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,s,i){const a=[];for(let e=0;e<sr;e++){const n=or[e],{isEnabled:r,Component:s}=F[n];r(t)&&s&&a.push(o(s,{key:n,...t,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&O(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<ir.length;e++){const n=ir[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const s=e[o],i=n[o];if(A(s))t.addValue(o,s),Rt(r)&&r.add(o);else if(A(i))t.addValue(o,ut(s,{owner:t})),Rt(r)&&r.remove(o);else if(i!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,ut(void 0!==e?e:s))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<ur;t++){const e=ar[t],n=this.props[e];(E(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ut(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=V(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||A(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new st),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let s=function(t,e,n){var r;const o={};for(const s in t){const t=Nt(s,e);o[s]=void 0!==t?t:null===(r=n.getValue(s))||void 0===r?void 0:r.get()}return o}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),s&&(s=r(s))),o){!function(t,e,n){var r,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),i=s.length;if(i)for(let a=0;a<i;a++){const i=s[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(o=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==o?o:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||W(l))?l=parseFloat(l):!It(l)&&Vt.test(u)&&(l=Et(i,u)),t.addValue(i,ut(l,{owner:t})),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,s);const t=er(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class cr extends lr{readValueFromInstance(t,e){if(C.has(e)){const t=St(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(D(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){N(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){B(t,e,n,r)}}class pr extends lr{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return C.has(e)?(null===(n=St(e))||void 0===n?void 0:n.default)||0:(e=j.has(e)?e:M(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){z(t,e,n,r)}mount(t){this.isSVGTag=$(t.tagName),super.mount(t)}}const hr={renderer:(t,e)=>q(t)?new pr(e,{enableHardwareAcceleration:!1}):new cr(e,{enableHardwareAcceleration:!0}),...cn,...Un};export{hr as domAnimation};
1
+ import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as s}from"react";import{P as o,q as i,t as a,u,v as l,w as c,x as p,y as h,z as d,A as f,B as m,C as v,D as g,E as y,F as w,r as V,G as b,d as A,H as C,I as M,n as x,J as S,c as E,i as T,K as P,f as k,b as F,m as I,a as O,L as D,g as N,p as R,M as B,N as j,s as U,h as L,o as z,j as $,k as q}from"./size-rollup-dom-animation-assets.js";function H(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const W=t=>/^0[^.\s]+$/.test(t),K={delta:0,timestamp:0},Y="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),X="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Y()),1/60*1e3);let G=!0,Z=!1,J=!1;const _=["read","update","preRender","render","postRender"],Q=_.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,s=!1,o=!1;const i=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const u=a&&s,l=u?e:n;return o&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&s&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(s)o=!0;else{if(s=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}s=!1,o&&(o=!1,a.process(u))}}};return a}(()=>Z=!0),t),{}),tt=_.reduce((t,e)=>{const n=Q[e];return t[e]=(t,e=!1,r=!1)=>(Z||st(),n.schedule(t,e,r)),t},{}),et=_.reduce((t,e)=>(t[e]=Q[e].cancel,t),{});_.reduce((t,e)=>(t[e]=()=>Q[e].process(K),t),{});const nt=t=>Q[t].process(K),rt=t=>{Z=!1,K.delta=G?1/60*1e3:Math.max(Math.min(t-K.timestamp,40),1),K.timestamp=t,J=!0,_.forEach(nt),J=!1,Z&&(G=!1,X(rt))},st=()=>{Z=!0,G=!0,J||X(rt)};class ot{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let s=0;s<r;s++){const r=this.subscriptions[s];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function it(t,e){return e?t*(1e3/e):0}class at{constructor(t,e={}){var n;this.version="7.10.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=K;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,tt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>tt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){return this.events[t]||(this.events[t]=new ot),this.events[t].add(e)}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?it(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.stopAnimation&&(this.stopAnimation(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.clearListeners(),this.stop()}}function ut(t,e){return new at(t,e)}const lt=(t,e)=>n=>Boolean(i(n)&&a.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),ct=(t,e,n)=>r=>{if(!i(r))return r;const[s,o,a,l]=r.match(u);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==l?parseFloat(l):1}},pt={...p,transform:t=>Math.round((t=>h(0,255,t))(t))},ht={test:lt("rgb","red"),parse:ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+l(c.transform(r))+")"};const dt={test:lt("#"),parse:function(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:ht.transform},ft={test:lt("hsl","hue"),parse:ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+d.transform(l(e))+", "+d.transform(l(n))+", "+l(c.transform(r))+")"},mt={test:t=>ht.test(t)||dt.test(t)||ft.test(t),parse:t=>ht.test(t)?ht.parse(t):ft.test(t)?ft.parse(t):dt.parse(t),transform:t=>i(t)?t:t.hasOwnProperty("red")?ht.transform(t):ft.transform(t)};function vt(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,r=0;const s=t.match(f);s&&(n=s.length,t=t.replace(f,"${c}"),e.push(...s.map(mt.parse)));const o=t.match(u);return o&&(r=o.length,t=t.replace(u,"${n}"),e.push(...o.map(p.parse))),{values:e,numColors:n,numNumbers:r,tokenised:t}}function gt(t){return vt(t).values}function yt(t){const{values:e,numColors:n,tokenised:r}=vt(t),s=e.length;return t=>{let e=r;for(let r=0;r<s;r++)e=e.replace(r<n?"${c}":"${n}",r<n?mt.transform(t[r]):l(t[r]));return e}}const wt=t=>"number"==typeof t?0:t;const Vt={test:function(t){var e,n;return isNaN(t)&&i(t)&&((null===(e=t.match(u))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(f))||void 0===n?void 0:n.length)||0)>0},parse:gt,createTransformer:yt,getAnimatableNone:function(t){const e=gt(t);return yt(t)(e.map(wt))}},bt=new Set(["brightness","contrast","saturate","opacity"]);function At(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(u)||[];if(!r)return t;const s=n.replace(r,"");let o=bt.has(e)?1:0;return r!==n&&(o*=100),e+"("+o+s+")"}const Ct=/([a-z-]*)\(.*?\)/g,Mt={...Vt,getAnimatableNone:t=>{const e=t.match(Ct);return e?e.map(At).join(" "):t}},xt={...m,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Mt,WebkitFilter:Mt},St=t=>xt[t];function Et(t,e){var n;let r=St(t);return r!==Mt&&(r=Vt),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Tt=t=>e=>e.test(t),Pt=[p,v,d,g,y,w,{test:t=>"auto"===t,parse:t=>t}],kt=t=>Pt.find(Tt(t)),Ft=[...Pt,mt,Vt],It=t=>Ft.find(Tt(t));function Ot(t,e,n){const r=t.getProps();return V(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Dt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ut(n))}function Nt(t,e){if(!e)return;return(e[t]||e.default||e).from}function Rt(t){return Boolean(A(t)&&t.add)}function Bt(t,e){const{MotionAppearAnimations:n}=window,r=((t,e)=>`${t}: ${e}`)(t,C.has(e)?"transform":e),s=n&&n.get(r);return s?(tt.render(()=>{try{s.cancel(),n.delete(r)}catch(t){}}),s.currentTime||0):0}const jt="data-"+M("framerAppearId");const Ut=t=>1e3*t,Lt=!1,zt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$t=t=>e=>1-t(1-e),qt=t=>t*t,Ht=$t(qt),Wt=zt(qt),Kt=(t,e,n)=>-n*t+n*e+t;function Yt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const Xt=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},Gt=[dt,ht,ft];function Zt(t){const e=(n=t,Gt.find(t=>t.test(n)));var n;let r=e.parse(t);return e===ft&&(r=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let s=0,o=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;s=Yt(a,r,t+1/3),o=Yt(a,r,t),i=Yt(a,r,t-1/3)}else s=o=i=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(r)),r}const Jt=(t,e)=>{const n=Zt(t),r=Zt(e),s={...n};return t=>(s.red=Xt(n.red,r.red,t),s.green=Xt(n.green,r.green,t),s.blue=Xt(n.blue,r.blue,t),s.alpha=Kt(n.alpha,r.alpha,t),ht.transform(s))},_t=(t,e)=>n=>e(t(n)),Qt=(...t)=>t.reduce(_t);function te(t,e){return"number"==typeof t?n=>Kt(t,e,n):mt.test(t)?Jt(t,e):re(t,e)}const ee=(t,e)=>{const n=[...t],r=n.length,s=t.map((t,n)=>te(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=s[e](t);return n}},ne=(t,e)=>{const n={...t,...e},r={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(r[s]=te(t[s],e[s]));return t=>{for(const e in r)n[e]=r[e](t);return n}},re=(t,e)=>{const n=Vt.createTransformer(e),r=vt(t),s=vt(e);return r.numColors===s.numColors&&r.numNumbers>=s.numNumbers?Qt(ee(r.values,s.values),n):n=>""+(n>0?e:t)},se=(t,e)=>n=>Kt(t,e,n);function oe(t,e,n){const r=[],s=n||("number"==typeof(o=t[0])?se:"string"==typeof o?mt.test(o)?Jt:re:Array.isArray(o)?ee:"object"==typeof o?ne:se);var o;const i=t.length-1;for(let n=0;n<i;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=Qt(t,o)}r.push(o)}return r}function ie(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const o=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const i=oe(e,r,s),a=i.length,u=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=((t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r})(t[n],t[n+1],e);return i[n](r)};return n?e=>u(h(t[0],t[o-1],e)):u}const ae=t=>t,ue=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function le(t,e,n,r){if(t===e&&n===r)return ae;const s=e=>function(t,e,n,r,s){let o,i,a=0;do{i=e+(n-e)/2,o=ue(i,r,s)-t,o>0?n=i:e=i}while(Math.abs(o)>1e-7&&++a<12);return i}(e,0,1,t,n);return t=>0===t||1===t?t:ue(s(t),e,r)}const ce=t=>1-Math.sin(Math.acos(t)),pe=$t(ce),he=zt(pe),de=le(.33,1.53,.69,.99),fe=$t(de),me=zt(fe),ve={linear:ae,easeIn:qt,easeInOut:Wt,easeOut:Ht,circIn:ce,circInOut:he,circOut:pe,backIn:fe,backInOut:me,backOut:de,anticipate:t=>(t*=2)<1?.5*fe(t):.5*(2-Math.pow(2,-10*(t-1)))},ge=t=>{if(Array.isArray(t)){t.length;const[e,n,r,s]=t;return le(e,n,r,s)}return"string"==typeof t?ve[t]:t};function ye({keyframes:t,ease:e=Wt,times:n,duration:r=300}){t=[...t];const s=ye[0],o=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(ge):ge(e),i={done:!1,value:s},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===ye.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),r);function u(){return ie(a,t,{ease:Array.isArray(o)?o:(e=t,n=o,e.map(()=>n||Wt).splice(0,e.length-1))});var e,n}let l=u();return{next:t=>(i.value=l(t),i.done=t>=r,i),flipTarget:()=>{t.reverse(),l=u()}}}function we({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let s,o,i=1-e;i=h(.05,1,i),t=h(.01,10,t/1e3),i<1?(s=e=>{const r=e*i,s=r*t;return.001-(r-n)/Ve(e,i)*Math.exp(-s)},o=e=>{const r=e*i*t,o=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=Ve(Math.pow(e,2),i);return(.001-s(e)>0?-1:1)*((o-a)*u)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function Ve(t,e){return t*Math.sqrt(1-e*e)}const be=["duration","bounce"],Ae=["stiffness","damping","mass"];function Ce(t,e){return e.some(e=>void 0!==t[e])}function Me({keyframes:t,restSpeed:e=2,restDelta:n=.01,...r}){let s=t[0],o=t[t.length-1];const i={done:!1,value:s},{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Ce(t,Ae)&&Ce(t,be)){const n=we(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r);let d=xe,f=c?-c/1e3:0;const m=u/(2*Math.sqrt(a*l));function v(){const t=o-s,e=Math.sqrt(a/l)/1e3;if(void 0===n&&(n=Math.min(Math.abs(o-s)/100,.4)),m<1){const n=Ve(e,m);d=r=>{const s=Math.exp(-m*e*r);return o-s*((f+m*e*t)/n*Math.sin(n*r)+t*Math.cos(n*r))}}else if(1===m)d=n=>o-Math.exp(-e*n)*(t+(f+e*t)*n);else{const n=e*Math.sqrt(m*m-1);d=r=>{const s=Math.exp(-m*e*r),i=Math.min(n*r,300);return o-s*((f+m*e*t)*Math.sinh(i)+n*t*Math.cosh(i))/n}}}return v(),{next:t=>{const r=d(t);if(h)i.done=t>=p;else{let s=f;if(0!==t)if(m<1){const e=Math.max(0,t-5);s=it(r-d(e),t-e)}else s=0;const a=Math.abs(s)<=e,u=Math.abs(o-r)<=n;i.done=a&&u}return i.value=i.done?o:r,i},flipTarget:()=>{f=-f,[s,o]=[o,s],v()}}}Me.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const xe=t=>0;const Se={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:r=350,restDelta:s=.5,modifyTarget:o}){const i=t[0],a={done:!1,value:i};let u=n*e;const l=i+u,c=void 0===o?l:o(l);return c!==l&&(u=c-i),{next:t=>{const e=-u*Math.exp(-t/r);return a.done=!(e>s||e<-s),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:ye,tween:ye,spring:Me};function Ee(t,e,n=0){return t-e-n}const Te=t=>{const e=({delta:e})=>t(e);return{start:()=>tt.update(e,!0),stop:()=>et.update(e)}};function Pe({duration:t,driver:e=Te,elapsed:n=0,repeat:r=0,repeatType:s="loop",repeatDelay:o=0,keyframes:i,autoplay:a=!0,onPlay:u,onStop:l,onComplete:c,onRepeat:p,onUpdate:h,type:d="keyframes",...f}){var m,v;let g,y,w,V=0,b=t,A=!1,C=!0;const M=Se[i.length>2?"keyframes":d],x=i[0],S=i[i.length-1];(null===(v=(m=M).needsInterpolation)||void 0===v?void 0:v.call(m,x,S))&&(w=ie([0,100],[x,S],{clamp:!1}),i=[0,100]);const E=M({...f,duration:t,keyframes:i});function T(){V++,"reverse"===s?(C=V%2==0,n=function(t,e=0,n=0,r=!0){return r?Ee(e+-t,e,n):e-(t-e)+n}(n,b,o,C)):(n=Ee(n,b,o),"mirror"===s&&E.flipTarget()),A=!1,p&&p()}function P(t){if(C||(t=-t),n+=t,!A){const t=E.next(Math.max(0,n));y=t.value,w&&(y=w(y)),A=C?t.done:n<=0}h&&h(y),A&&(0===V&&(b=void 0!==b?b:n),V<r?function(t,e,n,r){return r?t>=e+n:t<=-n}(n,b,o,C)&&T():(g.stop(),c&&c()))}return a&&(u&&u(),g=e(P),g.start()),{stop:()=>{l&&l(),g.stop()},sample:t=>E.next(Math.max(0,t))}}const ke=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Fe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ke([0,.65,.55,1]),circOut:ke([.55,0,1,.45]),backIn:ke([.31,.01,.66,-.59]),backOut:ke([.33,1.53,.69,.99])};function Ie(t){if(t)return Array.isArray(t)?ke(t):Fe[t]}function Oe(t,e,{onUpdate:n,onComplete:r,...s}){let{keyframes:o,duration:i=.3,elapsed:a=0,ease:u}=s;if("spring"===s.type||!(!(l=s.ease)||Array.isArray(l)||"string"==typeof l&&Fe[l])){const t=Pe(s);let e={done:!1,value:o[0]};const n=[];let r=0;for(;!e.done;)e=t.sample(r),n.push(e.value),r+=10;o=n,i=r-10,u="linear"}var l;const c=function(t,e,n,{delay:r=0,duration:s,repeat:o=0,repeatType:i="loop",ease:a,times:u}={}){return t.animate({[e]:n,offset:u},{delay:r,duration:s,easing:Ie(a),fill:"both",iterations:o+1,direction:"reverse"===i?"alternate":"normal"})}(t.owner.current,e,o,{...s,delay:-a,duration:i,ease:u});return c.onfinish=()=>{t.set(o[o.length-1]),r&&r()},()=>{const{currentTime:e}=c;if(e){const n=Pe(s);t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}tt.update(()=>c.cancel())}}function De({keyframes:t,elapsed:e,onUpdate:n,onComplete:r}){const s=()=>(n&&n(t[t.length-1]),r&&r(),()=>{});return e?function(t,e){const n=performance.now(),r=({timestamp:s})=>{const o=s-n;o>=e&&(et.read(r),t(o-e))};return tt.read(r,!0),()=>et.read(r)}(s,-e):s()}const Ne=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Re=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Be=()=>({type:"keyframes",ease:"linear",duration:.3}),je={type:"keyframes",duration:.8},Ue={x:Ne,y:Ne,z:Ne,rotate:Ne,rotateX:Ne,rotateY:Ne,rotateZ:Ne,scaleX:Re,scaleY:Re,scale:Re,opacity:Be,backgroundColor:Be,color:Be,default:Re},Le=(t,{keyframes:e})=>{if(e.length>2)return je;return(Ue[t]||Ue.default)(e[1])},ze=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Vt.test(e)||e.startsWith("url(")));function $e(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function qe(t){return"number"==typeof t?0:Et("",t)}const He={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},We={},Ke={};for(const t in He)Ke[t]=()=>(void 0===We[t]&&(We[t]=He[t]()),We[t]);const Ye=new Set(["opacity"]),Xe=(t,e,n,r={})=>s=>{const o=function(t,e){return t[e]||t.default||t}(r,t)||{},i=o.delay||r.delay||0;let{elapsed:a=0}=r;a-=Ut(i);const u=function(t,e,n,r){const s=ze(e,n);let o=void 0!==r.from?r.from:t.get();return"none"===o&&s&&"string"==typeof n?o=Et(e,n):$e(o)&&"string"==typeof n?o=qe(n):!Array.isArray(n)&&$e(n)&&"string"==typeof o&&(n=qe(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),l=u[0],c=u[u.length-1],p=ze(t,l),h=ze(t,c);let d={keyframes:u,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{s(),o.onComplete&&o.onComplete()}};if(!p||!h||Lt||!1===o.type)return De(d);if("inertia"===o.type){const t=function({keyframes:t,velocity:e=0,min:n,max:r,power:s=.8,timeConstant:o=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:h,onStop:d}){const f=t[0];let m;function v(t){return void 0!==n&&t<n||void 0!==r&&t>r}function g(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function y(t){null==m||m.stop(),m=Pe({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:d})}function w(t){y({type:"spring",stiffness:i,damping:a,restDelta:u,...t})}if(v(f))w({velocity:e,keyframes:[f,g(f)]});else{let t=s*e+f;void 0!==l&&(t=l(t));const r=g(t),i=r===n?-1:1;let a,c;const p=t=>{a=c,c=t,e=it(t-a,K.delta),(1===i&&t>r||-1===i&&t<r)&&w({keyframes:[t,r],velocity:e})};y({type:"decay",keyframes:[f,0],velocity:e,timeConstant:o,power:s,restDelta:u,modifyTarget:l,onUpdate:v(t)?p:void 0})}return{stop:()=>null==m?void 0:m.stop()}}(d);return()=>t.stop()}(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length})(o)||(d={...d,...Le(t,d)}),d.duration&&(d.duration=Ut(d.duration)),d.repeatDelay&&(d.repeatDelay=Ut(d.repeatDelay));const f=e.owner,m=f&&f.current;if(Ke.waapi()&&Ye.has(t)&&!d.repeatDelay&&"mirror"!==d.repeatType&&0!==d.damping&&f&&m instanceof HTMLElement&&!f.getProps().onUpdate)return Oe(e,t,d);{const t=Pe(d);return()=>t.stop()}};function Ge(t,e,n={}){var r;const s=Ot(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const i=s?()=>Ze(t,s,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:s=0,staggerChildren:i,staggerDirection:a}=o;return function(t,e,n=0,r=0,s=1,o){const i=[],a=(t.variantChildren.size-1)*r,u=1===s?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Je).forEach((t,r)=>{i.push(Ge(t,e,{...o,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,s+r,i,a,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function Ze(t,e,{delay:n=0,transitionOverride:r,type:s}={}){var o;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=s&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[s]);for(const e in u){const r=t.getValue(e),s=u[e];if(!r||void 0===s||p&&_e(p,e))continue;let o={delay:n,elapsed:0,...i};if(t.shouldReduceMotion&&C.has(e)&&(o={...o,type:!1,delay:0}),!r.hasAnimated){const n=t.getProps()[jt];n&&(o.elapsed=Bt(n,e))}let a=r.start(Xe(e,r,s,o));Rt(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=Ot(t,e);let{transitionEnd:r={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const e in o){Dt(t,e,b(o[e]))}}(t,a)})}function Je(t,e){return t.sortNodePosition(e)}function _e({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var Qe;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Qe||(Qe={}));const tn=[Qe.Animate,Qe.InView,Qe.Focus,Qe.Hover,Qe.Tap,Qe.Drag,Qe.Exit],en=[...tn].reverse(),nn=tn.length;function rn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Ge(t,e,n));r=Promise.all(s)}else if("string"==typeof e)r=Ge(t,e,n);else{const s="function"==typeof e?Ot(t,e,n.custom):e;r=Ze(t,s,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function sn(t){let e=rn(t);const n={[Qe.Animate]:an(!0),[Qe.InView]:an(),[Qe.Hover]:an(),[Qe.Tap]:an(),[Qe.Drag]:an(),[Qe.Focus]:an(),[Qe.Exit]:an()};let r=!0;const s=(e,n)=>{const r=Ot(t,n);if(r){const{transition:t,transitionEnd:n,...s}=r;e={...e,...s,...n}}return e};function o(o,i){const a=t.getProps(),u=t.getVariantContext(!0)||{},l=[],c=new Set;let p={},h=1/0;for(let e=0;e<nn;e++){const d=en[e],f=n[d],m=void 0!==a[d]?a[d]:u[d],v=E(m),g=d===i?f.isActive:null;!1===g&&(h=e);let y=m===u[d]&&m!==a[d]&&v;if(y&&r&&t.manuallyAnimateOnMount&&(y=!1),f.protectedKeys={...p},!f.isActive&&null===g||!m&&!f.prevProp||x(m)||"boolean"==typeof m)continue;const w=on(f.prevProp,m);let V=w||d===i&&f.isActive&&!y&&v||e>h&&v;const b=Array.isArray(m)?m:[m];let A=b.reduce(s,{});!1===g&&(A={});const{prevResolvedValues:C={}}=f,M={...C,...A},T=t=>{V=!0,c.delete(t),f.needsAnimating[t]=!0};for(const t in M){const e=A[t],n=C[t];p.hasOwnProperty(t)||(e!==n?S(e)&&S(n)?!H(e,n)||w?T(t):f.protectedKeys[t]=!0:void 0!==e?T(t):c.add(t):void 0!==e&&c.has(t)?T(t):f.protectedKeys[t]=!0)}f.prevProp=m,f.prevResolvedValues=A,f.isActive&&(p={...p,...A}),r&&t.blockInitialAnimation&&(V=!1),V&&!y&&l.push(...b.map(t=>({animation:t,options:{type:d,...o}})))}if(c.size){const e={};c.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),l.push({animation:e})}let d=Boolean(l.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),r=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,r,s){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=o(s,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function on(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!H(e,t)}function an(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const un=t=>e=>(t(e),null),ln={animation:un(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=sn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:un(r=>{const{custom:s,visualElement:i}=r,[a,u]=function(){const r=t(o);if(null===r)return[!0,null];const{isPresent:s,onExitComplete:i,register:a}=r,u=e();return n(()=>a(u),[]),!s&&i?[!1,()=>i&&i(u)]:[!0]}(),l=t(o);n(()=>{i.isPresent=a;const t=i.animationState&&i.animationState.setActive(Qe.Exit,!a,{custom:l&&l.custom||s});t&&!a&&t.then(u)},[a])})};function cn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function pn(t,e,r,s){n(()=>{const n=t.current;if(r&&n)return cn(n,e,r,s)},[t,e,r,s])}function hn(t){return!!t.touches}const dn={pageX:0,pageY:0};function fn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||dn;return{x:n[e+"X"],y:n[e+"Y"]}}function mn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const vn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:hn(t)?fn(t,e):mn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},gn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},yn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function wn(t){return T&&null===window.onpointerdown?t:T&&null===window.ontouchstart?yn[t]:T&&null===window.onmousedown?gn[t]:t}function Vn(t,e,n,r){return cn(t,wn(e),vn(n,"pointerdown"===e),r)}function bn(t,e,n,r){return pn(t,wn(e),n&&vn(n,"pointerdown"===e),r)}function An(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Cn=An("dragHorizontal"),Mn=An("dragVertical");function xn(){const t=function(t){let e=!1;if("y"===t)e=Mn();else if("x"===t)e=Cn();else{const t=Cn(),n=Mn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Sn(t,e,n){return(r,s)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!xn()&&(t.animationState&&t.animationState.setActive(Qe.Hover,e),n&&n(r,s))}}const En=(t,e)=>!!e&&(t===e||En(t,e.parentElement));const Tn=("undefined"==typeof process||process.env,"production"),Pn=new Set;const kn=new WeakMap,Fn=new WeakMap,In=t=>{const e=kn.get(t.target);e&&e(t)},On=t=>{t.forEach(In)};function Dn(t,e,n){const r=function({root:t,...e}){const n=t||document;Fn.has(n)||Fn.set(n,{});const r=Fn.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(On,{root:t,...e})),r[s]}(e);return kn.set(t,n),r.observe(t),()=>{kn.delete(t),r.unobserve(t)}}const Nn={some:0,all:1};function Rn(t,e,r,{root:s,margin:o,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==s?void 0:s.current,rootMargin:o,threshold:"number"==typeof i?i:Nn[i]};return Dn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(Qe.InView,n);const s=r.getProps(),o=n?s.onViewportEnter:s.onViewportLeave;o&&o(t)})},[t,s,o,i])}function Bn(t,e,r,{fallback:s=!0}){n(()=>{var n,o;t&&s&&("production"!==Tn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Pn.has(n)||(console.warn(n),o&&console.warn(o),Pn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(Qe.InView,!0)}))},[t])}const jn={inView:un((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:s,viewport:o={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||s);o.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Bn:Rn)(a,i.current,t,o)})),tap:un((function({onTap:t,onTapStart:e,onTapCancel:s,whileTap:o,visualElement:i}){const a=t||e||s||o,u=r(!1),l=r(null),c={passive:!(e||t||s||m)};function p(){l.current&&l.current(),l.current=null}function h(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(Qe.Tap,!1),!xn()}function d(e,n){h()&&(En(i.current,e.target)?t&&t(e,n):s&&s(e,n))}function f(t,e){h()&&s&&s(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=Qt(Vn(window,"pointerup",d,c),Vn(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(Qe.Tap,!0),e&&e(t,n))}var v;bn(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:un((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;pn(e,"focus",t?()=>{n&&n.setActive(Qe.Focus,!0)}:void 0),pn(e,"blur",t?()=>{n&&n.setActive(Qe.Focus,!1)}:void 0)})),hover:un((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){bn(r,"pointerenter",t||n?Sn(r,!0,t):void 0,{passive:!t}),bn(r,"pointerleave",e||n?Sn(r,!1,e):void 0,{passive:!e})}))};function Un(t){return"string"==typeof t&&t.startsWith("var(--")}const Ln=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function zn(t,e,n=1){const[r,s]=function(t){const e=Ln.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const o=window.getComputedStyle(e).getPropertyValue(r);return o?o.trim():Un(s)?zn(s,e,n+1):s}const $n=new Set(["width","height","top","left","right","bottom","x","y"]),qn=t=>$n.has(t),Hn=(t,e)=>{t.set(e,!1),t.set(e)},Wn=t=>t===p||t===v;var Kn;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Kn||(Kn={}));const Yn=(t,e)=>parseFloat(t.split(", ")[e]),Xn=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/);if(s)return Yn(s[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?Yn(e[1],t):0}},Gn=new Set(["x","y","z"]),Zn=P.filter(t=>!Gn.has(t));const Jn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Xn(4,13),y:Xn(5,14)},_n=(t,e,n={},r={})=>{e={...e},r={...r};const s=Object.keys(e).filter(qn);let o=[],i=!1;const a=[];if(s.forEach(s=>{const u=t.getValue(s);if(!t.hasValue(s))return;let l=n[s],c=kt(l);const p=e[s];let h;if(S(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=kt(l);for(let n=e;n<t;n++)h?kt(p[n]):h=kt(p[n])}else h=kt(p);if(c!==h)if(Wn(c)&&Wn(h)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[s]=parseFloat(p):Array.isArray(p)&&h===v&&(e[s]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===l||0===p)?0===l?u.set(h.transform(l)):e[s]=c.transform(p):(i||(o=function(t){const e=[];return Zn.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(s),r[s]=void 0!==r[s]?r[s]:e[s],Hn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,s=((t,e,n)=>{const r=e.measureViewportBox(),s=e.current,o=getComputedStyle(s),{display:i}=o,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=Jn[t](r,o)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Hn(r,a[n]),t[n]=Jn[n](u,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),T&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:r}}return{target:e,transitionEnd:r}};function Qn(t,e,n,r){return(t=>Object.keys(t).some(qn))(e)?_n(t,e,n,r):{target:e,transitionEnd:r}}const tr=(t,e,n,r)=>{const s=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Un(e))return;const n=zn(e,r);n&&t.set(n)});for(const t in e){const s=e[t];if(!Un(s))continue;const o=zn(s,r);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,r);return Qn(t,e=s.target,n,r=s.transitionEnd)},er={current:null},nr={current:!1};const rr=Object.keys(k),sr=rr.length,or=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const ir=["initial",...tn],ar=ir.length;class ur extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>tt.render(this.render,!1,!0);const{latestValues:o,renderState:i}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=F(e),this.isVariantNode=I(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==o[t]&&A(e)&&(e.set(o[t],!1),Rt(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),nr.current||function(){if(nr.current=!0,T)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>er.current=t.matches;t.addListener(e),e()}else er.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||er.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),et.update(this.notifyUpdate),et.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=C.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,o,i){const a=[];for(let e=0;e<sr;e++){const n=rr[e],{isEnabled:r,Component:o}=k[n];r(t)&&o&&a.push(s(o,{key:n,...t,visualElement:this}))}if(!this.projection&&o){this.projection=new o(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:s,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(s)||a&&O(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<or.length;e++){const n=or[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const s in e){const o=e[s],i=n[s];if(A(o))t.addValue(s,o),Rt(r)&&r.add(s);else if(A(i))t.addValue(s,ut(o,{owner:t})),Rt(r)&&r.remove(s);else if(i!==o)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(s);t.addValue(s,ut(void 0!==e?e:o))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<ar;t++){const e=ir[t],n=this.props[e];(E(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===e||e(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ut(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=V(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||A(s)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ot),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},s){let o=function(t,e,n){var r;const s={};for(const o in t){const t=Nt(o,e);s[o]=void 0!==t?t:null===(r=n.getValue(o))||void 0===r?void 0:r.get()}return s}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),o&&(o=r(o))),s){!function(t,e,n){var r,s;const o=Object.keys(e).filter(e=>!t.hasValue(e)),i=o.length;if(i)for(let a=0;a<i;a++){const i=o[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(s=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==s?s:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||W(l))?l=parseFloat(l):!It(l)&&Vt.test(u)&&(l=Et(i,u)),t.addValue(i,ut(l,{owner:t})),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,o);const t=tr(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class lr extends ur{readValueFromInstance(t,e){if(C.has(e)){const t=St(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),s=(D(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){N(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){B(t,e,n,r)}}class cr extends ur{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return C.has(e)?(null===(n=St(e))||void 0===n?void 0:n.default)||0:(e=j.has(e)?e:M(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){z(t,e,n,r)}mount(t){this.isSVGTag=$(t.tagName),super.mount(t)}}const pr={renderer:(t,e)=>q(t)?new cr(e,{enableHardwareAcceleration:!1}):new lr(e,{enableHardwareAcceleration:!0}),...ln,...jn};export{pr as domAnimation};
@@ -1 +1 @@
1
- import{createContext as t,useRef as e}from"react";const a=t({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),r=t(null),n="undefined"!=typeof document;function s(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function o(t){return"string"==typeof t||Array.isArray(t)}function i(t){return"object"==typeof t&&"function"==typeof t.start}const f=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function c(t){return i(t.animate)||f.some(e=>o(t[e]))}function l(t){return Boolean(c(t)||t.variants)}const d=t=>({isEnabled:e=>t.some(t=>!!e[t])}),u={measureLayout:d(["layout","layoutId","drag"]),animation:d(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:d(["exit"]),drag:d(["drag","dragControls"]),focus:d(["whileFocus"]),hover:d(["whileHover","onHoverStart","onHoverEnd"]),tap:d(["whileTap","onTap","onTapStart","onTapCancel"]),pan:d(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:d(["whileInView","onViewportEnter","onViewportLeave"])};function p(t){const a=e(null);return null===a.current&&(a.current=t()),a.current}const m={hasAnimatedSinceResize:!0,hasEverUpdated:!1},g=t({}),h=t({}),y=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function v(t){return"string"==typeof t&&!t.includes("-")&&!!(y.indexOf(t)>-1||/[A-Z]/.test(t))}const w={};function x(t){Object.assign(w,t)}const b=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],k=new Set(b);function O(t,{layout:e,layoutId:a}){return k.has(t)||t.startsWith("origin")||(e||void 0!==a)&&(!!w[t]||"opacity"===t)}const L=t=>!!(null==t?void 0:t.getVelocity),T={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},S=(t,e)=>b.indexOf(t)-b.indexOf(e);function X(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,$=(t,e,a)=>Math.min(Math.max(a,t),e),P={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},A={...P,transform:t=>$(0,1,t)},B={...P,default:1},R=t=>Math.round(1e5*t)/1e5,V=/(-)?([\d]*\.?[\d])+/g,W=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Z=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function j(t){return"string"==typeof t}const z=t=>({test:e=>j(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),C=z("deg"),H=z("%"),E=z("px"),F=z("vh"),I=z("vw"),M={...H,parse:t=>H.parse(t)/100,transform:t=>H.transform(100*t)},D={...P,transform:Math.round},U={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,radius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,size:E,top:E,right:E,bottom:E,left:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,rotate:C,rotateX:C,rotateY:C,rotateZ:C,scale:B,scaleX:B,scaleY:B,scaleZ:B,skew:C,skewX:C,skewY:C,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:A,originX:M,originY:M,originZ:E,zIndex:D,fillOpacity:A,strokeOpacity:A,numOctaves:D};function K(t,e,a,r){const{style:n,vars:s,transform:o,transformKeys:i,transformOrigin:f}=t;i.length=0;let c=!1,l=!1,d=!0;for(const t in e){const a=e[t];if(X(t)){s[t]=a;continue}const r=U[t],u=Y(a,r);if(k.has(t)){if(c=!0,o[t]=u,i.push(t),!d)continue;a!==(r.default||0)&&(d=!1)}else t.startsWith("origin")?(l=!0,f[t]=u):n[t]=u}if(e.transform||(c||r?n.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:a=!0,allowTransformNone:r=!0},n,s){let o="";e.sort(S);for(const a of e)o+=`${T[a]||a}(${t[a]}) `;return a&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,n?"":o):r&&n&&(o="none"),o}(t,a,d,r):n.transform&&(n.transform="none")),l){const{originX:t="50%",originY:e="50%",originZ:a=0}=f;n.transformOrigin=`${t} ${e} ${a}`}}function q(t,e,a){return"string"==typeof t?t:E.transform(e+a*t)}const N={offset:"stroke-dashoffset",array:"stroke-dasharray"},G={offset:"strokeDashoffset",array:"strokeDasharray"};function J(t,{attrX:e,attrY:a,originX:r,originY:n,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...f},c,l,d){if(K(t,f,c,d),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:p,dimensions:m}=t;u.transform&&(m&&(p.transform=u.transform),delete u.transform),m&&(void 0!==r||void 0!==n||p.transform)&&(p.transformOrigin=function(t,e,a){return`${q(e,t.x,t.width)} ${q(a,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==n?n:.5)),void 0!==e&&(u.x=e),void 0!==a&&(u.y=a),void 0!==s&&function(t,e,a=1,r=0,n=!0){t.pathLength=1;const s=n?N:G;t[s.offset]=E.transform(-r);const o=E.transform(e),i=E.transform(a);t[s.array]=`${o} ${i}`}(u,s,o,i,!1)}const Q=t=>"string"==typeof t&&"svg"===t.toLowerCase(),_=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function tt(t,{style:e,vars:a},r,n){Object.assign(t.style,e,n&&n.getProjectionStyles(r));for(const e in a)t.style.setProperty(e,a[e])}const et=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function at(t,e,a,r){tt(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(et.has(a)?a:_(a),e.attrs[a])}function rt(t){const{style:e}=t,a={};for(const r in e)(L(e[r])||O(r,t))&&(a[r]=e[r]);return a}function nt(t){const e=rt(t);for(const a in t)if(L(t[a])){e["x"===a||"y"===a?"attr"+a.toUpperCase():a]=t[a]}return e}function st(t,e,a,r={},n={}){return"function"==typeof e&&(e=e(void 0!==a?a:t.custom,r,n)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==a?a:t.custom,r,n)),e}const ot=t=>Array.isArray(t),it=t=>ot(t)?t[t.length-1]||0:t;function ft(t){const e=L(t)?t.get():t;return a=e,Boolean(a&&"object"==typeof a&&a.mix&&a.toValue)?e.toValue():e;var a}export{P as A,H as B,W as C,_ as D,U as E,E as F,x as G,w as H,C as I,I as J,F as K,g as L,a as M,it as N,b as O,r as P,ot as Q,k as R,h as S,X as T,tt as U,et as V,s as a,c as b,o as c,L as d,O as e,u as f,m as g,K as h,n as i,J as j,Q as k,v as l,l as m,i as n,st as o,at as p,rt as q,ft as r,nt as s,$ as t,p as u,j as v,Z as w,V as x,R as y,A as z};
1
+ import{createContext as t,useRef as e}from"react";const a=t({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),r=t(null),n="undefined"!=typeof document;function s(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function o(t){return"string"==typeof t||Array.isArray(t)}function i(t){return"object"==typeof t&&"function"==typeof t.start}const f=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function c(t){return i(t.animate)||f.some(e=>o(t[e]))}function l(t){return Boolean(c(t)||t.variants)}const d=t=>({isEnabled:e=>t.some(t=>!!e[t])}),u={measureLayout:d(["layout","layoutId","drag"]),animation:d(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:d(["exit"]),drag:d(["drag","dragControls"]),focus:d(["whileFocus"]),hover:d(["whileHover","onHoverStart","onHoverEnd"]),tap:d(["whileTap","onTap","onTapStart","onTapCancel"]),pan:d(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:d(["whileInView","onViewportEnter","onViewportLeave"])};function p(t){const a=e(null);return null===a.current&&(a.current=t()),a.current}const m={hasAnimatedSinceResize:!0,hasEverUpdated:!1},g=t({}),h=t({}),y=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function v(t){return"string"==typeof t&&!t.includes("-")&&!!(y.indexOf(t)>-1||/[A-Z]/.test(t))}const w={};function x(t){Object.assign(w,t)}const b=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],k=new Set(b);function O(t,{layout:e,layoutId:a}){return k.has(t)||t.startsWith("origin")||(e||void 0!==a)&&(!!w[t]||"opacity"===t)}const L=t=>!!(null==t?void 0:t.getVelocity),T={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},S=(t,e)=>b.indexOf(t)-b.indexOf(e);function X(t){return t.startsWith("--")}const Y=(t,e)=>e&&"number"==typeof t?e.transform(t):t,$=(t,e,a)=>Math.min(Math.max(a,t),e),P={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},A={...P,transform:t=>$(0,1,t)},B={...P,default:1},R=t=>Math.round(1e5*t)/1e5,V=/(-)?([\d]*\.?[\d])+/g,W=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Z=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function j(t){return"string"==typeof t}const z=t=>({test:e=>j(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),C=z("deg"),H=z("%"),E=z("px"),F=z("vh"),I=z("vw"),M={...H,parse:t=>H.parse(t)/100,transform:t=>H.transform(100*t)},D={...P,transform:Math.round},U={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,radius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,size:E,top:E,right:E,bottom:E,left:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,rotate:C,rotateX:C,rotateY:C,rotateZ:C,scale:B,scaleX:B,scaleY:B,scaleZ:B,skew:C,skewX:C,skewY:C,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:A,originX:M,originY:M,originZ:E,zIndex:D,fillOpacity:A,strokeOpacity:A,numOctaves:D};function K(t,e,a,r){const{style:n,vars:s,transform:o,transformKeys:i,transformOrigin:f}=t;i.length=0;let c=!1,l=!1,d=!0;for(const t in e){const a=e[t];if(X(t)){s[t]=a;continue}const r=U[t],u=Y(a,r);if(k.has(t)){if(c=!0,o[t]=u,i.push(t),!d)continue;a!==(r.default||0)&&(d=!1)}else t.startsWith("origin")?(l=!0,f[t]=u):n[t]=u}if(e.transform||(c||r?n.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:a=!0,allowTransformNone:r=!0},n,s){let o="";e.sort(S);for(const a of e)o+=`${T[a]||a}(${t[a]}) `;return a&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,n?"":o):r&&n&&(o="none"),o}(t,a,d,r):n.transform&&(n.transform="none")),l){const{originX:t="50%",originY:e="50%",originZ:a=0}=f;n.transformOrigin=`${t} ${e} ${a}`}}function q(t,e,a){return"string"==typeof t?t:E.transform(e+a*t)}const N={offset:"stroke-dashoffset",array:"stroke-dasharray"},G={offset:"strokeDashoffset",array:"strokeDasharray"};function J(t,{attrX:e,attrY:a,originX:r,originY:n,pathLength:s,pathSpacing:o=1,pathOffset:i=0,...f},c,l,d){if(K(t,f,c,d),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:p,dimensions:m}=t;u.transform&&(m&&(p.transform=u.transform),delete u.transform),m&&(void 0!==r||void 0!==n||p.transform)&&(p.transformOrigin=function(t,e,a){return`${q(e,t.x,t.width)} ${q(a,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==n?n:.5)),void 0!==e&&(u.x=e),void 0!==a&&(u.y=a),void 0!==s&&function(t,e,a=1,r=0,n=!0){t.pathLength=1;const s=n?N:G;t[s.offset]=E.transform(-r);const o=E.transform(e),i=E.transform(a);t[s.array]=`${o} ${i}`}(u,s,o,i,!1)}const Q=t=>"string"==typeof t&&"svg"===t.toLowerCase(),_=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function tt(t,{style:e,vars:a},r,n){Object.assign(t.style,e,n&&n.getProjectionStyles(r));for(const e in a)t.style.setProperty(e,a[e])}const et=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function at(t,e,a,r){tt(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(et.has(a)?a:_(a),e.attrs[a])}function rt(t){const{style:e}=t,a={};for(const r in e)(L(e[r])||O(r,t))&&(a[r]=e[r]);return a}function nt(t){const e=rt(t);for(const a in t)if(L(t[a])){e["x"===a||"y"===a?"attr"+a.toUpperCase():a]=t[a]}return e}function st(t,e,a,r={},n={}){return"function"==typeof e&&(e=e(void 0!==a?a:t.custom,r,n)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==a?a:t.custom,r,n)),e}const ot=t=>Array.isArray(t),it=t=>ot(t)?t[t.length-1]||0:t;function ft(t){const e=L(t)?t.get():t;return a=e,Boolean(a&&"object"==typeof a&&a.mix&&a.toValue)?e.toValue():e;var a}export{P as A,H as B,W as C,U as D,E,x as F,w as G,C as H,I,F as J,it as K,g as L,a as M,b as N,ot as O,r as P,k as Q,_ as R,h as S,X as T,tt as U,et as V,s as a,c as b,o as c,L as d,O as e,u as f,m as g,K as h,n as i,J as j,Q as k,v as l,l as m,i as n,st as o,at as p,rt as q,ft as r,nt as s,$ as t,p as u,j as v,Z as w,V as x,R as y,A as z};