UNPKG

reacto-loader

Version:

A sleek, high-performance Loader component designed for seamless integration into both React and React Native/Expo applications.

1 lines 121 kB
"use strict";var t=require("react/jsx-runtime"),e=require("react");const n=e.createContext({});const i="undefined"!=typeof window,s=i?e.useLayoutEffect:e.useEffect,o=e.createContext(null);function r(t,e){-1===t.indexOf(e)&&t.push(e)}function a(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const l=(t,e,n)=>n>e?e:n<t?t:n;let c=()=>{},u=()=>{};"production"!==process.env.NODE_ENV&&(c=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},u=(t,e)=>{if(!t)throw new Error(e)});const h={},d=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function p(t){return"object"==typeof t&&null!==t}const m=t=>/^0[^.\s]+$/u.test(t);function f(t){let e;return()=>(void 0===e&&(e=t()),e)}const y=t=>t,g=(t,e)=>n=>e(t(n)),v=(...t)=>t.reduce(g),x=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class T{constructor(){this.subscriptions=[]}add(t){return r(this.subscriptions,t),()=>a(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const w=t=>1e3*t,b=t=>t/1e3;function S(t,e){return e?t*(1e3/e):0}const P=new Set;function A(t,e,n){t||P.has(e)||(console.warn(e),P.add(e))}const E=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function M(t,e,n,i){if(t===e&&n===i)return y;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=E(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:E(s(t),e,i)}const C=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,V=t=>e=>1-t(1-e),D=M(.33,1.53,.69,.99),k=V(D),R=C(k),j=t=>(t*=2)<1?.5*k(t):.5*(2-Math.pow(2,-10*(t-1))),L=t=>1-Math.sin(Math.acos(t)),I=V(L),F=C(L),B=M(.42,0,1,1),O=M(0,0,.58,1),N=M(.42,0,.58,1),U=t=>Array.isArray(t)&&"number"==typeof t[0],$={linear:y,easeIn:B,easeInOut:N,easeOut:O,circIn:L,circInOut:F,circOut:I,backIn:k,backInOut:R,backOut:D,anticipate:j},W=t=>{if(U(t)){u(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return M(e,n,i,s)}return"string"==typeof t?(u(void 0!==$[t],`Invalid easing type '${t}'`),$[t]):t},Y=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],z={value:null};function X(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Y.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&z.value&&z.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t)),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:p,render:m,postRender:f}=r,y=()=>{const o=h.useManualTiming?s.timestamp:performance.now();n=!1,h.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))};return{schedule:Y.reduce(((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(y)),a.schedule(e,o,r)),e}),{}),cancel:t=>{for(let e=0;e<Y.length;e++)r[Y[e]].cancel(t)},state:s,steps:r}}const{schedule:K,cancel:H,state:_,steps:q}=X("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:y,!0);let G;function Z(){G=void 0}const J={now:()=>(void 0===G&&J.set(_.isProcessing||h.useManualTiming?_.timestamp:performance.now()),G),set:t=>{G=t,queueMicrotask(Z)}},Q=t=>e=>"string"==typeof e&&e.startsWith(t),tt=Q("--"),et=Q("var(--"),nt=t=>!!et(t)&&it.test(t.split("/*")[0].trim()),it=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,st={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ot={...st,transform:t=>l(0,1,t)},rt={...st,default:1},at=t=>Math.round(1e5*t)/1e5,lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ct=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ut=(t,e)=>n=>Boolean("string"==typeof n&&ct.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ht=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(lt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},dt={...st,transform:t=>Math.round((t=>l(0,255,t))(t))},pt={test:ut("rgb","red"),parse:ht("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+dt.transform(t)+", "+dt.transform(e)+", "+dt.transform(n)+", "+at(ot.transform(i))+")"};const mt={test:ut("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:pt.transform},ft=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),yt=ft("deg"),gt=ft("%"),vt=ft("px"),xt=ft("vh"),Tt=ft("vw"),wt=(()=>({...gt,parse:t=>gt.parse(t)/100,transform:t=>gt.transform(100*t)}))(),bt={test:ut("hsl","hue"),parse:ht("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+gt.transform(at(e))+", "+gt.transform(at(n))+", "+at(ot.transform(i))+")"},St={test:t=>pt.test(t)||mt.test(t)||bt.test(t),parse:t=>pt.test(t)?pt.parse(t):bt.test(t)?bt.parse(t):mt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?pt.transform(t):bt.transform(t)},Pt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const At="number",Et="color",Mt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ct(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Mt,(t=>(St.test(t)?(i.color.push(o),s.push(Et),n.push(St.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(At),n.push(parseFloat(t))),++o,"${}"))).split("${}");return{values:n,split:r,indexes:i,types:s}}function Vt(t){return Ct(t).values}function Dt(t){const{split:e,types:n}=Ct(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===At?at(t[o]):e===Et?St.transform(t[o]):t[o]}return s}}const kt=t=>"number"==typeof t?0:t;const Rt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(lt)?.length||0)+(t.match(Pt)?.length||0)>0},parse:Vt,createTransformer:Dt,getAnimatableNone:function(t){const e=Vt(t);return Dt(t)(e.map(kt))}};function jt(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}function Lt(t,e){return n=>n>0?e:t}const It=(t,e,n)=>t+(e-t)*n,Ft=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Bt=[mt,pt,bt];function Ot(t){const e=(n=t,Bt.find((t=>t.test(n))));var n;if(c(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===bt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=jt(a,i,t+1/3),o=jt(a,i,t),r=jt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Nt=(t,e)=>{const n=Ot(t),i=Ot(e);if(!n||!i)return Lt(t,e);const s={...n};return t=>(s.red=Ft(n.red,i.red,t),s.green=Ft(n.green,i.green,t),s.blue=Ft(n.blue,i.blue,t),s.alpha=It(n.alpha,i.alpha,t),pt.transform(s))},Ut=new Set(["none","hidden"]);function $t(t,e){return n=>It(t,e,n)}function Wt(t){return"number"==typeof t?$t:"string"==typeof t?nt(t)?Lt:St.test(t)?Nt:Xt:Array.isArray(t)?Yt:"object"==typeof t?St.test(t)?Nt:zt:Lt}function Yt(t,e){const n=[...t],i=n.length,s=t.map(((t,n)=>Wt(t)(t,e[n])));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function zt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Wt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Xt=(t,e)=>{const n=Rt.createTransformer(e),i=Ct(t),s=Ct(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ut.has(t)&&!s.values.length||Ut.has(e)&&!i.values.length?function(t,e){return Ut.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):v(Yt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):(c(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Lt(t,e))};function Kt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return It(t,e,n);return Wt(t)(t,e)}const Ht=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>H(e),now:()=>_.isProcessing?_.timestamp:J.now()}},_t=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=t(e/(s-1))+", ";return`linear(${i.substring(0,i.length-2)})`},qt=2e4;function Gt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}function Zt(t,e,n){const i=Math.max(e-5,0);return S(n-t(i),e-i)}const Jt=100,Qt=10,te=1,ee=0,ne=800,ie=.3,se=.3,oe={granular:.01,default:2},re={granular:.005,default:.5},ae=.01,le=10,ce=.05,ue=1;function he({duration:t=ne,bounce:e=ie,velocity:n=ee,mass:i=te}){let s,o;c(t<=w(le),"Spring duration must be 10 seconds or less");let r=1-e;r=l(ce,ue,r),t=l(ae,le,b(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/pe(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=pe(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/c}):(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 i=n;for(let n=1;n<de;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=w(t),isNaN(a))return{stiffness:Jt,damping:Qt,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const de=12;function pe(t,e){return t*Math.sqrt(1-e*e)}const me=["duration","bounce"],fe=["stiffness","damping","mass"];function ye(t,e){return e.some((e=>void 0!==t[e]))}function ge(t=se,e=ie){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ee,stiffness:Jt,damping:Qt,mass:te,isResolvedFromDuration:!1,...t};if(!ye(t,fe)&&ye(t,me))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*l(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:te,stiffness:s,damping:o}}else{const n=he(t);e={...e,...n,mass:te},e.isResolvedFromDuration=!0}return e}({...n,velocity:-b(n.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=r-o,v=b(Math.sqrt(c/h)),x=Math.abs(g)<5;let T;if(i||(i=x?oe.granular:oe.default),s||(s=x?re.granular:re.default),y<1){const t=pe(v,y);T=e=>{const n=Math.exp(-y*v*e);return r-n*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>r-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return r-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const S={calculatedDuration:m&&d||null,next:t=>{const e=T(t);if(m)a.done=t>=d;else{let n=0===t?f:0;y<1&&(n=0===t?w(f):Zt(T,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Gt(S),qt),e=_t((e=>S.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return S}function ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,w=ge({keyframes:[d.value,p(d.value)],velocity:Zt(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function xe(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(u(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||h.mix||Kt,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||y:e;o=v(t,o)}i.push(o)}return i}(e,i,s),c=a.length,d=n=>{if(r&&n<t[0])return e[0];let i=0;if(c>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=x(t[i],t[i+1],n);return a[i](s)};return n?e=>d(l(t[0],t[o-1],e)):d}function Te(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=x(0,e,i);t.push(It(n,1,s))}}(e,t.length-1),e}function we({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(W):W(i),o={done:!1,value:e[0]},r=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:Te(e),t),a=xe(r,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map((()=>c||N)).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}ge.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Gt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:b(s)}}(t,100,ge);return t.ease=e.ease,t.duration=w(e.duration),t.type="keyframes",t};const be=t=>null!==t;function Se(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(be),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Pe={decay:ve,inertia:ve,tween:we,keyframes:we,spring:ge};function Ae(t){"string"==typeof t.type&&(t.type=Pe[t.type])}class Ee{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Me=t=>t/100;class Ce extends Ee{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==J.now()&&this.tick(J.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Ae(t);const{type:e=we,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||we;"production"!==process.env.NODE_ENV&&a!==we&&u(r.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`),a!==we&&"number"!=typeof r[0]&&(this.mixKeyframes=v(Me,Kt(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Gt(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,T=n;if(h){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/r)):"mirror"===d&&(T=o)),x=l(0,1,n)*r}const w=v?{done:!1,value:u[0]}:T.next(x);s&&(w.value=s(w.value));let{done:b}=w;v||null===a||(b=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==ve&&(w.value=Se(u,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return b(this.calculatedDuration)}get time(){return b(this.currentTime)}set time(t){t=w(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(J.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=b(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ht,startTime:e}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(J.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ve=t=>180*t/Math.PI,De=t=>{const e=Ve(Math.atan2(t[1],t[0]));return Re(e)},ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>Ve(Math.atan(t[1])),skewY:t=>Ve(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Re=t=>((t%=360)<0&&(t+=360),t),je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Le=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ie={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:je,scaleY:Le,scale:t=>(je(t)+Le(t))/2,rotateX:t=>Re(Ve(Math.atan2(t[6],t[5]))),rotateY:t=>Re(Ve(Math.atan2(-t[2],t[0]))),rotateZ:De,rotate:De,skewX:t=>Ve(Math.atan(t[4])),skewY:t=>Ve(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Fe(t){return t.includes("scale")?1:0}function Be(t,e){if(!t||"none"===t)return Fe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Ie,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=ke,s=e}if(!s)return Fe(e);const o=i[e],r=s[1].split(",").map(Oe);return"function"==typeof o?o(r):r[o]}function Oe(t){return parseFloat(t.trim())}const Ne=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=(()=>new Set(Ne))(),$e=t=>t===st||t===vt,We=new Set(["x","y","z"]),Ye=Ne.filter((t=>!We.has(t)));const ze={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:(t,{transform:e})=>Be(e,"x"),y:(t,{transform:e})=>Be(e,"y")};ze.translateX=ze.x,ze.translateY=ze.y;const Xe=new Set;let Ke=!1,He=!1,_e=!1;function qe(){if(He){const t=Array.from(Xe).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return Ye.forEach((n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}He=!1,Ke=!1,Xe.forEach((t=>t.complete(_e))),Xe.clear()}function Ge(){Xe.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(He=!0)}))}class Ze{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Xe.add(this),Ke||(Ke=!0,K.read(Ge),K.resolveKeyframes(qe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xe.delete(this)}cancel(){"scheduled"===this.state&&(Xe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Je=f((()=>void 0!==window.ScrollTimeline)),Qe={};function tn(t,e){const n=f(t);return()=>Qe[e]??n()}const en=tn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),nn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,sn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:nn([0,.65,.55,1]),circOut:nn([.55,0,1,.45]),backIn:nn([.31,.01,.66,-.59]),backOut:nn([.33,1.53,.69,.99])};function on(t,e){return t?"function"==typeof t?en()?_t(t,e):"ease-out":U(t)?nn(t):Array.isArray(t)?t.map((t=>on(t,e)||sn.easeOut)):sn[t]:void 0}function rn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=on(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function an(t){return"function"==typeof t&&"applyToOptions"in t}class ln extends Ee{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,u("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:t,...e}){return an(t)&&en()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=rn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Se(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return b(Number(t))}get time(){return b(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=w(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Je()?(this.animation.timeline=t,y):e(this)}}const cn={anticipate:j,backInOut:R,circInOut:F};function un(t){"string"==typeof t.ease&&t.ease in cn&&(t.ease=cn[t.ease])}class hn extends ln{constructor(t){un(t),Ae(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ce({...o,autoplay:!1}),a=w(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const dn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Rt.test(t)&&"0"!==t||t.startsWith("url(")));function pn(t){return p(t)&&"offsetHeight"in t}const mn=new Set(["opacity","clipPath","filter","transform"]),fn=f((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class yn extends Ee{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=J.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Ze;this.keyframeResolver=new d(r,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:u}=n;this.resolvedAt=J.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=dn(s,e),a=dn(o,e);return c(r===a,`You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||an(n))&&i)}(t,s,o,r)||(!h.instantAnimations&&a||u?.(Se(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const d={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},p=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!pn(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return fn()&&n&&mn.has(n)&&("transform"!==n||!l)&&!a&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(d)?new hn({...d,element:d.motionValue.owner.current}):new Ce(d);p.finished.then((()=>this.notifyFinished())).catch(y),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),_e=!0,Ge(),qe(),_e=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const gn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vn(t,e,n=1){u(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=gn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return d(t)?parseFloat(t):t}return nt(s)?vn(s,e,n+1):s}function xn(t,e){return t?.[e]??t?.default??t}const Tn=new Set(["width","height","top","left","right","bottom",...Ne]),wn=t=>e=>e.test(t),bn=[st,vt,gt,yt,Tt,xt,{test:t=>"auto"===t,parse:t=>t}],Sn=t=>bn.find(wn(t));const Pn=new Set(["brightness","contrast","saturate","opacity"]);function An(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(lt)||[];if(!i)return t;const s=n.replace(i,"");let o=Pn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const En=/\b([a-z-]*)\(.*?\)/gu,Mn={...Rt,getAnimatableNone:t=>{const e=t.match(En);return e?e.map(An).join(" "):t}},Cn={...st,transform:Math.round},Vn={borderWidth:vt,borderTopWidth:vt,borderRightWidth:vt,borderBottomWidth:vt,borderLeftWidth:vt,borderRadius:vt,radius:vt,borderTopLeftRadius:vt,borderTopRightRadius:vt,borderBottomRightRadius:vt,borderBottomLeftRadius:vt,width:vt,maxWidth:vt,height:vt,maxHeight:vt,top:vt,right:vt,bottom:vt,left:vt,padding:vt,paddingTop:vt,paddingRight:vt,paddingBottom:vt,paddingLeft:vt,margin:vt,marginTop:vt,marginRight:vt,marginBottom:vt,marginLeft:vt,backgroundPositionX:vt,backgroundPositionY:vt,...{rotate:yt,rotateX:yt,rotateY:yt,rotateZ:yt,scale:rt,scaleX:rt,scaleY:rt,scaleZ:rt,skew:yt,skewX:yt,skewY:yt,distance:vt,translateX:vt,translateY:vt,translateZ:vt,x:vt,y:vt,z:vt,perspective:vt,transformPerspective:vt,opacity:ot,originX:wt,originY:wt,originZ:vt},zIndex:Cn,fillOpacity:ot,strokeOpacity:ot,numOctaves:Cn},Dn={...Vn,color:St,backgroundColor:St,outlineColor:St,fill:St,stroke:St,borderColor:St,borderTopColor:St,borderRightColor:St,borderBottomColor:St,borderLeftColor:St,filter:Mn,WebkitFilter:Mn},kn=t=>Dn[t];function Rn(t,e){let n=kn(t);return n!==Mn&&(n=Rt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const jn=new Set(["auto","none","0"]);class Ln extends Ze{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),nt(i))){const s=vn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Tn.has(n)||2!==t.length)return;const[i,s]=t,o=Sn(i),r=Sn(s);if(o!==r)if($e(o)&&$e(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else ze[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||m(i)))&&n.push(e);var i;n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!jn.has(e)&&Ct(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Rn(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ze[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=ze[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const In=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=J.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=J.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&A(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new T);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}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=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=J.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return S(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bn(t,e){return new Fn(t,e)}const{schedule:On}=X(queueMicrotask,!1),Nn={x:!1,y:!1};function Un(){return Nn.x||Nn.y}function $n(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Wn(t){return!("touch"===t.pointerType||Un())}const Yn=(t,e)=>!!e&&(t===e||Yn(t,e.parentElement)),zn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Xn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Kn=new WeakSet;function Hn(t){return e=>{"Enter"===e.key&&t(e)}}function _n(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function qn(t){return zn(t)&&!Un()}function Gn(t,e,n={}){const[i,s,o]=$n(t,n),r=t=>{const i=t.currentTarget;if(!qn(t))return;Kn.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Kn.has(i)&&Kn.delete(i),qn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Yn(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),pn(t)&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Hn((()=>{if(Kn.has(n))return;_n(n,"down");const t=Hn((()=>{_n(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>_n(n,"cancel")),e)}));n.addEventListener("keydown",i,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",i)),e)})(t,s))),e=t,Xn.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),o}function Zn(t){return p(t)&&"ownerSVGElement"in t}const Jn=t=>Boolean(t&&t.getVelocity),Qn=[...bn,St,Rt],ti=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});const ei=e.createContext({strict:!1}),ni={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ii={};for(const t in ni)ii[t]={isEnabled:e=>ni[t].some((t=>!!e[t]))};const si=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function oi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||si.has(t)}let ri=t=>!oi(t);try{(ai=require("@emotion/is-prop-valid").default)&&(ri=t=>t.startsWith("on")?!oi(t):ai(t))}catch{}var ai;function li(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy(((...e)=>("production"!==process.env.NODE_ENV&&A(!1,"motion() is deprecated. Use motion.create() instead."),t(...e))),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const ci=e.createContext({});function ui(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function hi(t){return"string"==typeof t||Array.isArray(t)}const di=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pi=["initial",...di];function mi(t){return ui(t.animate)||pi.some((e=>hi(t[e])))}function fi(t){return Boolean(mi(t)||t.variants)}function yi(t){const{initial:n,animate:i}=function(t,e){if(mi(t)){const{initial:e,animate:n}=t;return{initial:!1===e||hi(e)?e:void 0,animate:hi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(ci));return e.useMemo((()=>({initial:n,animate:i})),[gi(n),gi(i)])}function gi(t){return Array.isArray(t)?t.join(" "):t}const vi=Symbol.for("motionComponentSymbol");function xi(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ti(t,n,i){return e.useCallback((e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):xi(i)&&(i.current=e))}),[n])}const wi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bi="data-"+wi("framerAppearId"),Si=e.createContext({});function Pi(t,n,i,r,a){const{visualElement:l}=e.useContext(ci),c=e.useContext(ei),u=e.useContext(o),h=e.useContext(ti).reducedMotion,d=e.useRef(null);r=r||c.renderer,!d.current&&r&&(d.current=r(t,{visualState:n,parent:l,props:i,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:h}));const p=d.current,m=e.useContext(Si);!p||p.projection||!a||"html"!==p.type&&"svg"!==p.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ai(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&xi(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(d.current,i,a,m);const f=e.useRef(!1);e.useInsertionEffect((()=>{p&&f.current&&p.update(i,u)}));const y=i[bi],g=e.useRef(Boolean(y)&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return s((()=>{p&&(f.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),On.render(p.render),g.current&&p.animationState&&p.animationState.animateChanges())})),e.useEffect((()=>{p&&(!g.current&&p.animationState&&p.animationState.animateChanges(),g.current&&(queueMicrotask((()=>{window.MotionHandoffMarkAsComplete?.(y)})),g.current=!1))})),p}function Ai(t){if(t)return!1!==t.options.allowProjection?t.projection:Ai(t.parent)}function Ei({preloadedFeatures:n,createVisualElement:s,useRender:o,useVisualState:r,Component:a}){function l(l,h){let d;const p={...e.useContext(ti),...l,layoutId:Mi(l)},{isStatic:m}=p,f=yi(l),y=r(l,m);if(!m&&i){!function(t,n){const i=e.useContext(ei).strict;if("production"!==process.env.NODE_ENV&&n&&i){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?c(!1,e):u(!1,e)}}(p,n);const t=function(t){const{drag:e,layout:n}=ii;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(p);d=t.MeasureLayout,f.visualElement=Pi(a,y,p,s,t.ProjectionNode)}return t.jsxs(ci.Provider,{value:f,children:[d&&f.visualElement?t.jsx(d,{visualElement:f.visualElement,...p}):null,o(a,l,Ti(y,f.visualElement,h),y,m,f.visualElement)]})}n&&function(t){for(const e in t)ii[e]={...ii[e],...t[e]}}(n),l.displayName=`motion.${"string"==typeof a?a:`create(${a.displayName??a.name??""})`}`;const h=e.forwardRef(l);return h[vi]=a,h}function Mi({layoutId:t}){const i=e.useContext(n).id;return i&&void 0!==t?i+"-"+t:t}const Ci={};function Vi(t,{layout:e,layoutId:n}){return Ue.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ci[t]||"opacity"===t)}const Di={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ki=Ne.length;function Ri(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(Ue.has(t))r=!0;else if(tt(t))s[t]=n;else{const e=In(n,Vn[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<ki;o++){const r=Ne[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=In(a,Vn[r]);l||(s=!1,i+=`${Di[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const ji=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Li(t,e,n){for(const i in e)Jn(e[i])||Vi(i,n)||(t[i]=e[i])}function Ii(t,n){const i={};return Li(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Ri(e,n,t),Object.assign({},e.vars,e.style)}),[n])}(t,n)),i}function Fi(t,e){const n={},i=Ii(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Bi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oi={offset:"strokeDashoffset",array:"strokeDasharray"};function Ni(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Ri(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Bi:Oi;t[o.offset]=vt.transform(-i);const r=vt.transform(e),a=vt.transform(n);t[o.array]=`${r} ${a}`}(h,s,o,r,!1)}const Ui=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),$i=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Wi(t,n,i,s){const o=e.useMemo((()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ni(e,n,$i(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}}),[n]);if(t.style){const e={};Li(e,t.style,t),o.style={...e,...o.style}}return o}const Yi=["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 zi(t){return"string"==typeof t&&!t.includes("-")&&!!(Yi.indexOf(t)>-1||/[A-Z]/u.test(t))}function Xi(t=!1){return(n,i,s,{latestValues:o},r)=>{const a=(zi(n)?Wi:Fi)(i,o,r,n),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(ri(s)||!0===n&&oi(s)||!e&&!oi(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(i,"string"==typeof n,t),c=n!==e.Fragment?{...l,...a,ref:s}:{},{children:u}=i,h=e.useMemo((()=>Jn(u)?u.get():u),[u]);return e.createElement(n,{...c,children:h})}}function Ki(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function Hi(t,e,n,i){if("function"==typeof e){const[s,o]=Ki(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Ki(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function _i(t){return Jn(t)?t.get():t}const qi=t=>(n,i)=>{const s=e.useContext(ci),r=e.useContext(o),a=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Gi(n,i,s,t),renderState:e()}}(t,n,s,r);return i?a():function(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}(a)};function Gi(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=_i(o[t]);let{initial:r,animate:a}=t;const l=mi(t),c=fi(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!ui(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Hi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function Zi(t,e,n){const{style:i}=t,s={};for(const o in i)(Jn(i[o])||e.style&&Jn(e.style[o])||Vi(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}const Ji={useVisualState:qi({scrapeMotionValuesFromProps:Zi,createRenderState:ji})};function Qi(t,e,n){const i=Zi(t,e,n);for(const n in t)if(Jn(t[n])||Jn(e[n])){i[-1!==Ne.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const ts={useVisualState:qi({scrapeMotionValuesFromProps:Qi,createRenderState:Ui})};function es(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return Ei({...zi(n)?ts:Ji,preloadedFeatures:t,useRender:Xi(i),createVisualElement:e,Component:n})}}function ns(t,e,n){const i=t.getProps();return Hi(i,e,void 0!==n?n:i.custom,t)}const is=t=>Array.isArray(t);function ss(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Bn(n))}function os(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Jn(i)&&i.add))return n.add(e);if(!n&&h.WillChange){const n=new h.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function rs(t){return t.props[bi]}const as=t=>null!==t;const ls={type:"spring",stiffness:500,damping:25,restSpeed:10},cs={type:"keyframes",duration:.8},us={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hs=(t,{keyframes:e})=>e.length>2?cs:Ue.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ls:us;const ds=(t,e,n,i={},s,o)=>r=>{const a=xn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=w(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdat